diff --git a/gen-proto-ibc-go.sh b/gen-proto-ibc-go.sh deleted file mode 100755 index b884062d..00000000 --- a/gen-proto-ibc-go.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash - -rm -r ./proto -rm -r ./proto-thirdparty-tmp -rm -rf ./ibc-go - -git clone git@github.com:cosmos/ibc-go.git -cd ibc-go && git checkout v4.3.0 && cd ../ - -git clone git@github.com:Ethernal-Tech/admin-module.git - -cp -r ibc-go/proto ./proto -cp -r ibc-go/third_party/proto ./proto-thirdparty-tmp -mv ./proto-thirdparty-tmp/tendermint ./proto/ -cp -r ./admin-module/proto/adminmodule ./proto/ - -proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) -proto_files=() - -for dir in $proto_dirs; do - proto_files=("${proto_files[@]} $(find "${dir}" -maxdepth 1 -name '*.proto')") -done - -echo ${proto_files[@]} - -npx pbjs \ - -o ./src/generated/ibc/proto.cjs \ - -t static-module \ - --force-long \ - --keep-case \ - --no-create \ - --path=./proto/ \ - --path=./proto-thirdparty-tmp/ \ - --path=./proto-thirdparty/ \ - --root="@cosmos-client/ibc" \ - ${proto_files[@]} - -npx pbjs \ - -o ./src/generated/ibc/proto.js \ - -t static-module \ - -w es6 \ - --es6 \ - --force-long \ - --keep-case \ - --no-create \ - --path=./proto/ \ - --path=./proto-thirdparty-tmp/ \ - --path=./proto-thirdparty/ \ - --root="@cosmos-client/ibc" \ - ${proto_files[@]} - -npx pbts \ - -o ./src/generated/ibc/proto.d.ts \ - ./src/generated/ibc/proto.js - -rm -r ./proto -rm -r ./proto-thirdparty-tmp -rm -rf ./ibc-go -rm -rf ./admin-module diff --git a/gen-proto.sh b/gen-proto.sh deleted file mode 100755 index 3b9f005a..00000000 --- a/gen-proto.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -rm -r ./proto -cp -r ../neutron/proto ./proto - -proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) -proto_files=() - -for dir in $proto_dirs; do - proto_files=("${proto_files[@]} $(find "${dir}" -maxdepth 1 -name '*.proto')") -done - -npx pbjs \ - -o ./src/generated/proto.cjs \ - -t static-module \ - --force-long \ - --keep-case \ - --no-create \ - --path=./proto/ \ - --path=./proto-thirdparty/ \ - --root="@neutron-org/neutron" \ - ${proto_files[@]} - -npx pbjs \ - -o ./src/generated/proto.js \ - -t static-module \ - -w es6 \ - --es6 \ - --force-long \ - --keep-case \ - --no-create \ - --path=./proto/ \ - --path=./proto-thirdparty/ \ - --root="@neutron-org/neutron" \ - ${proto_files[@]} - -npx pbts \ - -o ./src/generated/proto.d.ts \ - ./src/generated/proto.js - -rm ./src/generated/proto.js -rm -r ./proto diff --git a/src/generated/admin/proto.cjs b/src/generated/admin/proto.cjs deleted file mode 100644 index 52fa63d9..00000000 --- a/src/generated/admin/proto.cjs +++ /dev/null @@ -1,16686 +0,0 @@ -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("protobufjs/minimal")); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots["@cosmos-client/ibc"] || ($protobuf.roots["@cosmos-client/ibc"] = {}); - - $root.cosmos = (function() { - - /** - * Namespace cosmos. - * @exports cosmos - * @namespace - */ - var cosmos = {}; - - cosmos.adminmodule = (function() { - - /** - * Namespace adminmodule. - * @memberof cosmos - * @namespace - */ - var adminmodule = {}; - - adminmodule.adminmodule = (function() { - - /** - * Namespace adminmodule. - * @memberof cosmos.adminmodule - * @namespace - */ - var adminmodule = {}; - - adminmodule.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#deleteAdmin}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef DeleteAdminCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} [response] MsgDeleteAdminResponse - */ - - /** - * Calls DeleteAdmin. - * @function deleteAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} request MsgDeleteAdmin message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.DeleteAdminCallback} callback Node-style callback called with the error, if any, and MsgDeleteAdminResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.deleteAdmin = function deleteAdmin(request, callback) { - return this.rpcCall(deleteAdmin, $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin, $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse, request, callback); - }, "name", { value: "DeleteAdmin" }); - - /** - * Calls DeleteAdmin. - * @function deleteAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} request MsgDeleteAdmin message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#addAdmin}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef AddAdminCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} [response] MsgAddAdminResponse - */ - - /** - * Calls AddAdmin. - * @function addAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} request MsgAddAdmin message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.AddAdminCallback} callback Node-style callback called with the error, if any, and MsgAddAdminResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.addAdmin = function addAdmin(request, callback) { - return this.rpcCall(addAdmin, $root.cosmos.adminmodule.adminmodule.MsgAddAdmin, $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse, request, callback); - }, "name", { value: "AddAdmin" }); - - /** - * Calls AddAdmin. - * @function addAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} request MsgAddAdmin message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#submitProposal}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef SubmitProposalCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} [response] MsgSubmitProposalResponse - */ - - /** - * Calls SubmitProposal. - * @function submitProposal - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} request MsgSubmitProposal message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.SubmitProposalCallback} callback Node-style callback called with the error, if any, and MsgSubmitProposalResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.submitProposal = function submitProposal(request, callback) { - return this.rpcCall(submitProposal, $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal, $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse, request, callback); - }, "name", { value: "SubmitProposal" }); - - /** - * Calls SubmitProposal. - * @function submitProposal - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} request MsgSubmitProposal message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - adminmodule.MsgDeleteAdmin = (function() { - - /** - * Properties of a MsgDeleteAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgDeleteAdmin - * @property {string|null} [creator] MsgDeleteAdmin creator - * @property {string|null} [admin] MsgDeleteAdmin admin - */ - - /** - * Constructs a new MsgDeleteAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgDeleteAdmin. - * @implements IMsgDeleteAdmin - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin=} [properties] Properties to set - */ - function MsgDeleteAdmin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgDeleteAdmin creator. - * @member {string} creator - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - */ - MsgDeleteAdmin.prototype.creator = ""; - - /** - * MsgDeleteAdmin admin. - * @member {string} admin - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - */ - MsgDeleteAdmin.prototype.admin = ""; - - /** - * Encodes the specified MsgDeleteAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} message MsgDeleteAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdmin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.admin); - return writer; - }; - - /** - * Encodes the specified MsgDeleteAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} message MsgDeleteAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdmin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdmin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdmin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeleteAdmin message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeleteAdmin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.admin != null && message.hasOwnProperty("admin")) - if (!$util.isString(message.admin)) - return "admin: string expected"; - return null; - }; - - /** - * Creates a MsgDeleteAdmin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - */ - MsgDeleteAdmin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin(); - if (object.creator != null) - message.creator = String(object.creator); - if (object.admin != null) - message.admin = String(object.admin); - return message; - }; - - /** - * Creates a plain object from a MsgDeleteAdmin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} message MsgDeleteAdmin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeleteAdmin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.creator = ""; - object.admin = ""; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.admin != null && message.hasOwnProperty("admin")) - object.admin = message.admin; - return object; - }; - - /** - * Converts this MsgDeleteAdmin to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - * @returns {Object.} JSON object - */ - MsgDeleteAdmin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeleteAdmin; - })(); - - adminmodule.MsgDeleteAdminResponse = (function() { - - /** - * Properties of a MsgDeleteAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgDeleteAdminResponse - */ - - /** - * Constructs a new MsgDeleteAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgDeleteAdminResponse. - * @implements IMsgDeleteAdminResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse=} [properties] Properties to set - */ - function MsgDeleteAdminResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgDeleteAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse} message MsgDeleteAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdminResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgDeleteAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse} message MsgDeleteAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdminResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdminResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdminResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeleteAdminResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeleteAdminResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgDeleteAdminResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - */ - MsgDeleteAdminResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse) - return object; - return new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse(); - }; - - /** - * Creates a plain object from a MsgDeleteAdminResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} message MsgDeleteAdminResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeleteAdminResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgDeleteAdminResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @instance - * @returns {Object.} JSON object - */ - MsgDeleteAdminResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeleteAdminResponse; - })(); - - adminmodule.MsgAddAdmin = (function() { - - /** - * Properties of a MsgAddAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgAddAdmin - * @property {string|null} [creator] MsgAddAdmin creator - * @property {string|null} [admin] MsgAddAdmin admin - */ - - /** - * Constructs a new MsgAddAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgAddAdmin. - * @implements IMsgAddAdmin - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin=} [properties] Properties to set - */ - function MsgAddAdmin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgAddAdmin creator. - * @member {string} creator - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - */ - MsgAddAdmin.prototype.creator = ""; - - /** - * MsgAddAdmin admin. - * @member {string} admin - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - */ - MsgAddAdmin.prototype.admin = ""; - - /** - * Encodes the specified MsgAddAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} message MsgAddAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdmin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.admin); - return writer; - }; - - /** - * Encodes the specified MsgAddAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} message MsgAddAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdmin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdmin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdmin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdmin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAddAdmin message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAddAdmin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.admin != null && message.hasOwnProperty("admin")) - if (!$util.isString(message.admin)) - return "admin: string expected"; - return null; - }; - - /** - * Creates a MsgAddAdmin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - */ - MsgAddAdmin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgAddAdmin) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdmin(); - if (object.creator != null) - message.creator = String(object.creator); - if (object.admin != null) - message.admin = String(object.admin); - return message; - }; - - /** - * Creates a plain object from a MsgAddAdmin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.MsgAddAdmin} message MsgAddAdmin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAddAdmin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.creator = ""; - object.admin = ""; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.admin != null && message.hasOwnProperty("admin")) - object.admin = message.admin; - return object; - }; - - /** - * Converts this MsgAddAdmin to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - * @returns {Object.} JSON object - */ - MsgAddAdmin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAddAdmin; - })(); - - adminmodule.MsgAddAdminResponse = (function() { - - /** - * Properties of a MsgAddAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgAddAdminResponse - */ - - /** - * Constructs a new MsgAddAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgAddAdminResponse. - * @implements IMsgAddAdminResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse=} [properties] Properties to set - */ - function MsgAddAdminResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgAddAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse} message MsgAddAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdminResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgAddAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse} message MsgAddAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdminResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdminResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdminResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAddAdminResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAddAdminResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgAddAdminResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - */ - MsgAddAdminResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse) - return object; - return new $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse(); - }; - - /** - * Creates a plain object from a MsgAddAdminResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} message MsgAddAdminResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAddAdminResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgAddAdminResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @instance - * @returns {Object.} JSON object - */ - MsgAddAdminResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAddAdminResponse; - })(); - - adminmodule.MsgSubmitProposal = (function() { - - /** - * Properties of a MsgSubmitProposal. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgSubmitProposal - * @property {google.protobuf.IAny|null} [content] MsgSubmitProposal content - * @property {string|null} [proposer] MsgSubmitProposal proposer - */ - - /** - * Constructs a new MsgSubmitProposal. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgSubmitProposal. - * @implements IMsgSubmitProposal - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal=} [properties] Properties to set - */ - function MsgSubmitProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitProposal content. - * @member {google.protobuf.IAny|null|undefined} content - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - */ - MsgSubmitProposal.prototype.content = null; - - /** - * MsgSubmitProposal proposer. - * @member {string} proposer - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - */ - MsgSubmitProposal.prototype.proposer = ""; - - /** - * Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.proposer); - return writer; - }; - - /** - * Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.proposer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitProposal message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) { - var error = $root.google.protobuf.Any.verify(message.content); - if (error) - return "content." + error; - } - if (message.proposer != null && message.hasOwnProperty("proposer")) - if (!$util.isString(message.proposer)) - return "proposer: string expected"; - return null; - }; - - /** - * Creates a MsgSubmitProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - */ - MsgSubmitProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal(); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".cosmos.adminmodule.adminmodule.MsgSubmitProposal.content: object expected"); - message.content = $root.google.protobuf.Any.fromObject(object.content); - } - if (object.proposer != null) - message.proposer = String(object.proposer); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposal} message MsgSubmitProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = null; - object.proposer = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.protobuf.Any.toObject(message.content, options); - if (message.proposer != null && message.hasOwnProperty("proposer")) - object.proposer = message.proposer; - return object; - }; - - /** - * Converts this MsgSubmitProposal to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitProposal; - })(); - - adminmodule.MsgSubmitProposalResponse = (function() { - - /** - * Properties of a MsgSubmitProposalResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgSubmitProposalResponse - * @property {Long|null} [proposal_id] MsgSubmitProposalResponse proposal_id - */ - - /** - * Constructs a new MsgSubmitProposalResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgSubmitProposalResponse. - * @implements IMsgSubmitProposalResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse=} [properties] Properties to set - */ - function MsgSubmitProposalResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitProposalResponse proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @instance - */ - MsgSubmitProposalResponse.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposalResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - return writer; - }; - - /** - * Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposalResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposalResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposalResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitProposalResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitProposalResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - return null; - }; - - /** - * Creates a MsgSubmitProposalResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - */ - MsgSubmitProposalResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitProposalResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} message MsgSubmitProposalResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitProposalResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - return object; - }; - - /** - * Converts this MsgSubmitProposalResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitProposalResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitProposalResponse; - })(); - - adminmodule.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#admins}. - * @memberof cosmos.adminmodule.adminmodule.Query - * @typedef AdminsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.QueryAdminsResponse} [response] QueryAdminsResponse - */ - - /** - * Calls Admins. - * @function admins - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} request QueryAdminsRequest message or plain object - * @param {cosmos.adminmodule.adminmodule.Query.AdminsCallback} callback Node-style callback called with the error, if any, and QueryAdminsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.admins = function admins(request, callback) { - return this.rpcCall(admins, $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest, $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse, request, callback); - }, "name", { value: "Admins" }); - - /** - * Calls Admins. - * @function admins - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} request QueryAdminsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#archivedProposals}. - * @memberof cosmos.adminmodule.adminmodule.Query - * @typedef ArchivedProposalsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} [response] QueryArchivedProposalsResponse - */ - - /** - * Calls ArchivedProposals. - * @function archivedProposals - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} request QueryArchivedProposalsRequest message or plain object - * @param {cosmos.adminmodule.adminmodule.Query.ArchivedProposalsCallback} callback Node-style callback called with the error, if any, and QueryArchivedProposalsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.archivedProposals = function archivedProposals(request, callback) { - return this.rpcCall(archivedProposals, $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest, $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse, request, callback); - }, "name", { value: "ArchivedProposals" }); - - /** - * Calls ArchivedProposals. - * @function archivedProposals - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} request QueryArchivedProposalsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - adminmodule.QueryAdminsRequest = (function() { - - /** - * Properties of a QueryAdminsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryAdminsRequest - */ - - /** - * Constructs a new QueryAdminsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryAdminsRequest. - * @implements IQueryAdminsRequest - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest=} [properties] Properties to set - */ - function QueryAdminsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryAdminsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} message QueryAdminsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryAdminsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} message QueryAdminsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdminsRequest message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdminsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryAdminsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - */ - QueryAdminsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest) - return object; - return new $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest(); - }; - - /** - * Creates a plain object from a QueryAdminsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.QueryAdminsRequest} message QueryAdminsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdminsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryAdminsRequest to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryAdminsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryAdminsRequest; - })(); - - adminmodule.QueryAdminsResponse = (function() { - - /** - * Properties of a QueryAdminsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryAdminsResponse - * @property {Array.|null} [admins] QueryAdminsResponse admins - */ - - /** - * Constructs a new QueryAdminsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryAdminsResponse. - * @implements IQueryAdminsResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse=} [properties] Properties to set - */ - function QueryAdminsResponse(properties) { - this.admins = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryAdminsResponse admins. - * @member {Array.} admins - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @instance - */ - QueryAdminsResponse.prototype.admins = $util.emptyArray; - - /** - * Encodes the specified QueryAdminsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse} message QueryAdminsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.admins != null && message.admins.length) - for (var i = 0; i < message.admins.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.admins[i]); - return writer; - }; - - /** - * Encodes the specified QueryAdminsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse} message QueryAdminsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.admins && message.admins.length)) - message.admins = []; - message.admins.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdminsResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdminsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.admins != null && message.hasOwnProperty("admins")) { - if (!Array.isArray(message.admins)) - return "admins: array expected"; - for (var i = 0; i < message.admins.length; ++i) - if (!$util.isString(message.admins[i])) - return "admins: string[] expected"; - } - return null; - }; - - /** - * Creates a QueryAdminsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - */ - QueryAdminsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse(); - if (object.admins) { - if (!Array.isArray(object.admins)) - throw TypeError(".cosmos.adminmodule.adminmodule.QueryAdminsResponse.admins: array expected"); - message.admins = []; - for (var i = 0; i < object.admins.length; ++i) - message.admins[i] = String(object.admins[i]); - } - return message; - }; - - /** - * Creates a plain object from a QueryAdminsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.QueryAdminsResponse} message QueryAdminsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdminsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.admins = []; - if (message.admins && message.admins.length) { - object.admins = []; - for (var j = 0; j < message.admins.length; ++j) - object.admins[j] = message.admins[j]; - } - return object; - }; - - /** - * Converts this QueryAdminsResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryAdminsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryAdminsResponse; - })(); - - adminmodule.QueryArchivedProposalsRequest = (function() { - - /** - * Properties of a QueryArchivedProposalsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryArchivedProposalsRequest - */ - - /** - * Constructs a new QueryArchivedProposalsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryArchivedProposalsRequest. - * @implements IQueryArchivedProposalsRequest - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest=} [properties] Properties to set - */ - function QueryArchivedProposalsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryArchivedProposalsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} message QueryArchivedProposalsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryArchivedProposalsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} message QueryArchivedProposalsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryArchivedProposalsRequest message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryArchivedProposalsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryArchivedProposalsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - */ - QueryArchivedProposalsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest) - return object; - return new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest(); - }; - - /** - * Creates a plain object from a QueryArchivedProposalsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} message QueryArchivedProposalsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryArchivedProposalsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryArchivedProposalsRequest to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryArchivedProposalsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryArchivedProposalsRequest; - })(); - - adminmodule.QueryArchivedProposalsResponse = (function() { - - /** - * Properties of a QueryArchivedProposalsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryArchivedProposalsResponse - * @property {Array.|null} [proposals] QueryArchivedProposalsResponse proposals - */ - - /** - * Constructs a new QueryArchivedProposalsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryArchivedProposalsResponse. - * @implements IQueryArchivedProposalsResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse=} [properties] Properties to set - */ - function QueryArchivedProposalsResponse(properties) { - this.proposals = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryArchivedProposalsResponse proposals. - * @member {Array.} proposals - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @instance - */ - QueryArchivedProposalsResponse.prototype.proposals = $util.emptyArray; - - /** - * Encodes the specified QueryArchivedProposalsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse} message QueryArchivedProposalsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposals != null && message.proposals.length) - for (var i = 0; i < message.proposals.length; ++i) - $root.cosmos.gov.v1beta1.Proposal.encode(message.proposals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryArchivedProposalsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse} message QueryArchivedProposalsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.proposals && message.proposals.length)) - message.proposals = []; - message.proposals.push($root.cosmos.gov.v1beta1.Proposal.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryArchivedProposalsResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryArchivedProposalsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposals != null && message.hasOwnProperty("proposals")) { - if (!Array.isArray(message.proposals)) - return "proposals: array expected"; - for (var i = 0; i < message.proposals.length; ++i) { - var error = $root.cosmos.gov.v1beta1.Proposal.verify(message.proposals[i]); - if (error) - return "proposals." + error; - } - } - return null; - }; - - /** - * Creates a QueryArchivedProposalsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - */ - QueryArchivedProposalsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse(); - if (object.proposals) { - if (!Array.isArray(object.proposals)) - throw TypeError(".cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.proposals: array expected"); - message.proposals = []; - for (var i = 0; i < object.proposals.length; ++i) { - if (typeof object.proposals[i] !== "object") - throw TypeError(".cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.proposals: object expected"); - message.proposals[i] = $root.cosmos.gov.v1beta1.Proposal.fromObject(object.proposals[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryArchivedProposalsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} message QueryArchivedProposalsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryArchivedProposalsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.proposals = []; - if (message.proposals && message.proposals.length) { - object.proposals = []; - for (var j = 0; j < message.proposals.length; ++j) - object.proposals[j] = $root.cosmos.gov.v1beta1.Proposal.toObject(message.proposals[j], options); - } - return object; - }; - - /** - * Converts this QueryArchivedProposalsResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryArchivedProposalsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryArchivedProposalsResponse; - })(); - - adminmodule.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof cosmos.adminmodule.adminmodule - * @interface IGenesisState - * @property {Array.|null} [admins] GenesisState admins - */ - - /** - * Constructs a new GenesisState. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {cosmos.adminmodule.adminmodule.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.admins = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState admins. - * @member {Array.} admins - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @instance - */ - GenesisState.prototype.admins = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.admins != null && message.admins.length) - for (var i = 0; i < message.admins.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.admins[i]); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.admins && message.admins.length)) - message.admins = []; - message.admins.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.admins != null && message.hasOwnProperty("admins")) { - if (!Array.isArray(message.admins)) - return "admins: array expected"; - for (var i = 0; i < message.admins.length; ++i) - if (!$util.isString(message.admins[i])) - return "admins: string[] expected"; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.GenesisState) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.GenesisState(); - if (object.admins) { - if (!Array.isArray(object.admins)) - throw TypeError(".cosmos.adminmodule.adminmodule.GenesisState.admins: array expected"); - message.admins = []; - for (var i = 0; i < object.admins.length; ++i) - message.admins[i] = String(object.admins[i]); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.admins = []; - if (message.admins && message.admins.length) { - object.admins = []; - for (var j = 0; j < message.admins.length; ++j) - object.admins[j] = message.admins[j]; - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return adminmodule; - })(); - - return adminmodule; - })(); - - cosmos.gov = (function() { - - /** - * Namespace gov. - * @memberof cosmos - * @namespace - */ - var gov = {}; - - gov.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.gov - * @namespace - */ - var v1beta1 = {}; - - /** - * VoteOption enum. - * @name cosmos.gov.v1beta1.VoteOption - * @enum {number} - * @property {number} VOTE_OPTION_UNSPECIFIED=0 VOTE_OPTION_UNSPECIFIED value - * @property {number} VOTE_OPTION_YES=1 VOTE_OPTION_YES value - * @property {number} VOTE_OPTION_ABSTAIN=2 VOTE_OPTION_ABSTAIN value - * @property {number} VOTE_OPTION_NO=3 VOTE_OPTION_NO value - * @property {number} VOTE_OPTION_NO_WITH_VETO=4 VOTE_OPTION_NO_WITH_VETO value - */ - v1beta1.VoteOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VOTE_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "VOTE_OPTION_YES"] = 1; - values[valuesById[2] = "VOTE_OPTION_ABSTAIN"] = 2; - values[valuesById[3] = "VOTE_OPTION_NO"] = 3; - values[valuesById[4] = "VOTE_OPTION_NO_WITH_VETO"] = 4; - return values; - })(); - - v1beta1.WeightedVoteOption = (function() { - - /** - * Properties of a WeightedVoteOption. - * @memberof cosmos.gov.v1beta1 - * @interface IWeightedVoteOption - * @property {cosmos.gov.v1beta1.VoteOption|null} [option] WeightedVoteOption option - * @property {string|null} [weight] WeightedVoteOption weight - */ - - /** - * Constructs a new WeightedVoteOption. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a WeightedVoteOption. - * @implements IWeightedVoteOption - * @constructor - * @param {cosmos.gov.v1beta1.IWeightedVoteOption=} [properties] Properties to set - */ - function WeightedVoteOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WeightedVoteOption option. - * @member {cosmos.gov.v1beta1.VoteOption} option - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - */ - WeightedVoteOption.prototype.option = 0; - - /** - * WeightedVoteOption weight. - * @member {string} weight - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - */ - WeightedVoteOption.prototype.weight = ""; - - /** - * Encodes the specified WeightedVoteOption message. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.IWeightedVoteOption} message WeightedVoteOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedVoteOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.option != null && Object.hasOwnProperty.call(message, "option")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.option); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.weight); - return writer; - }; - - /** - * Encodes the specified WeightedVoteOption message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.IWeightedVoteOption} message WeightedVoteOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedVoteOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedVoteOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.WeightedVoteOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.option = reader.int32(); - break; - case 2: - message.weight = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedVoteOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WeightedVoteOption message. - * @function verify - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeightedVoteOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.option != null && message.hasOwnProperty("option")) - switch (message.option) { - default: - return "option: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.weight != null && message.hasOwnProperty("weight")) - if (!$util.isString(message.weight)) - return "weight: string expected"; - return null; - }; - - /** - * Creates a WeightedVoteOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - */ - WeightedVoteOption.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.WeightedVoteOption) - return object; - var message = new $root.cosmos.gov.v1beta1.WeightedVoteOption(); - switch (object.option) { - case "VOTE_OPTION_UNSPECIFIED": - case 0: - message.option = 0; - break; - case "VOTE_OPTION_YES": - case 1: - message.option = 1; - break; - case "VOTE_OPTION_ABSTAIN": - case 2: - message.option = 2; - break; - case "VOTE_OPTION_NO": - case 3: - message.option = 3; - break; - case "VOTE_OPTION_NO_WITH_VETO": - case 4: - message.option = 4; - break; - } - if (object.weight != null) - message.weight = String(object.weight); - return message; - }; - - /** - * Creates a plain object from a WeightedVoteOption message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.WeightedVoteOption} message WeightedVoteOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeightedVoteOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; - object.weight = ""; - } - if (message.option != null && message.hasOwnProperty("option")) - object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; - if (message.weight != null && message.hasOwnProperty("weight")) - object.weight = message.weight; - return object; - }; - - /** - * Converts this WeightedVoteOption to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - * @returns {Object.} JSON object - */ - WeightedVoteOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WeightedVoteOption; - })(); - - v1beta1.TextProposal = (function() { - - /** - * Properties of a TextProposal. - * @memberof cosmos.gov.v1beta1 - * @interface ITextProposal - * @property {string|null} [title] TextProposal title - * @property {string|null} [description] TextProposal description - */ - - /** - * Constructs a new TextProposal. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TextProposal. - * @implements ITextProposal - * @constructor - * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set - */ - function TextProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TextProposal title. - * @member {string} title - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - */ - TextProposal.prototype.title = ""; - - /** - * TextProposal description. - * @member {string} description - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - */ - TextProposal.prototype.description = ""; - - /** - * Encodes the specified TextProposal message. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified TextProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TextProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextProposal message. - * @function verify - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a TextProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - */ - TextProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TextProposal) - return object; - var message = new $root.cosmos.gov.v1beta1.TextProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a TextProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.TextProposal} message TextProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this TextProposal to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - * @returns {Object.} JSON object - */ - TextProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TextProposal; - })(); - - v1beta1.Deposit = (function() { - - /** - * Properties of a Deposit. - * @memberof cosmos.gov.v1beta1 - * @interface IDeposit - * @property {Long|null} [proposal_id] Deposit proposal_id - * @property {string|null} [depositor] Deposit depositor - * @property {Array.|null} [amount] Deposit amount - */ - - /** - * Constructs a new Deposit. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Deposit. - * @implements IDeposit - * @constructor - * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set - */ - function Deposit(properties) { - this.amount = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Deposit proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Deposit depositor. - * @member {string} depositor - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.depositor = ""; - - /** - * Deposit amount. - * @member {Array.} amount - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.amount = $util.emptyArray; - - /** - * Encodes the specified Deposit message. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deposit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); - if (message.amount != null && message.amount.length) - for (var i = 0; i < message.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Deposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deposit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Deposit message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deposit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Deposit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.depositor = reader.string(); - break; - case 3: - if (!(message.amount && message.amount.length)) - message.amount = []; - message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Deposit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deposit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Deposit message. - * @function verify - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Deposit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.depositor != null && message.hasOwnProperty("depositor")) - if (!$util.isString(message.depositor)) - return "depositor: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - if (!Array.isArray(message.amount)) - return "amount: array expected"; - for (var i = 0; i < message.amount.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); - if (error) - return "amount." + error; - } - } - return null; - }; - - /** - * Creates a Deposit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - */ - Deposit.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Deposit) - return object; - var message = new $root.cosmos.gov.v1beta1.Deposit(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.depositor != null) - message.depositor = String(object.depositor); - if (object.amount) { - if (!Array.isArray(object.amount)) - throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: array expected"); - message.amount = []; - for (var i = 0; i < object.amount.length; ++i) { - if (typeof object.amount[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: object expected"); - message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Deposit message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.Deposit} message Deposit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Deposit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.amount = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.depositor = ""; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.depositor != null && message.hasOwnProperty("depositor")) - object.depositor = message.depositor; - if (message.amount && message.amount.length) { - object.amount = []; - for (var j = 0; j < message.amount.length; ++j) - object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); - } - return object; - }; - - /** - * Converts this Deposit to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - * @returns {Object.} JSON object - */ - Deposit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Deposit; - })(); - - v1beta1.Proposal = (function() { - - /** - * Properties of a Proposal. - * @memberof cosmos.gov.v1beta1 - * @interface IProposal - * @property {Long|null} [proposal_id] Proposal proposal_id - * @property {google.protobuf.IAny|null} [content] Proposal content - * @property {cosmos.gov.v1beta1.ProposalStatus|null} [status] Proposal status - * @property {cosmos.gov.v1beta1.ITallyResult|null} [final_tally_result] Proposal final_tally_result - * @property {google.protobuf.ITimestamp|null} [submit_time] Proposal submit_time - * @property {google.protobuf.ITimestamp|null} [deposit_end_time] Proposal deposit_end_time - * @property {Array.|null} [total_deposit] Proposal total_deposit - * @property {google.protobuf.ITimestamp|null} [voting_start_time] Proposal voting_start_time - * @property {google.protobuf.ITimestamp|null} [voting_end_time] Proposal voting_end_time - */ - - /** - * Constructs a new Proposal. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Proposal. - * @implements IProposal - * @constructor - * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set - */ - function Proposal(properties) { - this.total_deposit = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proposal proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Proposal content. - * @member {google.protobuf.IAny|null|undefined} content - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.content = null; - - /** - * Proposal status. - * @member {cosmos.gov.v1beta1.ProposalStatus} status - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.status = 0; - - /** - * Proposal final_tally_result. - * @member {cosmos.gov.v1beta1.ITallyResult|null|undefined} final_tally_result - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.final_tally_result = null; - - /** - * Proposal submit_time. - * @member {google.protobuf.ITimestamp|null|undefined} submit_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.submit_time = null; - - /** - * Proposal deposit_end_time. - * @member {google.protobuf.ITimestamp|null|undefined} deposit_end_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.deposit_end_time = null; - - /** - * Proposal total_deposit. - * @member {Array.} total_deposit - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.total_deposit = $util.emptyArray; - - /** - * Proposal voting_start_time. - * @member {google.protobuf.ITimestamp|null|undefined} voting_start_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.voting_start_time = null; - - /** - * Proposal voting_end_time. - * @member {google.protobuf.ITimestamp|null|undefined} voting_end_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.voting_end_time = null; - - /** - * Encodes the specified Proposal message. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); - if (message.final_tally_result != null && Object.hasOwnProperty.call(message, "final_tally_result")) - $root.cosmos.gov.v1beta1.TallyResult.encode(message.final_tally_result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.submit_time != null && Object.hasOwnProperty.call(message, "submit_time")) - $root.google.protobuf.Timestamp.encode(message.submit_time, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deposit_end_time != null && Object.hasOwnProperty.call(message, "deposit_end_time")) - $root.google.protobuf.Timestamp.encode(message.deposit_end_time, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.total_deposit != null && message.total_deposit.length) - for (var i = 0; i < message.total_deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.total_deposit[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.voting_start_time != null && Object.hasOwnProperty.call(message, "voting_start_time")) - $root.google.protobuf.Timestamp.encode(message.voting_start_time, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.voting_end_time != null && Object.hasOwnProperty.call(message, "voting_end_time")) - $root.google.protobuf.Timestamp.encode(message.voting_end_time, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Proposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.status = reader.int32(); - break; - case 4: - message.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.decode(reader, reader.uint32()); - break; - case 5: - message.submit_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.deposit_end_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - if (!(message.total_deposit && message.total_deposit.length)) - message.total_deposit = []; - message.total_deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 8: - message.voting_start_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 9: - message.voting_end_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proposal message. - * @function verify - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.content != null && message.hasOwnProperty("content")) { - var error = $root.google.protobuf.Any.verify(message.content); - if (error) - return "content." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.final_tally_result != null && message.hasOwnProperty("final_tally_result")) { - var error = $root.cosmos.gov.v1beta1.TallyResult.verify(message.final_tally_result); - if (error) - return "final_tally_result." + error; - } - if (message.submit_time != null && message.hasOwnProperty("submit_time")) { - var error = $root.google.protobuf.Timestamp.verify(message.submit_time); - if (error) - return "submit_time." + error; - } - if (message.deposit_end_time != null && message.hasOwnProperty("deposit_end_time")) { - var error = $root.google.protobuf.Timestamp.verify(message.deposit_end_time); - if (error) - return "deposit_end_time." + error; - } - if (message.total_deposit != null && message.hasOwnProperty("total_deposit")) { - if (!Array.isArray(message.total_deposit)) - return "total_deposit: array expected"; - for (var i = 0; i < message.total_deposit.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.total_deposit[i]); - if (error) - return "total_deposit." + error; - } - } - if (message.voting_start_time != null && message.hasOwnProperty("voting_start_time")) { - var error = $root.google.protobuf.Timestamp.verify(message.voting_start_time); - if (error) - return "voting_start_time." + error; - } - if (message.voting_end_time != null && message.hasOwnProperty("voting_end_time")) { - var error = $root.google.protobuf.Timestamp.verify(message.voting_end_time); - if (error) - return "voting_end_time." + error; - } - return null; - }; - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - */ - Proposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Proposal) - return object; - var message = new $root.cosmos.gov.v1beta1.Proposal(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.content: object expected"); - message.content = $root.google.protobuf.Any.fromObject(object.content); - } - switch (object.status) { - case "PROPOSAL_STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "PROPOSAL_STATUS_DEPOSIT_PERIOD": - case 1: - message.status = 1; - break; - case "PROPOSAL_STATUS_VOTING_PERIOD": - case 2: - message.status = 2; - break; - case "PROPOSAL_STATUS_PASSED": - case 3: - message.status = 3; - break; - case "PROPOSAL_STATUS_REJECTED": - case 4: - message.status = 4; - break; - case "PROPOSAL_STATUS_FAILED": - case 5: - message.status = 5; - break; - } - if (object.final_tally_result != null) { - if (typeof object.final_tally_result !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.final_tally_result: object expected"); - message.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.fromObject(object.final_tally_result); - } - if (object.submit_time != null) { - if (typeof object.submit_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.submit_time: object expected"); - message.submit_time = $root.google.protobuf.Timestamp.fromObject(object.submit_time); - } - if (object.deposit_end_time != null) { - if (typeof object.deposit_end_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.deposit_end_time: object expected"); - message.deposit_end_time = $root.google.protobuf.Timestamp.fromObject(object.deposit_end_time); - } - if (object.total_deposit) { - if (!Array.isArray(object.total_deposit)) - throw TypeError(".cosmos.gov.v1beta1.Proposal.total_deposit: array expected"); - message.total_deposit = []; - for (var i = 0; i < object.total_deposit.length; ++i) { - if (typeof object.total_deposit[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.total_deposit: object expected"); - message.total_deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.total_deposit[i]); - } - } - if (object.voting_start_time != null) { - if (typeof object.voting_start_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.voting_start_time: object expected"); - message.voting_start_time = $root.google.protobuf.Timestamp.fromObject(object.voting_start_time); - } - if (object.voting_end_time != null) { - if (typeof object.voting_end_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.voting_end_time: object expected"); - message.voting_end_time = $root.google.protobuf.Timestamp.fromObject(object.voting_end_time); - } - return message; - }; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.Proposal} message Proposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.total_deposit = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.content = null; - object.status = options.enums === String ? "PROPOSAL_STATUS_UNSPECIFIED" : 0; - object.final_tally_result = null; - object.submit_time = null; - object.deposit_end_time = null; - object.voting_start_time = null; - object.voting_end_time = null; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.protobuf.Any.toObject(message.content, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.cosmos.gov.v1beta1.ProposalStatus[message.status] : message.status; - if (message.final_tally_result != null && message.hasOwnProperty("final_tally_result")) - object.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.toObject(message.final_tally_result, options); - if (message.submit_time != null && message.hasOwnProperty("submit_time")) - object.submit_time = $root.google.protobuf.Timestamp.toObject(message.submit_time, options); - if (message.deposit_end_time != null && message.hasOwnProperty("deposit_end_time")) - object.deposit_end_time = $root.google.protobuf.Timestamp.toObject(message.deposit_end_time, options); - if (message.total_deposit && message.total_deposit.length) { - object.total_deposit = []; - for (var j = 0; j < message.total_deposit.length; ++j) - object.total_deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.total_deposit[j], options); - } - if (message.voting_start_time != null && message.hasOwnProperty("voting_start_time")) - object.voting_start_time = $root.google.protobuf.Timestamp.toObject(message.voting_start_time, options); - if (message.voting_end_time != null && message.hasOwnProperty("voting_end_time")) - object.voting_end_time = $root.google.protobuf.Timestamp.toObject(message.voting_end_time, options); - return object; - }; - - /** - * Converts this Proposal to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - * @returns {Object.} JSON object - */ - Proposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proposal; - })(); - - /** - * ProposalStatus enum. - * @name cosmos.gov.v1beta1.ProposalStatus - * @enum {number} - * @property {number} PROPOSAL_STATUS_UNSPECIFIED=0 PROPOSAL_STATUS_UNSPECIFIED value - * @property {number} PROPOSAL_STATUS_DEPOSIT_PERIOD=1 PROPOSAL_STATUS_DEPOSIT_PERIOD value - * @property {number} PROPOSAL_STATUS_VOTING_PERIOD=2 PROPOSAL_STATUS_VOTING_PERIOD value - * @property {number} PROPOSAL_STATUS_PASSED=3 PROPOSAL_STATUS_PASSED value - * @property {number} PROPOSAL_STATUS_REJECTED=4 PROPOSAL_STATUS_REJECTED value - * @property {number} PROPOSAL_STATUS_FAILED=5 PROPOSAL_STATUS_FAILED value - */ - v1beta1.ProposalStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROPOSAL_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROPOSAL_STATUS_DEPOSIT_PERIOD"] = 1; - values[valuesById[2] = "PROPOSAL_STATUS_VOTING_PERIOD"] = 2; - values[valuesById[3] = "PROPOSAL_STATUS_PASSED"] = 3; - values[valuesById[4] = "PROPOSAL_STATUS_REJECTED"] = 4; - values[valuesById[5] = "PROPOSAL_STATUS_FAILED"] = 5; - return values; - })(); - - v1beta1.TallyResult = (function() { - - /** - * Properties of a TallyResult. - * @memberof cosmos.gov.v1beta1 - * @interface ITallyResult - * @property {string|null} [yes] TallyResult yes - * @property {string|null} [abstain] TallyResult abstain - * @property {string|null} [no] TallyResult no - * @property {string|null} [no_with_veto] TallyResult no_with_veto - */ - - /** - * Constructs a new TallyResult. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TallyResult. - * @implements ITallyResult - * @constructor - * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set - */ - function TallyResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TallyResult yes. - * @member {string} yes - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.yes = ""; - - /** - * TallyResult abstain. - * @member {string} abstain - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.abstain = ""; - - /** - * TallyResult no. - * @member {string} no - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.no = ""; - - /** - * TallyResult no_with_veto. - * @member {string} no_with_veto - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.no_with_veto = ""; - - /** - * Encodes the specified TallyResult message. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.yes != null && Object.hasOwnProperty.call(message, "yes")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.yes); - if (message.abstain != null && Object.hasOwnProperty.call(message, "abstain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.abstain); - if (message.no != null && Object.hasOwnProperty.call(message, "no")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.no); - if (message.no_with_veto != null && Object.hasOwnProperty.call(message, "no_with_veto")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.no_with_veto); - return writer; - }; - - /** - * Encodes the specified TallyResult message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TallyResult message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.yes = reader.string(); - break; - case 2: - message.abstain = reader.string(); - break; - case 3: - message.no = reader.string(); - break; - case 4: - message.no_with_veto = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TallyResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TallyResult message. - * @function verify - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TallyResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.yes != null && message.hasOwnProperty("yes")) - if (!$util.isString(message.yes)) - return "yes: string expected"; - if (message.abstain != null && message.hasOwnProperty("abstain")) - if (!$util.isString(message.abstain)) - return "abstain: string expected"; - if (message.no != null && message.hasOwnProperty("no")) - if (!$util.isString(message.no)) - return "no: string expected"; - if (message.no_with_veto != null && message.hasOwnProperty("no_with_veto")) - if (!$util.isString(message.no_with_veto)) - return "no_with_veto: string expected"; - return null; - }; - - /** - * Creates a TallyResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - */ - TallyResult.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TallyResult) - return object; - var message = new $root.cosmos.gov.v1beta1.TallyResult(); - if (object.yes != null) - message.yes = String(object.yes); - if (object.abstain != null) - message.abstain = String(object.abstain); - if (object.no != null) - message.no = String(object.no); - if (object.no_with_veto != null) - message.no_with_veto = String(object.no_with_veto); - return message; - }; - - /** - * Creates a plain object from a TallyResult message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.TallyResult} message TallyResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TallyResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.yes = ""; - object.abstain = ""; - object.no = ""; - object.no_with_veto = ""; - } - if (message.yes != null && message.hasOwnProperty("yes")) - object.yes = message.yes; - if (message.abstain != null && message.hasOwnProperty("abstain")) - object.abstain = message.abstain; - if (message.no != null && message.hasOwnProperty("no")) - object.no = message.no; - if (message.no_with_veto != null && message.hasOwnProperty("no_with_veto")) - object.no_with_veto = message.no_with_veto; - return object; - }; - - /** - * Converts this TallyResult to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - * @returns {Object.} JSON object - */ - TallyResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TallyResult; - })(); - - v1beta1.Vote = (function() { - - /** - * Properties of a Vote. - * @memberof cosmos.gov.v1beta1 - * @interface IVote - * @property {Long|null} [proposal_id] Vote proposal_id - * @property {string|null} [voter] Vote voter - * @property {cosmos.gov.v1beta1.VoteOption|null} [option] Vote option - * @property {Array.|null} [options] Vote options - */ - - /** - * Constructs a new Vote. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Vote. - * @implements IVote - * @constructor - * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set - */ - function Vote(properties) { - this.options = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Vote proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Vote voter. - * @member {string} voter - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.voter = ""; - - /** - * Vote option. - * @member {cosmos.gov.v1beta1.VoteOption} option - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.option = 0; - - /** - * Vote options. - * @member {Array.} options - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.options = $util.emptyArray; - - /** - * Encodes the specified Vote message. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); - if (message.option != null && Object.hasOwnProperty.call(message, "option")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); - if (message.options != null && message.options.length) - for (var i = 0; i < message.options.length; ++i) - $root.cosmos.gov.v1beta1.WeightedVoteOption.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Vote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.option = reader.int32(); - break; - case 4: - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.cosmos.gov.v1beta1.WeightedVoteOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vote message. - * @function verify - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.voter != null && message.hasOwnProperty("voter")) - if (!$util.isString(message.voter)) - return "voter: string expected"; - if (message.option != null && message.hasOwnProperty("option")) - switch (message.option) { - default: - return "option: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.options != null && message.hasOwnProperty("options")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (var i = 0; i < message.options.length; ++i) { - var error = $root.cosmos.gov.v1beta1.WeightedVoteOption.verify(message.options[i]); - if (error) - return "options." + error; - } - } - return null; - }; - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Vote} Vote - */ - Vote.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Vote) - return object; - var message = new $root.cosmos.gov.v1beta1.Vote(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.voter != null) - message.voter = String(object.voter); - switch (object.option) { - case "VOTE_OPTION_UNSPECIFIED": - case 0: - message.option = 0; - break; - case "VOTE_OPTION_YES": - case 1: - message.option = 1; - break; - case "VOTE_OPTION_ABSTAIN": - case 2: - message.option = 2; - break; - case "VOTE_OPTION_NO": - case 3: - message.option = 3; - break; - case "VOTE_OPTION_NO_WITH_VETO": - case 4: - message.option = 4; - break; - } - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".cosmos.gov.v1beta1.Vote.options: array expected"); - message.options = []; - for (var i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Vote.options: object expected"); - message.options[i] = $root.cosmos.gov.v1beta1.WeightedVoteOption.fromObject(object.options[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.Vote} message Vote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.options = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.voter = ""; - object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.voter != null && message.hasOwnProperty("voter")) - object.voter = message.voter; - if (message.option != null && message.hasOwnProperty("option")) - object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; - if (message.options && message.options.length) { - object.options = []; - for (var j = 0; j < message.options.length; ++j) - object.options[j] = $root.cosmos.gov.v1beta1.WeightedVoteOption.toObject(message.options[j], options); - } - return object; - }; - - /** - * Converts this Vote to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Vote - * @instance - * @returns {Object.} JSON object - */ - Vote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Vote; - })(); - - v1beta1.DepositParams = (function() { - - /** - * Properties of a DepositParams. - * @memberof cosmos.gov.v1beta1 - * @interface IDepositParams - * @property {Array.|null} [min_deposit] DepositParams min_deposit - * @property {google.protobuf.IDuration|null} [max_deposit_period] DepositParams max_deposit_period - */ - - /** - * Constructs a new DepositParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a DepositParams. - * @implements IDepositParams - * @constructor - * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set - */ - function DepositParams(properties) { - this.min_deposit = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DepositParams min_deposit. - * @member {Array.} min_deposit - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - */ - DepositParams.prototype.min_deposit = $util.emptyArray; - - /** - * DepositParams max_deposit_period. - * @member {google.protobuf.IDuration|null|undefined} max_deposit_period - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - */ - DepositParams.prototype.max_deposit_period = null; - - /** - * Encodes the specified DepositParams message. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DepositParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.min_deposit != null && message.min_deposit.length) - for (var i = 0; i < message.min_deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.min_deposit[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.max_deposit_period != null && Object.hasOwnProperty.call(message, "max_deposit_period")) - $root.google.protobuf.Duration.encode(message.max_deposit_period, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DepositParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DepositParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DepositParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DepositParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.DepositParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.min_deposit && message.min_deposit.length)) - message.min_deposit = []; - message.min_deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 2: - message.max_deposit_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DepositParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DepositParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DepositParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DepositParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.min_deposit != null && message.hasOwnProperty("min_deposit")) { - if (!Array.isArray(message.min_deposit)) - return "min_deposit: array expected"; - for (var i = 0; i < message.min_deposit.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.min_deposit[i]); - if (error) - return "min_deposit." + error; - } - } - if (message.max_deposit_period != null && message.hasOwnProperty("max_deposit_period")) { - var error = $root.google.protobuf.Duration.verify(message.max_deposit_period); - if (error) - return "max_deposit_period." + error; - } - return null; - }; - - /** - * Creates a DepositParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - */ - DepositParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.DepositParams) - return object; - var message = new $root.cosmos.gov.v1beta1.DepositParams(); - if (object.min_deposit) { - if (!Array.isArray(object.min_deposit)) - throw TypeError(".cosmos.gov.v1beta1.DepositParams.min_deposit: array expected"); - message.min_deposit = []; - for (var i = 0; i < object.min_deposit.length; ++i) { - if (typeof object.min_deposit[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.DepositParams.min_deposit: object expected"); - message.min_deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.min_deposit[i]); - } - } - if (object.max_deposit_period != null) { - if (typeof object.max_deposit_period !== "object") - throw TypeError(".cosmos.gov.v1beta1.DepositParams.max_deposit_period: object expected"); - message.max_deposit_period = $root.google.protobuf.Duration.fromObject(object.max_deposit_period); - } - return message; - }; - - /** - * Creates a plain object from a DepositParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.DepositParams} message DepositParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DepositParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.min_deposit = []; - if (options.defaults) - object.max_deposit_period = null; - if (message.min_deposit && message.min_deposit.length) { - object.min_deposit = []; - for (var j = 0; j < message.min_deposit.length; ++j) - object.min_deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.min_deposit[j], options); - } - if (message.max_deposit_period != null && message.hasOwnProperty("max_deposit_period")) - object.max_deposit_period = $root.google.protobuf.Duration.toObject(message.max_deposit_period, options); - return object; - }; - - /** - * Converts this DepositParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - * @returns {Object.} JSON object - */ - DepositParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DepositParams; - })(); - - v1beta1.VotingParams = (function() { - - /** - * Properties of a VotingParams. - * @memberof cosmos.gov.v1beta1 - * @interface IVotingParams - * @property {google.protobuf.IDuration|null} [voting_period] VotingParams voting_period - */ - - /** - * Constructs a new VotingParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a VotingParams. - * @implements IVotingParams - * @constructor - * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set - */ - function VotingParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VotingParams voting_period. - * @member {google.protobuf.IDuration|null|undefined} voting_period - * @memberof cosmos.gov.v1beta1.VotingParams - * @instance - */ - VotingParams.prototype.voting_period = null; - - /** - * Encodes the specified VotingParams message. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VotingParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voting_period != null && Object.hasOwnProperty.call(message, "voting_period")) - $root.google.protobuf.Duration.encode(message.voting_period, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VotingParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VotingParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VotingParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VotingParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.VotingParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.voting_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VotingParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VotingParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VotingParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VotingParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voting_period != null && message.hasOwnProperty("voting_period")) { - var error = $root.google.protobuf.Duration.verify(message.voting_period); - if (error) - return "voting_period." + error; - } - return null; - }; - - /** - * Creates a VotingParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - */ - VotingParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.VotingParams) - return object; - var message = new $root.cosmos.gov.v1beta1.VotingParams(); - if (object.voting_period != null) { - if (typeof object.voting_period !== "object") - throw TypeError(".cosmos.gov.v1beta1.VotingParams.voting_period: object expected"); - message.voting_period = $root.google.protobuf.Duration.fromObject(object.voting_period); - } - return message; - }; - - /** - * Creates a plain object from a VotingParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.VotingParams} message VotingParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VotingParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.voting_period = null; - if (message.voting_period != null && message.hasOwnProperty("voting_period")) - object.voting_period = $root.google.protobuf.Duration.toObject(message.voting_period, options); - return object; - }; - - /** - * Converts this VotingParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.VotingParams - * @instance - * @returns {Object.} JSON object - */ - VotingParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VotingParams; - })(); - - v1beta1.TallyParams = (function() { - - /** - * Properties of a TallyParams. - * @memberof cosmos.gov.v1beta1 - * @interface ITallyParams - * @property {Uint8Array|null} [quorum] TallyParams quorum - * @property {Uint8Array|null} [threshold] TallyParams threshold - * @property {Uint8Array|null} [veto_threshold] TallyParams veto_threshold - */ - - /** - * Constructs a new TallyParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TallyParams. - * @implements ITallyParams - * @constructor - * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set - */ - function TallyParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TallyParams quorum. - * @member {Uint8Array} quorum - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.quorum = $util.newBuffer([]); - - /** - * TallyParams threshold. - * @member {Uint8Array} threshold - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.threshold = $util.newBuffer([]); - - /** - * TallyParams veto_threshold. - * @member {Uint8Array} veto_threshold - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.veto_threshold = $util.newBuffer([]); - - /** - * Encodes the specified TallyParams message. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quorum != null && Object.hasOwnProperty.call(message, "quorum")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorum); - if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.threshold); - if (message.veto_threshold != null && Object.hasOwnProperty.call(message, "veto_threshold")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.veto_threshold); - return writer; - }; - - /** - * Encodes the specified TallyParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TallyParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quorum = reader.bytes(); - break; - case 2: - message.threshold = reader.bytes(); - break; - case 3: - message.veto_threshold = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TallyParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TallyParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TallyParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quorum != null && message.hasOwnProperty("quorum")) - if (!(message.quorum && typeof message.quorum.length === "number" || $util.isString(message.quorum))) - return "quorum: buffer expected"; - if (message.threshold != null && message.hasOwnProperty("threshold")) - if (!(message.threshold && typeof message.threshold.length === "number" || $util.isString(message.threshold))) - return "threshold: buffer expected"; - if (message.veto_threshold != null && message.hasOwnProperty("veto_threshold")) - if (!(message.veto_threshold && typeof message.veto_threshold.length === "number" || $util.isString(message.veto_threshold))) - return "veto_threshold: buffer expected"; - return null; - }; - - /** - * Creates a TallyParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - */ - TallyParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TallyParams) - return object; - var message = new $root.cosmos.gov.v1beta1.TallyParams(); - if (object.quorum != null) - if (typeof object.quorum === "string") - $util.base64.decode(object.quorum, message.quorum = $util.newBuffer($util.base64.length(object.quorum)), 0); - else if (object.quorum.length) - message.quorum = object.quorum; - if (object.threshold != null) - if (typeof object.threshold === "string") - $util.base64.decode(object.threshold, message.threshold = $util.newBuffer($util.base64.length(object.threshold)), 0); - else if (object.threshold.length) - message.threshold = object.threshold; - if (object.veto_threshold != null) - if (typeof object.veto_threshold === "string") - $util.base64.decode(object.veto_threshold, message.veto_threshold = $util.newBuffer($util.base64.length(object.veto_threshold)), 0); - else if (object.veto_threshold.length) - message.veto_threshold = object.veto_threshold; - return message; - }; - - /** - * Creates a plain object from a TallyParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.TallyParams} message TallyParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TallyParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.quorum = ""; - else { - object.quorum = []; - if (options.bytes !== Array) - object.quorum = $util.newBuffer(object.quorum); - } - if (options.bytes === String) - object.threshold = ""; - else { - object.threshold = []; - if (options.bytes !== Array) - object.threshold = $util.newBuffer(object.threshold); - } - if (options.bytes === String) - object.veto_threshold = ""; - else { - object.veto_threshold = []; - if (options.bytes !== Array) - object.veto_threshold = $util.newBuffer(object.veto_threshold); - } - } - if (message.quorum != null && message.hasOwnProperty("quorum")) - object.quorum = options.bytes === String ? $util.base64.encode(message.quorum, 0, message.quorum.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorum) : message.quorum; - if (message.threshold != null && message.hasOwnProperty("threshold")) - object.threshold = options.bytes === String ? $util.base64.encode(message.threshold, 0, message.threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.threshold) : message.threshold; - if (message.veto_threshold != null && message.hasOwnProperty("veto_threshold")) - object.veto_threshold = options.bytes === String ? $util.base64.encode(message.veto_threshold, 0, message.veto_threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.veto_threshold) : message.veto_threshold; - return object; - }; - - /** - * Converts this TallyParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - * @returns {Object.} JSON object - */ - TallyParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TallyParams; - })(); - - return v1beta1; - })(); - - return gov; - })(); - - cosmos.base = (function() { - - /** - * Namespace base. - * @memberof cosmos - * @namespace - */ - var base = {}; - - base.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base - * @namespace - */ - var v1beta1 = {}; - - v1beta1.Coin = (function() { - - /** - * Properties of a Coin. - * @memberof cosmos.base.v1beta1 - * @interface ICoin - * @property {string|null} [denom] Coin denom - * @property {string|null} [amount] Coin amount - */ - - /** - * Constructs a new Coin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a Coin. - * @implements ICoin - * @constructor - * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set - */ - function Coin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Coin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.denom = ""; - - /** - * Coin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.amount = ""; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Coin message. - * @function verify - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Coin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.Coin} Coin - */ - Coin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.Coin) - return object; - var message = new $root.cosmos.base.v1beta1.Coin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.Coin} message Coin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Coin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this Coin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.Coin - * @instance - * @returns {Object.} JSON object - */ - Coin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Coin; - })(); - - v1beta1.DecCoin = (function() { - - /** - * Properties of a DecCoin. - * @memberof cosmos.base.v1beta1 - * @interface IDecCoin - * @property {string|null} [denom] DecCoin denom - * @property {string|null} [amount] DecCoin amount - */ - - /** - * Constructs a new DecCoin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecCoin. - * @implements IDecCoin - * @constructor - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - */ - function DecCoin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecCoin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.denom = ""; - - /** - * DecCoin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.amount = ""; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecCoin message. - * @function verify - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecCoin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - */ - DecCoin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecCoin) - return object; - var message = new $root.cosmos.base.v1beta1.DecCoin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.DecCoin} message DecCoin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecCoin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this DecCoin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - * @returns {Object.} JSON object - */ - DecCoin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecCoin; - })(); - - v1beta1.IntProto = (function() { - - /** - * Properties of an IntProto. - * @memberof cosmos.base.v1beta1 - * @interface IIntProto - * @property {string|null} [int] IntProto int - */ - - /** - * Constructs a new IntProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents an IntProto. - * @implements IIntProto - * @constructor - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - */ - function IntProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IntProto int. - * @member {string} int - * @memberof cosmos.base.v1beta1.IntProto - * @instance - */ - IntProto.prototype.int = ""; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.int != null && Object.hasOwnProperty.call(message, "int")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); - return writer; - }; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntProto message. - * @function verify - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.int != null && message.hasOwnProperty("int")) - if (!$util.isString(message.int)) - return "int: string expected"; - return null; - }; - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.IntProto} IntProto - */ - IntProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.IntProto) - return object; - var message = new $root.cosmos.base.v1beta1.IntProto(); - if (object.int != null) - message.int = String(object.int); - return message; - }; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IntProto} message IntProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.int = ""; - if (message.int != null && message.hasOwnProperty("int")) - object.int = message.int; - return object; - }; - - /** - * Converts this IntProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.IntProto - * @instance - * @returns {Object.} JSON object - */ - IntProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IntProto; - })(); - - v1beta1.DecProto = (function() { - - /** - * Properties of a DecProto. - * @memberof cosmos.base.v1beta1 - * @interface IDecProto - * @property {string|null} [dec] DecProto dec - */ - - /** - * Constructs a new DecProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecProto. - * @implements IDecProto - * @constructor - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - */ - function DecProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecProto dec. - * @member {string} dec - * @memberof cosmos.base.v1beta1.DecProto - * @instance - */ - DecProto.prototype.dec = ""; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); - return writer; - }; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dec = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecProto message. - * @function verify - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dec != null && message.hasOwnProperty("dec")) - if (!$util.isString(message.dec)) - return "dec: string expected"; - return null; - }; - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecProto} DecProto - */ - DecProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecProto) - return object; - var message = new $root.cosmos.base.v1beta1.DecProto(); - if (object.dec != null) - message.dec = String(object.dec); - return message; - }; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.DecProto} message DecProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.dec = ""; - if (message.dec != null && message.hasOwnProperty("dec")) - object.dec = message.dec; - return object; - }; - - /** - * Converts this DecProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecProto - * @instance - * @returns {Object.} JSON object - */ - DecProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecProto; - })(); - - return v1beta1; - })(); - - return base; - })(); - - return cosmos; - })(); - - $root.gogoproto = (function() { - - /** - * Namespace gogoproto. - * @exports gogoproto - * @namespace - */ - var gogoproto = {}; - - return gogoproto; - })(); - - $root.cosmos_proto = (function() { - - /** - * Namespace cosmos_proto. - * @exports cosmos_proto - * @namespace - */ - var cosmos_proto = {}; - - cosmos_proto.InterfaceDescriptor = (function() { - - /** - * Properties of an InterfaceDescriptor. - * @memberof cosmos_proto - * @interface IInterfaceDescriptor - * @property {string|null} [name] InterfaceDescriptor name - * @property {string|null} [description] InterfaceDescriptor description - */ - - /** - * Constructs a new InterfaceDescriptor. - * @memberof cosmos_proto - * @classdesc Represents an InterfaceDescriptor. - * @implements IInterfaceDescriptor - * @constructor - * @param {cosmos_proto.IInterfaceDescriptor=} [properties] Properties to set - */ - function InterfaceDescriptor(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InterfaceDescriptor name. - * @member {string} name - * @memberof cosmos_proto.InterfaceDescriptor - * @instance - */ - InterfaceDescriptor.prototype.name = ""; - - /** - * InterfaceDescriptor description. - * @member {string} description - * @memberof cosmos_proto.InterfaceDescriptor - * @instance - */ - InterfaceDescriptor.prototype.description = ""; - - /** - * Encodes the specified InterfaceDescriptor message. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @function encode - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {cosmos_proto.IInterfaceDescriptor} message InterfaceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterfaceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified InterfaceDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {cosmos_proto.IInterfaceDescriptor} message InterfaceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterfaceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos_proto.InterfaceDescriptor} InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterfaceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos_proto.InterfaceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos_proto.InterfaceDescriptor} InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterfaceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InterfaceDescriptor message. - * @function verify - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InterfaceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates an InterfaceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {cosmos_proto.InterfaceDescriptor} InterfaceDescriptor - */ - InterfaceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos_proto.InterfaceDescriptor) - return object; - var message = new $root.cosmos_proto.InterfaceDescriptor(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from an InterfaceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {cosmos_proto.InterfaceDescriptor} message InterfaceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InterfaceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this InterfaceDescriptor to JSON. - * @function toJSON - * @memberof cosmos_proto.InterfaceDescriptor - * @instance - * @returns {Object.} JSON object - */ - InterfaceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InterfaceDescriptor; - })(); - - cosmos_proto.ScalarDescriptor = (function() { - - /** - * Properties of a ScalarDescriptor. - * @memberof cosmos_proto - * @interface IScalarDescriptor - * @property {string|null} [name] ScalarDescriptor name - * @property {string|null} [description] ScalarDescriptor description - * @property {Array.|null} [field_type] ScalarDescriptor field_type - * @property {string|null} [legacy_amino_encoding] ScalarDescriptor legacy_amino_encoding - */ - - /** - * Constructs a new ScalarDescriptor. - * @memberof cosmos_proto - * @classdesc Represents a ScalarDescriptor. - * @implements IScalarDescriptor - * @constructor - * @param {cosmos_proto.IScalarDescriptor=} [properties] Properties to set - */ - function ScalarDescriptor(properties) { - this.field_type = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScalarDescriptor name. - * @member {string} name - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.name = ""; - - /** - * ScalarDescriptor description. - * @member {string} description - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.description = ""; - - /** - * ScalarDescriptor field_type. - * @member {Array.} field_type - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.field_type = $util.emptyArray; - - /** - * ScalarDescriptor legacy_amino_encoding. - * @member {string} legacy_amino_encoding - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.legacy_amino_encoding = ""; - - /** - * Encodes the specified ScalarDescriptor message. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @function encode - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {cosmos_proto.IScalarDescriptor} message ScalarDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScalarDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.field_type != null && message.field_type.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.field_type.length; ++i) - writer.int32(message.field_type[i]); - writer.ldelim(); - } - if (message.legacy_amino_encoding != null && Object.hasOwnProperty.call(message, "legacy_amino_encoding")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.legacy_amino_encoding); - return writer; - }; - - /** - * Encodes the specified ScalarDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {cosmos_proto.IScalarDescriptor} message ScalarDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScalarDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer. - * @function decode - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos_proto.ScalarDescriptor} ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScalarDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos_proto.ScalarDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - if (!(message.field_type && message.field_type.length)) - message.field_type = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.field_type.push(reader.int32()); - } else - message.field_type.push(reader.int32()); - break; - case 4: - message.legacy_amino_encoding = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos_proto.ScalarDescriptor} ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScalarDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScalarDescriptor message. - * @function verify - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScalarDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.field_type != null && message.hasOwnProperty("field_type")) { - if (!Array.isArray(message.field_type)) - return "field_type: array expected"; - for (var i = 0; i < message.field_type.length; ++i) - switch (message.field_type[i]) { - default: - return "field_type: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.legacy_amino_encoding != null && message.hasOwnProperty("legacy_amino_encoding")) - if (!$util.isString(message.legacy_amino_encoding)) - return "legacy_amino_encoding: string expected"; - return null; - }; - - /** - * Creates a ScalarDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {Object.} object Plain object - * @returns {cosmos_proto.ScalarDescriptor} ScalarDescriptor - */ - ScalarDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos_proto.ScalarDescriptor) - return object; - var message = new $root.cosmos_proto.ScalarDescriptor(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.field_type) { - if (!Array.isArray(object.field_type)) - throw TypeError(".cosmos_proto.ScalarDescriptor.field_type: array expected"); - message.field_type = []; - for (var i = 0; i < object.field_type.length; ++i) - switch (object.field_type[i]) { - default: - case "SCALAR_TYPE_UNSPECIFIED": - case 0: - message.field_type[i] = 0; - break; - case "SCALAR_TYPE_STRING": - case 1: - message.field_type[i] = 1; - break; - case "SCALAR_TYPE_BYTES": - case 2: - message.field_type[i] = 2; - break; - } - } - if (object.legacy_amino_encoding != null) - message.legacy_amino_encoding = String(object.legacy_amino_encoding); - return message; - }; - - /** - * Creates a plain object from a ScalarDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {cosmos_proto.ScalarDescriptor} message ScalarDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScalarDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.field_type = []; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.legacy_amino_encoding = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.field_type && message.field_type.length) { - object.field_type = []; - for (var j = 0; j < message.field_type.length; ++j) - object.field_type[j] = options.enums === String ? $root.cosmos_proto.ScalarType[message.field_type[j]] : message.field_type[j]; - } - if (message.legacy_amino_encoding != null && message.hasOwnProperty("legacy_amino_encoding")) - object.legacy_amino_encoding = message.legacy_amino_encoding; - return object; - }; - - /** - * Converts this ScalarDescriptor to JSON. - * @function toJSON - * @memberof cosmos_proto.ScalarDescriptor - * @instance - * @returns {Object.} JSON object - */ - ScalarDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ScalarDescriptor; - })(); - - /** - * ScalarType enum. - * @name cosmos_proto.ScalarType - * @enum {number} - * @property {number} SCALAR_TYPE_UNSPECIFIED=0 SCALAR_TYPE_UNSPECIFIED value - * @property {number} SCALAR_TYPE_STRING=1 SCALAR_TYPE_STRING value - * @property {number} SCALAR_TYPE_BYTES=2 SCALAR_TYPE_BYTES value - */ - cosmos_proto.ScalarType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCALAR_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCALAR_TYPE_STRING"] = 1; - values[valuesById[2] = "SCALAR_TYPE_BYTES"] = 2; - return values; - })(); - - return cosmos_proto; - })(); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorSet; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [public_dependency] FileDescriptorProto public_dependency - * @property {Array.|null} [weak_dependency] FileDescriptorProto weak_dependency - * @property {Array.|null} [message_type] FileDescriptorProto message_type - * @property {Array.|null} [enum_type] FileDescriptorProto enum_type - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [source_code_info] FileDescriptorProto source_code_info - * @property {string|null} [syntax] FileDescriptorProto syntax - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.public_dependency = []; - this.weak_dependency = []; - this.message_type = []; - this.enum_type = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto public_dependency. - * @member {Array.} public_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.public_dependency = $util.emptyArray; - - /** - * FileDescriptorProto weak_dependency. - * @member {Array.} weak_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weak_dependency = $util.emptyArray; - - /** - * FileDescriptorProto message_type. - * @member {Array.} message_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.message_type = $util.emptyArray; - - /** - * FileDescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto source_code_info. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} source_code_info - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.source_code_info = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.message_type != null && message.message_type.length) - for (var i = 0; i < message.message_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.message_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (var i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.source_code_info != null && Object.hasOwnProperty.call(message, "source_code_info")) - $root.google.protobuf.SourceCodeInfo.encode(message.source_code_info, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.public_dependency != null && message.public_dependency.length) - for (var i = 0; i < message.public_dependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.public_dependency[i]); - if (message.weak_dependency != null && message.weak_dependency.length) - for (var i = 0; i < message.weak_dependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weak_dependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.public_dependency && message.public_dependency.length)) - message.public_dependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.public_dependency.push(reader.int32()); - } else - message.public_dependency.push(reader.int32()); - break; - case 11: - if (!(message.weak_dependency && message.weak_dependency.length)) - message.weak_dependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weak_dependency.push(reader.int32()); - } else - message.weak_dependency.push(reader.int32()); - break; - case 4: - if (!(message.message_type && message.message_type.length)) - message.message_type = []; - message.message_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.source_code_info = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.public_dependency != null && message.hasOwnProperty("public_dependency")) { - if (!Array.isArray(message.public_dependency)) - return "public_dependency: array expected"; - for (var i = 0; i < message.public_dependency.length; ++i) - if (!$util.isInteger(message.public_dependency[i])) - return "public_dependency: integer[] expected"; - } - if (message.weak_dependency != null && message.hasOwnProperty("weak_dependency")) { - if (!Array.isArray(message.weak_dependency)) - return "weak_dependency: array expected"; - for (var i = 0; i < message.weak_dependency.length; ++i) - if (!$util.isInteger(message.weak_dependency[i])) - return "weak_dependency: integer[] expected"; - } - if (message.message_type != null && message.hasOwnProperty("message_type")) { - if (!Array.isArray(message.message_type)) - return "message_type: array expected"; - for (var i = 0; i < message.message_type.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.message_type[i]); - if (error) - return "message_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (var i = 0; i < message.enum_type.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.source_code_info); - if (error) - return "source_code_info." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.public_dependency) { - if (!Array.isArray(object.public_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.public_dependency: array expected"); - message.public_dependency = []; - for (var i = 0; i < object.public_dependency.length; ++i) - message.public_dependency[i] = object.public_dependency[i] | 0; - } - if (object.weak_dependency) { - if (!Array.isArray(object.weak_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weak_dependency: array expected"); - message.weak_dependency = []; - for (var i = 0; i < object.weak_dependency.length; ++i) - message.weak_dependency[i] = object.weak_dependency[i] | 0; - } - if (object.message_type) { - if (!Array.isArray(object.message_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: array expected"); - message.message_type = []; - for (var i = 0; i < object.message_type.length; ++i) { - if (typeof object.message_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: object expected"); - message.message_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.message_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (var i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.source_code_info != null) { - if (typeof object.source_code_info !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.source_code_info: object expected"); - message.source_code_info = $root.google.protobuf.SourceCodeInfo.fromObject(object.source_code_info); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.message_type = []; - object.enum_type = []; - object.service = []; - object.extension = []; - object.public_dependency = []; - object.weak_dependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.source_code_info = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.message_type && message.message_type.length) { - object.message_type = []; - for (var j = 0; j < message.message_type.length; ++j) - object.message_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.message_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (var j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) - object.source_code_info = $root.google.protobuf.SourceCodeInfo.toObject(message.source_code_info, options); - if (message.public_dependency && message.public_dependency.length) { - object.public_dependency = []; - for (var j = 0; j < message.public_dependency.length; ++j) - object.public_dependency[j] = message.public_dependency[j]; - } - if (message.weak_dependency && message.weak_dependency.length) { - object.weak_dependency = []; - for (var j = 0; j < message.weak_dependency.length; ++j) - object.weak_dependency[j] = message.weak_dependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nested_type] DescriptorProto nested_type - * @property {Array.|null} [enum_type] DescriptorProto enum_type - * @property {Array.|null} [extension_range] DescriptorProto extension_range - * @property {Array.|null} [oneof_decl] DescriptorProto oneof_decl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reserved_range] DescriptorProto reserved_range - * @property {Array.|null} [reserved_name] DescriptorProto reserved_name - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nested_type = []; - this.enum_type = []; - this.extension_range = []; - this.oneof_decl = []; - this.reserved_range = []; - this.reserved_name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nested_type. - * @member {Array.} nested_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nested_type = $util.emptyArray; - - /** - * DescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * DescriptorProto extension_range. - * @member {Array.} extension_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension_range = $util.emptyArray; - - /** - * DescriptorProto oneof_decl. - * @member {Array.} oneof_decl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneof_decl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reserved_range. - * @member {Array.} reserved_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_range = $util.emptyArray; - - /** - * DescriptorProto reserved_name. - * @member {Array.} reserved_name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_name = $util.emptyArray; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nested_type != null && message.nested_type.length) - for (var i = 0; i < message.nested_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nested_type[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (var i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extension_range != null && message.extension_range.length) - for (var i = 0; i < message.extension_range.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extension_range[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneof_decl != null && message.oneof_decl.length) - for (var i = 0; i < message.oneof_decl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneof_decl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reserved_range != null && message.reserved_range.length) - for (var i = 0; i < message.reserved_range.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reserved_range[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reserved_name != null && message.reserved_name.length) - for (var i = 0; i < message.reserved_name.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reserved_name[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nested_type && message.nested_type.length)) - message.nested_type = []; - message.nested_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extension_range && message.extension_range.length)) - message.extension_range = []; - message.extension_range.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneof_decl && message.oneof_decl.length)) - message.oneof_decl = []; - message.oneof_decl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reserved_range && message.reserved_range.length)) - message.reserved_range = []; - message.reserved_range.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reserved_name && message.reserved_name.length)) - message.reserved_name = []; - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nested_type != null && message.hasOwnProperty("nested_type")) { - if (!Array.isArray(message.nested_type)) - return "nested_type: array expected"; - for (var i = 0; i < message.nested_type.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nested_type[i]); - if (error) - return "nested_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (var i = 0; i < message.enum_type.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.extension_range != null && message.hasOwnProperty("extension_range")) { - if (!Array.isArray(message.extension_range)) - return "extension_range: array expected"; - for (var i = 0; i < message.extension_range.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extension_range[i]); - if (error) - return "extension_range." + error; - } - } - if (message.oneof_decl != null && message.hasOwnProperty("oneof_decl")) { - if (!Array.isArray(message.oneof_decl)) - return "oneof_decl: array expected"; - for (var i = 0; i < message.oneof_decl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneof_decl[i]); - if (error) - return "oneof_decl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reserved_range != null && message.hasOwnProperty("reserved_range")) { - if (!Array.isArray(message.reserved_range)) - return "reserved_range: array expected"; - for (var i = 0; i < message.reserved_range.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reserved_range[i]); - if (error) - return "reserved_range." + error; - } - } - if (message.reserved_name != null && message.hasOwnProperty("reserved_name")) { - if (!Array.isArray(message.reserved_name)) - return "reserved_name: array expected"; - for (var i = 0; i < message.reserved_name.length; ++i) - if (!$util.isString(message.reserved_name[i])) - return "reserved_name: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nested_type) { - if (!Array.isArray(object.nested_type)) - throw TypeError(".google.protobuf.DescriptorProto.nested_type: array expected"); - message.nested_type = []; - for (var i = 0; i < object.nested_type.length; ++i) { - if (typeof object.nested_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nested_type: object expected"); - message.nested_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nested_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.DescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (var i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.extension_range) { - if (!Array.isArray(object.extension_range)) - throw TypeError(".google.protobuf.DescriptorProto.extension_range: array expected"); - message.extension_range = []; - for (var i = 0; i < object.extension_range.length; ++i) { - if (typeof object.extension_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension_range: object expected"); - message.extension_range[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extension_range[i]); - } - } - if (object.oneof_decl) { - if (!Array.isArray(object.oneof_decl)) - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: array expected"); - message.oneof_decl = []; - for (var i = 0; i < object.oneof_decl.length; ++i) { - if (typeof object.oneof_decl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: object expected"); - message.oneof_decl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneof_decl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reserved_range) { - if (!Array.isArray(object.reserved_range)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: array expected"); - message.reserved_range = []; - for (var i = 0; i < object.reserved_range.length; ++i) { - if (typeof object.reserved_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: object expected"); - message.reserved_range[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reserved_range[i]); - } - } - if (object.reserved_name) { - if (!Array.isArray(object.reserved_name)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_name: array expected"); - message.reserved_name = []; - for (var i = 0; i < object.reserved_name.length; ++i) - message.reserved_name[i] = String(object.reserved_name[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nested_type = []; - object.enum_type = []; - object.extension_range = []; - object.extension = []; - object.oneof_decl = []; - object.reserved_range = []; - object.reserved_name = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nested_type && message.nested_type.length) { - object.nested_type = []; - for (var j = 0; j < message.nested_type.length; ++j) - object.nested_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.nested_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (var j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.extension_range && message.extension_range.length) { - object.extension_range = []; - for (var j = 0; j < message.extension_range.length; ++j) - object.extension_range[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extension_range[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneof_decl && message.oneof_decl.length) { - object.oneof_decl = []; - for (var j = 0; j < message.oneof_decl.length; ++j) - object.oneof_decl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneof_decl[j], options); - } - if (message.reserved_range && message.reserved_range.length) { - object.reserved_range = []; - for (var j = 0; j < message.reserved_range.length; ++j) - object.reserved_range[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reserved_range[j], options); - } - if (message.reserved_name && message.reserved_name.length) { - object.reserved_name = []; - for (var j = 0; j < message.reserved_name.length; ++j) - object.reserved_name[j] = message.reserved_name[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [type_name] FieldDescriptorProto type_name - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [default_value] FieldDescriptorProto default_value - * @property {number|null} [oneof_index] FieldDescriptorProto oneof_index - * @property {string|null} [json_name] FieldDescriptorProto json_name - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto type_name. - * @member {string} type_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type_name = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto default_value. - * @member {string} default_value - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.default_value = ""; - - /** - * FieldDescriptorProto oneof_index. - * @member {number} oneof_index - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneof_index = 0; - - /** - * FieldDescriptorProto json_name. - * @member {string} json_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.json_name = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.type_name != null && Object.hasOwnProperty.call(message, "type_name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.type_name); - if (message.default_value != null && Object.hasOwnProperty.call(message, "default_value")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.default_value); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneof_index != null && Object.hasOwnProperty.call(message, "oneof_index")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneof_index); - if (message.json_name != null && Object.hasOwnProperty.call(message, "json_name")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.json_name); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.type_name != null && message.hasOwnProperty("type_name")) - if (!$util.isString(message.type_name)) - return "type_name: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.default_value != null && message.hasOwnProperty("default_value")) - if (!$util.isString(message.default_value)) - return "default_value: string expected"; - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - if (!$util.isInteger(message.oneof_index)) - return "oneof_index: integer expected"; - if (message.json_name != null && message.hasOwnProperty("json_name")) - if (!$util.isString(message.json_name)) - return "json_name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.type_name != null) - message.type_name = String(object.type_name); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.default_value != null) - message.default_value = String(object.default_value); - if (object.oneof_index != null) - message.oneof_index = object.oneof_index | 0; - if (object.json_name != null) - message.json_name = String(object.json_name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.type_name = ""; - object.default_value = ""; - object.options = null; - object.oneof_index = 0; - object.json_name = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.type_name != null && message.hasOwnProperty("type_name")) - object.type_name = message.type_name; - if (message.default_value != null && message.hasOwnProperty("default_value")) - object.default_value = message.default_value; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - object.oneof_index = message.oneof_index; - if (message.json_name != null && message.hasOwnProperty("json_name")) - object.json_name = message.json_name; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.value = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [input_type] MethodDescriptorProto input_type - * @property {string|null} [output_type] MethodDescriptorProto output_type - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [client_streaming] MethodDescriptorProto client_streaming - * @property {boolean|null} [server_streaming] MethodDescriptorProto server_streaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto input_type. - * @member {string} input_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.input_type = ""; - - /** - * MethodDescriptorProto output_type. - * @member {string} output_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.output_type = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto client_streaming. - * @member {boolean} client_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.client_streaming = false; - - /** - * MethodDescriptorProto server_streaming. - * @member {boolean} server_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.server_streaming = false; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.input_type != null && Object.hasOwnProperty.call(message, "input_type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.input_type); - if (message.output_type != null && Object.hasOwnProperty.call(message, "output_type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.output_type); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.client_streaming != null && Object.hasOwnProperty.call(message, "client_streaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.client_streaming); - if (message.server_streaming != null && Object.hasOwnProperty.call(message, "server_streaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.server_streaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.input_type != null && message.hasOwnProperty("input_type")) - if (!$util.isString(message.input_type)) - return "input_type: string expected"; - if (message.output_type != null && message.hasOwnProperty("output_type")) - if (!$util.isString(message.output_type)) - return "output_type: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - if (typeof message.client_streaming !== "boolean") - return "client_streaming: boolean expected"; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - if (typeof message.server_streaming !== "boolean") - return "server_streaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.input_type != null) - message.input_type = String(object.input_type); - if (object.output_type != null) - message.output_type = String(object.output_type); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.client_streaming != null) - message.client_streaming = Boolean(object.client_streaming); - if (object.server_streaming != null) - message.server_streaming = Boolean(object.server_streaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.input_type = ""; - object.output_type = ""; - object.options = null; - object.client_streaming = false; - object.server_streaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.input_type != null && message.hasOwnProperty("input_type")) - object.input_type = message.input_type; - if (message.output_type != null && message.hasOwnProperty("output_type")) - object.output_type = message.output_type; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - object.client_streaming = message.client_streaming; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - object.server_streaming = message.server_streaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [java_package] FileOptions java_package - * @property {string|null} [java_outer_classname] FileOptions java_outer_classname - * @property {boolean|null} [java_multiple_files] FileOptions java_multiple_files - * @property {boolean|null} [java_generate_equals_and_hash] FileOptions java_generate_equals_and_hash - * @property {boolean|null} [java_string_check_utf8] FileOptions java_string_check_utf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimize_for] FileOptions optimize_for - * @property {string|null} [go_package] FileOptions go_package - * @property {boolean|null} [cc_generic_services] FileOptions cc_generic_services - * @property {boolean|null} [java_generic_services] FileOptions java_generic_services - * @property {boolean|null} [py_generic_services] FileOptions py_generic_services - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [cc_enable_arenas] FileOptions cc_enable_arenas - * @property {string|null} [objc_class_prefix] FileOptions objc_class_prefix - * @property {string|null} [csharp_namespace] FileOptions csharp_namespace - * @property {Array.|null} [uninterpreted_option] FileOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters_all"] FileOptions .gogoproto.goproto_getters_all - * @property {boolean|null} [".gogoproto.goproto_enum_prefix_all"] FileOptions .gogoproto.goproto_enum_prefix_all - * @property {boolean|null} [".gogoproto.goproto_stringer_all"] FileOptions .gogoproto.goproto_stringer_all - * @property {boolean|null} [".gogoproto.verbose_equal_all"] FileOptions .gogoproto.verbose_equal_all - * @property {boolean|null} [".gogoproto.face_all"] FileOptions .gogoproto.face_all - * @property {boolean|null} [".gogoproto.gostring_all"] FileOptions .gogoproto.gostring_all - * @property {boolean|null} [".gogoproto.populate_all"] FileOptions .gogoproto.populate_all - * @property {boolean|null} [".gogoproto.stringer_all"] FileOptions .gogoproto.stringer_all - * @property {boolean|null} [".gogoproto.onlyone_all"] FileOptions .gogoproto.onlyone_all - * @property {boolean|null} [".gogoproto.equal_all"] FileOptions .gogoproto.equal_all - * @property {boolean|null} [".gogoproto.description_all"] FileOptions .gogoproto.description_all - * @property {boolean|null} [".gogoproto.testgen_all"] FileOptions .gogoproto.testgen_all - * @property {boolean|null} [".gogoproto.benchgen_all"] FileOptions .gogoproto.benchgen_all - * @property {boolean|null} [".gogoproto.marshaler_all"] FileOptions .gogoproto.marshaler_all - * @property {boolean|null} [".gogoproto.unmarshaler_all"] FileOptions .gogoproto.unmarshaler_all - * @property {boolean|null} [".gogoproto.stable_marshaler_all"] FileOptions .gogoproto.stable_marshaler_all - * @property {boolean|null} [".gogoproto.sizer_all"] FileOptions .gogoproto.sizer_all - * @property {boolean|null} [".gogoproto.goproto_enum_stringer_all"] FileOptions .gogoproto.goproto_enum_stringer_all - * @property {boolean|null} [".gogoproto.enum_stringer_all"] FileOptions .gogoproto.enum_stringer_all - * @property {boolean|null} [".gogoproto.unsafe_marshaler_all"] FileOptions .gogoproto.unsafe_marshaler_all - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler_all"] FileOptions .gogoproto.unsafe_unmarshaler_all - * @property {boolean|null} [".gogoproto.goproto_extensions_map_all"] FileOptions .gogoproto.goproto_extensions_map_all - * @property {boolean|null} [".gogoproto.goproto_unrecognized_all"] FileOptions .gogoproto.goproto_unrecognized_all - * @property {boolean|null} [".gogoproto.gogoproto_import"] FileOptions .gogoproto.gogoproto_import - * @property {boolean|null} [".gogoproto.protosizer_all"] FileOptions .gogoproto.protosizer_all - * @property {boolean|null} [".gogoproto.compare_all"] FileOptions .gogoproto.compare_all - * @property {boolean|null} [".gogoproto.typedecl_all"] FileOptions .gogoproto.typedecl_all - * @property {boolean|null} [".gogoproto.enumdecl_all"] FileOptions .gogoproto.enumdecl_all - * @property {boolean|null} [".gogoproto.goproto_registration"] FileOptions .gogoproto.goproto_registration - * @property {boolean|null} [".gogoproto.messagename_all"] FileOptions .gogoproto.messagename_all - * @property {boolean|null} [".gogoproto.goproto_sizecache_all"] FileOptions .gogoproto.goproto_sizecache_all - * @property {boolean|null} [".gogoproto.goproto_unkeyed_all"] FileOptions .gogoproto.goproto_unkeyed_all - * @property {Array.|null} [".cosmos_proto.declare_interface"] FileOptions .cosmos_proto.declare_interface - * @property {Array.|null} [".cosmos_proto.declare_scalar"] FileOptions .cosmos_proto.declare_scalar - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpreted_option = []; - this[".cosmos_proto.declare_interface"] = []; - this[".cosmos_proto.declare_scalar"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions java_package. - * @member {string} java_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_package = ""; - - /** - * FileOptions java_outer_classname. - * @member {string} java_outer_classname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_outer_classname = ""; - - /** - * FileOptions java_multiple_files. - * @member {boolean} java_multiple_files - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_multiple_files = false; - - /** - * FileOptions java_generate_equals_and_hash. - * @member {boolean} java_generate_equals_and_hash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generate_equals_and_hash = false; - - /** - * FileOptions java_string_check_utf8. - * @member {boolean} java_string_check_utf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_string_check_utf8 = false; - - /** - * FileOptions optimize_for. - * @member {google.protobuf.FileOptions.OptimizeMode} optimize_for - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimize_for = 1; - - /** - * FileOptions go_package. - * @member {string} go_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.go_package = ""; - - /** - * FileOptions cc_generic_services. - * @member {boolean} cc_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_generic_services = false; - - /** - * FileOptions java_generic_services. - * @member {boolean} java_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generic_services = false; - - /** - * FileOptions py_generic_services. - * @member {boolean} py_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.py_generic_services = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions cc_enable_arenas. - * @member {boolean} cc_enable_arenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_enable_arenas = false; - - /** - * FileOptions objc_class_prefix. - * @member {string} objc_class_prefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objc_class_prefix = ""; - - /** - * FileOptions csharp_namespace. - * @member {string} csharp_namespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharp_namespace = ""; - - /** - * FileOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FileOptions .gogoproto.goproto_getters_all. - * @member {boolean} .gogoproto.goproto_getters_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_getters_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_prefix_all. - * @member {boolean} .gogoproto.goproto_enum_prefix_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_prefix_all"] = false; - - /** - * FileOptions .gogoproto.goproto_stringer_all. - * @member {boolean} .gogoproto.goproto_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_stringer_all"] = false; - - /** - * FileOptions .gogoproto.verbose_equal_all. - * @member {boolean} .gogoproto.verbose_equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.verbose_equal_all"] = false; - - /** - * FileOptions .gogoproto.face_all. - * @member {boolean} .gogoproto.face_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.face_all"] = false; - - /** - * FileOptions .gogoproto.gostring_all. - * @member {boolean} .gogoproto.gostring_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gostring_all"] = false; - - /** - * FileOptions .gogoproto.populate_all. - * @member {boolean} .gogoproto.populate_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.populate_all"] = false; - - /** - * FileOptions .gogoproto.stringer_all. - * @member {boolean} .gogoproto.stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stringer_all"] = false; - - /** - * FileOptions .gogoproto.onlyone_all. - * @member {boolean} .gogoproto.onlyone_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.onlyone_all"] = false; - - /** - * FileOptions .gogoproto.equal_all. - * @member {boolean} .gogoproto.equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.equal_all"] = false; - - /** - * FileOptions .gogoproto.description_all. - * @member {boolean} .gogoproto.description_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.description_all"] = false; - - /** - * FileOptions .gogoproto.testgen_all. - * @member {boolean} .gogoproto.testgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.testgen_all"] = false; - - /** - * FileOptions .gogoproto.benchgen_all. - * @member {boolean} .gogoproto.benchgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.benchgen_all"] = false; - - /** - * FileOptions .gogoproto.marshaler_all. - * @member {boolean} .gogoproto.marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unmarshaler_all. - * @member {boolean} .gogoproto.unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.stable_marshaler_all. - * @member {boolean} .gogoproto.stable_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stable_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.sizer_all. - * @member {boolean} .gogoproto.sizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.sizer_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_stringer_all. - * @member {boolean} .gogoproto.goproto_enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.enum_stringer_all. - * @member {boolean} .gogoproto.enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_marshaler_all. - * @member {boolean} .gogoproto.unsafe_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_unmarshaler_all. - * @member {boolean} .gogoproto.unsafe_unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.goproto_extensions_map_all. - * @member {boolean} .gogoproto.goproto_extensions_map_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_extensions_map_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unrecognized_all. - * @member {boolean} .gogoproto.goproto_unrecognized_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unrecognized_all"] = false; - - /** - * FileOptions .gogoproto.gogoproto_import. - * @member {boolean} .gogoproto.gogoproto_import - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gogoproto_import"] = false; - - /** - * FileOptions .gogoproto.protosizer_all. - * @member {boolean} .gogoproto.protosizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.protosizer_all"] = false; - - /** - * FileOptions .gogoproto.compare_all. - * @member {boolean} .gogoproto.compare_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.compare_all"] = false; - - /** - * FileOptions .gogoproto.typedecl_all. - * @member {boolean} .gogoproto.typedecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.typedecl_all"] = false; - - /** - * FileOptions .gogoproto.enumdecl_all. - * @member {boolean} .gogoproto.enumdecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enumdecl_all"] = false; - - /** - * FileOptions .gogoproto.goproto_registration. - * @member {boolean} .gogoproto.goproto_registration - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_registration"] = false; - - /** - * FileOptions .gogoproto.messagename_all. - * @member {boolean} .gogoproto.messagename_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.messagename_all"] = false; - - /** - * FileOptions .gogoproto.goproto_sizecache_all. - * @member {boolean} .gogoproto.goproto_sizecache_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_sizecache_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unkeyed_all. - * @member {boolean} .gogoproto.goproto_unkeyed_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unkeyed_all"] = false; - - /** - * FileOptions .cosmos_proto.declare_interface. - * @member {Array.} .cosmos_proto.declare_interface - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".cosmos_proto.declare_interface"] = $util.emptyArray; - - /** - * FileOptions .cosmos_proto.declare_scalar. - * @member {Array.} .cosmos_proto.declare_scalar - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".cosmos_proto.declare_scalar"] = $util.emptyArray; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.java_package != null && Object.hasOwnProperty.call(message, "java_package")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.java_package); - if (message.java_outer_classname != null && Object.hasOwnProperty.call(message, "java_outer_classname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.java_outer_classname); - if (message.optimize_for != null && Object.hasOwnProperty.call(message, "optimize_for")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimize_for); - if (message.java_multiple_files != null && Object.hasOwnProperty.call(message, "java_multiple_files")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.java_multiple_files); - if (message.go_package != null && Object.hasOwnProperty.call(message, "go_package")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.go_package); - if (message.cc_generic_services != null && Object.hasOwnProperty.call(message, "cc_generic_services")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.cc_generic_services); - if (message.java_generic_services != null && Object.hasOwnProperty.call(message, "java_generic_services")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.java_generic_services); - if (message.py_generic_services != null && Object.hasOwnProperty.call(message, "py_generic_services")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.py_generic_services); - if (message.java_generate_equals_and_hash != null && Object.hasOwnProperty.call(message, "java_generate_equals_and_hash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.java_generate_equals_and_hash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.java_string_check_utf8 != null && Object.hasOwnProperty.call(message, "java_string_check_utf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.java_string_check_utf8); - if (message.cc_enable_arenas != null && Object.hasOwnProperty.call(message, "cc_enable_arenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.cc_enable_arenas); - if (message.objc_class_prefix != null && Object.hasOwnProperty.call(message, "objc_class_prefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objc_class_prefix); - if (message.csharp_namespace != null && Object.hasOwnProperty.call(message, "csharp_namespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharp_namespace); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters_all")) - writer.uint32(/* id 63001, wireType 0 =*/504008).bool(message[".gogoproto.goproto_getters_all"]); - if (message[".gogoproto.goproto_enum_prefix_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix_all")) - writer.uint32(/* id 63002, wireType 0 =*/504016).bool(message[".gogoproto.goproto_enum_prefix_all"]); - if (message[".gogoproto.goproto_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer_all")) - writer.uint32(/* id 63003, wireType 0 =*/504024).bool(message[".gogoproto.goproto_stringer_all"]); - if (message[".gogoproto.verbose_equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal_all")) - writer.uint32(/* id 63004, wireType 0 =*/504032).bool(message[".gogoproto.verbose_equal_all"]); - if (message[".gogoproto.face_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face_all")) - writer.uint32(/* id 63005, wireType 0 =*/504040).bool(message[".gogoproto.face_all"]); - if (message[".gogoproto.gostring_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring_all")) - writer.uint32(/* id 63006, wireType 0 =*/504048).bool(message[".gogoproto.gostring_all"]); - if (message[".gogoproto.populate_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate_all")) - writer.uint32(/* id 63007, wireType 0 =*/504056).bool(message[".gogoproto.populate_all"]); - if (message[".gogoproto.stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer_all")) - writer.uint32(/* id 63008, wireType 0 =*/504064).bool(message[".gogoproto.stringer_all"]); - if (message[".gogoproto.onlyone_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone_all")) - writer.uint32(/* id 63009, wireType 0 =*/504072).bool(message[".gogoproto.onlyone_all"]); - if (message[".gogoproto.equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal_all")) - writer.uint32(/* id 63013, wireType 0 =*/504104).bool(message[".gogoproto.equal_all"]); - if (message[".gogoproto.description_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description_all")) - writer.uint32(/* id 63014, wireType 0 =*/504112).bool(message[".gogoproto.description_all"]); - if (message[".gogoproto.testgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen_all")) - writer.uint32(/* id 63015, wireType 0 =*/504120).bool(message[".gogoproto.testgen_all"]); - if (message[".gogoproto.benchgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen_all")) - writer.uint32(/* id 63016, wireType 0 =*/504128).bool(message[".gogoproto.benchgen_all"]); - if (message[".gogoproto.marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler_all")) - writer.uint32(/* id 63017, wireType 0 =*/504136).bool(message[".gogoproto.marshaler_all"]); - if (message[".gogoproto.unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler_all")) - writer.uint32(/* id 63018, wireType 0 =*/504144).bool(message[".gogoproto.unmarshaler_all"]); - if (message[".gogoproto.stable_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler_all")) - writer.uint32(/* id 63019, wireType 0 =*/504152).bool(message[".gogoproto.stable_marshaler_all"]); - if (message[".gogoproto.sizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer_all")) - writer.uint32(/* id 63020, wireType 0 =*/504160).bool(message[".gogoproto.sizer_all"]); - if (message[".gogoproto.goproto_enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer_all")) - writer.uint32(/* id 63021, wireType 0 =*/504168).bool(message[".gogoproto.goproto_enum_stringer_all"]); - if (message[".gogoproto.enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer_all")) - writer.uint32(/* id 63022, wireType 0 =*/504176).bool(message[".gogoproto.enum_stringer_all"]); - if (message[".gogoproto.unsafe_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler_all")) - writer.uint32(/* id 63023, wireType 0 =*/504184).bool(message[".gogoproto.unsafe_marshaler_all"]); - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler_all")) - writer.uint32(/* id 63024, wireType 0 =*/504192).bool(message[".gogoproto.unsafe_unmarshaler_all"]); - if (message[".gogoproto.goproto_extensions_map_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map_all")) - writer.uint32(/* id 63025, wireType 0 =*/504200).bool(message[".gogoproto.goproto_extensions_map_all"]); - if (message[".gogoproto.goproto_unrecognized_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized_all")) - writer.uint32(/* id 63026, wireType 0 =*/504208).bool(message[".gogoproto.goproto_unrecognized_all"]); - if (message[".gogoproto.gogoproto_import"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gogoproto_import")) - writer.uint32(/* id 63027, wireType 0 =*/504216).bool(message[".gogoproto.gogoproto_import"]); - if (message[".gogoproto.protosizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer_all")) - writer.uint32(/* id 63028, wireType 0 =*/504224).bool(message[".gogoproto.protosizer_all"]); - if (message[".gogoproto.compare_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare_all")) - writer.uint32(/* id 63029, wireType 0 =*/504232).bool(message[".gogoproto.compare_all"]); - if (message[".gogoproto.typedecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl_all")) - writer.uint32(/* id 63030, wireType 0 =*/504240).bool(message[".gogoproto.typedecl_all"]); - if (message[".gogoproto.enumdecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl_all")) - writer.uint32(/* id 63031, wireType 0 =*/504248).bool(message[".gogoproto.enumdecl_all"]); - if (message[".gogoproto.goproto_registration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_registration")) - writer.uint32(/* id 63032, wireType 0 =*/504256).bool(message[".gogoproto.goproto_registration"]); - if (message[".gogoproto.messagename_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename_all")) - writer.uint32(/* id 63033, wireType 0 =*/504264).bool(message[".gogoproto.messagename_all"]); - if (message[".gogoproto.goproto_sizecache_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache_all")) - writer.uint32(/* id 63034, wireType 0 =*/504272).bool(message[".gogoproto.goproto_sizecache_all"]); - if (message[".gogoproto.goproto_unkeyed_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed_all")) - writer.uint32(/* id 63035, wireType 0 =*/504280).bool(message[".gogoproto.goproto_unkeyed_all"]); - if (message[".cosmos_proto.declare_interface"] != null && message[".cosmos_proto.declare_interface"].length) - for (var i = 0; i < message[".cosmos_proto.declare_interface"].length; ++i) - $root.cosmos_proto.InterfaceDescriptor.encode(message[".cosmos_proto.declare_interface"][i], writer.uint32(/* id 793021, wireType 2 =*/6344170).fork()).ldelim(); - if (message[".cosmos_proto.declare_scalar"] != null && message[".cosmos_proto.declare_scalar"].length) - for (var i = 0; i < message[".cosmos_proto.declare_scalar"].length; ++i) - $root.cosmos_proto.ScalarDescriptor.encode(message[".cosmos_proto.declare_scalar"][i], writer.uint32(/* id 793022, wireType 2 =*/6344178).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32(); - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 63001: - message[".gogoproto.goproto_getters_all"] = reader.bool(); - break; - case 63002: - message[".gogoproto.goproto_enum_prefix_all"] = reader.bool(); - break; - case 63003: - message[".gogoproto.goproto_stringer_all"] = reader.bool(); - break; - case 63004: - message[".gogoproto.verbose_equal_all"] = reader.bool(); - break; - case 63005: - message[".gogoproto.face_all"] = reader.bool(); - break; - case 63006: - message[".gogoproto.gostring_all"] = reader.bool(); - break; - case 63007: - message[".gogoproto.populate_all"] = reader.bool(); - break; - case 63008: - message[".gogoproto.stringer_all"] = reader.bool(); - break; - case 63009: - message[".gogoproto.onlyone_all"] = reader.bool(); - break; - case 63013: - message[".gogoproto.equal_all"] = reader.bool(); - break; - case 63014: - message[".gogoproto.description_all"] = reader.bool(); - break; - case 63015: - message[".gogoproto.testgen_all"] = reader.bool(); - break; - case 63016: - message[".gogoproto.benchgen_all"] = reader.bool(); - break; - case 63017: - message[".gogoproto.marshaler_all"] = reader.bool(); - break; - case 63018: - message[".gogoproto.unmarshaler_all"] = reader.bool(); - break; - case 63019: - message[".gogoproto.stable_marshaler_all"] = reader.bool(); - break; - case 63020: - message[".gogoproto.sizer_all"] = reader.bool(); - break; - case 63021: - message[".gogoproto.goproto_enum_stringer_all"] = reader.bool(); - break; - case 63022: - message[".gogoproto.enum_stringer_all"] = reader.bool(); - break; - case 63023: - message[".gogoproto.unsafe_marshaler_all"] = reader.bool(); - break; - case 63024: - message[".gogoproto.unsafe_unmarshaler_all"] = reader.bool(); - break; - case 63025: - message[".gogoproto.goproto_extensions_map_all"] = reader.bool(); - break; - case 63026: - message[".gogoproto.goproto_unrecognized_all"] = reader.bool(); - break; - case 63027: - message[".gogoproto.gogoproto_import"] = reader.bool(); - break; - case 63028: - message[".gogoproto.protosizer_all"] = reader.bool(); - break; - case 63029: - message[".gogoproto.compare_all"] = reader.bool(); - break; - case 63030: - message[".gogoproto.typedecl_all"] = reader.bool(); - break; - case 63031: - message[".gogoproto.enumdecl_all"] = reader.bool(); - break; - case 63032: - message[".gogoproto.goproto_registration"] = reader.bool(); - break; - case 63033: - message[".gogoproto.messagename_all"] = reader.bool(); - break; - case 63034: - message[".gogoproto.goproto_sizecache_all"] = reader.bool(); - break; - case 63035: - message[".gogoproto.goproto_unkeyed_all"] = reader.bool(); - break; - case 793021: - if (!(message[".cosmos_proto.declare_interface"] && message[".cosmos_proto.declare_interface"].length)) - message[".cosmos_proto.declare_interface"] = []; - message[".cosmos_proto.declare_interface"].push($root.cosmos_proto.InterfaceDescriptor.decode(reader, reader.uint32())); - break; - case 793022: - if (!(message[".cosmos_proto.declare_scalar"] && message[".cosmos_proto.declare_scalar"].length)) - message[".cosmos_proto.declare_scalar"] = []; - message[".cosmos_proto.declare_scalar"].push($root.cosmos_proto.ScalarDescriptor.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.java_package != null && message.hasOwnProperty("java_package")) - if (!$util.isString(message.java_package)) - return "java_package: string expected"; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - if (!$util.isString(message.java_outer_classname)) - return "java_outer_classname: string expected"; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - if (typeof message.java_multiple_files !== "boolean") - return "java_multiple_files: boolean expected"; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - if (typeof message.java_generate_equals_and_hash !== "boolean") - return "java_generate_equals_and_hash: boolean expected"; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - if (typeof message.java_string_check_utf8 !== "boolean") - return "java_string_check_utf8: boolean expected"; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - switch (message.optimize_for) { - default: - return "optimize_for: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.go_package != null && message.hasOwnProperty("go_package")) - if (!$util.isString(message.go_package)) - return "go_package: string expected"; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - if (typeof message.cc_generic_services !== "boolean") - return "cc_generic_services: boolean expected"; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - if (typeof message.java_generic_services !== "boolean") - return "java_generic_services: boolean expected"; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - if (typeof message.py_generic_services !== "boolean") - return "py_generic_services: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - if (typeof message.cc_enable_arenas !== "boolean") - return "cc_enable_arenas: boolean expected"; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - if (!$util.isString(message.objc_class_prefix)) - return "objc_class_prefix: string expected"; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - if (!$util.isString(message.csharp_namespace)) - return "csharp_namespace: string expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - if (typeof message[".gogoproto.goproto_getters_all"] !== "boolean") - return ".gogoproto.goproto_getters_all: boolean expected"; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - if (typeof message[".gogoproto.goproto_enum_prefix_all"] !== "boolean") - return ".gogoproto.goproto_enum_prefix_all: boolean expected"; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - if (typeof message[".gogoproto.goproto_stringer_all"] !== "boolean") - return ".gogoproto.goproto_stringer_all: boolean expected"; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - if (typeof message[".gogoproto.verbose_equal_all"] !== "boolean") - return ".gogoproto.verbose_equal_all: boolean expected"; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - if (typeof message[".gogoproto.face_all"] !== "boolean") - return ".gogoproto.face_all: boolean expected"; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - if (typeof message[".gogoproto.gostring_all"] !== "boolean") - return ".gogoproto.gostring_all: boolean expected"; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - if (typeof message[".gogoproto.populate_all"] !== "boolean") - return ".gogoproto.populate_all: boolean expected"; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - if (typeof message[".gogoproto.stringer_all"] !== "boolean") - return ".gogoproto.stringer_all: boolean expected"; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - if (typeof message[".gogoproto.onlyone_all"] !== "boolean") - return ".gogoproto.onlyone_all: boolean expected"; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - if (typeof message[".gogoproto.equal_all"] !== "boolean") - return ".gogoproto.equal_all: boolean expected"; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - if (typeof message[".gogoproto.description_all"] !== "boolean") - return ".gogoproto.description_all: boolean expected"; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - if (typeof message[".gogoproto.testgen_all"] !== "boolean") - return ".gogoproto.testgen_all: boolean expected"; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - if (typeof message[".gogoproto.benchgen_all"] !== "boolean") - return ".gogoproto.benchgen_all: boolean expected"; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - if (typeof message[".gogoproto.marshaler_all"] !== "boolean") - return ".gogoproto.marshaler_all: boolean expected"; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - if (typeof message[".gogoproto.unmarshaler_all"] !== "boolean") - return ".gogoproto.unmarshaler_all: boolean expected"; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - if (typeof message[".gogoproto.stable_marshaler_all"] !== "boolean") - return ".gogoproto.stable_marshaler_all: boolean expected"; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - if (typeof message[".gogoproto.sizer_all"] !== "boolean") - return ".gogoproto.sizer_all: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - if (typeof message[".gogoproto.goproto_enum_stringer_all"] !== "boolean") - return ".gogoproto.goproto_enum_stringer_all: boolean expected"; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - if (typeof message[".gogoproto.enum_stringer_all"] !== "boolean") - return ".gogoproto.enum_stringer_all: boolean expected"; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - if (typeof message[".gogoproto.unsafe_marshaler_all"] !== "boolean") - return ".gogoproto.unsafe_marshaler_all: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - if (typeof message[".gogoproto.unsafe_unmarshaler_all"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler_all: boolean expected"; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - if (typeof message[".gogoproto.goproto_extensions_map_all"] !== "boolean") - return ".gogoproto.goproto_extensions_map_all: boolean expected"; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - if (typeof message[".gogoproto.goproto_unrecognized_all"] !== "boolean") - return ".gogoproto.goproto_unrecognized_all: boolean expected"; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - if (typeof message[".gogoproto.gogoproto_import"] !== "boolean") - return ".gogoproto.gogoproto_import: boolean expected"; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - if (typeof message[".gogoproto.protosizer_all"] !== "boolean") - return ".gogoproto.protosizer_all: boolean expected"; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - if (typeof message[".gogoproto.compare_all"] !== "boolean") - return ".gogoproto.compare_all: boolean expected"; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - if (typeof message[".gogoproto.typedecl_all"] !== "boolean") - return ".gogoproto.typedecl_all: boolean expected"; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - if (typeof message[".gogoproto.enumdecl_all"] !== "boolean") - return ".gogoproto.enumdecl_all: boolean expected"; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - if (typeof message[".gogoproto.goproto_registration"] !== "boolean") - return ".gogoproto.goproto_registration: boolean expected"; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - if (typeof message[".gogoproto.messagename_all"] !== "boolean") - return ".gogoproto.messagename_all: boolean expected"; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - if (typeof message[".gogoproto.goproto_sizecache_all"] !== "boolean") - return ".gogoproto.goproto_sizecache_all: boolean expected"; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - if (typeof message[".gogoproto.goproto_unkeyed_all"] !== "boolean") - return ".gogoproto.goproto_unkeyed_all: boolean expected"; - if (message[".cosmos_proto.declare_interface"] != null && message.hasOwnProperty(".cosmos_proto.declare_interface")) { - if (!Array.isArray(message[".cosmos_proto.declare_interface"])) - return ".cosmos_proto.declare_interface: array expected"; - for (var i = 0; i < message[".cosmos_proto.declare_interface"].length; ++i) { - var error = $root.cosmos_proto.InterfaceDescriptor.verify(message[".cosmos_proto.declare_interface"][i]); - if (error) - return ".cosmos_proto.declare_interface." + error; - } - } - if (message[".cosmos_proto.declare_scalar"] != null && message.hasOwnProperty(".cosmos_proto.declare_scalar")) { - if (!Array.isArray(message[".cosmos_proto.declare_scalar"])) - return ".cosmos_proto.declare_scalar: array expected"; - for (var i = 0; i < message[".cosmos_proto.declare_scalar"].length; ++i) { - var error = $root.cosmos_proto.ScalarDescriptor.verify(message[".cosmos_proto.declare_scalar"][i]); - if (error) - return ".cosmos_proto.declare_scalar." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.java_package != null) - message.java_package = String(object.java_package); - if (object.java_outer_classname != null) - message.java_outer_classname = String(object.java_outer_classname); - if (object.java_multiple_files != null) - message.java_multiple_files = Boolean(object.java_multiple_files); - if (object.java_generate_equals_and_hash != null) - message.java_generate_equals_and_hash = Boolean(object.java_generate_equals_and_hash); - if (object.java_string_check_utf8 != null) - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - switch (object.optimize_for) { - case "SPEED": - case 1: - message.optimize_for = 1; - break; - case "CODE_SIZE": - case 2: - message.optimize_for = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimize_for = 3; - break; - } - if (object.go_package != null) - message.go_package = String(object.go_package); - if (object.cc_generic_services != null) - message.cc_generic_services = Boolean(object.cc_generic_services); - if (object.java_generic_services != null) - message.java_generic_services = Boolean(object.java_generic_services); - if (object.py_generic_services != null) - message.py_generic_services = Boolean(object.py_generic_services); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.cc_enable_arenas != null) - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - if (object.objc_class_prefix != null) - message.objc_class_prefix = String(object.objc_class_prefix); - if (object.csharp_namespace != null) - message.csharp_namespace = String(object.csharp_namespace); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters_all"] != null) - message[".gogoproto.goproto_getters_all"] = Boolean(object[".gogoproto.goproto_getters_all"]); - if (object[".gogoproto.goproto_enum_prefix_all"] != null) - message[".gogoproto.goproto_enum_prefix_all"] = Boolean(object[".gogoproto.goproto_enum_prefix_all"]); - if (object[".gogoproto.goproto_stringer_all"] != null) - message[".gogoproto.goproto_stringer_all"] = Boolean(object[".gogoproto.goproto_stringer_all"]); - if (object[".gogoproto.verbose_equal_all"] != null) - message[".gogoproto.verbose_equal_all"] = Boolean(object[".gogoproto.verbose_equal_all"]); - if (object[".gogoproto.face_all"] != null) - message[".gogoproto.face_all"] = Boolean(object[".gogoproto.face_all"]); - if (object[".gogoproto.gostring_all"] != null) - message[".gogoproto.gostring_all"] = Boolean(object[".gogoproto.gostring_all"]); - if (object[".gogoproto.populate_all"] != null) - message[".gogoproto.populate_all"] = Boolean(object[".gogoproto.populate_all"]); - if (object[".gogoproto.stringer_all"] != null) - message[".gogoproto.stringer_all"] = Boolean(object[".gogoproto.stringer_all"]); - if (object[".gogoproto.onlyone_all"] != null) - message[".gogoproto.onlyone_all"] = Boolean(object[".gogoproto.onlyone_all"]); - if (object[".gogoproto.equal_all"] != null) - message[".gogoproto.equal_all"] = Boolean(object[".gogoproto.equal_all"]); - if (object[".gogoproto.description_all"] != null) - message[".gogoproto.description_all"] = Boolean(object[".gogoproto.description_all"]); - if (object[".gogoproto.testgen_all"] != null) - message[".gogoproto.testgen_all"] = Boolean(object[".gogoproto.testgen_all"]); - if (object[".gogoproto.benchgen_all"] != null) - message[".gogoproto.benchgen_all"] = Boolean(object[".gogoproto.benchgen_all"]); - if (object[".gogoproto.marshaler_all"] != null) - message[".gogoproto.marshaler_all"] = Boolean(object[".gogoproto.marshaler_all"]); - if (object[".gogoproto.unmarshaler_all"] != null) - message[".gogoproto.unmarshaler_all"] = Boolean(object[".gogoproto.unmarshaler_all"]); - if (object[".gogoproto.stable_marshaler_all"] != null) - message[".gogoproto.stable_marshaler_all"] = Boolean(object[".gogoproto.stable_marshaler_all"]); - if (object[".gogoproto.sizer_all"] != null) - message[".gogoproto.sizer_all"] = Boolean(object[".gogoproto.sizer_all"]); - if (object[".gogoproto.goproto_enum_stringer_all"] != null) - message[".gogoproto.goproto_enum_stringer_all"] = Boolean(object[".gogoproto.goproto_enum_stringer_all"]); - if (object[".gogoproto.enum_stringer_all"] != null) - message[".gogoproto.enum_stringer_all"] = Boolean(object[".gogoproto.enum_stringer_all"]); - if (object[".gogoproto.unsafe_marshaler_all"] != null) - message[".gogoproto.unsafe_marshaler_all"] = Boolean(object[".gogoproto.unsafe_marshaler_all"]); - if (object[".gogoproto.unsafe_unmarshaler_all"] != null) - message[".gogoproto.unsafe_unmarshaler_all"] = Boolean(object[".gogoproto.unsafe_unmarshaler_all"]); - if (object[".gogoproto.goproto_extensions_map_all"] != null) - message[".gogoproto.goproto_extensions_map_all"] = Boolean(object[".gogoproto.goproto_extensions_map_all"]); - if (object[".gogoproto.goproto_unrecognized_all"] != null) - message[".gogoproto.goproto_unrecognized_all"] = Boolean(object[".gogoproto.goproto_unrecognized_all"]); - if (object[".gogoproto.gogoproto_import"] != null) - message[".gogoproto.gogoproto_import"] = Boolean(object[".gogoproto.gogoproto_import"]); - if (object[".gogoproto.protosizer_all"] != null) - message[".gogoproto.protosizer_all"] = Boolean(object[".gogoproto.protosizer_all"]); - if (object[".gogoproto.compare_all"] != null) - message[".gogoproto.compare_all"] = Boolean(object[".gogoproto.compare_all"]); - if (object[".gogoproto.typedecl_all"] != null) - message[".gogoproto.typedecl_all"] = Boolean(object[".gogoproto.typedecl_all"]); - if (object[".gogoproto.enumdecl_all"] != null) - message[".gogoproto.enumdecl_all"] = Boolean(object[".gogoproto.enumdecl_all"]); - if (object[".gogoproto.goproto_registration"] != null) - message[".gogoproto.goproto_registration"] = Boolean(object[".gogoproto.goproto_registration"]); - if (object[".gogoproto.messagename_all"] != null) - message[".gogoproto.messagename_all"] = Boolean(object[".gogoproto.messagename_all"]); - if (object[".gogoproto.goproto_sizecache_all"] != null) - message[".gogoproto.goproto_sizecache_all"] = Boolean(object[".gogoproto.goproto_sizecache_all"]); - if (object[".gogoproto.goproto_unkeyed_all"] != null) - message[".gogoproto.goproto_unkeyed_all"] = Boolean(object[".gogoproto.goproto_unkeyed_all"]); - if (object[".cosmos_proto.declare_interface"]) { - if (!Array.isArray(object[".cosmos_proto.declare_interface"])) - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_interface: array expected"); - message[".cosmos_proto.declare_interface"] = []; - for (var i = 0; i < object[".cosmos_proto.declare_interface"].length; ++i) { - if (typeof object[".cosmos_proto.declare_interface"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_interface: object expected"); - message[".cosmos_proto.declare_interface"][i] = $root.cosmos_proto.InterfaceDescriptor.fromObject(object[".cosmos_proto.declare_interface"][i]); - } - } - if (object[".cosmos_proto.declare_scalar"]) { - if (!Array.isArray(object[".cosmos_proto.declare_scalar"])) - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_scalar: array expected"); - message[".cosmos_proto.declare_scalar"] = []; - for (var i = 0; i < object[".cosmos_proto.declare_scalar"].length; ++i) { - if (typeof object[".cosmos_proto.declare_scalar"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_scalar: object expected"); - message[".cosmos_proto.declare_scalar"][i] = $root.cosmos_proto.ScalarDescriptor.fromObject(object[".cosmos_proto.declare_scalar"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpreted_option = []; - object[".cosmos_proto.declare_interface"] = []; - object[".cosmos_proto.declare_scalar"] = []; - } - if (options.defaults) { - object.java_package = ""; - object.java_outer_classname = ""; - object.optimize_for = options.enums === String ? "SPEED" : 1; - object.java_multiple_files = false; - object.go_package = ""; - object.cc_generic_services = false; - object.java_generic_services = false; - object.py_generic_services = false; - object.java_generate_equals_and_hash = false; - object.deprecated = false; - object.java_string_check_utf8 = false; - object.cc_enable_arenas = false; - object.objc_class_prefix = ""; - object.csharp_namespace = ""; - object[".gogoproto.goproto_getters_all"] = false; - object[".gogoproto.goproto_enum_prefix_all"] = false; - object[".gogoproto.goproto_stringer_all"] = false; - object[".gogoproto.verbose_equal_all"] = false; - object[".gogoproto.face_all"] = false; - object[".gogoproto.gostring_all"] = false; - object[".gogoproto.populate_all"] = false; - object[".gogoproto.stringer_all"] = false; - object[".gogoproto.onlyone_all"] = false; - object[".gogoproto.equal_all"] = false; - object[".gogoproto.description_all"] = false; - object[".gogoproto.testgen_all"] = false; - object[".gogoproto.benchgen_all"] = false; - object[".gogoproto.marshaler_all"] = false; - object[".gogoproto.unmarshaler_all"] = false; - object[".gogoproto.stable_marshaler_all"] = false; - object[".gogoproto.sizer_all"] = false; - object[".gogoproto.goproto_enum_stringer_all"] = false; - object[".gogoproto.enum_stringer_all"] = false; - object[".gogoproto.unsafe_marshaler_all"] = false; - object[".gogoproto.unsafe_unmarshaler_all"] = false; - object[".gogoproto.goproto_extensions_map_all"] = false; - object[".gogoproto.goproto_unrecognized_all"] = false; - object[".gogoproto.gogoproto_import"] = false; - object[".gogoproto.protosizer_all"] = false; - object[".gogoproto.compare_all"] = false; - object[".gogoproto.typedecl_all"] = false; - object[".gogoproto.enumdecl_all"] = false; - object[".gogoproto.goproto_registration"] = false; - object[".gogoproto.messagename_all"] = false; - object[".gogoproto.goproto_sizecache_all"] = false; - object[".gogoproto.goproto_unkeyed_all"] = false; - } - if (message.java_package != null && message.hasOwnProperty("java_package")) - object.java_package = message.java_package; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - object.java_outer_classname = message.java_outer_classname; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - object.optimize_for = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimize_for] : message.optimize_for; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - object.java_multiple_files = message.java_multiple_files; - if (message.go_package != null && message.hasOwnProperty("go_package")) - object.go_package = message.go_package; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - object.cc_generic_services = message.cc_generic_services; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - object.java_generic_services = message.java_generic_services; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - object.py_generic_services = message.py_generic_services; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - object.java_generate_equals_and_hash = message.java_generate_equals_and_hash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - object.java_string_check_utf8 = message.java_string_check_utf8; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - object.cc_enable_arenas = message.cc_enable_arenas; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - object.objc_class_prefix = message.objc_class_prefix; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - object.csharp_namespace = message.csharp_namespace; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - object[".gogoproto.goproto_getters_all"] = message[".gogoproto.goproto_getters_all"]; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - object[".gogoproto.goproto_enum_prefix_all"] = message[".gogoproto.goproto_enum_prefix_all"]; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - object[".gogoproto.goproto_stringer_all"] = message[".gogoproto.goproto_stringer_all"]; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - object[".gogoproto.verbose_equal_all"] = message[".gogoproto.verbose_equal_all"]; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - object[".gogoproto.face_all"] = message[".gogoproto.face_all"]; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - object[".gogoproto.gostring_all"] = message[".gogoproto.gostring_all"]; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - object[".gogoproto.populate_all"] = message[".gogoproto.populate_all"]; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - object[".gogoproto.stringer_all"] = message[".gogoproto.stringer_all"]; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - object[".gogoproto.onlyone_all"] = message[".gogoproto.onlyone_all"]; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - object[".gogoproto.equal_all"] = message[".gogoproto.equal_all"]; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - object[".gogoproto.description_all"] = message[".gogoproto.description_all"]; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - object[".gogoproto.testgen_all"] = message[".gogoproto.testgen_all"]; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - object[".gogoproto.benchgen_all"] = message[".gogoproto.benchgen_all"]; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - object[".gogoproto.marshaler_all"] = message[".gogoproto.marshaler_all"]; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - object[".gogoproto.unmarshaler_all"] = message[".gogoproto.unmarshaler_all"]; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - object[".gogoproto.stable_marshaler_all"] = message[".gogoproto.stable_marshaler_all"]; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - object[".gogoproto.sizer_all"] = message[".gogoproto.sizer_all"]; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - object[".gogoproto.goproto_enum_stringer_all"] = message[".gogoproto.goproto_enum_stringer_all"]; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - object[".gogoproto.enum_stringer_all"] = message[".gogoproto.enum_stringer_all"]; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - object[".gogoproto.unsafe_marshaler_all"] = message[".gogoproto.unsafe_marshaler_all"]; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - object[".gogoproto.unsafe_unmarshaler_all"] = message[".gogoproto.unsafe_unmarshaler_all"]; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - object[".gogoproto.goproto_extensions_map_all"] = message[".gogoproto.goproto_extensions_map_all"]; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - object[".gogoproto.goproto_unrecognized_all"] = message[".gogoproto.goproto_unrecognized_all"]; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - object[".gogoproto.gogoproto_import"] = message[".gogoproto.gogoproto_import"]; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - object[".gogoproto.protosizer_all"] = message[".gogoproto.protosizer_all"]; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - object[".gogoproto.compare_all"] = message[".gogoproto.compare_all"]; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - object[".gogoproto.typedecl_all"] = message[".gogoproto.typedecl_all"]; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - object[".gogoproto.enumdecl_all"] = message[".gogoproto.enumdecl_all"]; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - object[".gogoproto.goproto_registration"] = message[".gogoproto.goproto_registration"]; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - object[".gogoproto.messagename_all"] = message[".gogoproto.messagename_all"]; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - object[".gogoproto.goproto_sizecache_all"] = message[".gogoproto.goproto_sizecache_all"]; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - object[".gogoproto.goproto_unkeyed_all"] = message[".gogoproto.goproto_unkeyed_all"]; - if (message[".cosmos_proto.declare_interface"] && message[".cosmos_proto.declare_interface"].length) { - object[".cosmos_proto.declare_interface"] = []; - for (var j = 0; j < message[".cosmos_proto.declare_interface"].length; ++j) - object[".cosmos_proto.declare_interface"][j] = $root.cosmos_proto.InterfaceDescriptor.toObject(message[".cosmos_proto.declare_interface"][j], options); - } - if (message[".cosmos_proto.declare_scalar"] && message[".cosmos_proto.declare_scalar"].length) { - object[".cosmos_proto.declare_scalar"] = []; - for (var j = 0; j < message[".cosmos_proto.declare_scalar"].length; ++j) - object[".cosmos_proto.declare_scalar"][j] = $root.cosmos_proto.ScalarDescriptor.toObject(message[".cosmos_proto.declare_scalar"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [message_set_wire_format] MessageOptions message_set_wire_format - * @property {boolean|null} [no_standard_descriptor_accessor] MessageOptions no_standard_descriptor_accessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [map_entry] MessageOptions map_entry - * @property {Array.|null} [uninterpreted_option] MessageOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters"] MessageOptions .gogoproto.goproto_getters - * @property {boolean|null} [".gogoproto.goproto_stringer"] MessageOptions .gogoproto.goproto_stringer - * @property {boolean|null} [".gogoproto.verbose_equal"] MessageOptions .gogoproto.verbose_equal - * @property {boolean|null} [".gogoproto.face"] MessageOptions .gogoproto.face - * @property {boolean|null} [".gogoproto.gostring"] MessageOptions .gogoproto.gostring - * @property {boolean|null} [".gogoproto.populate"] MessageOptions .gogoproto.populate - * @property {boolean|null} [".gogoproto.stringer"] MessageOptions .gogoproto.stringer - * @property {boolean|null} [".gogoproto.onlyone"] MessageOptions .gogoproto.onlyone - * @property {boolean|null} [".gogoproto.equal"] MessageOptions .gogoproto.equal - * @property {boolean|null} [".gogoproto.description"] MessageOptions .gogoproto.description - * @property {boolean|null} [".gogoproto.testgen"] MessageOptions .gogoproto.testgen - * @property {boolean|null} [".gogoproto.benchgen"] MessageOptions .gogoproto.benchgen - * @property {boolean|null} [".gogoproto.marshaler"] MessageOptions .gogoproto.marshaler - * @property {boolean|null} [".gogoproto.unmarshaler"] MessageOptions .gogoproto.unmarshaler - * @property {boolean|null} [".gogoproto.stable_marshaler"] MessageOptions .gogoproto.stable_marshaler - * @property {boolean|null} [".gogoproto.sizer"] MessageOptions .gogoproto.sizer - * @property {boolean|null} [".gogoproto.unsafe_marshaler"] MessageOptions .gogoproto.unsafe_marshaler - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler"] MessageOptions .gogoproto.unsafe_unmarshaler - * @property {boolean|null} [".gogoproto.goproto_extensions_map"] MessageOptions .gogoproto.goproto_extensions_map - * @property {boolean|null} [".gogoproto.goproto_unrecognized"] MessageOptions .gogoproto.goproto_unrecognized - * @property {boolean|null} [".gogoproto.protosizer"] MessageOptions .gogoproto.protosizer - * @property {boolean|null} [".gogoproto.compare"] MessageOptions .gogoproto.compare - * @property {boolean|null} [".gogoproto.typedecl"] MessageOptions .gogoproto.typedecl - * @property {boolean|null} [".gogoproto.messagename"] MessageOptions .gogoproto.messagename - * @property {boolean|null} [".gogoproto.goproto_sizecache"] MessageOptions .gogoproto.goproto_sizecache - * @property {boolean|null} [".gogoproto.goproto_unkeyed"] MessageOptions .gogoproto.goproto_unkeyed - * @property {Array.|null} [".cosmos_proto.implements_interface"] MessageOptions .cosmos_proto.implements_interface - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpreted_option = []; - this[".cosmos_proto.implements_interface"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions message_set_wire_format. - * @member {boolean} message_set_wire_format - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.message_set_wire_format = false; - - /** - * MessageOptions no_standard_descriptor_accessor. - * @member {boolean} no_standard_descriptor_accessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.no_standard_descriptor_accessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions map_entry. - * @member {boolean} map_entry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.map_entry = false; - - /** - * MessageOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MessageOptions .gogoproto.goproto_getters. - * @member {boolean} .gogoproto.goproto_getters - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_getters"] = false; - - /** - * MessageOptions .gogoproto.goproto_stringer. - * @member {boolean} .gogoproto.goproto_stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_stringer"] = false; - - /** - * MessageOptions .gogoproto.verbose_equal. - * @member {boolean} .gogoproto.verbose_equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.verbose_equal"] = false; - - /** - * MessageOptions .gogoproto.face. - * @member {boolean} .gogoproto.face - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.face"] = false; - - /** - * MessageOptions .gogoproto.gostring. - * @member {boolean} .gogoproto.gostring - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.gostring"] = false; - - /** - * MessageOptions .gogoproto.populate. - * @member {boolean} .gogoproto.populate - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.populate"] = false; - - /** - * MessageOptions .gogoproto.stringer. - * @member {boolean} .gogoproto.stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stringer"] = false; - - /** - * MessageOptions .gogoproto.onlyone. - * @member {boolean} .gogoproto.onlyone - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.onlyone"] = false; - - /** - * MessageOptions .gogoproto.equal. - * @member {boolean} .gogoproto.equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.equal"] = false; - - /** - * MessageOptions .gogoproto.description. - * @member {boolean} .gogoproto.description - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.description"] = false; - - /** - * MessageOptions .gogoproto.testgen. - * @member {boolean} .gogoproto.testgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.testgen"] = false; - - /** - * MessageOptions .gogoproto.benchgen. - * @member {boolean} .gogoproto.benchgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.benchgen"] = false; - - /** - * MessageOptions .gogoproto.marshaler. - * @member {boolean} .gogoproto.marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.marshaler"] = false; - - /** - * MessageOptions .gogoproto.unmarshaler. - * @member {boolean} .gogoproto.unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.stable_marshaler. - * @member {boolean} .gogoproto.stable_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stable_marshaler"] = false; - - /** - * MessageOptions .gogoproto.sizer. - * @member {boolean} .gogoproto.sizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.sizer"] = false; - - /** - * MessageOptions .gogoproto.unsafe_marshaler. - * @member {boolean} .gogoproto.unsafe_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_marshaler"] = false; - - /** - * MessageOptions .gogoproto.unsafe_unmarshaler. - * @member {boolean} .gogoproto.unsafe_unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.goproto_extensions_map. - * @member {boolean} .gogoproto.goproto_extensions_map - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_extensions_map"] = false; - - /** - * MessageOptions .gogoproto.goproto_unrecognized. - * @member {boolean} .gogoproto.goproto_unrecognized - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unrecognized"] = false; - - /** - * MessageOptions .gogoproto.protosizer. - * @member {boolean} .gogoproto.protosizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.protosizer"] = false; - - /** - * MessageOptions .gogoproto.compare. - * @member {boolean} .gogoproto.compare - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.compare"] = false; - - /** - * MessageOptions .gogoproto.typedecl. - * @member {boolean} .gogoproto.typedecl - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.typedecl"] = false; - - /** - * MessageOptions .gogoproto.messagename. - * @member {boolean} .gogoproto.messagename - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.messagename"] = false; - - /** - * MessageOptions .gogoproto.goproto_sizecache. - * @member {boolean} .gogoproto.goproto_sizecache - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_sizecache"] = false; - - /** - * MessageOptions .gogoproto.goproto_unkeyed. - * @member {boolean} .gogoproto.goproto_unkeyed - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unkeyed"] = false; - - /** - * MessageOptions .cosmos_proto.implements_interface. - * @member {Array.} .cosmos_proto.implements_interface - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".cosmos_proto.implements_interface"] = $util.emptyArray; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message_set_wire_format != null && Object.hasOwnProperty.call(message, "message_set_wire_format")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.message_set_wire_format); - if (message.no_standard_descriptor_accessor != null && Object.hasOwnProperty.call(message, "no_standard_descriptor_accessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.no_standard_descriptor_accessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.map_entry != null && Object.hasOwnProperty.call(message, "map_entry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.map_entry); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters")) - writer.uint32(/* id 64001, wireType 0 =*/512008).bool(message[".gogoproto.goproto_getters"]); - if (message[".gogoproto.goproto_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer")) - writer.uint32(/* id 64003, wireType 0 =*/512024).bool(message[".gogoproto.goproto_stringer"]); - if (message[".gogoproto.verbose_equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal")) - writer.uint32(/* id 64004, wireType 0 =*/512032).bool(message[".gogoproto.verbose_equal"]); - if (message[".gogoproto.face"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face")) - writer.uint32(/* id 64005, wireType 0 =*/512040).bool(message[".gogoproto.face"]); - if (message[".gogoproto.gostring"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring")) - writer.uint32(/* id 64006, wireType 0 =*/512048).bool(message[".gogoproto.gostring"]); - if (message[".gogoproto.populate"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate")) - writer.uint32(/* id 64007, wireType 0 =*/512056).bool(message[".gogoproto.populate"]); - if (message[".gogoproto.onlyone"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone")) - writer.uint32(/* id 64009, wireType 0 =*/512072).bool(message[".gogoproto.onlyone"]); - if (message[".gogoproto.equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal")) - writer.uint32(/* id 64013, wireType 0 =*/512104).bool(message[".gogoproto.equal"]); - if (message[".gogoproto.description"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description")) - writer.uint32(/* id 64014, wireType 0 =*/512112).bool(message[".gogoproto.description"]); - if (message[".gogoproto.testgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen")) - writer.uint32(/* id 64015, wireType 0 =*/512120).bool(message[".gogoproto.testgen"]); - if (message[".gogoproto.benchgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen")) - writer.uint32(/* id 64016, wireType 0 =*/512128).bool(message[".gogoproto.benchgen"]); - if (message[".gogoproto.marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler")) - writer.uint32(/* id 64017, wireType 0 =*/512136).bool(message[".gogoproto.marshaler"]); - if (message[".gogoproto.unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler")) - writer.uint32(/* id 64018, wireType 0 =*/512144).bool(message[".gogoproto.unmarshaler"]); - if (message[".gogoproto.stable_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler")) - writer.uint32(/* id 64019, wireType 0 =*/512152).bool(message[".gogoproto.stable_marshaler"]); - if (message[".gogoproto.sizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer")) - writer.uint32(/* id 64020, wireType 0 =*/512160).bool(message[".gogoproto.sizer"]); - if (message[".gogoproto.unsafe_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler")) - writer.uint32(/* id 64023, wireType 0 =*/512184).bool(message[".gogoproto.unsafe_marshaler"]); - if (message[".gogoproto.unsafe_unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler")) - writer.uint32(/* id 64024, wireType 0 =*/512192).bool(message[".gogoproto.unsafe_unmarshaler"]); - if (message[".gogoproto.goproto_extensions_map"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map")) - writer.uint32(/* id 64025, wireType 0 =*/512200).bool(message[".gogoproto.goproto_extensions_map"]); - if (message[".gogoproto.goproto_unrecognized"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized")) - writer.uint32(/* id 64026, wireType 0 =*/512208).bool(message[".gogoproto.goproto_unrecognized"]); - if (message[".gogoproto.protosizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer")) - writer.uint32(/* id 64028, wireType 0 =*/512224).bool(message[".gogoproto.protosizer"]); - if (message[".gogoproto.compare"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare")) - writer.uint32(/* id 64029, wireType 0 =*/512232).bool(message[".gogoproto.compare"]); - if (message[".gogoproto.typedecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl")) - writer.uint32(/* id 64030, wireType 0 =*/512240).bool(message[".gogoproto.typedecl"]); - if (message[".gogoproto.messagename"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename")) - writer.uint32(/* id 64033, wireType 0 =*/512264).bool(message[".gogoproto.messagename"]); - if (message[".gogoproto.goproto_sizecache"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache")) - writer.uint32(/* id 64034, wireType 0 =*/512272).bool(message[".gogoproto.goproto_sizecache"]); - if (message[".gogoproto.goproto_unkeyed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed")) - writer.uint32(/* id 64035, wireType 0 =*/512280).bool(message[".gogoproto.goproto_unkeyed"]); - if (message[".gogoproto.stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer")) - writer.uint32(/* id 67008, wireType 0 =*/536064).bool(message[".gogoproto.stringer"]); - if (message[".cosmos_proto.implements_interface"] != null && message[".cosmos_proto.implements_interface"].length) - for (var i = 0; i < message[".cosmos_proto.implements_interface"].length; ++i) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.implements_interface"][i]); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 64001: - message[".gogoproto.goproto_getters"] = reader.bool(); - break; - case 64003: - message[".gogoproto.goproto_stringer"] = reader.bool(); - break; - case 64004: - message[".gogoproto.verbose_equal"] = reader.bool(); - break; - case 64005: - message[".gogoproto.face"] = reader.bool(); - break; - case 64006: - message[".gogoproto.gostring"] = reader.bool(); - break; - case 64007: - message[".gogoproto.populate"] = reader.bool(); - break; - case 67008: - message[".gogoproto.stringer"] = reader.bool(); - break; - case 64009: - message[".gogoproto.onlyone"] = reader.bool(); - break; - case 64013: - message[".gogoproto.equal"] = reader.bool(); - break; - case 64014: - message[".gogoproto.description"] = reader.bool(); - break; - case 64015: - message[".gogoproto.testgen"] = reader.bool(); - break; - case 64016: - message[".gogoproto.benchgen"] = reader.bool(); - break; - case 64017: - message[".gogoproto.marshaler"] = reader.bool(); - break; - case 64018: - message[".gogoproto.unmarshaler"] = reader.bool(); - break; - case 64019: - message[".gogoproto.stable_marshaler"] = reader.bool(); - break; - case 64020: - message[".gogoproto.sizer"] = reader.bool(); - break; - case 64023: - message[".gogoproto.unsafe_marshaler"] = reader.bool(); - break; - case 64024: - message[".gogoproto.unsafe_unmarshaler"] = reader.bool(); - break; - case 64025: - message[".gogoproto.goproto_extensions_map"] = reader.bool(); - break; - case 64026: - message[".gogoproto.goproto_unrecognized"] = reader.bool(); - break; - case 64028: - message[".gogoproto.protosizer"] = reader.bool(); - break; - case 64029: - message[".gogoproto.compare"] = reader.bool(); - break; - case 64030: - message[".gogoproto.typedecl"] = reader.bool(); - break; - case 64033: - message[".gogoproto.messagename"] = reader.bool(); - break; - case 64034: - message[".gogoproto.goproto_sizecache"] = reader.bool(); - break; - case 64035: - message[".gogoproto.goproto_unkeyed"] = reader.bool(); - break; - case 93001: - if (!(message[".cosmos_proto.implements_interface"] && message[".cosmos_proto.implements_interface"].length)) - message[".cosmos_proto.implements_interface"] = []; - message[".cosmos_proto.implements_interface"].push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - if (typeof message.message_set_wire_format !== "boolean") - return "message_set_wire_format: boolean expected"; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - if (typeof message.no_standard_descriptor_accessor !== "boolean") - return "no_standard_descriptor_accessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - if (typeof message.map_entry !== "boolean") - return "map_entry: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - if (typeof message[".gogoproto.goproto_getters"] !== "boolean") - return ".gogoproto.goproto_getters: boolean expected"; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - if (typeof message[".gogoproto.goproto_stringer"] !== "boolean") - return ".gogoproto.goproto_stringer: boolean expected"; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - if (typeof message[".gogoproto.verbose_equal"] !== "boolean") - return ".gogoproto.verbose_equal: boolean expected"; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - if (typeof message[".gogoproto.face"] !== "boolean") - return ".gogoproto.face: boolean expected"; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - if (typeof message[".gogoproto.gostring"] !== "boolean") - return ".gogoproto.gostring: boolean expected"; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - if (typeof message[".gogoproto.populate"] !== "boolean") - return ".gogoproto.populate: boolean expected"; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - if (typeof message[".gogoproto.stringer"] !== "boolean") - return ".gogoproto.stringer: boolean expected"; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - if (typeof message[".gogoproto.onlyone"] !== "boolean") - return ".gogoproto.onlyone: boolean expected"; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - if (typeof message[".gogoproto.equal"] !== "boolean") - return ".gogoproto.equal: boolean expected"; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - if (typeof message[".gogoproto.description"] !== "boolean") - return ".gogoproto.description: boolean expected"; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - if (typeof message[".gogoproto.testgen"] !== "boolean") - return ".gogoproto.testgen: boolean expected"; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - if (typeof message[".gogoproto.benchgen"] !== "boolean") - return ".gogoproto.benchgen: boolean expected"; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - if (typeof message[".gogoproto.marshaler"] !== "boolean") - return ".gogoproto.marshaler: boolean expected"; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - if (typeof message[".gogoproto.unmarshaler"] !== "boolean") - return ".gogoproto.unmarshaler: boolean expected"; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - if (typeof message[".gogoproto.stable_marshaler"] !== "boolean") - return ".gogoproto.stable_marshaler: boolean expected"; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - if (typeof message[".gogoproto.sizer"] !== "boolean") - return ".gogoproto.sizer: boolean expected"; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - if (typeof message[".gogoproto.unsafe_marshaler"] !== "boolean") - return ".gogoproto.unsafe_marshaler: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - if (typeof message[".gogoproto.unsafe_unmarshaler"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler: boolean expected"; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - if (typeof message[".gogoproto.goproto_extensions_map"] !== "boolean") - return ".gogoproto.goproto_extensions_map: boolean expected"; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - if (typeof message[".gogoproto.goproto_unrecognized"] !== "boolean") - return ".gogoproto.goproto_unrecognized: boolean expected"; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - if (typeof message[".gogoproto.protosizer"] !== "boolean") - return ".gogoproto.protosizer: boolean expected"; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - if (typeof message[".gogoproto.compare"] !== "boolean") - return ".gogoproto.compare: boolean expected"; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - if (typeof message[".gogoproto.typedecl"] !== "boolean") - return ".gogoproto.typedecl: boolean expected"; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - if (typeof message[".gogoproto.messagename"] !== "boolean") - return ".gogoproto.messagename: boolean expected"; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - if (typeof message[".gogoproto.goproto_sizecache"] !== "boolean") - return ".gogoproto.goproto_sizecache: boolean expected"; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - if (typeof message[".gogoproto.goproto_unkeyed"] !== "boolean") - return ".gogoproto.goproto_unkeyed: boolean expected"; - if (message[".cosmos_proto.implements_interface"] != null && message.hasOwnProperty(".cosmos_proto.implements_interface")) { - if (!Array.isArray(message[".cosmos_proto.implements_interface"])) - return ".cosmos_proto.implements_interface: array expected"; - for (var i = 0; i < message[".cosmos_proto.implements_interface"].length; ++i) - if (!$util.isString(message[".cosmos_proto.implements_interface"][i])) - return ".cosmos_proto.implements_interface: string[] expected"; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.message_set_wire_format != null) - message.message_set_wire_format = Boolean(object.message_set_wire_format); - if (object.no_standard_descriptor_accessor != null) - message.no_standard_descriptor_accessor = Boolean(object.no_standard_descriptor_accessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.map_entry != null) - message.map_entry = Boolean(object.map_entry); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters"] != null) - message[".gogoproto.goproto_getters"] = Boolean(object[".gogoproto.goproto_getters"]); - if (object[".gogoproto.goproto_stringer"] != null) - message[".gogoproto.goproto_stringer"] = Boolean(object[".gogoproto.goproto_stringer"]); - if (object[".gogoproto.verbose_equal"] != null) - message[".gogoproto.verbose_equal"] = Boolean(object[".gogoproto.verbose_equal"]); - if (object[".gogoproto.face"] != null) - message[".gogoproto.face"] = Boolean(object[".gogoproto.face"]); - if (object[".gogoproto.gostring"] != null) - message[".gogoproto.gostring"] = Boolean(object[".gogoproto.gostring"]); - if (object[".gogoproto.populate"] != null) - message[".gogoproto.populate"] = Boolean(object[".gogoproto.populate"]); - if (object[".gogoproto.stringer"] != null) - message[".gogoproto.stringer"] = Boolean(object[".gogoproto.stringer"]); - if (object[".gogoproto.onlyone"] != null) - message[".gogoproto.onlyone"] = Boolean(object[".gogoproto.onlyone"]); - if (object[".gogoproto.equal"] != null) - message[".gogoproto.equal"] = Boolean(object[".gogoproto.equal"]); - if (object[".gogoproto.description"] != null) - message[".gogoproto.description"] = Boolean(object[".gogoproto.description"]); - if (object[".gogoproto.testgen"] != null) - message[".gogoproto.testgen"] = Boolean(object[".gogoproto.testgen"]); - if (object[".gogoproto.benchgen"] != null) - message[".gogoproto.benchgen"] = Boolean(object[".gogoproto.benchgen"]); - if (object[".gogoproto.marshaler"] != null) - message[".gogoproto.marshaler"] = Boolean(object[".gogoproto.marshaler"]); - if (object[".gogoproto.unmarshaler"] != null) - message[".gogoproto.unmarshaler"] = Boolean(object[".gogoproto.unmarshaler"]); - if (object[".gogoproto.stable_marshaler"] != null) - message[".gogoproto.stable_marshaler"] = Boolean(object[".gogoproto.stable_marshaler"]); - if (object[".gogoproto.sizer"] != null) - message[".gogoproto.sizer"] = Boolean(object[".gogoproto.sizer"]); - if (object[".gogoproto.unsafe_marshaler"] != null) - message[".gogoproto.unsafe_marshaler"] = Boolean(object[".gogoproto.unsafe_marshaler"]); - if (object[".gogoproto.unsafe_unmarshaler"] != null) - message[".gogoproto.unsafe_unmarshaler"] = Boolean(object[".gogoproto.unsafe_unmarshaler"]); - if (object[".gogoproto.goproto_extensions_map"] != null) - message[".gogoproto.goproto_extensions_map"] = Boolean(object[".gogoproto.goproto_extensions_map"]); - if (object[".gogoproto.goproto_unrecognized"] != null) - message[".gogoproto.goproto_unrecognized"] = Boolean(object[".gogoproto.goproto_unrecognized"]); - if (object[".gogoproto.protosizer"] != null) - message[".gogoproto.protosizer"] = Boolean(object[".gogoproto.protosizer"]); - if (object[".gogoproto.compare"] != null) - message[".gogoproto.compare"] = Boolean(object[".gogoproto.compare"]); - if (object[".gogoproto.typedecl"] != null) - message[".gogoproto.typedecl"] = Boolean(object[".gogoproto.typedecl"]); - if (object[".gogoproto.messagename"] != null) - message[".gogoproto.messagename"] = Boolean(object[".gogoproto.messagename"]); - if (object[".gogoproto.goproto_sizecache"] != null) - message[".gogoproto.goproto_sizecache"] = Boolean(object[".gogoproto.goproto_sizecache"]); - if (object[".gogoproto.goproto_unkeyed"] != null) - message[".gogoproto.goproto_unkeyed"] = Boolean(object[".gogoproto.goproto_unkeyed"]); - if (object[".cosmos_proto.implements_interface"]) { - if (!Array.isArray(object[".cosmos_proto.implements_interface"])) - throw TypeError(".google.protobuf.MessageOptions..cosmos_proto.implements_interface: array expected"); - message[".cosmos_proto.implements_interface"] = []; - for (var i = 0; i < object[".cosmos_proto.implements_interface"].length; ++i) - message[".cosmos_proto.implements_interface"][i] = String(object[".cosmos_proto.implements_interface"][i]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpreted_option = []; - object[".cosmos_proto.implements_interface"] = []; - } - if (options.defaults) { - object.message_set_wire_format = false; - object.no_standard_descriptor_accessor = false; - object.deprecated = false; - object.map_entry = false; - object[".gogoproto.goproto_getters"] = false; - object[".gogoproto.goproto_stringer"] = false; - object[".gogoproto.verbose_equal"] = false; - object[".gogoproto.face"] = false; - object[".gogoproto.gostring"] = false; - object[".gogoproto.populate"] = false; - object[".gogoproto.onlyone"] = false; - object[".gogoproto.equal"] = false; - object[".gogoproto.description"] = false; - object[".gogoproto.testgen"] = false; - object[".gogoproto.benchgen"] = false; - object[".gogoproto.marshaler"] = false; - object[".gogoproto.unmarshaler"] = false; - object[".gogoproto.stable_marshaler"] = false; - object[".gogoproto.sizer"] = false; - object[".gogoproto.unsafe_marshaler"] = false; - object[".gogoproto.unsafe_unmarshaler"] = false; - object[".gogoproto.goproto_extensions_map"] = false; - object[".gogoproto.goproto_unrecognized"] = false; - object[".gogoproto.protosizer"] = false; - object[".gogoproto.compare"] = false; - object[".gogoproto.typedecl"] = false; - object[".gogoproto.messagename"] = false; - object[".gogoproto.goproto_sizecache"] = false; - object[".gogoproto.goproto_unkeyed"] = false; - object[".gogoproto.stringer"] = false; - } - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - object.message_set_wire_format = message.message_set_wire_format; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - object.no_standard_descriptor_accessor = message.no_standard_descriptor_accessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - object.map_entry = message.map_entry; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - object[".gogoproto.goproto_getters"] = message[".gogoproto.goproto_getters"]; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - object[".gogoproto.goproto_stringer"] = message[".gogoproto.goproto_stringer"]; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - object[".gogoproto.verbose_equal"] = message[".gogoproto.verbose_equal"]; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - object[".gogoproto.face"] = message[".gogoproto.face"]; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - object[".gogoproto.gostring"] = message[".gogoproto.gostring"]; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - object[".gogoproto.populate"] = message[".gogoproto.populate"]; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - object[".gogoproto.onlyone"] = message[".gogoproto.onlyone"]; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - object[".gogoproto.equal"] = message[".gogoproto.equal"]; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - object[".gogoproto.description"] = message[".gogoproto.description"]; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - object[".gogoproto.testgen"] = message[".gogoproto.testgen"]; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - object[".gogoproto.benchgen"] = message[".gogoproto.benchgen"]; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - object[".gogoproto.marshaler"] = message[".gogoproto.marshaler"]; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - object[".gogoproto.unmarshaler"] = message[".gogoproto.unmarshaler"]; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - object[".gogoproto.stable_marshaler"] = message[".gogoproto.stable_marshaler"]; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - object[".gogoproto.sizer"] = message[".gogoproto.sizer"]; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - object[".gogoproto.unsafe_marshaler"] = message[".gogoproto.unsafe_marshaler"]; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - object[".gogoproto.unsafe_unmarshaler"] = message[".gogoproto.unsafe_unmarshaler"]; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - object[".gogoproto.goproto_extensions_map"] = message[".gogoproto.goproto_extensions_map"]; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - object[".gogoproto.goproto_unrecognized"] = message[".gogoproto.goproto_unrecognized"]; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - object[".gogoproto.protosizer"] = message[".gogoproto.protosizer"]; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - object[".gogoproto.compare"] = message[".gogoproto.compare"]; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - object[".gogoproto.typedecl"] = message[".gogoproto.typedecl"]; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - object[".gogoproto.messagename"] = message[".gogoproto.messagename"]; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - object[".gogoproto.goproto_sizecache"] = message[".gogoproto.goproto_sizecache"]; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - object[".gogoproto.goproto_unkeyed"] = message[".gogoproto.goproto_unkeyed"]; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - object[".gogoproto.stringer"] = message[".gogoproto.stringer"]; - if (message[".cosmos_proto.implements_interface"] && message[".cosmos_proto.implements_interface"].length) { - object[".cosmos_proto.implements_interface"] = []; - for (var j = 0; j < message[".cosmos_proto.implements_interface"].length; ++j) - object[".cosmos_proto.implements_interface"][j] = message[".cosmos_proto.implements_interface"][j]; - } - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpreted_option] FieldOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.nullable"] FieldOptions .gogoproto.nullable - * @property {boolean|null} [".gogoproto.embed"] FieldOptions .gogoproto.embed - * @property {string|null} [".gogoproto.customtype"] FieldOptions .gogoproto.customtype - * @property {string|null} [".gogoproto.customname"] FieldOptions .gogoproto.customname - * @property {string|null} [".gogoproto.jsontag"] FieldOptions .gogoproto.jsontag - * @property {string|null} [".gogoproto.moretags"] FieldOptions .gogoproto.moretags - * @property {string|null} [".gogoproto.casttype"] FieldOptions .gogoproto.casttype - * @property {string|null} [".gogoproto.castkey"] FieldOptions .gogoproto.castkey - * @property {string|null} [".gogoproto.castvalue"] FieldOptions .gogoproto.castvalue - * @property {boolean|null} [".gogoproto.stdtime"] FieldOptions .gogoproto.stdtime - * @property {boolean|null} [".gogoproto.stdduration"] FieldOptions .gogoproto.stdduration - * @property {boolean|null} [".gogoproto.wktpointer"] FieldOptions .gogoproto.wktpointer - * @property {string|null} [".gogoproto.castrepeated"] FieldOptions .gogoproto.castrepeated - * @property {string|null} [".cosmos_proto.accepts_interface"] FieldOptions .cosmos_proto.accepts_interface - * @property {string|null} [".cosmos_proto.scalar"] FieldOptions .cosmos_proto.scalar - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FieldOptions .gogoproto.nullable. - * @member {boolean} .gogoproto.nullable - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.nullable"] = false; - - /** - * FieldOptions .gogoproto.embed. - * @member {boolean} .gogoproto.embed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.embed"] = false; - - /** - * FieldOptions .gogoproto.customtype. - * @member {string} .gogoproto.customtype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customtype"] = ""; - - /** - * FieldOptions .gogoproto.customname. - * @member {string} .gogoproto.customname - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customname"] = ""; - - /** - * FieldOptions .gogoproto.jsontag. - * @member {string} .gogoproto.jsontag - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.jsontag"] = ""; - - /** - * FieldOptions .gogoproto.moretags. - * @member {string} .gogoproto.moretags - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.moretags"] = ""; - - /** - * FieldOptions .gogoproto.casttype. - * @member {string} .gogoproto.casttype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.casttype"] = ""; - - /** - * FieldOptions .gogoproto.castkey. - * @member {string} .gogoproto.castkey - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castkey"] = ""; - - /** - * FieldOptions .gogoproto.castvalue. - * @member {string} .gogoproto.castvalue - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castvalue"] = ""; - - /** - * FieldOptions .gogoproto.stdtime. - * @member {boolean} .gogoproto.stdtime - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdtime"] = false; - - /** - * FieldOptions .gogoproto.stdduration. - * @member {boolean} .gogoproto.stdduration - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdduration"] = false; - - /** - * FieldOptions .gogoproto.wktpointer. - * @member {boolean} .gogoproto.wktpointer - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.wktpointer"] = false; - - /** - * FieldOptions .gogoproto.castrepeated. - * @member {string} .gogoproto.castrepeated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castrepeated"] = ""; - - /** - * FieldOptions .cosmos_proto.accepts_interface. - * @member {string} .cosmos_proto.accepts_interface - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".cosmos_proto.accepts_interface"] = ""; - - /** - * FieldOptions .cosmos_proto.scalar. - * @member {string} .cosmos_proto.scalar - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".cosmos_proto.scalar"] = ""; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.nullable"] != null && Object.hasOwnProperty.call(message, ".gogoproto.nullable")) - writer.uint32(/* id 65001, wireType 0 =*/520008).bool(message[".gogoproto.nullable"]); - if (message[".gogoproto.embed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.embed")) - writer.uint32(/* id 65002, wireType 0 =*/520016).bool(message[".gogoproto.embed"]); - if (message[".gogoproto.customtype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customtype")) - writer.uint32(/* id 65003, wireType 2 =*/520026).string(message[".gogoproto.customtype"]); - if (message[".gogoproto.customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customname")) - writer.uint32(/* id 65004, wireType 2 =*/520034).string(message[".gogoproto.customname"]); - if (message[".gogoproto.jsontag"] != null && Object.hasOwnProperty.call(message, ".gogoproto.jsontag")) - writer.uint32(/* id 65005, wireType 2 =*/520042).string(message[".gogoproto.jsontag"]); - if (message[".gogoproto.moretags"] != null && Object.hasOwnProperty.call(message, ".gogoproto.moretags")) - writer.uint32(/* id 65006, wireType 2 =*/520050).string(message[".gogoproto.moretags"]); - if (message[".gogoproto.casttype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.casttype")) - writer.uint32(/* id 65007, wireType 2 =*/520058).string(message[".gogoproto.casttype"]); - if (message[".gogoproto.castkey"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castkey")) - writer.uint32(/* id 65008, wireType 2 =*/520066).string(message[".gogoproto.castkey"]); - if (message[".gogoproto.castvalue"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castvalue")) - writer.uint32(/* id 65009, wireType 2 =*/520074).string(message[".gogoproto.castvalue"]); - if (message[".gogoproto.stdtime"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdtime")) - writer.uint32(/* id 65010, wireType 0 =*/520080).bool(message[".gogoproto.stdtime"]); - if (message[".gogoproto.stdduration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdduration")) - writer.uint32(/* id 65011, wireType 0 =*/520088).bool(message[".gogoproto.stdduration"]); - if (message[".gogoproto.wktpointer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.wktpointer")) - writer.uint32(/* id 65012, wireType 0 =*/520096).bool(message[".gogoproto.wktpointer"]); - if (message[".gogoproto.castrepeated"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castrepeated")) - writer.uint32(/* id 65013, wireType 2 =*/520106).string(message[".gogoproto.castrepeated"]); - if (message[".cosmos_proto.accepts_interface"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.accepts_interface")) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.accepts_interface"]); - if (message[".cosmos_proto.scalar"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.scalar")) - writer.uint32(/* id 93002, wireType 2 =*/744018).string(message[".cosmos_proto.scalar"]); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 65001: - message[".gogoproto.nullable"] = reader.bool(); - break; - case 65002: - message[".gogoproto.embed"] = reader.bool(); - break; - case 65003: - message[".gogoproto.customtype"] = reader.string(); - break; - case 65004: - message[".gogoproto.customname"] = reader.string(); - break; - case 65005: - message[".gogoproto.jsontag"] = reader.string(); - break; - case 65006: - message[".gogoproto.moretags"] = reader.string(); - break; - case 65007: - message[".gogoproto.casttype"] = reader.string(); - break; - case 65008: - message[".gogoproto.castkey"] = reader.string(); - break; - case 65009: - message[".gogoproto.castvalue"] = reader.string(); - break; - case 65010: - message[".gogoproto.stdtime"] = reader.bool(); - break; - case 65011: - message[".gogoproto.stdduration"] = reader.bool(); - break; - case 65012: - message[".gogoproto.wktpointer"] = reader.bool(); - break; - case 65013: - message[".gogoproto.castrepeated"] = reader.string(); - break; - case 93001: - message[".cosmos_proto.accepts_interface"] = reader.string(); - break; - case 93002: - message[".cosmos_proto.scalar"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - if (typeof message[".gogoproto.nullable"] !== "boolean") - return ".gogoproto.nullable: boolean expected"; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - if (typeof message[".gogoproto.embed"] !== "boolean") - return ".gogoproto.embed: boolean expected"; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - if (!$util.isString(message[".gogoproto.customtype"])) - return ".gogoproto.customtype: string expected"; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - if (!$util.isString(message[".gogoproto.customname"])) - return ".gogoproto.customname: string expected"; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - if (!$util.isString(message[".gogoproto.jsontag"])) - return ".gogoproto.jsontag: string expected"; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - if (!$util.isString(message[".gogoproto.moretags"])) - return ".gogoproto.moretags: string expected"; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - if (!$util.isString(message[".gogoproto.casttype"])) - return ".gogoproto.casttype: string expected"; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - if (!$util.isString(message[".gogoproto.castkey"])) - return ".gogoproto.castkey: string expected"; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - if (!$util.isString(message[".gogoproto.castvalue"])) - return ".gogoproto.castvalue: string expected"; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - if (typeof message[".gogoproto.stdtime"] !== "boolean") - return ".gogoproto.stdtime: boolean expected"; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - if (typeof message[".gogoproto.stdduration"] !== "boolean") - return ".gogoproto.stdduration: boolean expected"; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - if (typeof message[".gogoproto.wktpointer"] !== "boolean") - return ".gogoproto.wktpointer: boolean expected"; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - if (!$util.isString(message[".gogoproto.castrepeated"])) - return ".gogoproto.castrepeated: string expected"; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - if (!$util.isString(message[".cosmos_proto.accepts_interface"])) - return ".cosmos_proto.accepts_interface: string expected"; - if (message[".cosmos_proto.scalar"] != null && message.hasOwnProperty(".cosmos_proto.scalar")) - if (!$util.isString(message[".cosmos_proto.scalar"])) - return ".cosmos_proto.scalar: string expected"; - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.nullable"] != null) - message[".gogoproto.nullable"] = Boolean(object[".gogoproto.nullable"]); - if (object[".gogoproto.embed"] != null) - message[".gogoproto.embed"] = Boolean(object[".gogoproto.embed"]); - if (object[".gogoproto.customtype"] != null) - message[".gogoproto.customtype"] = String(object[".gogoproto.customtype"]); - if (object[".gogoproto.customname"] != null) - message[".gogoproto.customname"] = String(object[".gogoproto.customname"]); - if (object[".gogoproto.jsontag"] != null) - message[".gogoproto.jsontag"] = String(object[".gogoproto.jsontag"]); - if (object[".gogoproto.moretags"] != null) - message[".gogoproto.moretags"] = String(object[".gogoproto.moretags"]); - if (object[".gogoproto.casttype"] != null) - message[".gogoproto.casttype"] = String(object[".gogoproto.casttype"]); - if (object[".gogoproto.castkey"] != null) - message[".gogoproto.castkey"] = String(object[".gogoproto.castkey"]); - if (object[".gogoproto.castvalue"] != null) - message[".gogoproto.castvalue"] = String(object[".gogoproto.castvalue"]); - if (object[".gogoproto.stdtime"] != null) - message[".gogoproto.stdtime"] = Boolean(object[".gogoproto.stdtime"]); - if (object[".gogoproto.stdduration"] != null) - message[".gogoproto.stdduration"] = Boolean(object[".gogoproto.stdduration"]); - if (object[".gogoproto.wktpointer"] != null) - message[".gogoproto.wktpointer"] = Boolean(object[".gogoproto.wktpointer"]); - if (object[".gogoproto.castrepeated"] != null) - message[".gogoproto.castrepeated"] = String(object[".gogoproto.castrepeated"]); - if (object[".cosmos_proto.accepts_interface"] != null) - message[".cosmos_proto.accepts_interface"] = String(object[".cosmos_proto.accepts_interface"]); - if (object[".cosmos_proto.scalar"] != null) - message[".cosmos_proto.scalar"] = String(object[".cosmos_proto.scalar"]); - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object[".gogoproto.nullable"] = false; - object[".gogoproto.embed"] = false; - object[".gogoproto.customtype"] = ""; - object[".gogoproto.customname"] = ""; - object[".gogoproto.jsontag"] = ""; - object[".gogoproto.moretags"] = ""; - object[".gogoproto.casttype"] = ""; - object[".gogoproto.castkey"] = ""; - object[".gogoproto.castvalue"] = ""; - object[".gogoproto.stdtime"] = false; - object[".gogoproto.stdduration"] = false; - object[".gogoproto.wktpointer"] = false; - object[".gogoproto.castrepeated"] = ""; - object[".cosmos_proto.accepts_interface"] = ""; - object[".cosmos_proto.scalar"] = ""; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - object[".gogoproto.nullable"] = message[".gogoproto.nullable"]; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - object[".gogoproto.embed"] = message[".gogoproto.embed"]; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - object[".gogoproto.customtype"] = message[".gogoproto.customtype"]; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - object[".gogoproto.customname"] = message[".gogoproto.customname"]; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - object[".gogoproto.jsontag"] = message[".gogoproto.jsontag"]; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - object[".gogoproto.moretags"] = message[".gogoproto.moretags"]; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - object[".gogoproto.casttype"] = message[".gogoproto.casttype"]; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - object[".gogoproto.castkey"] = message[".gogoproto.castkey"]; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - object[".gogoproto.castvalue"] = message[".gogoproto.castvalue"]; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - object[".gogoproto.stdtime"] = message[".gogoproto.stdtime"]; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - object[".gogoproto.stdduration"] = message[".gogoproto.stdduration"]; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - object[".gogoproto.wktpointer"] = message[".gogoproto.wktpointer"]; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - object[".gogoproto.castrepeated"] = message[".gogoproto.castrepeated"]; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - object[".cosmos_proto.accepts_interface"] = message[".cosmos_proto.accepts_interface"]; - if (message[".cosmos_proto.scalar"] != null && message.hasOwnProperty(".cosmos_proto.scalar")) - object[".cosmos_proto.scalar"] = message[".cosmos_proto.scalar"]; - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpreted_option] OneofOptions uninterpreted_option - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allow_alias] EnumOptions allow_alias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_enum_prefix"] EnumOptions .gogoproto.goproto_enum_prefix - * @property {boolean|null} [".gogoproto.goproto_enum_stringer"] EnumOptions .gogoproto.goproto_enum_stringer - * @property {boolean|null} [".gogoproto.enum_stringer"] EnumOptions .gogoproto.enum_stringer - * @property {string|null} [".gogoproto.enum_customname"] EnumOptions .gogoproto.enum_customname - * @property {boolean|null} [".gogoproto.enumdecl"] EnumOptions .gogoproto.enumdecl - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allow_alias. - * @member {boolean} allow_alias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allow_alias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumOptions .gogoproto.goproto_enum_prefix. - * @member {boolean} .gogoproto.goproto_enum_prefix - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_prefix"] = false; - - /** - * EnumOptions .gogoproto.goproto_enum_stringer. - * @member {boolean} .gogoproto.goproto_enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_stringer. - * @member {boolean} .gogoproto.enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_customname. - * @member {string} .gogoproto.enum_customname - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_customname"] = ""; - - /** - * EnumOptions .gogoproto.enumdecl. - * @member {boolean} .gogoproto.enumdecl - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enumdecl"] = false; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allow_alias != null && Object.hasOwnProperty.call(message, "allow_alias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allow_alias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_enum_prefix"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix")) - writer.uint32(/* id 62001, wireType 0 =*/496008).bool(message[".gogoproto.goproto_enum_prefix"]); - if (message[".gogoproto.goproto_enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer")) - writer.uint32(/* id 62021, wireType 0 =*/496168).bool(message[".gogoproto.goproto_enum_stringer"]); - if (message[".gogoproto.enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer")) - writer.uint32(/* id 62022, wireType 0 =*/496176).bool(message[".gogoproto.enum_stringer"]); - if (message[".gogoproto.enum_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_customname")) - writer.uint32(/* id 62023, wireType 2 =*/496186).string(message[".gogoproto.enum_customname"]); - if (message[".gogoproto.enumdecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl")) - writer.uint32(/* id 62024, wireType 0 =*/496192).bool(message[".gogoproto.enumdecl"]); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 62001: - message[".gogoproto.goproto_enum_prefix"] = reader.bool(); - break; - case 62021: - message[".gogoproto.goproto_enum_stringer"] = reader.bool(); - break; - case 62022: - message[".gogoproto.enum_stringer"] = reader.bool(); - break; - case 62023: - message[".gogoproto.enum_customname"] = reader.string(); - break; - case 62024: - message[".gogoproto.enumdecl"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - if (typeof message.allow_alias !== "boolean") - return "allow_alias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - if (typeof message[".gogoproto.goproto_enum_prefix"] !== "boolean") - return ".gogoproto.goproto_enum_prefix: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - if (typeof message[".gogoproto.goproto_enum_stringer"] !== "boolean") - return ".gogoproto.goproto_enum_stringer: boolean expected"; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - if (typeof message[".gogoproto.enum_stringer"] !== "boolean") - return ".gogoproto.enum_stringer: boolean expected"; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - if (!$util.isString(message[".gogoproto.enum_customname"])) - return ".gogoproto.enum_customname: string expected"; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - if (typeof message[".gogoproto.enumdecl"] !== "boolean") - return ".gogoproto.enumdecl: boolean expected"; - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allow_alias != null) - message.allow_alias = Boolean(object.allow_alias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_enum_prefix"] != null) - message[".gogoproto.goproto_enum_prefix"] = Boolean(object[".gogoproto.goproto_enum_prefix"]); - if (object[".gogoproto.goproto_enum_stringer"] != null) - message[".gogoproto.goproto_enum_stringer"] = Boolean(object[".gogoproto.goproto_enum_stringer"]); - if (object[".gogoproto.enum_stringer"] != null) - message[".gogoproto.enum_stringer"] = Boolean(object[".gogoproto.enum_stringer"]); - if (object[".gogoproto.enum_customname"] != null) - message[".gogoproto.enum_customname"] = String(object[".gogoproto.enum_customname"]); - if (object[".gogoproto.enumdecl"] != null) - message[".gogoproto.enumdecl"] = Boolean(object[".gogoproto.enumdecl"]); - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.allow_alias = false; - object.deprecated = false; - object[".gogoproto.goproto_enum_prefix"] = false; - object[".gogoproto.goproto_enum_stringer"] = false; - object[".gogoproto.enum_stringer"] = false; - object[".gogoproto.enum_customname"] = ""; - object[".gogoproto.enumdecl"] = false; - } - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - object.allow_alias = message.allow_alias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - object[".gogoproto.goproto_enum_prefix"] = message[".gogoproto.goproto_enum_prefix"]; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - object[".gogoproto.goproto_enum_stringer"] = message[".gogoproto.goproto_enum_stringer"]; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - object[".gogoproto.enum_stringer"] = message[".gogoproto.enum_stringer"]; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - object[".gogoproto.enum_customname"] = message[".gogoproto.enum_customname"]; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - object[".gogoproto.enumdecl"] = message[".gogoproto.enumdecl"]; - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumValueOptions uninterpreted_option - * @property {string|null} [".gogoproto.enumvalue_customname"] EnumValueOptions .gogoproto.enumvalue_customname - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumValueOptions .gogoproto.enumvalue_customname. - * @member {string} .gogoproto.enumvalue_customname - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype[".gogoproto.enumvalue_customname"] = ""; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.enumvalue_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumvalue_customname")) - writer.uint32(/* id 66001, wireType 2 =*/528010).string(message[".gogoproto.enumvalue_customname"]); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 66001: - message[".gogoproto.enumvalue_customname"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - if (!$util.isString(message[".gogoproto.enumvalue_customname"])) - return ".gogoproto.enumvalue_customname: string expected"; - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.enumvalue_customname"] != null) - message[".gogoproto.enumvalue_customname"] = String(object[".gogoproto.enumvalue_customname"]); - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".gogoproto.enumvalue_customname"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - object[".gogoproto.enumvalue_customname"] = message[".gogoproto.enumvalue_customname"]; - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpreted_option] ServiceOptions uninterpreted_option - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {Array.|null} [uninterpreted_option] MethodOptions uninterpreted_option - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifier_value] UninterpretedOption identifier_value - * @property {Long|null} [positive_int_value] UninterpretedOption positive_int_value - * @property {Long|null} [negative_int_value] UninterpretedOption negative_int_value - * @property {number|null} [double_value] UninterpretedOption double_value - * @property {Uint8Array|null} [string_value] UninterpretedOption string_value - * @property {string|null} [aggregate_value] UninterpretedOption aggregate_value - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifier_value. - * @member {string} identifier_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifier_value = ""; - - /** - * UninterpretedOption positive_int_value. - * @member {Long} positive_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positive_int_value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negative_int_value. - * @member {Long} negative_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negative_int_value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption double_value. - * @member {number} double_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.double_value = 0; - - /** - * UninterpretedOption string_value. - * @member {Uint8Array} string_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.string_value = $util.newBuffer([]); - - /** - * UninterpretedOption aggregate_value. - * @member {string} aggregate_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregate_value = ""; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifier_value != null && Object.hasOwnProperty.call(message, "identifier_value")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifier_value); - if (message.positive_int_value != null && Object.hasOwnProperty.call(message, "positive_int_value")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positive_int_value); - if (message.negative_int_value != null && Object.hasOwnProperty.call(message, "negative_int_value")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negative_int_value); - if (message.double_value != null && Object.hasOwnProperty.call(message, "double_value")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.double_value); - if (message.string_value != null && Object.hasOwnProperty.call(message, "string_value")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.string_value); - if (message.aggregate_value != null && Object.hasOwnProperty.call(message, "aggregate_value")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregate_value); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = reader.uint64(); - break; - case 5: - message.negative_int_value = reader.int64(); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - if (!$util.isString(message.identifier_value)) - return "identifier_value: string expected"; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (!$util.isInteger(message.positive_int_value) && !(message.positive_int_value && $util.isInteger(message.positive_int_value.low) && $util.isInteger(message.positive_int_value.high))) - return "positive_int_value: integer|Long expected"; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (!$util.isInteger(message.negative_int_value) && !(message.negative_int_value && $util.isInteger(message.negative_int_value.low) && $util.isInteger(message.negative_int_value.high))) - return "negative_int_value: integer|Long expected"; - if (message.double_value != null && message.hasOwnProperty("double_value")) - if (typeof message.double_value !== "number") - return "double_value: number expected"; - if (message.string_value != null && message.hasOwnProperty("string_value")) - if (!(message.string_value && typeof message.string_value.length === "number" || $util.isString(message.string_value))) - return "string_value: buffer expected"; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - if (!$util.isString(message.aggregate_value)) - return "aggregate_value: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifier_value != null) - message.identifier_value = String(object.identifier_value); - if (object.positive_int_value != null) - if ($util.Long) - (message.positive_int_value = $util.Long.fromValue(object.positive_int_value)).unsigned = true; - else if (typeof object.positive_int_value === "string") - message.positive_int_value = parseInt(object.positive_int_value, 10); - else if (typeof object.positive_int_value === "number") - message.positive_int_value = object.positive_int_value; - else if (typeof object.positive_int_value === "object") - message.positive_int_value = new $util.LongBits(object.positive_int_value.low >>> 0, object.positive_int_value.high >>> 0).toNumber(true); - if (object.negative_int_value != null) - if ($util.Long) - (message.negative_int_value = $util.Long.fromValue(object.negative_int_value)).unsigned = false; - else if (typeof object.negative_int_value === "string") - message.negative_int_value = parseInt(object.negative_int_value, 10); - else if (typeof object.negative_int_value === "number") - message.negative_int_value = object.negative_int_value; - else if (typeof object.negative_int_value === "object") - message.negative_int_value = new $util.LongBits(object.negative_int_value.low >>> 0, object.negative_int_value.high >>> 0).toNumber(); - if (object.double_value != null) - message.double_value = Number(object.double_value); - if (object.string_value != null) - if (typeof object.string_value === "string") - $util.base64.decode(object.string_value, message.string_value = $util.newBuffer($util.base64.length(object.string_value)), 0); - else if (object.string_value.length) - message.string_value = object.string_value; - if (object.aggregate_value != null) - message.aggregate_value = String(object.aggregate_value); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifier_value = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positive_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positive_int_value = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negative_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negative_int_value = options.longs === String ? "0" : 0; - object.double_value = 0; - if (options.bytes === String) - object.string_value = ""; - else { - object.string_value = []; - if (options.bytes !== Array) - object.string_value = $util.newBuffer(object.string_value); - } - object.aggregate_value = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - object.identifier_value = message.identifier_value; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (typeof message.positive_int_value === "number") - object.positive_int_value = options.longs === String ? String(message.positive_int_value) : message.positive_int_value; - else - object.positive_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.positive_int_value) : options.longs === Number ? new $util.LongBits(message.positive_int_value.low >>> 0, message.positive_int_value.high >>> 0).toNumber(true) : message.positive_int_value; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (typeof message.negative_int_value === "number") - object.negative_int_value = options.longs === String ? String(message.negative_int_value) : message.negative_int_value; - else - object.negative_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.negative_int_value) : options.longs === Number ? new $util.LongBits(message.negative_int_value.low >>> 0, message.negative_int_value.high >>> 0).toNumber() : message.negative_int_value; - if (message.double_value != null && message.hasOwnProperty("double_value")) - object.double_value = options.json && !isFinite(message.double_value) ? String(message.double_value) : message.double_value; - if (message.string_value != null && message.hasOwnProperty("string_value")) - object.string_value = options.bytes === String ? $util.base64.encode(message.string_value, 0, message.string_value.length) : options.bytes === Array ? Array.prototype.slice.call(message.string_value) : message.string_value; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - object.aggregate_value = message.aggregate_value; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} name_part NamePart name_part - * @property {boolean} is_extension NamePart is_extension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart name_part. - * @member {string} name_part - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.name_part = ""; - - /** - * NamePart is_extension. - * @member {boolean} is_extension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.is_extension = false; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name_part); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_extension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("name_part")) - throw $util.ProtocolError("missing required 'name_part'", { instance: message }); - if (!message.hasOwnProperty("is_extension")) - throw $util.ProtocolError("missing required 'is_extension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.name_part)) - return "name_part: string expected"; - if (typeof message.is_extension !== "boolean") - return "is_extension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.name_part != null) - message.name_part = String(object.name_part); - if (object.is_extension != null) - message.is_extension = Boolean(object.is_extension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name_part = ""; - object.is_extension = false; - } - if (message.name_part != null && message.hasOwnProperty("name_part")) - object.name_part = message.name_part; - if (message.is_extension != null && message.hasOwnProperty("is_extension")) - object.is_extension = message.is_extension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leading_comments] Location leading_comments - * @property {string|null} [trailing_comments] Location trailing_comments - * @property {Array.|null} [leading_detached_comments] Location leading_detached_comments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leading_detached_comments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leading_comments. - * @member {string} leading_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_comments = ""; - - /** - * Location trailing_comments. - * @member {string} trailing_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailing_comments = ""; - - /** - * Location leading_detached_comments. - * @member {Array.} leading_detached_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_detached_comments = $util.emptyArray; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leading_comments != null && Object.hasOwnProperty.call(message, "leading_comments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leading_comments); - if (message.trailing_comments != null && Object.hasOwnProperty.call(message, "trailing_comments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailing_comments); - if (message.leading_detached_comments != null && message.leading_detached_comments.length) - for (var i = 0; i < message.leading_detached_comments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leading_detached_comments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - if (!(message.leading_detached_comments && message.leading_detached_comments.length)) - message.leading_detached_comments = []; - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - if (!$util.isString(message.leading_comments)) - return "leading_comments: string expected"; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - if (!$util.isString(message.trailing_comments)) - return "trailing_comments: string expected"; - if (message.leading_detached_comments != null && message.hasOwnProperty("leading_detached_comments")) { - if (!Array.isArray(message.leading_detached_comments)) - return "leading_detached_comments: array expected"; - for (var i = 0; i < message.leading_detached_comments.length; ++i) - if (!$util.isString(message.leading_detached_comments[i])) - return "leading_detached_comments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leading_comments != null) - message.leading_comments = String(object.leading_comments); - if (object.trailing_comments != null) - message.trailing_comments = String(object.trailing_comments); - if (object.leading_detached_comments) { - if (!Array.isArray(object.leading_detached_comments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leading_detached_comments: array expected"); - message.leading_detached_comments = []; - for (var i = 0; i < object.leading_detached_comments.length; ++i) - message.leading_detached_comments[i] = String(object.leading_detached_comments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leading_detached_comments = []; - } - if (options.defaults) { - object.leading_comments = ""; - object.trailing_comments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - object.leading_comments = message.leading_comments; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - object.trailing_comments = message.trailing_comments; - if (message.leading_detached_comments && message.leading_detached_comments.length) { - object.leading_detached_comments = []; - for (var j = 0; j < message.leading_detached_comments.length; ++j) - object.leading_detached_comments[j] = message.leading_detached_comments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [source_file] Annotation source_file - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation source_file. - * @member {string} source_file - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.source_file = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.source_file != null && Object.hasOwnProperty.call(message, "source_file")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_file); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.source_file = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - if (!$util.isString(message.source_file)) - return "source_file: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.source_file != null) - message.source_file = String(object.source_file); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.source_file = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - object.source_file = message.source_file; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Any; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Timestamp; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Duration; - })(); - - return protobuf; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fully_decode_reserved_expansion] Http fully_decode_reserved_expansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fully_decode_reserved_expansion. - * @member {boolean} fully_decode_reserved_expansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fully_decode_reserved_expansion = false; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fully_decode_reserved_expansion != null && Object.hasOwnProperty.call(message, "fully_decode_reserved_expansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fully_decode_reserved_expansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - if (typeof message.fully_decode_reserved_expansion !== "boolean") - return "fully_decode_reserved_expansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fully_decode_reserved_expansion != null) - message.fully_decode_reserved_expansion = Boolean(object.fully_decode_reserved_expansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fully_decode_reserved_expansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - object.fully_decode_reserved_expansion = message.fully_decode_reserved_expansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [response_body] HttpRule response_body - * @property {Array.|null} [additional_bindings] HttpRule additional_bindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additional_bindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule response_body. - * @member {string} response_body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.response_body = ""; - - /** - * HttpRule additional_bindings. - * @member {Array.} additional_bindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additional_bindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additional_bindings != null && message.additional_bindings.length) - for (var i = 0; i < message.additional_bindings.length; ++i) - $root.google.api.HttpRule.encode(message.additional_bindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.response_body != null && Object.hasOwnProperty.call(message, "response_body")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.response_body); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.response_body = reader.string(); - break; - case 11: - if (!(message.additional_bindings && message.additional_bindings.length)) - message.additional_bindings = []; - message.additional_bindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.response_body != null && message.hasOwnProperty("response_body")) - if (!$util.isString(message.response_body)) - return "response_body: string expected"; - if (message.additional_bindings != null && message.hasOwnProperty("additional_bindings")) { - if (!Array.isArray(message.additional_bindings)) - return "additional_bindings: array expected"; - for (var i = 0; i < message.additional_bindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additional_bindings[i]); - if (error) - return "additional_bindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.response_body != null) - message.response_body = String(object.response_body); - if (object.additional_bindings) { - if (!Array.isArray(object.additional_bindings)) - throw TypeError(".google.api.HttpRule.additional_bindings: array expected"); - message.additional_bindings = []; - for (var i = 0; i < object.additional_bindings.length; ++i) { - if (typeof object.additional_bindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additional_bindings: object expected"); - message.additional_bindings[i] = $root.google.api.HttpRule.fromObject(object.additional_bindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additional_bindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.response_body = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additional_bindings && message.additional_bindings.length) { - object.additional_bindings = []; - for (var j = 0; j < message.additional_bindings.length; ++j) - object.additional_bindings[j] = $root.google.api.HttpRule.toObject(message.additional_bindings[j], options); - } - if (message.response_body != null && message.hasOwnProperty("response_body")) - object.response_body = message.response_body; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CustomHttpPattern; - })(); - - return api; - })(); - - return google; - })(); - - return $root; -}); diff --git a/src/generated/admin/proto.d.ts b/src/generated/admin/proto.d.ts deleted file mode 100644 index abe34f2e..00000000 --- a/src/generated/admin/proto.d.ts +++ /dev/null @@ -1,6015 +0,0 @@ -import * as $protobuf from "protobufjs"; -/** Namespace cosmos. */ -export namespace cosmos { - - /** Namespace adminmodule. */ - namespace adminmodule { - - /** Namespace adminmodule. */ - namespace adminmodule { - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls DeleteAdmin. - * @param request MsgDeleteAdmin message or plain object - * @param callback Node-style callback called with the error, if any, and MsgDeleteAdminResponse - */ - public deleteAdmin(request: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin, callback: cosmos.adminmodule.adminmodule.Msg.DeleteAdminCallback): void; - - /** - * Calls DeleteAdmin. - * @param request MsgDeleteAdmin message or plain object - * @returns Promise - */ - public deleteAdmin(request: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin): Promise; - - /** - * Calls AddAdmin. - * @param request MsgAddAdmin message or plain object - * @param callback Node-style callback called with the error, if any, and MsgAddAdminResponse - */ - public addAdmin(request: cosmos.adminmodule.adminmodule.IMsgAddAdmin, callback: cosmos.adminmodule.adminmodule.Msg.AddAdminCallback): void; - - /** - * Calls AddAdmin. - * @param request MsgAddAdmin message or plain object - * @returns Promise - */ - public addAdmin(request: cosmos.adminmodule.adminmodule.IMsgAddAdmin): Promise; - - /** - * Calls SubmitProposal. - * @param request MsgSubmitProposal message or plain object - * @param callback Node-style callback called with the error, if any, and MsgSubmitProposalResponse - */ - public submitProposal(request: cosmos.adminmodule.adminmodule.IMsgSubmitProposal, callback: cosmos.adminmodule.adminmodule.Msg.SubmitProposalCallback): void; - - /** - * Calls SubmitProposal. - * @param request MsgSubmitProposal message or plain object - * @returns Promise - */ - public submitProposal(request: cosmos.adminmodule.adminmodule.IMsgSubmitProposal): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#deleteAdmin}. - * @param error Error, if any - * @param [response] MsgDeleteAdminResponse - */ - type DeleteAdminCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse) => void; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#addAdmin}. - * @param error Error, if any - * @param [response] MsgAddAdminResponse - */ - type AddAdminCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.MsgAddAdminResponse) => void; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#submitProposal}. - * @param error Error, if any - * @param [response] MsgSubmitProposalResponse - */ - type SubmitProposalCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse) => void; - } - - /** Properties of a MsgDeleteAdmin. */ - interface IMsgDeleteAdmin { - - /** MsgDeleteAdmin creator */ - creator?: (string|null); - - /** MsgDeleteAdmin admin */ - admin?: (string|null); - } - - /** Represents a MsgDeleteAdmin. */ - class MsgDeleteAdmin implements IMsgDeleteAdmin { - - /** - * Constructs a new MsgDeleteAdmin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin); - - /** MsgDeleteAdmin creator. */ - public creator: string; - - /** MsgDeleteAdmin admin. */ - public admin: string; - - /** - * Encodes the specified MsgDeleteAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @param message MsgDeleteAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgDeleteAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @param message MsgDeleteAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgDeleteAdmin; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgDeleteAdmin; - - /** - * Verifies a MsgDeleteAdmin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgDeleteAdmin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgDeleteAdmin - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgDeleteAdmin; - - /** - * Creates a plain object from a MsgDeleteAdmin message. Also converts values to other types if specified. - * @param message MsgDeleteAdmin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgDeleteAdmin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgDeleteAdmin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgDeleteAdminResponse. */ - interface IMsgDeleteAdminResponse { - } - - /** Represents a MsgDeleteAdminResponse. */ - class MsgDeleteAdminResponse implements IMsgDeleteAdminResponse { - - /** - * Constructs a new MsgDeleteAdminResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse); - - /** - * Encodes the specified MsgDeleteAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @param message MsgDeleteAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgDeleteAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @param message MsgDeleteAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse; - - /** - * Verifies a MsgDeleteAdminResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgDeleteAdminResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgDeleteAdminResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse; - - /** - * Creates a plain object from a MsgDeleteAdminResponse message. Also converts values to other types if specified. - * @param message MsgDeleteAdminResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgDeleteAdminResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgAddAdmin. */ - interface IMsgAddAdmin { - - /** MsgAddAdmin creator */ - creator?: (string|null); - - /** MsgAddAdmin admin */ - admin?: (string|null); - } - - /** Represents a MsgAddAdmin. */ - class MsgAddAdmin implements IMsgAddAdmin { - - /** - * Constructs a new MsgAddAdmin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgAddAdmin); - - /** MsgAddAdmin creator. */ - public creator: string; - - /** MsgAddAdmin admin. */ - public admin: string; - - /** - * Encodes the specified MsgAddAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @param message MsgAddAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgAddAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgAddAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @param message MsgAddAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgAddAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgAddAdmin; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgAddAdmin; - - /** - * Verifies a MsgAddAdmin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgAddAdmin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgAddAdmin - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgAddAdmin; - - /** - * Creates a plain object from a MsgAddAdmin message. Also converts values to other types if specified. - * @param message MsgAddAdmin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgAddAdmin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgAddAdmin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgAddAdminResponse. */ - interface IMsgAddAdminResponse { - } - - /** Represents a MsgAddAdminResponse. */ - class MsgAddAdminResponse implements IMsgAddAdminResponse { - - /** - * Constructs a new MsgAddAdminResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgAddAdminResponse); - - /** - * Encodes the specified MsgAddAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @param message MsgAddAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgAddAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgAddAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @param message MsgAddAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgAddAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgAddAdminResponse; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgAddAdminResponse; - - /** - * Verifies a MsgAddAdminResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgAddAdminResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgAddAdminResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgAddAdminResponse; - - /** - * Creates a plain object from a MsgAddAdminResponse message. Also converts values to other types if specified. - * @param message MsgAddAdminResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgAddAdminResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgAddAdminResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitProposal. */ - interface IMsgSubmitProposal { - - /** MsgSubmitProposal content */ - content?: (google.protobuf.IAny|null); - - /** MsgSubmitProposal proposer */ - proposer?: (string|null); - } - - /** Represents a MsgSubmitProposal. */ - class MsgSubmitProposal implements IMsgSubmitProposal { - - /** - * Constructs a new MsgSubmitProposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgSubmitProposal); - - /** MsgSubmitProposal content. */ - public content?: (google.protobuf.IAny|null); - - /** MsgSubmitProposal proposer. */ - public proposer: string; - - /** - * Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @param message MsgSubmitProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgSubmitProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @param message MsgSubmitProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgSubmitProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgSubmitProposal; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgSubmitProposal; - - /** - * Verifies a MsgSubmitProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitProposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgSubmitProposal; - - /** - * Creates a plain object from a MsgSubmitProposal message. Also converts values to other types if specified. - * @param message MsgSubmitProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgSubmitProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitProposalResponse. */ - interface IMsgSubmitProposalResponse { - - /** MsgSubmitProposalResponse proposal_id */ - proposal_id?: (Long|null); - } - - /** Represents a MsgSubmitProposalResponse. */ - class MsgSubmitProposalResponse implements IMsgSubmitProposalResponse { - - /** - * Constructs a new MsgSubmitProposalResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse); - - /** MsgSubmitProposalResponse proposal_id. */ - public proposal_id: Long; - - /** - * Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @param message MsgSubmitProposalResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @param message MsgSubmitProposalResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse; - - /** - * Verifies a MsgSubmitProposalResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitProposalResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitProposalResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse; - - /** - * Creates a plain object from a MsgSubmitProposalResponse message. Also converts values to other types if specified. - * @param message MsgSubmitProposalResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitProposalResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Admins. - * @param request QueryAdminsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryAdminsResponse - */ - public admins(request: cosmos.adminmodule.adminmodule.IQueryAdminsRequest, callback: cosmos.adminmodule.adminmodule.Query.AdminsCallback): void; - - /** - * Calls Admins. - * @param request QueryAdminsRequest message or plain object - * @returns Promise - */ - public admins(request: cosmos.adminmodule.adminmodule.IQueryAdminsRequest): Promise; - - /** - * Calls ArchivedProposals. - * @param request QueryArchivedProposalsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryArchivedProposalsResponse - */ - public archivedProposals(request: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest, callback: cosmos.adminmodule.adminmodule.Query.ArchivedProposalsCallback): void; - - /** - * Calls ArchivedProposals. - * @param request QueryArchivedProposalsRequest message or plain object - * @returns Promise - */ - public archivedProposals(request: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#admins}. - * @param error Error, if any - * @param [response] QueryAdminsResponse - */ - type AdminsCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.QueryAdminsResponse) => void; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#archivedProposals}. - * @param error Error, if any - * @param [response] QueryArchivedProposalsResponse - */ - type ArchivedProposalsCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse) => void; - } - - /** Properties of a QueryAdminsRequest. */ - interface IQueryAdminsRequest { - } - - /** Represents a QueryAdminsRequest. */ - class QueryAdminsRequest implements IQueryAdminsRequest { - - /** - * Constructs a new QueryAdminsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IQueryAdminsRequest); - - /** - * Encodes the specified QueryAdminsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @param message QueryAdminsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IQueryAdminsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryAdminsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @param message QueryAdminsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IQueryAdminsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.QueryAdminsRequest; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.QueryAdminsRequest; - - /** - * Verifies a QueryAdminsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryAdminsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryAdminsRequest - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.QueryAdminsRequest; - - /** - * Creates a plain object from a QueryAdminsRequest message. Also converts values to other types if specified. - * @param message QueryAdminsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.QueryAdminsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryAdminsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryAdminsResponse. */ - interface IQueryAdminsResponse { - - /** QueryAdminsResponse admins */ - admins?: (string[]|null); - } - - /** Represents a QueryAdminsResponse. */ - class QueryAdminsResponse implements IQueryAdminsResponse { - - /** - * Constructs a new QueryAdminsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IQueryAdminsResponse); - - /** QueryAdminsResponse admins. */ - public admins: string[]; - - /** - * Encodes the specified QueryAdminsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @param message QueryAdminsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IQueryAdminsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryAdminsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @param message QueryAdminsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IQueryAdminsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.QueryAdminsResponse; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.QueryAdminsResponse; - - /** - * Verifies a QueryAdminsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryAdminsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryAdminsResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.QueryAdminsResponse; - - /** - * Creates a plain object from a QueryAdminsResponse message. Also converts values to other types if specified. - * @param message QueryAdminsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.QueryAdminsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryAdminsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryArchivedProposalsRequest. */ - interface IQueryArchivedProposalsRequest { - } - - /** Represents a QueryArchivedProposalsRequest. */ - class QueryArchivedProposalsRequest implements IQueryArchivedProposalsRequest { - - /** - * Constructs a new QueryArchivedProposalsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest); - - /** - * Encodes the specified QueryArchivedProposalsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @param message QueryArchivedProposalsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryArchivedProposalsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @param message QueryArchivedProposalsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest; - - /** - * Verifies a QueryArchivedProposalsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryArchivedProposalsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryArchivedProposalsRequest - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest; - - /** - * Creates a plain object from a QueryArchivedProposalsRequest message. Also converts values to other types if specified. - * @param message QueryArchivedProposalsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryArchivedProposalsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryArchivedProposalsResponse. */ - interface IQueryArchivedProposalsResponse { - - /** QueryArchivedProposalsResponse proposals */ - proposals?: (cosmos.gov.v1beta1.IProposal[]|null); - } - - /** Represents a QueryArchivedProposalsResponse. */ - class QueryArchivedProposalsResponse implements IQueryArchivedProposalsResponse { - - /** - * Constructs a new QueryArchivedProposalsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse); - - /** QueryArchivedProposalsResponse proposals. */ - public proposals: cosmos.gov.v1beta1.IProposal[]; - - /** - * Encodes the specified QueryArchivedProposalsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @param message QueryArchivedProposalsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryArchivedProposalsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @param message QueryArchivedProposalsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse; - - /** - * Verifies a QueryArchivedProposalsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryArchivedProposalsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryArchivedProposalsResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse; - - /** - * Creates a plain object from a QueryArchivedProposalsResponse message. Also converts values to other types if specified. - * @param message QueryArchivedProposalsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryArchivedProposalsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState admins */ - admins?: (string[]|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IGenesisState); - - /** GenesisState admins. */ - public admins: string[]; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace gov. */ - namespace gov { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** VoteOption enum. */ - enum VoteOption { - VOTE_OPTION_UNSPECIFIED = 0, - VOTE_OPTION_YES = 1, - VOTE_OPTION_ABSTAIN = 2, - VOTE_OPTION_NO = 3, - VOTE_OPTION_NO_WITH_VETO = 4 - } - - /** Properties of a WeightedVoteOption. */ - interface IWeightedVoteOption { - - /** WeightedVoteOption option */ - option?: (cosmos.gov.v1beta1.VoteOption|null); - - /** WeightedVoteOption weight */ - weight?: (string|null); - } - - /** Represents a WeightedVoteOption. */ - class WeightedVoteOption implements IWeightedVoteOption { - - /** - * Constructs a new WeightedVoteOption. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IWeightedVoteOption); - - /** WeightedVoteOption option. */ - public option: cosmos.gov.v1beta1.VoteOption; - - /** WeightedVoteOption weight. */ - public weight: string; - - /** - * Encodes the specified WeightedVoteOption message. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @param message WeightedVoteOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IWeightedVoteOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WeightedVoteOption message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @param message WeightedVoteOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IWeightedVoteOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.WeightedVoteOption; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.WeightedVoteOption; - - /** - * Verifies a WeightedVoteOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WeightedVoteOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WeightedVoteOption - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.WeightedVoteOption; - - /** - * Creates a plain object from a WeightedVoteOption message. Also converts values to other types if specified. - * @param message WeightedVoteOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.WeightedVoteOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WeightedVoteOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TextProposal. */ - interface ITextProposal { - - /** TextProposal title */ - title?: (string|null); - - /** TextProposal description */ - description?: (string|null); - } - - /** Represents a TextProposal. */ - class TextProposal implements ITextProposal { - - /** - * Constructs a new TextProposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.ITextProposal); - - /** TextProposal title. */ - public title: string; - - /** TextProposal description. */ - public description: string; - - /** - * Encodes the specified TextProposal message. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @param message TextProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.ITextProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @param message TextProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.ITextProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.TextProposal; - - /** - * Decodes a TextProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.TextProposal; - - /** - * Verifies a TextProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TextProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextProposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.TextProposal; - - /** - * Creates a plain object from a TextProposal message. Also converts values to other types if specified. - * @param message TextProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.TextProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Deposit. */ - interface IDeposit { - - /** Deposit proposal_id */ - proposal_id?: (Long|null); - - /** Deposit depositor */ - depositor?: (string|null); - - /** Deposit amount */ - amount?: (cosmos.base.v1beta1.ICoin[]|null); - } - - /** Represents a Deposit. */ - class Deposit implements IDeposit { - - /** - * Constructs a new Deposit. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IDeposit); - - /** Deposit proposal_id. */ - public proposal_id: Long; - - /** Deposit depositor. */ - public depositor: string; - - /** Deposit amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** - * Encodes the specified Deposit message. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @param message Deposit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IDeposit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Deposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @param message Deposit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IDeposit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Deposit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.Deposit; - - /** - * Decodes a Deposit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.Deposit; - - /** - * Verifies a Deposit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Deposit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Deposit - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.Deposit; - - /** - * Creates a plain object from a Deposit message. Also converts values to other types if specified. - * @param message Deposit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.Deposit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Deposit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Proposal. */ - interface IProposal { - - /** Proposal proposal_id */ - proposal_id?: (Long|null); - - /** Proposal content */ - content?: (google.protobuf.IAny|null); - - /** Proposal status */ - status?: (cosmos.gov.v1beta1.ProposalStatus|null); - - /** Proposal final_tally_result */ - final_tally_result?: (cosmos.gov.v1beta1.ITallyResult|null); - - /** Proposal submit_time */ - submit_time?: (google.protobuf.ITimestamp|null); - - /** Proposal deposit_end_time */ - deposit_end_time?: (google.protobuf.ITimestamp|null); - - /** Proposal total_deposit */ - total_deposit?: (cosmos.base.v1beta1.ICoin[]|null); - - /** Proposal voting_start_time */ - voting_start_time?: (google.protobuf.ITimestamp|null); - - /** Proposal voting_end_time */ - voting_end_time?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Proposal. */ - class Proposal implements IProposal { - - /** - * Constructs a new Proposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IProposal); - - /** Proposal proposal_id. */ - public proposal_id: Long; - - /** Proposal content. */ - public content?: (google.protobuf.IAny|null); - - /** Proposal status. */ - public status: cosmos.gov.v1beta1.ProposalStatus; - - /** Proposal final_tally_result. */ - public final_tally_result?: (cosmos.gov.v1beta1.ITallyResult|null); - - /** Proposal submit_time. */ - public submit_time?: (google.protobuf.ITimestamp|null); - - /** Proposal deposit_end_time. */ - public deposit_end_time?: (google.protobuf.ITimestamp|null); - - /** Proposal total_deposit. */ - public total_deposit: cosmos.base.v1beta1.ICoin[]; - - /** Proposal voting_start_time. */ - public voting_start_time?: (google.protobuf.ITimestamp|null); - - /** Proposal voting_end_time. */ - public voting_end_time?: (google.protobuf.ITimestamp|null); - - /** - * Encodes the specified Proposal message. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @param message Proposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @param message Proposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.Proposal; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.Proposal; - - /** - * Verifies a Proposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Proposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.Proposal; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @param message Proposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.Proposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Proposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** ProposalStatus enum. */ - enum ProposalStatus { - PROPOSAL_STATUS_UNSPECIFIED = 0, - PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, - PROPOSAL_STATUS_VOTING_PERIOD = 2, - PROPOSAL_STATUS_PASSED = 3, - PROPOSAL_STATUS_REJECTED = 4, - PROPOSAL_STATUS_FAILED = 5 - } - - /** Properties of a TallyResult. */ - interface ITallyResult { - - /** TallyResult yes */ - yes?: (string|null); - - /** TallyResult abstain */ - abstain?: (string|null); - - /** TallyResult no */ - no?: (string|null); - - /** TallyResult no_with_veto */ - no_with_veto?: (string|null); - } - - /** Represents a TallyResult. */ - class TallyResult implements ITallyResult { - - /** - * Constructs a new TallyResult. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.ITallyResult); - - /** TallyResult yes. */ - public yes: string; - - /** TallyResult abstain. */ - public abstain: string; - - /** TallyResult no. */ - public no: string; - - /** TallyResult no_with_veto. */ - public no_with_veto: string; - - /** - * Encodes the specified TallyResult message. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @param message TallyResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.ITallyResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TallyResult message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @param message TallyResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.ITallyResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TallyResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.TallyResult; - - /** - * Decodes a TallyResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.TallyResult; - - /** - * Verifies a TallyResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TallyResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TallyResult - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.TallyResult; - - /** - * Creates a plain object from a TallyResult message. Also converts values to other types if specified. - * @param message TallyResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.TallyResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TallyResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Vote. */ - interface IVote { - - /** Vote proposal_id */ - proposal_id?: (Long|null); - - /** Vote voter */ - voter?: (string|null); - - /** Vote option */ - option?: (cosmos.gov.v1beta1.VoteOption|null); - - /** Vote options */ - options?: (cosmos.gov.v1beta1.IWeightedVoteOption[]|null); - } - - /** Represents a Vote. */ - class Vote implements IVote { - - /** - * Constructs a new Vote. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IVote); - - /** Vote proposal_id. */ - public proposal_id: Long; - - /** Vote voter. */ - public voter: string; - - /** Vote option. */ - public option: cosmos.gov.v1beta1.VoteOption; - - /** Vote options. */ - public options: cosmos.gov.v1beta1.IWeightedVoteOption[]; - - /** - * Encodes the specified Vote message. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @param message Vote message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IVote, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @param message Vote message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IVote, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.Vote; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.Vote; - - /** - * Verifies a Vote message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Vote - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.Vote; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @param message Vote - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.Vote, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Vote to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DepositParams. */ - interface IDepositParams { - - /** DepositParams min_deposit */ - min_deposit?: (cosmos.base.v1beta1.ICoin[]|null); - - /** DepositParams max_deposit_period */ - max_deposit_period?: (google.protobuf.IDuration|null); - } - - /** Represents a DepositParams. */ - class DepositParams implements IDepositParams { - - /** - * Constructs a new DepositParams. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IDepositParams); - - /** DepositParams min_deposit. */ - public min_deposit: cosmos.base.v1beta1.ICoin[]; - - /** DepositParams max_deposit_period. */ - public max_deposit_period?: (google.protobuf.IDuration|null); - - /** - * Encodes the specified DepositParams message. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @param message DepositParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IDepositParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DepositParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @param message DepositParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IDepositParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DepositParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.DepositParams; - - /** - * Decodes a DepositParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.DepositParams; - - /** - * Verifies a DepositParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DepositParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DepositParams - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.DepositParams; - - /** - * Creates a plain object from a DepositParams message. Also converts values to other types if specified. - * @param message DepositParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.DepositParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DepositParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a VotingParams. */ - interface IVotingParams { - - /** VotingParams voting_period */ - voting_period?: (google.protobuf.IDuration|null); - } - - /** Represents a VotingParams. */ - class VotingParams implements IVotingParams { - - /** - * Constructs a new VotingParams. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IVotingParams); - - /** VotingParams voting_period. */ - public voting_period?: (google.protobuf.IDuration|null); - - /** - * Encodes the specified VotingParams message. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @param message VotingParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IVotingParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VotingParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @param message VotingParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IVotingParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VotingParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.VotingParams; - - /** - * Decodes a VotingParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.VotingParams; - - /** - * Verifies a VotingParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VotingParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VotingParams - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.VotingParams; - - /** - * Creates a plain object from a VotingParams message. Also converts values to other types if specified. - * @param message VotingParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.VotingParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VotingParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TallyParams. */ - interface ITallyParams { - - /** TallyParams quorum */ - quorum?: (Uint8Array|null); - - /** TallyParams threshold */ - threshold?: (Uint8Array|null); - - /** TallyParams veto_threshold */ - veto_threshold?: (Uint8Array|null); - } - - /** Represents a TallyParams. */ - class TallyParams implements ITallyParams { - - /** - * Constructs a new TallyParams. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.ITallyParams); - - /** TallyParams quorum. */ - public quorum: Uint8Array; - - /** TallyParams threshold. */ - public threshold: Uint8Array; - - /** TallyParams veto_threshold. */ - public veto_threshold: Uint8Array; - - /** - * Encodes the specified TallyParams message. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @param message TallyParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.ITallyParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TallyParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @param message TallyParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.ITallyParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TallyParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.TallyParams; - - /** - * Decodes a TallyParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.TallyParams; - - /** - * Verifies a TallyParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TallyParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TallyParams - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.TallyParams; - - /** - * Creates a plain object from a TallyParams message. Also converts values to other types if specified. - * @param message TallyParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.TallyParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TallyParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace base. */ - namespace base { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a Coin. */ - interface ICoin { - - /** Coin denom */ - denom?: (string|null); - - /** Coin amount */ - amount?: (string|null); - } - - /** Represents a Coin. */ - class Coin implements ICoin { - - /** - * Constructs a new Coin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.ICoin); - - /** Coin denom. */ - public denom: string; - - /** Coin amount. */ - public amount: string; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.Coin; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.Coin; - - /** - * Verifies a Coin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Coin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.Coin; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @param message Coin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Coin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecCoin. */ - interface IDecCoin { - - /** DecCoin denom */ - denom?: (string|null); - - /** DecCoin amount */ - amount?: (string|null); - } - - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - - /** - * Constructs a new DecCoin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecCoin; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecCoin; - - /** - * Verifies a DecCoin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecCoin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecCoin; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @param message DecCoin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecCoin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecCoin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IntProto. */ - interface IIntProto { - - /** IntProto int */ - int?: (string|null); - } - - /** Represents an IntProto. */ - class IntProto implements IIntProto { - - /** - * Constructs a new IntProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.IntProto; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.IntProto; - - /** - * Verifies an IntProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.IntProto; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @param message IntProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.IntProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecProto. */ - interface IDecProto { - - /** DecProto dec */ - dec?: (string|null); - } - - /** Represents a DecProto. */ - class DecProto implements IDecProto { - - /** - * Constructs a new DecProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecProto; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecProto; - - /** - * Verifies a DecProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecProto; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @param message DecProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } -} - -/** Namespace cosmos_proto. */ -export namespace cosmos_proto { - - /** Properties of an InterfaceDescriptor. */ - interface IInterfaceDescriptor { - - /** InterfaceDescriptor name */ - name?: (string|null); - - /** InterfaceDescriptor description */ - description?: (string|null); - } - - /** Represents an InterfaceDescriptor. */ - class InterfaceDescriptor implements IInterfaceDescriptor { - - /** - * Constructs a new InterfaceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos_proto.IInterfaceDescriptor); - - /** InterfaceDescriptor name. */ - public name: string; - - /** InterfaceDescriptor description. */ - public description: string; - - /** - * Encodes the specified InterfaceDescriptor message. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @param message InterfaceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos_proto.IInterfaceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InterfaceDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @param message InterfaceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos_proto.IInterfaceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos_proto.InterfaceDescriptor; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos_proto.InterfaceDescriptor; - - /** - * Verifies an InterfaceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InterfaceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InterfaceDescriptor - */ - public static fromObject(object: { [k: string]: any }): cosmos_proto.InterfaceDescriptor; - - /** - * Creates a plain object from an InterfaceDescriptor message. Also converts values to other types if specified. - * @param message InterfaceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos_proto.InterfaceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InterfaceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ScalarDescriptor. */ - interface IScalarDescriptor { - - /** ScalarDescriptor name */ - name?: (string|null); - - /** ScalarDescriptor description */ - description?: (string|null); - - /** ScalarDescriptor field_type */ - field_type?: (cosmos_proto.ScalarType[]|null); - - /** ScalarDescriptor legacy_amino_encoding */ - legacy_amino_encoding?: (string|null); - } - - /** Represents a ScalarDescriptor. */ - class ScalarDescriptor implements IScalarDescriptor { - - /** - * Constructs a new ScalarDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos_proto.IScalarDescriptor); - - /** ScalarDescriptor name. */ - public name: string; - - /** ScalarDescriptor description. */ - public description: string; - - /** ScalarDescriptor field_type. */ - public field_type: cosmos_proto.ScalarType[]; - - /** ScalarDescriptor legacy_amino_encoding. */ - public legacy_amino_encoding: string; - - /** - * Encodes the specified ScalarDescriptor message. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @param message ScalarDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos_proto.IScalarDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ScalarDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @param message ScalarDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos_proto.IScalarDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos_proto.ScalarDescriptor; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos_proto.ScalarDescriptor; - - /** - * Verifies a ScalarDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ScalarDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ScalarDescriptor - */ - public static fromObject(object: { [k: string]: any }): cosmos_proto.ScalarDescriptor; - - /** - * Creates a plain object from a ScalarDescriptor message. Also converts values to other types if specified. - * @param message ScalarDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos_proto.ScalarDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ScalarDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** ScalarType enum. */ - enum ScalarType { - SCALAR_TYPE_UNSPECIFIED = 0, - SCALAR_TYPE_STRING = 1, - SCALAR_TYPE_BYTES = 2 - } -} - -/** Namespace google. */ -export namespace google { - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto public_dependency */ - public_dependency?: (number[]|null); - - /** FileDescriptorProto weak_dependency */ - weak_dependency?: (number[]|null); - - /** FileDescriptorProto message_type */ - message_type?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enum_type */ - enum_type?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto source_code_info */ - source_code_info?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto public_dependency. */ - public public_dependency: number[]; - - /** FileDescriptorProto weak_dependency. */ - public weak_dependency: number[]; - - /** FileDescriptorProto message_type. */ - public message_type: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enum_type. */ - public enum_type: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto source_code_info. */ - public source_code_info?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nested_type */ - nested_type?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enum_type */ - enum_type?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extension_range */ - extension_range?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneof_decl */ - oneof_decl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reserved_range */ - reserved_range?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reserved_name */ - reserved_name?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nested_type. */ - public nested_type: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enum_type. */ - public enum_type: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extension_range. */ - public extension_range: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneof_decl. */ - public oneof_decl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reserved_range. */ - public reserved_range: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reserved_name. */ - public reserved_name: string[]; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto type_name */ - type_name?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto default_value */ - default_value?: (string|null); - - /** FieldDescriptorProto oneof_index */ - oneof_index?: (number|null); - - /** FieldDescriptorProto json_name */ - json_name?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; - - /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; - - /** FieldDescriptorProto type_name. */ - public type_name: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto default_value. */ - public default_value: string; - - /** FieldDescriptorProto oneof_index. */ - public oneof_index: number; - - /** FieldDescriptorProto json_name. */ - public json_name: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto input_type */ - input_type?: (string|null); - - /** MethodDescriptorProto output_type */ - output_type?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto client_streaming */ - client_streaming?: (boolean|null); - - /** MethodDescriptorProto server_streaming */ - server_streaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto input_type. */ - public input_type: string; - - /** MethodDescriptorProto output_type. */ - public output_type: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto client_streaming. */ - public client_streaming: boolean; - - /** MethodDescriptorProto server_streaming. */ - public server_streaming: boolean; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions java_package */ - java_package?: (string|null); - - /** FileOptions java_outer_classname */ - java_outer_classname?: (string|null); - - /** FileOptions java_multiple_files */ - java_multiple_files?: (boolean|null); - - /** FileOptions java_generate_equals_and_hash */ - java_generate_equals_and_hash?: (boolean|null); - - /** FileOptions java_string_check_utf8 */ - java_string_check_utf8?: (boolean|null); - - /** FileOptions optimize_for */ - optimize_for?: (google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions go_package */ - go_package?: (string|null); - - /** FileOptions cc_generic_services */ - cc_generic_services?: (boolean|null); - - /** FileOptions java_generic_services */ - java_generic_services?: (boolean|null); - - /** FileOptions py_generic_services */ - py_generic_services?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions cc_enable_arenas */ - cc_enable_arenas?: (boolean|null); - - /** FileOptions objc_class_prefix */ - objc_class_prefix?: (string|null); - - /** FileOptions csharp_namespace */ - csharp_namespace?: (string|null); - - /** FileOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .gogoproto.goproto_getters_all */ - ".gogoproto.goproto_getters_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_enum_prefix_all */ - ".gogoproto.goproto_enum_prefix_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_stringer_all */ - ".gogoproto.goproto_stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.verbose_equal_all */ - ".gogoproto.verbose_equal_all"?: (boolean|null); - - /** FileOptions .gogoproto.face_all */ - ".gogoproto.face_all"?: (boolean|null); - - /** FileOptions .gogoproto.gostring_all */ - ".gogoproto.gostring_all"?: (boolean|null); - - /** FileOptions .gogoproto.populate_all */ - ".gogoproto.populate_all"?: (boolean|null); - - /** FileOptions .gogoproto.stringer_all */ - ".gogoproto.stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.onlyone_all */ - ".gogoproto.onlyone_all"?: (boolean|null); - - /** FileOptions .gogoproto.equal_all */ - ".gogoproto.equal_all"?: (boolean|null); - - /** FileOptions .gogoproto.description_all */ - ".gogoproto.description_all"?: (boolean|null); - - /** FileOptions .gogoproto.testgen_all */ - ".gogoproto.testgen_all"?: (boolean|null); - - /** FileOptions .gogoproto.benchgen_all */ - ".gogoproto.benchgen_all"?: (boolean|null); - - /** FileOptions .gogoproto.marshaler_all */ - ".gogoproto.marshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.unmarshaler_all */ - ".gogoproto.unmarshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.stable_marshaler_all */ - ".gogoproto.stable_marshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.sizer_all */ - ".gogoproto.sizer_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_enum_stringer_all */ - ".gogoproto.goproto_enum_stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.enum_stringer_all */ - ".gogoproto.enum_stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.unsafe_marshaler_all */ - ".gogoproto.unsafe_marshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.unsafe_unmarshaler_all */ - ".gogoproto.unsafe_unmarshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_extensions_map_all */ - ".gogoproto.goproto_extensions_map_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_unrecognized_all */ - ".gogoproto.goproto_unrecognized_all"?: (boolean|null); - - /** FileOptions .gogoproto.gogoproto_import */ - ".gogoproto.gogoproto_import"?: (boolean|null); - - /** FileOptions .gogoproto.protosizer_all */ - ".gogoproto.protosizer_all"?: (boolean|null); - - /** FileOptions .gogoproto.compare_all */ - ".gogoproto.compare_all"?: (boolean|null); - - /** FileOptions .gogoproto.typedecl_all */ - ".gogoproto.typedecl_all"?: (boolean|null); - - /** FileOptions .gogoproto.enumdecl_all */ - ".gogoproto.enumdecl_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_registration */ - ".gogoproto.goproto_registration"?: (boolean|null); - - /** FileOptions .gogoproto.messagename_all */ - ".gogoproto.messagename_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_sizecache_all */ - ".gogoproto.goproto_sizecache_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_unkeyed_all */ - ".gogoproto.goproto_unkeyed_all"?: (boolean|null); - - /** FileOptions .cosmos_proto.declare_interface */ - ".cosmos_proto.declare_interface"?: (cosmos_proto.IInterfaceDescriptor[]|null); - - /** FileOptions .cosmos_proto.declare_scalar */ - ".cosmos_proto.declare_scalar"?: (cosmos_proto.IScalarDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions java_package. */ - public java_package: string; - - /** FileOptions java_outer_classname. */ - public java_outer_classname: string; - - /** FileOptions java_multiple_files. */ - public java_multiple_files: boolean; - - /** FileOptions java_generate_equals_and_hash. */ - public java_generate_equals_and_hash: boolean; - - /** FileOptions java_string_check_utf8. */ - public java_string_check_utf8: boolean; - - /** FileOptions optimize_for. */ - public optimize_for: google.protobuf.FileOptions.OptimizeMode; - - /** FileOptions go_package. */ - public go_package: string; - - /** FileOptions cc_generic_services. */ - public cc_generic_services: boolean; - - /** FileOptions java_generic_services. */ - public java_generic_services: boolean; - - /** FileOptions py_generic_services. */ - public py_generic_services: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions cc_enable_arenas. */ - public cc_enable_arenas: boolean; - - /** FileOptions objc_class_prefix. */ - public objc_class_prefix: string; - - /** FileOptions csharp_namespace. */ - public csharp_namespace: string; - - /** FileOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions message_set_wire_format */ - message_set_wire_format?: (boolean|null); - - /** MessageOptions no_standard_descriptor_accessor */ - no_standard_descriptor_accessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions map_entry */ - map_entry?: (boolean|null); - - /** MessageOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .gogoproto.goproto_getters */ - ".gogoproto.goproto_getters"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_stringer */ - ".gogoproto.goproto_stringer"?: (boolean|null); - - /** MessageOptions .gogoproto.verbose_equal */ - ".gogoproto.verbose_equal"?: (boolean|null); - - /** MessageOptions .gogoproto.face */ - ".gogoproto.face"?: (boolean|null); - - /** MessageOptions .gogoproto.gostring */ - ".gogoproto.gostring"?: (boolean|null); - - /** MessageOptions .gogoproto.populate */ - ".gogoproto.populate"?: (boolean|null); - - /** MessageOptions .gogoproto.stringer */ - ".gogoproto.stringer"?: (boolean|null); - - /** MessageOptions .gogoproto.onlyone */ - ".gogoproto.onlyone"?: (boolean|null); - - /** MessageOptions .gogoproto.equal */ - ".gogoproto.equal"?: (boolean|null); - - /** MessageOptions .gogoproto.description */ - ".gogoproto.description"?: (boolean|null); - - /** MessageOptions .gogoproto.testgen */ - ".gogoproto.testgen"?: (boolean|null); - - /** MessageOptions .gogoproto.benchgen */ - ".gogoproto.benchgen"?: (boolean|null); - - /** MessageOptions .gogoproto.marshaler */ - ".gogoproto.marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.unmarshaler */ - ".gogoproto.unmarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.stable_marshaler */ - ".gogoproto.stable_marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.sizer */ - ".gogoproto.sizer"?: (boolean|null); - - /** MessageOptions .gogoproto.unsafe_marshaler */ - ".gogoproto.unsafe_marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.unsafe_unmarshaler */ - ".gogoproto.unsafe_unmarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_extensions_map */ - ".gogoproto.goproto_extensions_map"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_unrecognized */ - ".gogoproto.goproto_unrecognized"?: (boolean|null); - - /** MessageOptions .gogoproto.protosizer */ - ".gogoproto.protosizer"?: (boolean|null); - - /** MessageOptions .gogoproto.compare */ - ".gogoproto.compare"?: (boolean|null); - - /** MessageOptions .gogoproto.typedecl */ - ".gogoproto.typedecl"?: (boolean|null); - - /** MessageOptions .gogoproto.messagename */ - ".gogoproto.messagename"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_sizecache */ - ".gogoproto.goproto_sizecache"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_unkeyed */ - ".gogoproto.goproto_unkeyed"?: (boolean|null); - - /** MessageOptions .cosmos_proto.implements_interface */ - ".cosmos_proto.implements_interface"?: (string[]|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions message_set_wire_format. */ - public message_set_wire_format: boolean; - - /** MessageOptions no_standard_descriptor_accessor. */ - public no_standard_descriptor_accessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions map_entry. */ - public map_entry: boolean; - - /** MessageOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .gogoproto.nullable */ - ".gogoproto.nullable"?: (boolean|null); - - /** FieldOptions .gogoproto.embed */ - ".gogoproto.embed"?: (boolean|null); - - /** FieldOptions .gogoproto.customtype */ - ".gogoproto.customtype"?: (string|null); - - /** FieldOptions .gogoproto.customname */ - ".gogoproto.customname"?: (string|null); - - /** FieldOptions .gogoproto.jsontag */ - ".gogoproto.jsontag"?: (string|null); - - /** FieldOptions .gogoproto.moretags */ - ".gogoproto.moretags"?: (string|null); - - /** FieldOptions .gogoproto.casttype */ - ".gogoproto.casttype"?: (string|null); - - /** FieldOptions .gogoproto.castkey */ - ".gogoproto.castkey"?: (string|null); - - /** FieldOptions .gogoproto.castvalue */ - ".gogoproto.castvalue"?: (string|null); - - /** FieldOptions .gogoproto.stdtime */ - ".gogoproto.stdtime"?: (boolean|null); - - /** FieldOptions .gogoproto.stdduration */ - ".gogoproto.stdduration"?: (boolean|null); - - /** FieldOptions .gogoproto.wktpointer */ - ".gogoproto.wktpointer"?: (boolean|null); - - /** FieldOptions .gogoproto.castrepeated */ - ".gogoproto.castrepeated"?: (string|null); - - /** FieldOptions .cosmos_proto.accepts_interface */ - ".cosmos_proto.accepts_interface"?: (string|null); - - /** FieldOptions .cosmos_proto.scalar */ - ".cosmos_proto.scalar"?: (string|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allow_alias */ - allow_alias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** EnumOptions .gogoproto.goproto_enum_prefix */ - ".gogoproto.goproto_enum_prefix"?: (boolean|null); - - /** EnumOptions .gogoproto.goproto_enum_stringer */ - ".gogoproto.goproto_enum_stringer"?: (boolean|null); - - /** EnumOptions .gogoproto.enum_stringer */ - ".gogoproto.enum_stringer"?: (boolean|null); - - /** EnumOptions .gogoproto.enum_customname */ - ".gogoproto.enum_customname"?: (string|null); - - /** EnumOptions .gogoproto.enumdecl */ - ".gogoproto.enumdecl"?: (boolean|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allow_alias. */ - public allow_alias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** EnumValueOptions .gogoproto.enumvalue_customname */ - ".gogoproto.enumvalue_customname"?: (string|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifier_value */ - identifier_value?: (string|null); - - /** UninterpretedOption positive_int_value */ - positive_int_value?: (Long|null); - - /** UninterpretedOption negative_int_value */ - negative_int_value?: (Long|null); - - /** UninterpretedOption double_value */ - double_value?: (number|null); - - /** UninterpretedOption string_value */ - string_value?: (Uint8Array|null); - - /** UninterpretedOption aggregate_value */ - aggregate_value?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifier_value. */ - public identifier_value: string; - - /** UninterpretedOption positive_int_value. */ - public positive_int_value: Long; - - /** UninterpretedOption negative_int_value. */ - public negative_int_value: Long; - - /** UninterpretedOption double_value. */ - public double_value: number; - - /** UninterpretedOption string_value. */ - public string_value: Uint8Array; - - /** UninterpretedOption aggregate_value. */ - public aggregate_value: string; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart name_part */ - name_part: string; - - /** NamePart is_extension */ - is_extension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart name_part. */ - public name_part: string; - - /** NamePart is_extension. */ - public is_extension: boolean; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leading_comments */ - leading_comments?: (string|null); - - /** Location trailing_comments */ - trailing_comments?: (string|null); - - /** Location leading_detached_comments */ - leading_detached_comments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leading_comments. */ - public leading_comments: string; - - /** Location trailing_comments. */ - public trailing_comments: string; - - /** Location leading_detached_comments. */ - public leading_detached_comments: string[]; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation source_file */ - source_file?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation source_file. */ - public source_file: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (Long|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: Long; - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (Long|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: Long; - - /** Duration nanos. */ - public nanos: number; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fully_decode_reserved_expansion */ - fully_decode_reserved_expansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fully_decode_reserved_expansion. */ - public fully_decode_reserved_expansion: boolean; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule response_body */ - response_body?: (string|null); - - /** HttpRule additional_bindings */ - additional_bindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule response_body. */ - public response_body: string; - - /** HttpRule additional_bindings. */ - public additional_bindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } -} diff --git a/src/generated/admin/proto.js b/src/generated/admin/proto.js deleted file mode 100644 index 1984f52f..00000000 --- a/src/generated/admin/proto.js +++ /dev/null @@ -1,16676 +0,0 @@ -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -import * as $protobuf from "protobufjs/minimal"; - -// Common aliases -const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - -// Exported root namespace -const $root = $protobuf.roots["@cosmos-client/ibc"] || ($protobuf.roots["@cosmos-client/ibc"] = {}); - -export const cosmos = $root.cosmos = (() => { - - /** - * Namespace cosmos. - * @exports cosmos - * @namespace - */ - const cosmos = {}; - - cosmos.adminmodule = (function() { - - /** - * Namespace adminmodule. - * @memberof cosmos - * @namespace - */ - const adminmodule = {}; - - adminmodule.adminmodule = (function() { - - /** - * Namespace adminmodule. - * @memberof cosmos.adminmodule - * @namespace - */ - const adminmodule = {}; - - adminmodule.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#deleteAdmin}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef DeleteAdminCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} [response] MsgDeleteAdminResponse - */ - - /** - * Calls DeleteAdmin. - * @function deleteAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} request MsgDeleteAdmin message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.DeleteAdminCallback} callback Node-style callback called with the error, if any, and MsgDeleteAdminResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.deleteAdmin = function deleteAdmin(request, callback) { - return this.rpcCall(deleteAdmin, $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin, $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse, request, callback); - }, "name", { value: "DeleteAdmin" }); - - /** - * Calls DeleteAdmin. - * @function deleteAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} request MsgDeleteAdmin message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#addAdmin}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef AddAdminCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} [response] MsgAddAdminResponse - */ - - /** - * Calls AddAdmin. - * @function addAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} request MsgAddAdmin message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.AddAdminCallback} callback Node-style callback called with the error, if any, and MsgAddAdminResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.addAdmin = function addAdmin(request, callback) { - return this.rpcCall(addAdmin, $root.cosmos.adminmodule.adminmodule.MsgAddAdmin, $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse, request, callback); - }, "name", { value: "AddAdmin" }); - - /** - * Calls AddAdmin. - * @function addAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} request MsgAddAdmin message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#submitProposal}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef SubmitProposalCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} [response] MsgSubmitProposalResponse - */ - - /** - * Calls SubmitProposal. - * @function submitProposal - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} request MsgSubmitProposal message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.SubmitProposalCallback} callback Node-style callback called with the error, if any, and MsgSubmitProposalResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.submitProposal = function submitProposal(request, callback) { - return this.rpcCall(submitProposal, $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal, $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse, request, callback); - }, "name", { value: "SubmitProposal" }); - - /** - * Calls SubmitProposal. - * @function submitProposal - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} request MsgSubmitProposal message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - adminmodule.MsgDeleteAdmin = (function() { - - /** - * Properties of a MsgDeleteAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgDeleteAdmin - * @property {string|null} [creator] MsgDeleteAdmin creator - * @property {string|null} [admin] MsgDeleteAdmin admin - */ - - /** - * Constructs a new MsgDeleteAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgDeleteAdmin. - * @implements IMsgDeleteAdmin - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin=} [properties] Properties to set - */ - function MsgDeleteAdmin(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgDeleteAdmin creator. - * @member {string} creator - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - */ - MsgDeleteAdmin.prototype.creator = ""; - - /** - * MsgDeleteAdmin admin. - * @member {string} admin - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - */ - MsgDeleteAdmin.prototype.admin = ""; - - /** - * Encodes the specified MsgDeleteAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} message MsgDeleteAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdmin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.admin); - return writer; - }; - - /** - * Encodes the specified MsgDeleteAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} message MsgDeleteAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdmin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdmin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdmin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeleteAdmin message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeleteAdmin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.admin != null && message.hasOwnProperty("admin")) - if (!$util.isString(message.admin)) - return "admin: string expected"; - return null; - }; - - /** - * Creates a MsgDeleteAdmin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - */ - MsgDeleteAdmin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin(); - if (object.creator != null) - message.creator = String(object.creator); - if (object.admin != null) - message.admin = String(object.admin); - return message; - }; - - /** - * Creates a plain object from a MsgDeleteAdmin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} message MsgDeleteAdmin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeleteAdmin.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.creator = ""; - object.admin = ""; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.admin != null && message.hasOwnProperty("admin")) - object.admin = message.admin; - return object; - }; - - /** - * Converts this MsgDeleteAdmin to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - * @returns {Object.} JSON object - */ - MsgDeleteAdmin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeleteAdmin; - })(); - - adminmodule.MsgDeleteAdminResponse = (function() { - - /** - * Properties of a MsgDeleteAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgDeleteAdminResponse - */ - - /** - * Constructs a new MsgDeleteAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgDeleteAdminResponse. - * @implements IMsgDeleteAdminResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse=} [properties] Properties to set - */ - function MsgDeleteAdminResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgDeleteAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse} message MsgDeleteAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdminResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgDeleteAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse} message MsgDeleteAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdminResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdminResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdminResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeleteAdminResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeleteAdminResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgDeleteAdminResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - */ - MsgDeleteAdminResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse) - return object; - return new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse(); - }; - - /** - * Creates a plain object from a MsgDeleteAdminResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} message MsgDeleteAdminResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeleteAdminResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgDeleteAdminResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @instance - * @returns {Object.} JSON object - */ - MsgDeleteAdminResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeleteAdminResponse; - })(); - - adminmodule.MsgAddAdmin = (function() { - - /** - * Properties of a MsgAddAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgAddAdmin - * @property {string|null} [creator] MsgAddAdmin creator - * @property {string|null} [admin] MsgAddAdmin admin - */ - - /** - * Constructs a new MsgAddAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgAddAdmin. - * @implements IMsgAddAdmin - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin=} [properties] Properties to set - */ - function MsgAddAdmin(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgAddAdmin creator. - * @member {string} creator - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - */ - MsgAddAdmin.prototype.creator = ""; - - /** - * MsgAddAdmin admin. - * @member {string} admin - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - */ - MsgAddAdmin.prototype.admin = ""; - - /** - * Encodes the specified MsgAddAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} message MsgAddAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdmin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.admin); - return writer; - }; - - /** - * Encodes the specified MsgAddAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} message MsgAddAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdmin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdmin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdmin(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdmin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAddAdmin message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAddAdmin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.admin != null && message.hasOwnProperty("admin")) - if (!$util.isString(message.admin)) - return "admin: string expected"; - return null; - }; - - /** - * Creates a MsgAddAdmin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - */ - MsgAddAdmin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgAddAdmin) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdmin(); - if (object.creator != null) - message.creator = String(object.creator); - if (object.admin != null) - message.admin = String(object.admin); - return message; - }; - - /** - * Creates a plain object from a MsgAddAdmin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.MsgAddAdmin} message MsgAddAdmin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAddAdmin.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.creator = ""; - object.admin = ""; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.admin != null && message.hasOwnProperty("admin")) - object.admin = message.admin; - return object; - }; - - /** - * Converts this MsgAddAdmin to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - * @returns {Object.} JSON object - */ - MsgAddAdmin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAddAdmin; - })(); - - adminmodule.MsgAddAdminResponse = (function() { - - /** - * Properties of a MsgAddAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgAddAdminResponse - */ - - /** - * Constructs a new MsgAddAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgAddAdminResponse. - * @implements IMsgAddAdminResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse=} [properties] Properties to set - */ - function MsgAddAdminResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgAddAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse} message MsgAddAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdminResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgAddAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse} message MsgAddAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdminResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdminResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdminResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAddAdminResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAddAdminResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgAddAdminResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - */ - MsgAddAdminResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse) - return object; - return new $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse(); - }; - - /** - * Creates a plain object from a MsgAddAdminResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} message MsgAddAdminResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAddAdminResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgAddAdminResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @instance - * @returns {Object.} JSON object - */ - MsgAddAdminResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAddAdminResponse; - })(); - - adminmodule.MsgSubmitProposal = (function() { - - /** - * Properties of a MsgSubmitProposal. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgSubmitProposal - * @property {google.protobuf.IAny|null} [content] MsgSubmitProposal content - * @property {string|null} [proposer] MsgSubmitProposal proposer - */ - - /** - * Constructs a new MsgSubmitProposal. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgSubmitProposal. - * @implements IMsgSubmitProposal - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal=} [properties] Properties to set - */ - function MsgSubmitProposal(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitProposal content. - * @member {google.protobuf.IAny|null|undefined} content - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - */ - MsgSubmitProposal.prototype.content = null; - - /** - * MsgSubmitProposal proposer. - * @member {string} proposer - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - */ - MsgSubmitProposal.prototype.proposer = ""; - - /** - * Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.proposer); - return writer; - }; - - /** - * Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.proposer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitProposal message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) { - let error = $root.google.protobuf.Any.verify(message.content); - if (error) - return "content." + error; - } - if (message.proposer != null && message.hasOwnProperty("proposer")) - if (!$util.isString(message.proposer)) - return "proposer: string expected"; - return null; - }; - - /** - * Creates a MsgSubmitProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - */ - MsgSubmitProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal(); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".cosmos.adminmodule.adminmodule.MsgSubmitProposal.content: object expected"); - message.content = $root.google.protobuf.Any.fromObject(object.content); - } - if (object.proposer != null) - message.proposer = String(object.proposer); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposal} message MsgSubmitProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.content = null; - object.proposer = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.protobuf.Any.toObject(message.content, options); - if (message.proposer != null && message.hasOwnProperty("proposer")) - object.proposer = message.proposer; - return object; - }; - - /** - * Converts this MsgSubmitProposal to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitProposal; - })(); - - adminmodule.MsgSubmitProposalResponse = (function() { - - /** - * Properties of a MsgSubmitProposalResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgSubmitProposalResponse - * @property {Long|null} [proposal_id] MsgSubmitProposalResponse proposal_id - */ - - /** - * Constructs a new MsgSubmitProposalResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgSubmitProposalResponse. - * @implements IMsgSubmitProposalResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse=} [properties] Properties to set - */ - function MsgSubmitProposalResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitProposalResponse proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @instance - */ - MsgSubmitProposalResponse.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposalResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - return writer; - }; - - /** - * Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposalResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposalResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposalResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitProposalResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitProposalResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - return null; - }; - - /** - * Creates a MsgSubmitProposalResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - */ - MsgSubmitProposalResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitProposalResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} message MsgSubmitProposalResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitProposalResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - return object; - }; - - /** - * Converts this MsgSubmitProposalResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitProposalResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitProposalResponse; - })(); - - adminmodule.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#admins}. - * @memberof cosmos.adminmodule.adminmodule.Query - * @typedef AdminsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.QueryAdminsResponse} [response] QueryAdminsResponse - */ - - /** - * Calls Admins. - * @function admins - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} request QueryAdminsRequest message or plain object - * @param {cosmos.adminmodule.adminmodule.Query.AdminsCallback} callback Node-style callback called with the error, if any, and QueryAdminsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.admins = function admins(request, callback) { - return this.rpcCall(admins, $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest, $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse, request, callback); - }, "name", { value: "Admins" }); - - /** - * Calls Admins. - * @function admins - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} request QueryAdminsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#archivedProposals}. - * @memberof cosmos.adminmodule.adminmodule.Query - * @typedef ArchivedProposalsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} [response] QueryArchivedProposalsResponse - */ - - /** - * Calls ArchivedProposals. - * @function archivedProposals - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} request QueryArchivedProposalsRequest message or plain object - * @param {cosmos.adminmodule.adminmodule.Query.ArchivedProposalsCallback} callback Node-style callback called with the error, if any, and QueryArchivedProposalsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.archivedProposals = function archivedProposals(request, callback) { - return this.rpcCall(archivedProposals, $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest, $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse, request, callback); - }, "name", { value: "ArchivedProposals" }); - - /** - * Calls ArchivedProposals. - * @function archivedProposals - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} request QueryArchivedProposalsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - adminmodule.QueryAdminsRequest = (function() { - - /** - * Properties of a QueryAdminsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryAdminsRequest - */ - - /** - * Constructs a new QueryAdminsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryAdminsRequest. - * @implements IQueryAdminsRequest - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest=} [properties] Properties to set - */ - function QueryAdminsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryAdminsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} message QueryAdminsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryAdminsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} message QueryAdminsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdminsRequest message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdminsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryAdminsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - */ - QueryAdminsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest) - return object; - return new $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest(); - }; - - /** - * Creates a plain object from a QueryAdminsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.QueryAdminsRequest} message QueryAdminsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdminsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryAdminsRequest to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryAdminsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryAdminsRequest; - })(); - - adminmodule.QueryAdminsResponse = (function() { - - /** - * Properties of a QueryAdminsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryAdminsResponse - * @property {Array.|null} [admins] QueryAdminsResponse admins - */ - - /** - * Constructs a new QueryAdminsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryAdminsResponse. - * @implements IQueryAdminsResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse=} [properties] Properties to set - */ - function QueryAdminsResponse(properties) { - this.admins = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryAdminsResponse admins. - * @member {Array.} admins - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @instance - */ - QueryAdminsResponse.prototype.admins = $util.emptyArray; - - /** - * Encodes the specified QueryAdminsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse} message QueryAdminsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.admins != null && message.admins.length) - for (let i = 0; i < message.admins.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.admins[i]); - return writer; - }; - - /** - * Encodes the specified QueryAdminsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse} message QueryAdminsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.admins && message.admins.length)) - message.admins = []; - message.admins.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdminsResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdminsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.admins != null && message.hasOwnProperty("admins")) { - if (!Array.isArray(message.admins)) - return "admins: array expected"; - for (let i = 0; i < message.admins.length; ++i) - if (!$util.isString(message.admins[i])) - return "admins: string[] expected"; - } - return null; - }; - - /** - * Creates a QueryAdminsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - */ - QueryAdminsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse(); - if (object.admins) { - if (!Array.isArray(object.admins)) - throw TypeError(".cosmos.adminmodule.adminmodule.QueryAdminsResponse.admins: array expected"); - message.admins = []; - for (let i = 0; i < object.admins.length; ++i) - message.admins[i] = String(object.admins[i]); - } - return message; - }; - - /** - * Creates a plain object from a QueryAdminsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.QueryAdminsResponse} message QueryAdminsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdminsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.admins = []; - if (message.admins && message.admins.length) { - object.admins = []; - for (let j = 0; j < message.admins.length; ++j) - object.admins[j] = message.admins[j]; - } - return object; - }; - - /** - * Converts this QueryAdminsResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryAdminsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryAdminsResponse; - })(); - - adminmodule.QueryArchivedProposalsRequest = (function() { - - /** - * Properties of a QueryArchivedProposalsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryArchivedProposalsRequest - */ - - /** - * Constructs a new QueryArchivedProposalsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryArchivedProposalsRequest. - * @implements IQueryArchivedProposalsRequest - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest=} [properties] Properties to set - */ - function QueryArchivedProposalsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryArchivedProposalsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} message QueryArchivedProposalsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryArchivedProposalsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} message QueryArchivedProposalsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryArchivedProposalsRequest message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryArchivedProposalsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryArchivedProposalsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - */ - QueryArchivedProposalsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest) - return object; - return new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest(); - }; - - /** - * Creates a plain object from a QueryArchivedProposalsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} message QueryArchivedProposalsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryArchivedProposalsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryArchivedProposalsRequest to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryArchivedProposalsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryArchivedProposalsRequest; - })(); - - adminmodule.QueryArchivedProposalsResponse = (function() { - - /** - * Properties of a QueryArchivedProposalsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryArchivedProposalsResponse - * @property {Array.|null} [proposals] QueryArchivedProposalsResponse proposals - */ - - /** - * Constructs a new QueryArchivedProposalsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryArchivedProposalsResponse. - * @implements IQueryArchivedProposalsResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse=} [properties] Properties to set - */ - function QueryArchivedProposalsResponse(properties) { - this.proposals = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryArchivedProposalsResponse proposals. - * @member {Array.} proposals - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @instance - */ - QueryArchivedProposalsResponse.prototype.proposals = $util.emptyArray; - - /** - * Encodes the specified QueryArchivedProposalsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse} message QueryArchivedProposalsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposals != null && message.proposals.length) - for (let i = 0; i < message.proposals.length; ++i) - $root.cosmos.gov.v1beta1.Proposal.encode(message.proposals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryArchivedProposalsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse} message QueryArchivedProposalsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.proposals && message.proposals.length)) - message.proposals = []; - message.proposals.push($root.cosmos.gov.v1beta1.Proposal.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryArchivedProposalsResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryArchivedProposalsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposals != null && message.hasOwnProperty("proposals")) { - if (!Array.isArray(message.proposals)) - return "proposals: array expected"; - for (let i = 0; i < message.proposals.length; ++i) { - let error = $root.cosmos.gov.v1beta1.Proposal.verify(message.proposals[i]); - if (error) - return "proposals." + error; - } - } - return null; - }; - - /** - * Creates a QueryArchivedProposalsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - */ - QueryArchivedProposalsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse(); - if (object.proposals) { - if (!Array.isArray(object.proposals)) - throw TypeError(".cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.proposals: array expected"); - message.proposals = []; - for (let i = 0; i < object.proposals.length; ++i) { - if (typeof object.proposals[i] !== "object") - throw TypeError(".cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.proposals: object expected"); - message.proposals[i] = $root.cosmos.gov.v1beta1.Proposal.fromObject(object.proposals[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryArchivedProposalsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} message QueryArchivedProposalsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryArchivedProposalsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.proposals = []; - if (message.proposals && message.proposals.length) { - object.proposals = []; - for (let j = 0; j < message.proposals.length; ++j) - object.proposals[j] = $root.cosmos.gov.v1beta1.Proposal.toObject(message.proposals[j], options); - } - return object; - }; - - /** - * Converts this QueryArchivedProposalsResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryArchivedProposalsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryArchivedProposalsResponse; - })(); - - adminmodule.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof cosmos.adminmodule.adminmodule - * @interface IGenesisState - * @property {Array.|null} [admins] GenesisState admins - */ - - /** - * Constructs a new GenesisState. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {cosmos.adminmodule.adminmodule.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.admins = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState admins. - * @member {Array.} admins - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @instance - */ - GenesisState.prototype.admins = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.admins != null && message.admins.length) - for (let i = 0; i < message.admins.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.admins[i]); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.GenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.admins && message.admins.length)) - message.admins = []; - message.admins.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.admins != null && message.hasOwnProperty("admins")) { - if (!Array.isArray(message.admins)) - return "admins: array expected"; - for (let i = 0; i < message.admins.length; ++i) - if (!$util.isString(message.admins[i])) - return "admins: string[] expected"; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.GenesisState) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.GenesisState(); - if (object.admins) { - if (!Array.isArray(object.admins)) - throw TypeError(".cosmos.adminmodule.adminmodule.GenesisState.admins: array expected"); - message.admins = []; - for (let i = 0; i < object.admins.length; ++i) - message.admins[i] = String(object.admins[i]); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.admins = []; - if (message.admins && message.admins.length) { - object.admins = []; - for (let j = 0; j < message.admins.length; ++j) - object.admins[j] = message.admins[j]; - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return adminmodule; - })(); - - return adminmodule; - })(); - - cosmos.gov = (function() { - - /** - * Namespace gov. - * @memberof cosmos - * @namespace - */ - const gov = {}; - - gov.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.gov - * @namespace - */ - const v1beta1 = {}; - - /** - * VoteOption enum. - * @name cosmos.gov.v1beta1.VoteOption - * @enum {number} - * @property {number} VOTE_OPTION_UNSPECIFIED=0 VOTE_OPTION_UNSPECIFIED value - * @property {number} VOTE_OPTION_YES=1 VOTE_OPTION_YES value - * @property {number} VOTE_OPTION_ABSTAIN=2 VOTE_OPTION_ABSTAIN value - * @property {number} VOTE_OPTION_NO=3 VOTE_OPTION_NO value - * @property {number} VOTE_OPTION_NO_WITH_VETO=4 VOTE_OPTION_NO_WITH_VETO value - */ - v1beta1.VoteOption = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VOTE_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "VOTE_OPTION_YES"] = 1; - values[valuesById[2] = "VOTE_OPTION_ABSTAIN"] = 2; - values[valuesById[3] = "VOTE_OPTION_NO"] = 3; - values[valuesById[4] = "VOTE_OPTION_NO_WITH_VETO"] = 4; - return values; - })(); - - v1beta1.WeightedVoteOption = (function() { - - /** - * Properties of a WeightedVoteOption. - * @memberof cosmos.gov.v1beta1 - * @interface IWeightedVoteOption - * @property {cosmos.gov.v1beta1.VoteOption|null} [option] WeightedVoteOption option - * @property {string|null} [weight] WeightedVoteOption weight - */ - - /** - * Constructs a new WeightedVoteOption. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a WeightedVoteOption. - * @implements IWeightedVoteOption - * @constructor - * @param {cosmos.gov.v1beta1.IWeightedVoteOption=} [properties] Properties to set - */ - function WeightedVoteOption(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WeightedVoteOption option. - * @member {cosmos.gov.v1beta1.VoteOption} option - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - */ - WeightedVoteOption.prototype.option = 0; - - /** - * WeightedVoteOption weight. - * @member {string} weight - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - */ - WeightedVoteOption.prototype.weight = ""; - - /** - * Encodes the specified WeightedVoteOption message. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.IWeightedVoteOption} message WeightedVoteOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedVoteOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.option != null && Object.hasOwnProperty.call(message, "option")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.option); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.weight); - return writer; - }; - - /** - * Encodes the specified WeightedVoteOption message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.IWeightedVoteOption} message WeightedVoteOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedVoteOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedVoteOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.WeightedVoteOption(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.option = reader.int32(); - break; - case 2: - message.weight = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedVoteOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WeightedVoteOption message. - * @function verify - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeightedVoteOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.option != null && message.hasOwnProperty("option")) - switch (message.option) { - default: - return "option: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.weight != null && message.hasOwnProperty("weight")) - if (!$util.isString(message.weight)) - return "weight: string expected"; - return null; - }; - - /** - * Creates a WeightedVoteOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - */ - WeightedVoteOption.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.WeightedVoteOption) - return object; - let message = new $root.cosmos.gov.v1beta1.WeightedVoteOption(); - switch (object.option) { - case "VOTE_OPTION_UNSPECIFIED": - case 0: - message.option = 0; - break; - case "VOTE_OPTION_YES": - case 1: - message.option = 1; - break; - case "VOTE_OPTION_ABSTAIN": - case 2: - message.option = 2; - break; - case "VOTE_OPTION_NO": - case 3: - message.option = 3; - break; - case "VOTE_OPTION_NO_WITH_VETO": - case 4: - message.option = 4; - break; - } - if (object.weight != null) - message.weight = String(object.weight); - return message; - }; - - /** - * Creates a plain object from a WeightedVoteOption message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.WeightedVoteOption} message WeightedVoteOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeightedVoteOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; - object.weight = ""; - } - if (message.option != null && message.hasOwnProperty("option")) - object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; - if (message.weight != null && message.hasOwnProperty("weight")) - object.weight = message.weight; - return object; - }; - - /** - * Converts this WeightedVoteOption to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - * @returns {Object.} JSON object - */ - WeightedVoteOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WeightedVoteOption; - })(); - - v1beta1.TextProposal = (function() { - - /** - * Properties of a TextProposal. - * @memberof cosmos.gov.v1beta1 - * @interface ITextProposal - * @property {string|null} [title] TextProposal title - * @property {string|null} [description] TextProposal description - */ - - /** - * Constructs a new TextProposal. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TextProposal. - * @implements ITextProposal - * @constructor - * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set - */ - function TextProposal(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TextProposal title. - * @member {string} title - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - */ - TextProposal.prototype.title = ""; - - /** - * TextProposal description. - * @member {string} description - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - */ - TextProposal.prototype.description = ""; - - /** - * Encodes the specified TextProposal message. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified TextProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TextProposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextProposal message. - * @function verify - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a TextProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - */ - TextProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TextProposal) - return object; - let message = new $root.cosmos.gov.v1beta1.TextProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a TextProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.TextProposal} message TextProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this TextProposal to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - * @returns {Object.} JSON object - */ - TextProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TextProposal; - })(); - - v1beta1.Deposit = (function() { - - /** - * Properties of a Deposit. - * @memberof cosmos.gov.v1beta1 - * @interface IDeposit - * @property {Long|null} [proposal_id] Deposit proposal_id - * @property {string|null} [depositor] Deposit depositor - * @property {Array.|null} [amount] Deposit amount - */ - - /** - * Constructs a new Deposit. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Deposit. - * @implements IDeposit - * @constructor - * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set - */ - function Deposit(properties) { - this.amount = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Deposit proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Deposit depositor. - * @member {string} depositor - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.depositor = ""; - - /** - * Deposit amount. - * @member {Array.} amount - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.amount = $util.emptyArray; - - /** - * Encodes the specified Deposit message. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deposit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); - if (message.amount != null && message.amount.length) - for (let i = 0; i < message.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Deposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deposit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Deposit message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deposit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Deposit(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.depositor = reader.string(); - break; - case 3: - if (!(message.amount && message.amount.length)) - message.amount = []; - message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Deposit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deposit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Deposit message. - * @function verify - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Deposit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.depositor != null && message.hasOwnProperty("depositor")) - if (!$util.isString(message.depositor)) - return "depositor: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - if (!Array.isArray(message.amount)) - return "amount: array expected"; - for (let i = 0; i < message.amount.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); - if (error) - return "amount." + error; - } - } - return null; - }; - - /** - * Creates a Deposit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - */ - Deposit.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Deposit) - return object; - let message = new $root.cosmos.gov.v1beta1.Deposit(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.depositor != null) - message.depositor = String(object.depositor); - if (object.amount) { - if (!Array.isArray(object.amount)) - throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: array expected"); - message.amount = []; - for (let i = 0; i < object.amount.length; ++i) { - if (typeof object.amount[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: object expected"); - message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Deposit message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.Deposit} message Deposit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Deposit.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.amount = []; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.depositor = ""; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.depositor != null && message.hasOwnProperty("depositor")) - object.depositor = message.depositor; - if (message.amount && message.amount.length) { - object.amount = []; - for (let j = 0; j < message.amount.length; ++j) - object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); - } - return object; - }; - - /** - * Converts this Deposit to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - * @returns {Object.} JSON object - */ - Deposit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Deposit; - })(); - - v1beta1.Proposal = (function() { - - /** - * Properties of a Proposal. - * @memberof cosmos.gov.v1beta1 - * @interface IProposal - * @property {Long|null} [proposal_id] Proposal proposal_id - * @property {google.protobuf.IAny|null} [content] Proposal content - * @property {cosmos.gov.v1beta1.ProposalStatus|null} [status] Proposal status - * @property {cosmos.gov.v1beta1.ITallyResult|null} [final_tally_result] Proposal final_tally_result - * @property {google.protobuf.ITimestamp|null} [submit_time] Proposal submit_time - * @property {google.protobuf.ITimestamp|null} [deposit_end_time] Proposal deposit_end_time - * @property {Array.|null} [total_deposit] Proposal total_deposit - * @property {google.protobuf.ITimestamp|null} [voting_start_time] Proposal voting_start_time - * @property {google.protobuf.ITimestamp|null} [voting_end_time] Proposal voting_end_time - */ - - /** - * Constructs a new Proposal. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Proposal. - * @implements IProposal - * @constructor - * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set - */ - function Proposal(properties) { - this.total_deposit = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proposal proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Proposal content. - * @member {google.protobuf.IAny|null|undefined} content - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.content = null; - - /** - * Proposal status. - * @member {cosmos.gov.v1beta1.ProposalStatus} status - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.status = 0; - - /** - * Proposal final_tally_result. - * @member {cosmos.gov.v1beta1.ITallyResult|null|undefined} final_tally_result - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.final_tally_result = null; - - /** - * Proposal submit_time. - * @member {google.protobuf.ITimestamp|null|undefined} submit_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.submit_time = null; - - /** - * Proposal deposit_end_time. - * @member {google.protobuf.ITimestamp|null|undefined} deposit_end_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.deposit_end_time = null; - - /** - * Proposal total_deposit. - * @member {Array.} total_deposit - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.total_deposit = $util.emptyArray; - - /** - * Proposal voting_start_time. - * @member {google.protobuf.ITimestamp|null|undefined} voting_start_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.voting_start_time = null; - - /** - * Proposal voting_end_time. - * @member {google.protobuf.ITimestamp|null|undefined} voting_end_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.voting_end_time = null; - - /** - * Encodes the specified Proposal message. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); - if (message.final_tally_result != null && Object.hasOwnProperty.call(message, "final_tally_result")) - $root.cosmos.gov.v1beta1.TallyResult.encode(message.final_tally_result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.submit_time != null && Object.hasOwnProperty.call(message, "submit_time")) - $root.google.protobuf.Timestamp.encode(message.submit_time, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deposit_end_time != null && Object.hasOwnProperty.call(message, "deposit_end_time")) - $root.google.protobuf.Timestamp.encode(message.deposit_end_time, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.total_deposit != null && message.total_deposit.length) - for (let i = 0; i < message.total_deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.total_deposit[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.voting_start_time != null && Object.hasOwnProperty.call(message, "voting_start_time")) - $root.google.protobuf.Timestamp.encode(message.voting_start_time, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.voting_end_time != null && Object.hasOwnProperty.call(message, "voting_end_time")) - $root.google.protobuf.Timestamp.encode(message.voting_end_time, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Proposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.status = reader.int32(); - break; - case 4: - message.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.decode(reader, reader.uint32()); - break; - case 5: - message.submit_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.deposit_end_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - if (!(message.total_deposit && message.total_deposit.length)) - message.total_deposit = []; - message.total_deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 8: - message.voting_start_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 9: - message.voting_end_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proposal message. - * @function verify - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.content != null && message.hasOwnProperty("content")) { - let error = $root.google.protobuf.Any.verify(message.content); - if (error) - return "content." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.final_tally_result != null && message.hasOwnProperty("final_tally_result")) { - let error = $root.cosmos.gov.v1beta1.TallyResult.verify(message.final_tally_result); - if (error) - return "final_tally_result." + error; - } - if (message.submit_time != null && message.hasOwnProperty("submit_time")) { - let error = $root.google.protobuf.Timestamp.verify(message.submit_time); - if (error) - return "submit_time." + error; - } - if (message.deposit_end_time != null && message.hasOwnProperty("deposit_end_time")) { - let error = $root.google.protobuf.Timestamp.verify(message.deposit_end_time); - if (error) - return "deposit_end_time." + error; - } - if (message.total_deposit != null && message.hasOwnProperty("total_deposit")) { - if (!Array.isArray(message.total_deposit)) - return "total_deposit: array expected"; - for (let i = 0; i < message.total_deposit.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.total_deposit[i]); - if (error) - return "total_deposit." + error; - } - } - if (message.voting_start_time != null && message.hasOwnProperty("voting_start_time")) { - let error = $root.google.protobuf.Timestamp.verify(message.voting_start_time); - if (error) - return "voting_start_time." + error; - } - if (message.voting_end_time != null && message.hasOwnProperty("voting_end_time")) { - let error = $root.google.protobuf.Timestamp.verify(message.voting_end_time); - if (error) - return "voting_end_time." + error; - } - return null; - }; - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - */ - Proposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Proposal) - return object; - let message = new $root.cosmos.gov.v1beta1.Proposal(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.content: object expected"); - message.content = $root.google.protobuf.Any.fromObject(object.content); - } - switch (object.status) { - case "PROPOSAL_STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "PROPOSAL_STATUS_DEPOSIT_PERIOD": - case 1: - message.status = 1; - break; - case "PROPOSAL_STATUS_VOTING_PERIOD": - case 2: - message.status = 2; - break; - case "PROPOSAL_STATUS_PASSED": - case 3: - message.status = 3; - break; - case "PROPOSAL_STATUS_REJECTED": - case 4: - message.status = 4; - break; - case "PROPOSAL_STATUS_FAILED": - case 5: - message.status = 5; - break; - } - if (object.final_tally_result != null) { - if (typeof object.final_tally_result !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.final_tally_result: object expected"); - message.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.fromObject(object.final_tally_result); - } - if (object.submit_time != null) { - if (typeof object.submit_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.submit_time: object expected"); - message.submit_time = $root.google.protobuf.Timestamp.fromObject(object.submit_time); - } - if (object.deposit_end_time != null) { - if (typeof object.deposit_end_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.deposit_end_time: object expected"); - message.deposit_end_time = $root.google.protobuf.Timestamp.fromObject(object.deposit_end_time); - } - if (object.total_deposit) { - if (!Array.isArray(object.total_deposit)) - throw TypeError(".cosmos.gov.v1beta1.Proposal.total_deposit: array expected"); - message.total_deposit = []; - for (let i = 0; i < object.total_deposit.length; ++i) { - if (typeof object.total_deposit[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.total_deposit: object expected"); - message.total_deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.total_deposit[i]); - } - } - if (object.voting_start_time != null) { - if (typeof object.voting_start_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.voting_start_time: object expected"); - message.voting_start_time = $root.google.protobuf.Timestamp.fromObject(object.voting_start_time); - } - if (object.voting_end_time != null) { - if (typeof object.voting_end_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.voting_end_time: object expected"); - message.voting_end_time = $root.google.protobuf.Timestamp.fromObject(object.voting_end_time); - } - return message; - }; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.Proposal} message Proposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.total_deposit = []; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.content = null; - object.status = options.enums === String ? "PROPOSAL_STATUS_UNSPECIFIED" : 0; - object.final_tally_result = null; - object.submit_time = null; - object.deposit_end_time = null; - object.voting_start_time = null; - object.voting_end_time = null; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.protobuf.Any.toObject(message.content, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.cosmos.gov.v1beta1.ProposalStatus[message.status] : message.status; - if (message.final_tally_result != null && message.hasOwnProperty("final_tally_result")) - object.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.toObject(message.final_tally_result, options); - if (message.submit_time != null && message.hasOwnProperty("submit_time")) - object.submit_time = $root.google.protobuf.Timestamp.toObject(message.submit_time, options); - if (message.deposit_end_time != null && message.hasOwnProperty("deposit_end_time")) - object.deposit_end_time = $root.google.protobuf.Timestamp.toObject(message.deposit_end_time, options); - if (message.total_deposit && message.total_deposit.length) { - object.total_deposit = []; - for (let j = 0; j < message.total_deposit.length; ++j) - object.total_deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.total_deposit[j], options); - } - if (message.voting_start_time != null && message.hasOwnProperty("voting_start_time")) - object.voting_start_time = $root.google.protobuf.Timestamp.toObject(message.voting_start_time, options); - if (message.voting_end_time != null && message.hasOwnProperty("voting_end_time")) - object.voting_end_time = $root.google.protobuf.Timestamp.toObject(message.voting_end_time, options); - return object; - }; - - /** - * Converts this Proposal to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - * @returns {Object.} JSON object - */ - Proposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proposal; - })(); - - /** - * ProposalStatus enum. - * @name cosmos.gov.v1beta1.ProposalStatus - * @enum {number} - * @property {number} PROPOSAL_STATUS_UNSPECIFIED=0 PROPOSAL_STATUS_UNSPECIFIED value - * @property {number} PROPOSAL_STATUS_DEPOSIT_PERIOD=1 PROPOSAL_STATUS_DEPOSIT_PERIOD value - * @property {number} PROPOSAL_STATUS_VOTING_PERIOD=2 PROPOSAL_STATUS_VOTING_PERIOD value - * @property {number} PROPOSAL_STATUS_PASSED=3 PROPOSAL_STATUS_PASSED value - * @property {number} PROPOSAL_STATUS_REJECTED=4 PROPOSAL_STATUS_REJECTED value - * @property {number} PROPOSAL_STATUS_FAILED=5 PROPOSAL_STATUS_FAILED value - */ - v1beta1.ProposalStatus = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROPOSAL_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROPOSAL_STATUS_DEPOSIT_PERIOD"] = 1; - values[valuesById[2] = "PROPOSAL_STATUS_VOTING_PERIOD"] = 2; - values[valuesById[3] = "PROPOSAL_STATUS_PASSED"] = 3; - values[valuesById[4] = "PROPOSAL_STATUS_REJECTED"] = 4; - values[valuesById[5] = "PROPOSAL_STATUS_FAILED"] = 5; - return values; - })(); - - v1beta1.TallyResult = (function() { - - /** - * Properties of a TallyResult. - * @memberof cosmos.gov.v1beta1 - * @interface ITallyResult - * @property {string|null} [yes] TallyResult yes - * @property {string|null} [abstain] TallyResult abstain - * @property {string|null} [no] TallyResult no - * @property {string|null} [no_with_veto] TallyResult no_with_veto - */ - - /** - * Constructs a new TallyResult. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TallyResult. - * @implements ITallyResult - * @constructor - * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set - */ - function TallyResult(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TallyResult yes. - * @member {string} yes - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.yes = ""; - - /** - * TallyResult abstain. - * @member {string} abstain - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.abstain = ""; - - /** - * TallyResult no. - * @member {string} no - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.no = ""; - - /** - * TallyResult no_with_veto. - * @member {string} no_with_veto - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.no_with_veto = ""; - - /** - * Encodes the specified TallyResult message. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.yes != null && Object.hasOwnProperty.call(message, "yes")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.yes); - if (message.abstain != null && Object.hasOwnProperty.call(message, "abstain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.abstain); - if (message.no != null && Object.hasOwnProperty.call(message, "no")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.no); - if (message.no_with_veto != null && Object.hasOwnProperty.call(message, "no_with_veto")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.no_with_veto); - return writer; - }; - - /** - * Encodes the specified TallyResult message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TallyResult message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyResult(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.yes = reader.string(); - break; - case 2: - message.abstain = reader.string(); - break; - case 3: - message.no = reader.string(); - break; - case 4: - message.no_with_veto = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TallyResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TallyResult message. - * @function verify - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TallyResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.yes != null && message.hasOwnProperty("yes")) - if (!$util.isString(message.yes)) - return "yes: string expected"; - if (message.abstain != null && message.hasOwnProperty("abstain")) - if (!$util.isString(message.abstain)) - return "abstain: string expected"; - if (message.no != null && message.hasOwnProperty("no")) - if (!$util.isString(message.no)) - return "no: string expected"; - if (message.no_with_veto != null && message.hasOwnProperty("no_with_veto")) - if (!$util.isString(message.no_with_veto)) - return "no_with_veto: string expected"; - return null; - }; - - /** - * Creates a TallyResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - */ - TallyResult.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TallyResult) - return object; - let message = new $root.cosmos.gov.v1beta1.TallyResult(); - if (object.yes != null) - message.yes = String(object.yes); - if (object.abstain != null) - message.abstain = String(object.abstain); - if (object.no != null) - message.no = String(object.no); - if (object.no_with_veto != null) - message.no_with_veto = String(object.no_with_veto); - return message; - }; - - /** - * Creates a plain object from a TallyResult message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.TallyResult} message TallyResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TallyResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.yes = ""; - object.abstain = ""; - object.no = ""; - object.no_with_veto = ""; - } - if (message.yes != null && message.hasOwnProperty("yes")) - object.yes = message.yes; - if (message.abstain != null && message.hasOwnProperty("abstain")) - object.abstain = message.abstain; - if (message.no != null && message.hasOwnProperty("no")) - object.no = message.no; - if (message.no_with_veto != null && message.hasOwnProperty("no_with_veto")) - object.no_with_veto = message.no_with_veto; - return object; - }; - - /** - * Converts this TallyResult to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - * @returns {Object.} JSON object - */ - TallyResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TallyResult; - })(); - - v1beta1.Vote = (function() { - - /** - * Properties of a Vote. - * @memberof cosmos.gov.v1beta1 - * @interface IVote - * @property {Long|null} [proposal_id] Vote proposal_id - * @property {string|null} [voter] Vote voter - * @property {cosmos.gov.v1beta1.VoteOption|null} [option] Vote option - * @property {Array.|null} [options] Vote options - */ - - /** - * Constructs a new Vote. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Vote. - * @implements IVote - * @constructor - * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set - */ - function Vote(properties) { - this.options = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Vote proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Vote voter. - * @member {string} voter - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.voter = ""; - - /** - * Vote option. - * @member {cosmos.gov.v1beta1.VoteOption} option - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.option = 0; - - /** - * Vote options. - * @member {Array.} options - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.options = $util.emptyArray; - - /** - * Encodes the specified Vote message. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); - if (message.option != null && Object.hasOwnProperty.call(message, "option")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); - if (message.options != null && message.options.length) - for (let i = 0; i < message.options.length; ++i) - $root.cosmos.gov.v1beta1.WeightedVoteOption.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Vote(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.option = reader.int32(); - break; - case 4: - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.cosmos.gov.v1beta1.WeightedVoteOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vote message. - * @function verify - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.voter != null && message.hasOwnProperty("voter")) - if (!$util.isString(message.voter)) - return "voter: string expected"; - if (message.option != null && message.hasOwnProperty("option")) - switch (message.option) { - default: - return "option: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.options != null && message.hasOwnProperty("options")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (let i = 0; i < message.options.length; ++i) { - let error = $root.cosmos.gov.v1beta1.WeightedVoteOption.verify(message.options[i]); - if (error) - return "options." + error; - } - } - return null; - }; - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Vote} Vote - */ - Vote.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Vote) - return object; - let message = new $root.cosmos.gov.v1beta1.Vote(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.voter != null) - message.voter = String(object.voter); - switch (object.option) { - case "VOTE_OPTION_UNSPECIFIED": - case 0: - message.option = 0; - break; - case "VOTE_OPTION_YES": - case 1: - message.option = 1; - break; - case "VOTE_OPTION_ABSTAIN": - case 2: - message.option = 2; - break; - case "VOTE_OPTION_NO": - case 3: - message.option = 3; - break; - case "VOTE_OPTION_NO_WITH_VETO": - case 4: - message.option = 4; - break; - } - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".cosmos.gov.v1beta1.Vote.options: array expected"); - message.options = []; - for (let i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Vote.options: object expected"); - message.options[i] = $root.cosmos.gov.v1beta1.WeightedVoteOption.fromObject(object.options[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.Vote} message Vote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vote.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.options = []; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.voter = ""; - object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.voter != null && message.hasOwnProperty("voter")) - object.voter = message.voter; - if (message.option != null && message.hasOwnProperty("option")) - object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; - if (message.options && message.options.length) { - object.options = []; - for (let j = 0; j < message.options.length; ++j) - object.options[j] = $root.cosmos.gov.v1beta1.WeightedVoteOption.toObject(message.options[j], options); - } - return object; - }; - - /** - * Converts this Vote to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Vote - * @instance - * @returns {Object.} JSON object - */ - Vote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Vote; - })(); - - v1beta1.DepositParams = (function() { - - /** - * Properties of a DepositParams. - * @memberof cosmos.gov.v1beta1 - * @interface IDepositParams - * @property {Array.|null} [min_deposit] DepositParams min_deposit - * @property {google.protobuf.IDuration|null} [max_deposit_period] DepositParams max_deposit_period - */ - - /** - * Constructs a new DepositParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a DepositParams. - * @implements IDepositParams - * @constructor - * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set - */ - function DepositParams(properties) { - this.min_deposit = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DepositParams min_deposit. - * @member {Array.} min_deposit - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - */ - DepositParams.prototype.min_deposit = $util.emptyArray; - - /** - * DepositParams max_deposit_period. - * @member {google.protobuf.IDuration|null|undefined} max_deposit_period - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - */ - DepositParams.prototype.max_deposit_period = null; - - /** - * Encodes the specified DepositParams message. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DepositParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.min_deposit != null && message.min_deposit.length) - for (let i = 0; i < message.min_deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.min_deposit[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.max_deposit_period != null && Object.hasOwnProperty.call(message, "max_deposit_period")) - $root.google.protobuf.Duration.encode(message.max_deposit_period, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DepositParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DepositParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DepositParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DepositParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.DepositParams(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.min_deposit && message.min_deposit.length)) - message.min_deposit = []; - message.min_deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 2: - message.max_deposit_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DepositParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DepositParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DepositParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DepositParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.min_deposit != null && message.hasOwnProperty("min_deposit")) { - if (!Array.isArray(message.min_deposit)) - return "min_deposit: array expected"; - for (let i = 0; i < message.min_deposit.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.min_deposit[i]); - if (error) - return "min_deposit." + error; - } - } - if (message.max_deposit_period != null && message.hasOwnProperty("max_deposit_period")) { - let error = $root.google.protobuf.Duration.verify(message.max_deposit_period); - if (error) - return "max_deposit_period." + error; - } - return null; - }; - - /** - * Creates a DepositParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - */ - DepositParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.DepositParams) - return object; - let message = new $root.cosmos.gov.v1beta1.DepositParams(); - if (object.min_deposit) { - if (!Array.isArray(object.min_deposit)) - throw TypeError(".cosmos.gov.v1beta1.DepositParams.min_deposit: array expected"); - message.min_deposit = []; - for (let i = 0; i < object.min_deposit.length; ++i) { - if (typeof object.min_deposit[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.DepositParams.min_deposit: object expected"); - message.min_deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.min_deposit[i]); - } - } - if (object.max_deposit_period != null) { - if (typeof object.max_deposit_period !== "object") - throw TypeError(".cosmos.gov.v1beta1.DepositParams.max_deposit_period: object expected"); - message.max_deposit_period = $root.google.protobuf.Duration.fromObject(object.max_deposit_period); - } - return message; - }; - - /** - * Creates a plain object from a DepositParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.DepositParams} message DepositParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DepositParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.min_deposit = []; - if (options.defaults) - object.max_deposit_period = null; - if (message.min_deposit && message.min_deposit.length) { - object.min_deposit = []; - for (let j = 0; j < message.min_deposit.length; ++j) - object.min_deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.min_deposit[j], options); - } - if (message.max_deposit_period != null && message.hasOwnProperty("max_deposit_period")) - object.max_deposit_period = $root.google.protobuf.Duration.toObject(message.max_deposit_period, options); - return object; - }; - - /** - * Converts this DepositParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - * @returns {Object.} JSON object - */ - DepositParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DepositParams; - })(); - - v1beta1.VotingParams = (function() { - - /** - * Properties of a VotingParams. - * @memberof cosmos.gov.v1beta1 - * @interface IVotingParams - * @property {google.protobuf.IDuration|null} [voting_period] VotingParams voting_period - */ - - /** - * Constructs a new VotingParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a VotingParams. - * @implements IVotingParams - * @constructor - * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set - */ - function VotingParams(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VotingParams voting_period. - * @member {google.protobuf.IDuration|null|undefined} voting_period - * @memberof cosmos.gov.v1beta1.VotingParams - * @instance - */ - VotingParams.prototype.voting_period = null; - - /** - * Encodes the specified VotingParams message. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VotingParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voting_period != null && Object.hasOwnProperty.call(message, "voting_period")) - $root.google.protobuf.Duration.encode(message.voting_period, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VotingParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VotingParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VotingParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VotingParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.VotingParams(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.voting_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VotingParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VotingParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VotingParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VotingParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voting_period != null && message.hasOwnProperty("voting_period")) { - let error = $root.google.protobuf.Duration.verify(message.voting_period); - if (error) - return "voting_period." + error; - } - return null; - }; - - /** - * Creates a VotingParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - */ - VotingParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.VotingParams) - return object; - let message = new $root.cosmos.gov.v1beta1.VotingParams(); - if (object.voting_period != null) { - if (typeof object.voting_period !== "object") - throw TypeError(".cosmos.gov.v1beta1.VotingParams.voting_period: object expected"); - message.voting_period = $root.google.protobuf.Duration.fromObject(object.voting_period); - } - return message; - }; - - /** - * Creates a plain object from a VotingParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.VotingParams} message VotingParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VotingParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.voting_period = null; - if (message.voting_period != null && message.hasOwnProperty("voting_period")) - object.voting_period = $root.google.protobuf.Duration.toObject(message.voting_period, options); - return object; - }; - - /** - * Converts this VotingParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.VotingParams - * @instance - * @returns {Object.} JSON object - */ - VotingParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VotingParams; - })(); - - v1beta1.TallyParams = (function() { - - /** - * Properties of a TallyParams. - * @memberof cosmos.gov.v1beta1 - * @interface ITallyParams - * @property {Uint8Array|null} [quorum] TallyParams quorum - * @property {Uint8Array|null} [threshold] TallyParams threshold - * @property {Uint8Array|null} [veto_threshold] TallyParams veto_threshold - */ - - /** - * Constructs a new TallyParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TallyParams. - * @implements ITallyParams - * @constructor - * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set - */ - function TallyParams(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TallyParams quorum. - * @member {Uint8Array} quorum - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.quorum = $util.newBuffer([]); - - /** - * TallyParams threshold. - * @member {Uint8Array} threshold - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.threshold = $util.newBuffer([]); - - /** - * TallyParams veto_threshold. - * @member {Uint8Array} veto_threshold - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.veto_threshold = $util.newBuffer([]); - - /** - * Encodes the specified TallyParams message. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quorum != null && Object.hasOwnProperty.call(message, "quorum")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorum); - if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.threshold); - if (message.veto_threshold != null && Object.hasOwnProperty.call(message, "veto_threshold")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.veto_threshold); - return writer; - }; - - /** - * Encodes the specified TallyParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TallyParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyParams(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quorum = reader.bytes(); - break; - case 2: - message.threshold = reader.bytes(); - break; - case 3: - message.veto_threshold = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TallyParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TallyParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TallyParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quorum != null && message.hasOwnProperty("quorum")) - if (!(message.quorum && typeof message.quorum.length === "number" || $util.isString(message.quorum))) - return "quorum: buffer expected"; - if (message.threshold != null && message.hasOwnProperty("threshold")) - if (!(message.threshold && typeof message.threshold.length === "number" || $util.isString(message.threshold))) - return "threshold: buffer expected"; - if (message.veto_threshold != null && message.hasOwnProperty("veto_threshold")) - if (!(message.veto_threshold && typeof message.veto_threshold.length === "number" || $util.isString(message.veto_threshold))) - return "veto_threshold: buffer expected"; - return null; - }; - - /** - * Creates a TallyParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - */ - TallyParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TallyParams) - return object; - let message = new $root.cosmos.gov.v1beta1.TallyParams(); - if (object.quorum != null) - if (typeof object.quorum === "string") - $util.base64.decode(object.quorum, message.quorum = $util.newBuffer($util.base64.length(object.quorum)), 0); - else if (object.quorum.length) - message.quorum = object.quorum; - if (object.threshold != null) - if (typeof object.threshold === "string") - $util.base64.decode(object.threshold, message.threshold = $util.newBuffer($util.base64.length(object.threshold)), 0); - else if (object.threshold.length) - message.threshold = object.threshold; - if (object.veto_threshold != null) - if (typeof object.veto_threshold === "string") - $util.base64.decode(object.veto_threshold, message.veto_threshold = $util.newBuffer($util.base64.length(object.veto_threshold)), 0); - else if (object.veto_threshold.length) - message.veto_threshold = object.veto_threshold; - return message; - }; - - /** - * Creates a plain object from a TallyParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.TallyParams} message TallyParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TallyParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.quorum = ""; - else { - object.quorum = []; - if (options.bytes !== Array) - object.quorum = $util.newBuffer(object.quorum); - } - if (options.bytes === String) - object.threshold = ""; - else { - object.threshold = []; - if (options.bytes !== Array) - object.threshold = $util.newBuffer(object.threshold); - } - if (options.bytes === String) - object.veto_threshold = ""; - else { - object.veto_threshold = []; - if (options.bytes !== Array) - object.veto_threshold = $util.newBuffer(object.veto_threshold); - } - } - if (message.quorum != null && message.hasOwnProperty("quorum")) - object.quorum = options.bytes === String ? $util.base64.encode(message.quorum, 0, message.quorum.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorum) : message.quorum; - if (message.threshold != null && message.hasOwnProperty("threshold")) - object.threshold = options.bytes === String ? $util.base64.encode(message.threshold, 0, message.threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.threshold) : message.threshold; - if (message.veto_threshold != null && message.hasOwnProperty("veto_threshold")) - object.veto_threshold = options.bytes === String ? $util.base64.encode(message.veto_threshold, 0, message.veto_threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.veto_threshold) : message.veto_threshold; - return object; - }; - - /** - * Converts this TallyParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - * @returns {Object.} JSON object - */ - TallyParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TallyParams; - })(); - - return v1beta1; - })(); - - return gov; - })(); - - cosmos.base = (function() { - - /** - * Namespace base. - * @memberof cosmos - * @namespace - */ - const base = {}; - - base.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base - * @namespace - */ - const v1beta1 = {}; - - v1beta1.Coin = (function() { - - /** - * Properties of a Coin. - * @memberof cosmos.base.v1beta1 - * @interface ICoin - * @property {string|null} [denom] Coin denom - * @property {string|null} [amount] Coin amount - */ - - /** - * Constructs a new Coin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a Coin. - * @implements ICoin - * @constructor - * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set - */ - function Coin(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Coin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.denom = ""; - - /** - * Coin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.amount = ""; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Coin message. - * @function verify - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Coin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.Coin} Coin - */ - Coin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.Coin) - return object; - let message = new $root.cosmos.base.v1beta1.Coin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.Coin} message Coin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Coin.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this Coin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.Coin - * @instance - * @returns {Object.} JSON object - */ - Coin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Coin; - })(); - - v1beta1.DecCoin = (function() { - - /** - * Properties of a DecCoin. - * @memberof cosmos.base.v1beta1 - * @interface IDecCoin - * @property {string|null} [denom] DecCoin denom - * @property {string|null} [amount] DecCoin amount - */ - - /** - * Constructs a new DecCoin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecCoin. - * @implements IDecCoin - * @constructor - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - */ - function DecCoin(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecCoin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.denom = ""; - - /** - * DecCoin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.amount = ""; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecCoin message. - * @function verify - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecCoin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - */ - DecCoin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecCoin) - return object; - let message = new $root.cosmos.base.v1beta1.DecCoin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.DecCoin} message DecCoin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecCoin.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this DecCoin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - * @returns {Object.} JSON object - */ - DecCoin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecCoin; - })(); - - v1beta1.IntProto = (function() { - - /** - * Properties of an IntProto. - * @memberof cosmos.base.v1beta1 - * @interface IIntProto - * @property {string|null} [int] IntProto int - */ - - /** - * Constructs a new IntProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents an IntProto. - * @implements IIntProto - * @constructor - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - */ - function IntProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IntProto int. - * @member {string} int - * @memberof cosmos.base.v1beta1.IntProto - * @instance - */ - IntProto.prototype.int = ""; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.int != null && Object.hasOwnProperty.call(message, "int")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); - return writer; - }; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntProto message. - * @function verify - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.int != null && message.hasOwnProperty("int")) - if (!$util.isString(message.int)) - return "int: string expected"; - return null; - }; - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.IntProto} IntProto - */ - IntProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.IntProto) - return object; - let message = new $root.cosmos.base.v1beta1.IntProto(); - if (object.int != null) - message.int = String(object.int); - return message; - }; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IntProto} message IntProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.int = ""; - if (message.int != null && message.hasOwnProperty("int")) - object.int = message.int; - return object; - }; - - /** - * Converts this IntProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.IntProto - * @instance - * @returns {Object.} JSON object - */ - IntProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IntProto; - })(); - - v1beta1.DecProto = (function() { - - /** - * Properties of a DecProto. - * @memberof cosmos.base.v1beta1 - * @interface IDecProto - * @property {string|null} [dec] DecProto dec - */ - - /** - * Constructs a new DecProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecProto. - * @implements IDecProto - * @constructor - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - */ - function DecProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecProto dec. - * @member {string} dec - * @memberof cosmos.base.v1beta1.DecProto - * @instance - */ - DecProto.prototype.dec = ""; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); - return writer; - }; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dec = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecProto message. - * @function verify - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dec != null && message.hasOwnProperty("dec")) - if (!$util.isString(message.dec)) - return "dec: string expected"; - return null; - }; - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecProto} DecProto - */ - DecProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecProto) - return object; - let message = new $root.cosmos.base.v1beta1.DecProto(); - if (object.dec != null) - message.dec = String(object.dec); - return message; - }; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.DecProto} message DecProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.dec = ""; - if (message.dec != null && message.hasOwnProperty("dec")) - object.dec = message.dec; - return object; - }; - - /** - * Converts this DecProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecProto - * @instance - * @returns {Object.} JSON object - */ - DecProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecProto; - })(); - - return v1beta1; - })(); - - return base; - })(); - - return cosmos; -})(); - -export const gogoproto = $root.gogoproto = (() => { - - /** - * Namespace gogoproto. - * @exports gogoproto - * @namespace - */ - const gogoproto = {}; - - return gogoproto; -})(); - -export const cosmos_proto = $root.cosmos_proto = (() => { - - /** - * Namespace cosmos_proto. - * @exports cosmos_proto - * @namespace - */ - const cosmos_proto = {}; - - cosmos_proto.InterfaceDescriptor = (function() { - - /** - * Properties of an InterfaceDescriptor. - * @memberof cosmos_proto - * @interface IInterfaceDescriptor - * @property {string|null} [name] InterfaceDescriptor name - * @property {string|null} [description] InterfaceDescriptor description - */ - - /** - * Constructs a new InterfaceDescriptor. - * @memberof cosmos_proto - * @classdesc Represents an InterfaceDescriptor. - * @implements IInterfaceDescriptor - * @constructor - * @param {cosmos_proto.IInterfaceDescriptor=} [properties] Properties to set - */ - function InterfaceDescriptor(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InterfaceDescriptor name. - * @member {string} name - * @memberof cosmos_proto.InterfaceDescriptor - * @instance - */ - InterfaceDescriptor.prototype.name = ""; - - /** - * InterfaceDescriptor description. - * @member {string} description - * @memberof cosmos_proto.InterfaceDescriptor - * @instance - */ - InterfaceDescriptor.prototype.description = ""; - - /** - * Encodes the specified InterfaceDescriptor message. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @function encode - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {cosmos_proto.IInterfaceDescriptor} message InterfaceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterfaceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified InterfaceDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {cosmos_proto.IInterfaceDescriptor} message InterfaceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterfaceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos_proto.InterfaceDescriptor} InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterfaceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos_proto.InterfaceDescriptor(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos_proto.InterfaceDescriptor} InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterfaceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InterfaceDescriptor message. - * @function verify - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InterfaceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates an InterfaceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {cosmos_proto.InterfaceDescriptor} InterfaceDescriptor - */ - InterfaceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos_proto.InterfaceDescriptor) - return object; - let message = new $root.cosmos_proto.InterfaceDescriptor(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from an InterfaceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {cosmos_proto.InterfaceDescriptor} message InterfaceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InterfaceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this InterfaceDescriptor to JSON. - * @function toJSON - * @memberof cosmos_proto.InterfaceDescriptor - * @instance - * @returns {Object.} JSON object - */ - InterfaceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InterfaceDescriptor; - })(); - - cosmos_proto.ScalarDescriptor = (function() { - - /** - * Properties of a ScalarDescriptor. - * @memberof cosmos_proto - * @interface IScalarDescriptor - * @property {string|null} [name] ScalarDescriptor name - * @property {string|null} [description] ScalarDescriptor description - * @property {Array.|null} [field_type] ScalarDescriptor field_type - * @property {string|null} [legacy_amino_encoding] ScalarDescriptor legacy_amino_encoding - */ - - /** - * Constructs a new ScalarDescriptor. - * @memberof cosmos_proto - * @classdesc Represents a ScalarDescriptor. - * @implements IScalarDescriptor - * @constructor - * @param {cosmos_proto.IScalarDescriptor=} [properties] Properties to set - */ - function ScalarDescriptor(properties) { - this.field_type = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScalarDescriptor name. - * @member {string} name - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.name = ""; - - /** - * ScalarDescriptor description. - * @member {string} description - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.description = ""; - - /** - * ScalarDescriptor field_type. - * @member {Array.} field_type - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.field_type = $util.emptyArray; - - /** - * ScalarDescriptor legacy_amino_encoding. - * @member {string} legacy_amino_encoding - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.legacy_amino_encoding = ""; - - /** - * Encodes the specified ScalarDescriptor message. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @function encode - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {cosmos_proto.IScalarDescriptor} message ScalarDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScalarDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.field_type != null && message.field_type.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (let i = 0; i < message.field_type.length; ++i) - writer.int32(message.field_type[i]); - writer.ldelim(); - } - if (message.legacy_amino_encoding != null && Object.hasOwnProperty.call(message, "legacy_amino_encoding")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.legacy_amino_encoding); - return writer; - }; - - /** - * Encodes the specified ScalarDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {cosmos_proto.IScalarDescriptor} message ScalarDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScalarDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer. - * @function decode - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos_proto.ScalarDescriptor} ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScalarDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos_proto.ScalarDescriptor(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - if (!(message.field_type && message.field_type.length)) - message.field_type = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.field_type.push(reader.int32()); - } else - message.field_type.push(reader.int32()); - break; - case 4: - message.legacy_amino_encoding = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos_proto.ScalarDescriptor} ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScalarDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScalarDescriptor message. - * @function verify - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScalarDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.field_type != null && message.hasOwnProperty("field_type")) { - if (!Array.isArray(message.field_type)) - return "field_type: array expected"; - for (let i = 0; i < message.field_type.length; ++i) - switch (message.field_type[i]) { - default: - return "field_type: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.legacy_amino_encoding != null && message.hasOwnProperty("legacy_amino_encoding")) - if (!$util.isString(message.legacy_amino_encoding)) - return "legacy_amino_encoding: string expected"; - return null; - }; - - /** - * Creates a ScalarDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {Object.} object Plain object - * @returns {cosmos_proto.ScalarDescriptor} ScalarDescriptor - */ - ScalarDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos_proto.ScalarDescriptor) - return object; - let message = new $root.cosmos_proto.ScalarDescriptor(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.field_type) { - if (!Array.isArray(object.field_type)) - throw TypeError(".cosmos_proto.ScalarDescriptor.field_type: array expected"); - message.field_type = []; - for (let i = 0; i < object.field_type.length; ++i) - switch (object.field_type[i]) { - default: - case "SCALAR_TYPE_UNSPECIFIED": - case 0: - message.field_type[i] = 0; - break; - case "SCALAR_TYPE_STRING": - case 1: - message.field_type[i] = 1; - break; - case "SCALAR_TYPE_BYTES": - case 2: - message.field_type[i] = 2; - break; - } - } - if (object.legacy_amino_encoding != null) - message.legacy_amino_encoding = String(object.legacy_amino_encoding); - return message; - }; - - /** - * Creates a plain object from a ScalarDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {cosmos_proto.ScalarDescriptor} message ScalarDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScalarDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.field_type = []; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.legacy_amino_encoding = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.field_type && message.field_type.length) { - object.field_type = []; - for (let j = 0; j < message.field_type.length; ++j) - object.field_type[j] = options.enums === String ? $root.cosmos_proto.ScalarType[message.field_type[j]] : message.field_type[j]; - } - if (message.legacy_amino_encoding != null && message.hasOwnProperty("legacy_amino_encoding")) - object.legacy_amino_encoding = message.legacy_amino_encoding; - return object; - }; - - /** - * Converts this ScalarDescriptor to JSON. - * @function toJSON - * @memberof cosmos_proto.ScalarDescriptor - * @instance - * @returns {Object.} JSON object - */ - ScalarDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ScalarDescriptor; - })(); - - /** - * ScalarType enum. - * @name cosmos_proto.ScalarType - * @enum {number} - * @property {number} SCALAR_TYPE_UNSPECIFIED=0 SCALAR_TYPE_UNSPECIFIED value - * @property {number} SCALAR_TYPE_STRING=1 SCALAR_TYPE_STRING value - * @property {number} SCALAR_TYPE_BYTES=2 SCALAR_TYPE_BYTES value - */ - cosmos_proto.ScalarType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCALAR_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCALAR_TYPE_STRING"] = 1; - values[valuesById[2] = "SCALAR_TYPE_BYTES"] = 2; - return values; - })(); - - return cosmos_proto; -})(); - -export const google = $root.google = (() => { - - /** - * Namespace google. - * @exports google - * @namespace - */ - const google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - const protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (let i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (let i = 0; i < message.file.length; ++i) { - let error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - let message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (let i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (let j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorSet; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [public_dependency] FileDescriptorProto public_dependency - * @property {Array.|null} [weak_dependency] FileDescriptorProto weak_dependency - * @property {Array.|null} [message_type] FileDescriptorProto message_type - * @property {Array.|null} [enum_type] FileDescriptorProto enum_type - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [source_code_info] FileDescriptorProto source_code_info - * @property {string|null} [syntax] FileDescriptorProto syntax - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.public_dependency = []; - this.weak_dependency = []; - this.message_type = []; - this.enum_type = []; - this.service = []; - this.extension = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto public_dependency. - * @member {Array.} public_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.public_dependency = $util.emptyArray; - - /** - * FileDescriptorProto weak_dependency. - * @member {Array.} weak_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weak_dependency = $util.emptyArray; - - /** - * FileDescriptorProto message_type. - * @member {Array.} message_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.message_type = $util.emptyArray; - - /** - * FileDescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto source_code_info. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} source_code_info - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.source_code_info = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (let i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.message_type != null && message.message_type.length) - for (let i = 0; i < message.message_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.message_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (let i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (let i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (let i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.source_code_info != null && Object.hasOwnProperty.call(message, "source_code_info")) - $root.google.protobuf.SourceCodeInfo.encode(message.source_code_info, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.public_dependency != null && message.public_dependency.length) - for (let i = 0; i < message.public_dependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.public_dependency[i]); - if (message.weak_dependency != null && message.weak_dependency.length) - for (let i = 0; i < message.weak_dependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weak_dependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.public_dependency && message.public_dependency.length)) - message.public_dependency = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.public_dependency.push(reader.int32()); - } else - message.public_dependency.push(reader.int32()); - break; - case 11: - if (!(message.weak_dependency && message.weak_dependency.length)) - message.weak_dependency = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weak_dependency.push(reader.int32()); - } else - message.weak_dependency.push(reader.int32()); - break; - case 4: - if (!(message.message_type && message.message_type.length)) - message.message_type = []; - message.message_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.source_code_info = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (let i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.public_dependency != null && message.hasOwnProperty("public_dependency")) { - if (!Array.isArray(message.public_dependency)) - return "public_dependency: array expected"; - for (let i = 0; i < message.public_dependency.length; ++i) - if (!$util.isInteger(message.public_dependency[i])) - return "public_dependency: integer[] expected"; - } - if (message.weak_dependency != null && message.hasOwnProperty("weak_dependency")) { - if (!Array.isArray(message.weak_dependency)) - return "weak_dependency: array expected"; - for (let i = 0; i < message.weak_dependency.length; ++i) - if (!$util.isInteger(message.weak_dependency[i])) - return "weak_dependency: integer[] expected"; - } - if (message.message_type != null && message.hasOwnProperty("message_type")) { - if (!Array.isArray(message.message_type)) - return "message_type: array expected"; - for (let i = 0; i < message.message_type.length; ++i) { - let error = $root.google.protobuf.DescriptorProto.verify(message.message_type[i]); - if (error) - return "message_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (let i = 0; i < message.enum_type.length; ++i) { - let error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (let i = 0; i < message.service.length; ++i) { - let error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (let i = 0; i < message.extension.length; ++i) { - let error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) { - let error = $root.google.protobuf.SourceCodeInfo.verify(message.source_code_info); - if (error) - return "source_code_info." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - let message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (let i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.public_dependency) { - if (!Array.isArray(object.public_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.public_dependency: array expected"); - message.public_dependency = []; - for (let i = 0; i < object.public_dependency.length; ++i) - message.public_dependency[i] = object.public_dependency[i] | 0; - } - if (object.weak_dependency) { - if (!Array.isArray(object.weak_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weak_dependency: array expected"); - message.weak_dependency = []; - for (let i = 0; i < object.weak_dependency.length; ++i) - message.weak_dependency[i] = object.weak_dependency[i] | 0; - } - if (object.message_type) { - if (!Array.isArray(object.message_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: array expected"); - message.message_type = []; - for (let i = 0; i < object.message_type.length; ++i) { - if (typeof object.message_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: object expected"); - message.message_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.message_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (let i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (let i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (let i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.source_code_info != null) { - if (typeof object.source_code_info !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.source_code_info: object expected"); - message.source_code_info = $root.google.protobuf.SourceCodeInfo.fromObject(object.source_code_info); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.message_type = []; - object.enum_type = []; - object.service = []; - object.extension = []; - object.public_dependency = []; - object.weak_dependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.source_code_info = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (let j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.message_type && message.message_type.length) { - object.message_type = []; - for (let j = 0; j < message.message_type.length; ++j) - object.message_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.message_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (let j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (let j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (let j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) - object.source_code_info = $root.google.protobuf.SourceCodeInfo.toObject(message.source_code_info, options); - if (message.public_dependency && message.public_dependency.length) { - object.public_dependency = []; - for (let j = 0; j < message.public_dependency.length; ++j) - object.public_dependency[j] = message.public_dependency[j]; - } - if (message.weak_dependency && message.weak_dependency.length) { - object.weak_dependency = []; - for (let j = 0; j < message.weak_dependency.length; ++j) - object.weak_dependency[j] = message.weak_dependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nested_type] DescriptorProto nested_type - * @property {Array.|null} [enum_type] DescriptorProto enum_type - * @property {Array.|null} [extension_range] DescriptorProto extension_range - * @property {Array.|null} [oneof_decl] DescriptorProto oneof_decl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reserved_range] DescriptorProto reserved_range - * @property {Array.|null} [reserved_name] DescriptorProto reserved_name - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nested_type = []; - this.enum_type = []; - this.extension_range = []; - this.oneof_decl = []; - this.reserved_range = []; - this.reserved_name = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nested_type. - * @member {Array.} nested_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nested_type = $util.emptyArray; - - /** - * DescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * DescriptorProto extension_range. - * @member {Array.} extension_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension_range = $util.emptyArray; - - /** - * DescriptorProto oneof_decl. - * @member {Array.} oneof_decl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneof_decl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reserved_range. - * @member {Array.} reserved_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_range = $util.emptyArray; - - /** - * DescriptorProto reserved_name. - * @member {Array.} reserved_name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_name = $util.emptyArray; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (let i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nested_type != null && message.nested_type.length) - for (let i = 0; i < message.nested_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nested_type[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (let i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extension_range != null && message.extension_range.length) - for (let i = 0; i < message.extension_range.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extension_range[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (let i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneof_decl != null && message.oneof_decl.length) - for (let i = 0; i < message.oneof_decl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneof_decl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reserved_range != null && message.reserved_range.length) - for (let i = 0; i < message.reserved_range.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reserved_range[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reserved_name != null && message.reserved_name.length) - for (let i = 0; i < message.reserved_name.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reserved_name[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nested_type && message.nested_type.length)) - message.nested_type = []; - message.nested_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extension_range && message.extension_range.length)) - message.extension_range = []; - message.extension_range.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneof_decl && message.oneof_decl.length)) - message.oneof_decl = []; - message.oneof_decl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reserved_range && message.reserved_range.length)) - message.reserved_range = []; - message.reserved_range.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reserved_name && message.reserved_name.length)) - message.reserved_name = []; - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (let i = 0; i < message.field.length; ++i) { - let error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (let i = 0; i < message.extension.length; ++i) { - let error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nested_type != null && message.hasOwnProperty("nested_type")) { - if (!Array.isArray(message.nested_type)) - return "nested_type: array expected"; - for (let i = 0; i < message.nested_type.length; ++i) { - let error = $root.google.protobuf.DescriptorProto.verify(message.nested_type[i]); - if (error) - return "nested_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (let i = 0; i < message.enum_type.length; ++i) { - let error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.extension_range != null && message.hasOwnProperty("extension_range")) { - if (!Array.isArray(message.extension_range)) - return "extension_range: array expected"; - for (let i = 0; i < message.extension_range.length; ++i) { - let error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extension_range[i]); - if (error) - return "extension_range." + error; - } - } - if (message.oneof_decl != null && message.hasOwnProperty("oneof_decl")) { - if (!Array.isArray(message.oneof_decl)) - return "oneof_decl: array expected"; - for (let i = 0; i < message.oneof_decl.length; ++i) { - let error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneof_decl[i]); - if (error) - return "oneof_decl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reserved_range != null && message.hasOwnProperty("reserved_range")) { - if (!Array.isArray(message.reserved_range)) - return "reserved_range: array expected"; - for (let i = 0; i < message.reserved_range.length; ++i) { - let error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reserved_range[i]); - if (error) - return "reserved_range." + error; - } - } - if (message.reserved_name != null && message.hasOwnProperty("reserved_name")) { - if (!Array.isArray(message.reserved_name)) - return "reserved_name: array expected"; - for (let i = 0; i < message.reserved_name.length; ++i) - if (!$util.isString(message.reserved_name[i])) - return "reserved_name: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - let message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (let i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (let i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nested_type) { - if (!Array.isArray(object.nested_type)) - throw TypeError(".google.protobuf.DescriptorProto.nested_type: array expected"); - message.nested_type = []; - for (let i = 0; i < object.nested_type.length; ++i) { - if (typeof object.nested_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nested_type: object expected"); - message.nested_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nested_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.DescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (let i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.extension_range) { - if (!Array.isArray(object.extension_range)) - throw TypeError(".google.protobuf.DescriptorProto.extension_range: array expected"); - message.extension_range = []; - for (let i = 0; i < object.extension_range.length; ++i) { - if (typeof object.extension_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension_range: object expected"); - message.extension_range[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extension_range[i]); - } - } - if (object.oneof_decl) { - if (!Array.isArray(object.oneof_decl)) - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: array expected"); - message.oneof_decl = []; - for (let i = 0; i < object.oneof_decl.length; ++i) { - if (typeof object.oneof_decl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: object expected"); - message.oneof_decl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneof_decl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reserved_range) { - if (!Array.isArray(object.reserved_range)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: array expected"); - message.reserved_range = []; - for (let i = 0; i < object.reserved_range.length; ++i) { - if (typeof object.reserved_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: object expected"); - message.reserved_range[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reserved_range[i]); - } - } - if (object.reserved_name) { - if (!Array.isArray(object.reserved_name)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_name: array expected"); - message.reserved_name = []; - for (let i = 0; i < object.reserved_name.length; ++i) - message.reserved_name[i] = String(object.reserved_name[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nested_type = []; - object.enum_type = []; - object.extension_range = []; - object.extension = []; - object.oneof_decl = []; - object.reserved_range = []; - object.reserved_name = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (let j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nested_type && message.nested_type.length) { - object.nested_type = []; - for (let j = 0; j < message.nested_type.length; ++j) - object.nested_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.nested_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (let j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.extension_range && message.extension_range.length) { - object.extension_range = []; - for (let j = 0; j < message.extension_range.length; ++j) - object.extension_range[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extension_range[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (let j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneof_decl && message.oneof_decl.length) { - object.oneof_decl = []; - for (let j = 0; j < message.oneof_decl.length; ++j) - object.oneof_decl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneof_decl[j], options); - } - if (message.reserved_range && message.reserved_range.length) { - object.reserved_range = []; - for (let j = 0; j < message.reserved_range.length; ++j) - object.reserved_range[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reserved_range[j], options); - } - if (message.reserved_name && message.reserved_name.length) { - object.reserved_name = []; - for (let j = 0; j < message.reserved_name.length; ++j) - object.reserved_name[j] = message.reserved_name[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - let message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - let message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [type_name] FieldDescriptorProto type_name - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [default_value] FieldDescriptorProto default_value - * @property {number|null} [oneof_index] FieldDescriptorProto oneof_index - * @property {string|null} [json_name] FieldDescriptorProto json_name - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto type_name. - * @member {string} type_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type_name = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto default_value. - * @member {string} default_value - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.default_value = ""; - - /** - * FieldDescriptorProto oneof_index. - * @member {number} oneof_index - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneof_index = 0; - - /** - * FieldDescriptorProto json_name. - * @member {string} json_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.json_name = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.type_name != null && Object.hasOwnProperty.call(message, "type_name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.type_name); - if (message.default_value != null && Object.hasOwnProperty.call(message, "default_value")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.default_value); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneof_index != null && Object.hasOwnProperty.call(message, "oneof_index")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneof_index); - if (message.json_name != null && Object.hasOwnProperty.call(message, "json_name")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.json_name); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.type_name != null && message.hasOwnProperty("type_name")) - if (!$util.isString(message.type_name)) - return "type_name: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.default_value != null && message.hasOwnProperty("default_value")) - if (!$util.isString(message.default_value)) - return "default_value: string expected"; - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - if (!$util.isInteger(message.oneof_index)) - return "oneof_index: integer expected"; - if (message.json_name != null && message.hasOwnProperty("json_name")) - if (!$util.isString(message.json_name)) - return "json_name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - let message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.type_name != null) - message.type_name = String(object.type_name); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.default_value != null) - message.default_value = String(object.default_value); - if (object.oneof_index != null) - message.oneof_index = object.oneof_index | 0; - if (object.json_name != null) - message.json_name = String(object.json_name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.type_name = ""; - object.default_value = ""; - object.options = null; - object.oneof_index = 0; - object.json_name = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.type_name != null && message.hasOwnProperty("type_name")) - object.type_name = message.type_name; - if (message.default_value != null && message.hasOwnProperty("default_value")) - object.default_value = message.default_value; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - object.oneof_index = message.oneof_index; - if (message.json_name != null && message.hasOwnProperty("json_name")) - object.json_name = message.json_name; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - let message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (let i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (let i = 0; i < message.value.length; ++i) { - let error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - let message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (let i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.value = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (let j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - let message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (let i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (let i = 0; i < message.method.length; ++i) { - let error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - let message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (let i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (let j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [input_type] MethodDescriptorProto input_type - * @property {string|null} [output_type] MethodDescriptorProto output_type - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [client_streaming] MethodDescriptorProto client_streaming - * @property {boolean|null} [server_streaming] MethodDescriptorProto server_streaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto input_type. - * @member {string} input_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.input_type = ""; - - /** - * MethodDescriptorProto output_type. - * @member {string} output_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.output_type = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto client_streaming. - * @member {boolean} client_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.client_streaming = false; - - /** - * MethodDescriptorProto server_streaming. - * @member {boolean} server_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.server_streaming = false; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.input_type != null && Object.hasOwnProperty.call(message, "input_type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.input_type); - if (message.output_type != null && Object.hasOwnProperty.call(message, "output_type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.output_type); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.client_streaming != null && Object.hasOwnProperty.call(message, "client_streaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.client_streaming); - if (message.server_streaming != null && Object.hasOwnProperty.call(message, "server_streaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.server_streaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.input_type != null && message.hasOwnProperty("input_type")) - if (!$util.isString(message.input_type)) - return "input_type: string expected"; - if (message.output_type != null && message.hasOwnProperty("output_type")) - if (!$util.isString(message.output_type)) - return "output_type: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - if (typeof message.client_streaming !== "boolean") - return "client_streaming: boolean expected"; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - if (typeof message.server_streaming !== "boolean") - return "server_streaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - let message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.input_type != null) - message.input_type = String(object.input_type); - if (object.output_type != null) - message.output_type = String(object.output_type); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.client_streaming != null) - message.client_streaming = Boolean(object.client_streaming); - if (object.server_streaming != null) - message.server_streaming = Boolean(object.server_streaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.input_type = ""; - object.output_type = ""; - object.options = null; - object.client_streaming = false; - object.server_streaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.input_type != null && message.hasOwnProperty("input_type")) - object.input_type = message.input_type; - if (message.output_type != null && message.hasOwnProperty("output_type")) - object.output_type = message.output_type; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - object.client_streaming = message.client_streaming; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - object.server_streaming = message.server_streaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [java_package] FileOptions java_package - * @property {string|null} [java_outer_classname] FileOptions java_outer_classname - * @property {boolean|null} [java_multiple_files] FileOptions java_multiple_files - * @property {boolean|null} [java_generate_equals_and_hash] FileOptions java_generate_equals_and_hash - * @property {boolean|null} [java_string_check_utf8] FileOptions java_string_check_utf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimize_for] FileOptions optimize_for - * @property {string|null} [go_package] FileOptions go_package - * @property {boolean|null} [cc_generic_services] FileOptions cc_generic_services - * @property {boolean|null} [java_generic_services] FileOptions java_generic_services - * @property {boolean|null} [py_generic_services] FileOptions py_generic_services - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [cc_enable_arenas] FileOptions cc_enable_arenas - * @property {string|null} [objc_class_prefix] FileOptions objc_class_prefix - * @property {string|null} [csharp_namespace] FileOptions csharp_namespace - * @property {Array.|null} [uninterpreted_option] FileOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters_all"] FileOptions .gogoproto.goproto_getters_all - * @property {boolean|null} [".gogoproto.goproto_enum_prefix_all"] FileOptions .gogoproto.goproto_enum_prefix_all - * @property {boolean|null} [".gogoproto.goproto_stringer_all"] FileOptions .gogoproto.goproto_stringer_all - * @property {boolean|null} [".gogoproto.verbose_equal_all"] FileOptions .gogoproto.verbose_equal_all - * @property {boolean|null} [".gogoproto.face_all"] FileOptions .gogoproto.face_all - * @property {boolean|null} [".gogoproto.gostring_all"] FileOptions .gogoproto.gostring_all - * @property {boolean|null} [".gogoproto.populate_all"] FileOptions .gogoproto.populate_all - * @property {boolean|null} [".gogoproto.stringer_all"] FileOptions .gogoproto.stringer_all - * @property {boolean|null} [".gogoproto.onlyone_all"] FileOptions .gogoproto.onlyone_all - * @property {boolean|null} [".gogoproto.equal_all"] FileOptions .gogoproto.equal_all - * @property {boolean|null} [".gogoproto.description_all"] FileOptions .gogoproto.description_all - * @property {boolean|null} [".gogoproto.testgen_all"] FileOptions .gogoproto.testgen_all - * @property {boolean|null} [".gogoproto.benchgen_all"] FileOptions .gogoproto.benchgen_all - * @property {boolean|null} [".gogoproto.marshaler_all"] FileOptions .gogoproto.marshaler_all - * @property {boolean|null} [".gogoproto.unmarshaler_all"] FileOptions .gogoproto.unmarshaler_all - * @property {boolean|null} [".gogoproto.stable_marshaler_all"] FileOptions .gogoproto.stable_marshaler_all - * @property {boolean|null} [".gogoproto.sizer_all"] FileOptions .gogoproto.sizer_all - * @property {boolean|null} [".gogoproto.goproto_enum_stringer_all"] FileOptions .gogoproto.goproto_enum_stringer_all - * @property {boolean|null} [".gogoproto.enum_stringer_all"] FileOptions .gogoproto.enum_stringer_all - * @property {boolean|null} [".gogoproto.unsafe_marshaler_all"] FileOptions .gogoproto.unsafe_marshaler_all - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler_all"] FileOptions .gogoproto.unsafe_unmarshaler_all - * @property {boolean|null} [".gogoproto.goproto_extensions_map_all"] FileOptions .gogoproto.goproto_extensions_map_all - * @property {boolean|null} [".gogoproto.goproto_unrecognized_all"] FileOptions .gogoproto.goproto_unrecognized_all - * @property {boolean|null} [".gogoproto.gogoproto_import"] FileOptions .gogoproto.gogoproto_import - * @property {boolean|null} [".gogoproto.protosizer_all"] FileOptions .gogoproto.protosizer_all - * @property {boolean|null} [".gogoproto.compare_all"] FileOptions .gogoproto.compare_all - * @property {boolean|null} [".gogoproto.typedecl_all"] FileOptions .gogoproto.typedecl_all - * @property {boolean|null} [".gogoproto.enumdecl_all"] FileOptions .gogoproto.enumdecl_all - * @property {boolean|null} [".gogoproto.goproto_registration"] FileOptions .gogoproto.goproto_registration - * @property {boolean|null} [".gogoproto.messagename_all"] FileOptions .gogoproto.messagename_all - * @property {boolean|null} [".gogoproto.goproto_sizecache_all"] FileOptions .gogoproto.goproto_sizecache_all - * @property {boolean|null} [".gogoproto.goproto_unkeyed_all"] FileOptions .gogoproto.goproto_unkeyed_all - * @property {Array.|null} [".cosmos_proto.declare_interface"] FileOptions .cosmos_proto.declare_interface - * @property {Array.|null} [".cosmos_proto.declare_scalar"] FileOptions .cosmos_proto.declare_scalar - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpreted_option = []; - this[".cosmos_proto.declare_interface"] = []; - this[".cosmos_proto.declare_scalar"] = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions java_package. - * @member {string} java_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_package = ""; - - /** - * FileOptions java_outer_classname. - * @member {string} java_outer_classname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_outer_classname = ""; - - /** - * FileOptions java_multiple_files. - * @member {boolean} java_multiple_files - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_multiple_files = false; - - /** - * FileOptions java_generate_equals_and_hash. - * @member {boolean} java_generate_equals_and_hash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generate_equals_and_hash = false; - - /** - * FileOptions java_string_check_utf8. - * @member {boolean} java_string_check_utf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_string_check_utf8 = false; - - /** - * FileOptions optimize_for. - * @member {google.protobuf.FileOptions.OptimizeMode} optimize_for - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimize_for = 1; - - /** - * FileOptions go_package. - * @member {string} go_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.go_package = ""; - - /** - * FileOptions cc_generic_services. - * @member {boolean} cc_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_generic_services = false; - - /** - * FileOptions java_generic_services. - * @member {boolean} java_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generic_services = false; - - /** - * FileOptions py_generic_services. - * @member {boolean} py_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.py_generic_services = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions cc_enable_arenas. - * @member {boolean} cc_enable_arenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_enable_arenas = false; - - /** - * FileOptions objc_class_prefix. - * @member {string} objc_class_prefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objc_class_prefix = ""; - - /** - * FileOptions csharp_namespace. - * @member {string} csharp_namespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharp_namespace = ""; - - /** - * FileOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FileOptions .gogoproto.goproto_getters_all. - * @member {boolean} .gogoproto.goproto_getters_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_getters_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_prefix_all. - * @member {boolean} .gogoproto.goproto_enum_prefix_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_prefix_all"] = false; - - /** - * FileOptions .gogoproto.goproto_stringer_all. - * @member {boolean} .gogoproto.goproto_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_stringer_all"] = false; - - /** - * FileOptions .gogoproto.verbose_equal_all. - * @member {boolean} .gogoproto.verbose_equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.verbose_equal_all"] = false; - - /** - * FileOptions .gogoproto.face_all. - * @member {boolean} .gogoproto.face_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.face_all"] = false; - - /** - * FileOptions .gogoproto.gostring_all. - * @member {boolean} .gogoproto.gostring_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gostring_all"] = false; - - /** - * FileOptions .gogoproto.populate_all. - * @member {boolean} .gogoproto.populate_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.populate_all"] = false; - - /** - * FileOptions .gogoproto.stringer_all. - * @member {boolean} .gogoproto.stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stringer_all"] = false; - - /** - * FileOptions .gogoproto.onlyone_all. - * @member {boolean} .gogoproto.onlyone_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.onlyone_all"] = false; - - /** - * FileOptions .gogoproto.equal_all. - * @member {boolean} .gogoproto.equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.equal_all"] = false; - - /** - * FileOptions .gogoproto.description_all. - * @member {boolean} .gogoproto.description_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.description_all"] = false; - - /** - * FileOptions .gogoproto.testgen_all. - * @member {boolean} .gogoproto.testgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.testgen_all"] = false; - - /** - * FileOptions .gogoproto.benchgen_all. - * @member {boolean} .gogoproto.benchgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.benchgen_all"] = false; - - /** - * FileOptions .gogoproto.marshaler_all. - * @member {boolean} .gogoproto.marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unmarshaler_all. - * @member {boolean} .gogoproto.unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.stable_marshaler_all. - * @member {boolean} .gogoproto.stable_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stable_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.sizer_all. - * @member {boolean} .gogoproto.sizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.sizer_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_stringer_all. - * @member {boolean} .gogoproto.goproto_enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.enum_stringer_all. - * @member {boolean} .gogoproto.enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_marshaler_all. - * @member {boolean} .gogoproto.unsafe_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_unmarshaler_all. - * @member {boolean} .gogoproto.unsafe_unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.goproto_extensions_map_all. - * @member {boolean} .gogoproto.goproto_extensions_map_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_extensions_map_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unrecognized_all. - * @member {boolean} .gogoproto.goproto_unrecognized_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unrecognized_all"] = false; - - /** - * FileOptions .gogoproto.gogoproto_import. - * @member {boolean} .gogoproto.gogoproto_import - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gogoproto_import"] = false; - - /** - * FileOptions .gogoproto.protosizer_all. - * @member {boolean} .gogoproto.protosizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.protosizer_all"] = false; - - /** - * FileOptions .gogoproto.compare_all. - * @member {boolean} .gogoproto.compare_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.compare_all"] = false; - - /** - * FileOptions .gogoproto.typedecl_all. - * @member {boolean} .gogoproto.typedecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.typedecl_all"] = false; - - /** - * FileOptions .gogoproto.enumdecl_all. - * @member {boolean} .gogoproto.enumdecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enumdecl_all"] = false; - - /** - * FileOptions .gogoproto.goproto_registration. - * @member {boolean} .gogoproto.goproto_registration - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_registration"] = false; - - /** - * FileOptions .gogoproto.messagename_all. - * @member {boolean} .gogoproto.messagename_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.messagename_all"] = false; - - /** - * FileOptions .gogoproto.goproto_sizecache_all. - * @member {boolean} .gogoproto.goproto_sizecache_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_sizecache_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unkeyed_all. - * @member {boolean} .gogoproto.goproto_unkeyed_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unkeyed_all"] = false; - - /** - * FileOptions .cosmos_proto.declare_interface. - * @member {Array.} .cosmos_proto.declare_interface - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".cosmos_proto.declare_interface"] = $util.emptyArray; - - /** - * FileOptions .cosmos_proto.declare_scalar. - * @member {Array.} .cosmos_proto.declare_scalar - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".cosmos_proto.declare_scalar"] = $util.emptyArray; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.java_package != null && Object.hasOwnProperty.call(message, "java_package")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.java_package); - if (message.java_outer_classname != null && Object.hasOwnProperty.call(message, "java_outer_classname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.java_outer_classname); - if (message.optimize_for != null && Object.hasOwnProperty.call(message, "optimize_for")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimize_for); - if (message.java_multiple_files != null && Object.hasOwnProperty.call(message, "java_multiple_files")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.java_multiple_files); - if (message.go_package != null && Object.hasOwnProperty.call(message, "go_package")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.go_package); - if (message.cc_generic_services != null && Object.hasOwnProperty.call(message, "cc_generic_services")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.cc_generic_services); - if (message.java_generic_services != null && Object.hasOwnProperty.call(message, "java_generic_services")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.java_generic_services); - if (message.py_generic_services != null && Object.hasOwnProperty.call(message, "py_generic_services")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.py_generic_services); - if (message.java_generate_equals_and_hash != null && Object.hasOwnProperty.call(message, "java_generate_equals_and_hash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.java_generate_equals_and_hash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.java_string_check_utf8 != null && Object.hasOwnProperty.call(message, "java_string_check_utf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.java_string_check_utf8); - if (message.cc_enable_arenas != null && Object.hasOwnProperty.call(message, "cc_enable_arenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.cc_enable_arenas); - if (message.objc_class_prefix != null && Object.hasOwnProperty.call(message, "objc_class_prefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objc_class_prefix); - if (message.csharp_namespace != null && Object.hasOwnProperty.call(message, "csharp_namespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharp_namespace); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters_all")) - writer.uint32(/* id 63001, wireType 0 =*/504008).bool(message[".gogoproto.goproto_getters_all"]); - if (message[".gogoproto.goproto_enum_prefix_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix_all")) - writer.uint32(/* id 63002, wireType 0 =*/504016).bool(message[".gogoproto.goproto_enum_prefix_all"]); - if (message[".gogoproto.goproto_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer_all")) - writer.uint32(/* id 63003, wireType 0 =*/504024).bool(message[".gogoproto.goproto_stringer_all"]); - if (message[".gogoproto.verbose_equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal_all")) - writer.uint32(/* id 63004, wireType 0 =*/504032).bool(message[".gogoproto.verbose_equal_all"]); - if (message[".gogoproto.face_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face_all")) - writer.uint32(/* id 63005, wireType 0 =*/504040).bool(message[".gogoproto.face_all"]); - if (message[".gogoproto.gostring_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring_all")) - writer.uint32(/* id 63006, wireType 0 =*/504048).bool(message[".gogoproto.gostring_all"]); - if (message[".gogoproto.populate_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate_all")) - writer.uint32(/* id 63007, wireType 0 =*/504056).bool(message[".gogoproto.populate_all"]); - if (message[".gogoproto.stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer_all")) - writer.uint32(/* id 63008, wireType 0 =*/504064).bool(message[".gogoproto.stringer_all"]); - if (message[".gogoproto.onlyone_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone_all")) - writer.uint32(/* id 63009, wireType 0 =*/504072).bool(message[".gogoproto.onlyone_all"]); - if (message[".gogoproto.equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal_all")) - writer.uint32(/* id 63013, wireType 0 =*/504104).bool(message[".gogoproto.equal_all"]); - if (message[".gogoproto.description_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description_all")) - writer.uint32(/* id 63014, wireType 0 =*/504112).bool(message[".gogoproto.description_all"]); - if (message[".gogoproto.testgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen_all")) - writer.uint32(/* id 63015, wireType 0 =*/504120).bool(message[".gogoproto.testgen_all"]); - if (message[".gogoproto.benchgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen_all")) - writer.uint32(/* id 63016, wireType 0 =*/504128).bool(message[".gogoproto.benchgen_all"]); - if (message[".gogoproto.marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler_all")) - writer.uint32(/* id 63017, wireType 0 =*/504136).bool(message[".gogoproto.marshaler_all"]); - if (message[".gogoproto.unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler_all")) - writer.uint32(/* id 63018, wireType 0 =*/504144).bool(message[".gogoproto.unmarshaler_all"]); - if (message[".gogoproto.stable_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler_all")) - writer.uint32(/* id 63019, wireType 0 =*/504152).bool(message[".gogoproto.stable_marshaler_all"]); - if (message[".gogoproto.sizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer_all")) - writer.uint32(/* id 63020, wireType 0 =*/504160).bool(message[".gogoproto.sizer_all"]); - if (message[".gogoproto.goproto_enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer_all")) - writer.uint32(/* id 63021, wireType 0 =*/504168).bool(message[".gogoproto.goproto_enum_stringer_all"]); - if (message[".gogoproto.enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer_all")) - writer.uint32(/* id 63022, wireType 0 =*/504176).bool(message[".gogoproto.enum_stringer_all"]); - if (message[".gogoproto.unsafe_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler_all")) - writer.uint32(/* id 63023, wireType 0 =*/504184).bool(message[".gogoproto.unsafe_marshaler_all"]); - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler_all")) - writer.uint32(/* id 63024, wireType 0 =*/504192).bool(message[".gogoproto.unsafe_unmarshaler_all"]); - if (message[".gogoproto.goproto_extensions_map_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map_all")) - writer.uint32(/* id 63025, wireType 0 =*/504200).bool(message[".gogoproto.goproto_extensions_map_all"]); - if (message[".gogoproto.goproto_unrecognized_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized_all")) - writer.uint32(/* id 63026, wireType 0 =*/504208).bool(message[".gogoproto.goproto_unrecognized_all"]); - if (message[".gogoproto.gogoproto_import"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gogoproto_import")) - writer.uint32(/* id 63027, wireType 0 =*/504216).bool(message[".gogoproto.gogoproto_import"]); - if (message[".gogoproto.protosizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer_all")) - writer.uint32(/* id 63028, wireType 0 =*/504224).bool(message[".gogoproto.protosizer_all"]); - if (message[".gogoproto.compare_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare_all")) - writer.uint32(/* id 63029, wireType 0 =*/504232).bool(message[".gogoproto.compare_all"]); - if (message[".gogoproto.typedecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl_all")) - writer.uint32(/* id 63030, wireType 0 =*/504240).bool(message[".gogoproto.typedecl_all"]); - if (message[".gogoproto.enumdecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl_all")) - writer.uint32(/* id 63031, wireType 0 =*/504248).bool(message[".gogoproto.enumdecl_all"]); - if (message[".gogoproto.goproto_registration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_registration")) - writer.uint32(/* id 63032, wireType 0 =*/504256).bool(message[".gogoproto.goproto_registration"]); - if (message[".gogoproto.messagename_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename_all")) - writer.uint32(/* id 63033, wireType 0 =*/504264).bool(message[".gogoproto.messagename_all"]); - if (message[".gogoproto.goproto_sizecache_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache_all")) - writer.uint32(/* id 63034, wireType 0 =*/504272).bool(message[".gogoproto.goproto_sizecache_all"]); - if (message[".gogoproto.goproto_unkeyed_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed_all")) - writer.uint32(/* id 63035, wireType 0 =*/504280).bool(message[".gogoproto.goproto_unkeyed_all"]); - if (message[".cosmos_proto.declare_interface"] != null && message[".cosmos_proto.declare_interface"].length) - for (let i = 0; i < message[".cosmos_proto.declare_interface"].length; ++i) - $root.cosmos_proto.InterfaceDescriptor.encode(message[".cosmos_proto.declare_interface"][i], writer.uint32(/* id 793021, wireType 2 =*/6344170).fork()).ldelim(); - if (message[".cosmos_proto.declare_scalar"] != null && message[".cosmos_proto.declare_scalar"].length) - for (let i = 0; i < message[".cosmos_proto.declare_scalar"].length; ++i) - $root.cosmos_proto.ScalarDescriptor.encode(message[".cosmos_proto.declare_scalar"][i], writer.uint32(/* id 793022, wireType 2 =*/6344178).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32(); - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 63001: - message[".gogoproto.goproto_getters_all"] = reader.bool(); - break; - case 63002: - message[".gogoproto.goproto_enum_prefix_all"] = reader.bool(); - break; - case 63003: - message[".gogoproto.goproto_stringer_all"] = reader.bool(); - break; - case 63004: - message[".gogoproto.verbose_equal_all"] = reader.bool(); - break; - case 63005: - message[".gogoproto.face_all"] = reader.bool(); - break; - case 63006: - message[".gogoproto.gostring_all"] = reader.bool(); - break; - case 63007: - message[".gogoproto.populate_all"] = reader.bool(); - break; - case 63008: - message[".gogoproto.stringer_all"] = reader.bool(); - break; - case 63009: - message[".gogoproto.onlyone_all"] = reader.bool(); - break; - case 63013: - message[".gogoproto.equal_all"] = reader.bool(); - break; - case 63014: - message[".gogoproto.description_all"] = reader.bool(); - break; - case 63015: - message[".gogoproto.testgen_all"] = reader.bool(); - break; - case 63016: - message[".gogoproto.benchgen_all"] = reader.bool(); - break; - case 63017: - message[".gogoproto.marshaler_all"] = reader.bool(); - break; - case 63018: - message[".gogoproto.unmarshaler_all"] = reader.bool(); - break; - case 63019: - message[".gogoproto.stable_marshaler_all"] = reader.bool(); - break; - case 63020: - message[".gogoproto.sizer_all"] = reader.bool(); - break; - case 63021: - message[".gogoproto.goproto_enum_stringer_all"] = reader.bool(); - break; - case 63022: - message[".gogoproto.enum_stringer_all"] = reader.bool(); - break; - case 63023: - message[".gogoproto.unsafe_marshaler_all"] = reader.bool(); - break; - case 63024: - message[".gogoproto.unsafe_unmarshaler_all"] = reader.bool(); - break; - case 63025: - message[".gogoproto.goproto_extensions_map_all"] = reader.bool(); - break; - case 63026: - message[".gogoproto.goproto_unrecognized_all"] = reader.bool(); - break; - case 63027: - message[".gogoproto.gogoproto_import"] = reader.bool(); - break; - case 63028: - message[".gogoproto.protosizer_all"] = reader.bool(); - break; - case 63029: - message[".gogoproto.compare_all"] = reader.bool(); - break; - case 63030: - message[".gogoproto.typedecl_all"] = reader.bool(); - break; - case 63031: - message[".gogoproto.enumdecl_all"] = reader.bool(); - break; - case 63032: - message[".gogoproto.goproto_registration"] = reader.bool(); - break; - case 63033: - message[".gogoproto.messagename_all"] = reader.bool(); - break; - case 63034: - message[".gogoproto.goproto_sizecache_all"] = reader.bool(); - break; - case 63035: - message[".gogoproto.goproto_unkeyed_all"] = reader.bool(); - break; - case 793021: - if (!(message[".cosmos_proto.declare_interface"] && message[".cosmos_proto.declare_interface"].length)) - message[".cosmos_proto.declare_interface"] = []; - message[".cosmos_proto.declare_interface"].push($root.cosmos_proto.InterfaceDescriptor.decode(reader, reader.uint32())); - break; - case 793022: - if (!(message[".cosmos_proto.declare_scalar"] && message[".cosmos_proto.declare_scalar"].length)) - message[".cosmos_proto.declare_scalar"] = []; - message[".cosmos_proto.declare_scalar"].push($root.cosmos_proto.ScalarDescriptor.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.java_package != null && message.hasOwnProperty("java_package")) - if (!$util.isString(message.java_package)) - return "java_package: string expected"; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - if (!$util.isString(message.java_outer_classname)) - return "java_outer_classname: string expected"; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - if (typeof message.java_multiple_files !== "boolean") - return "java_multiple_files: boolean expected"; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - if (typeof message.java_generate_equals_and_hash !== "boolean") - return "java_generate_equals_and_hash: boolean expected"; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - if (typeof message.java_string_check_utf8 !== "boolean") - return "java_string_check_utf8: boolean expected"; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - switch (message.optimize_for) { - default: - return "optimize_for: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.go_package != null && message.hasOwnProperty("go_package")) - if (!$util.isString(message.go_package)) - return "go_package: string expected"; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - if (typeof message.cc_generic_services !== "boolean") - return "cc_generic_services: boolean expected"; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - if (typeof message.java_generic_services !== "boolean") - return "java_generic_services: boolean expected"; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - if (typeof message.py_generic_services !== "boolean") - return "py_generic_services: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - if (typeof message.cc_enable_arenas !== "boolean") - return "cc_enable_arenas: boolean expected"; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - if (!$util.isString(message.objc_class_prefix)) - return "objc_class_prefix: string expected"; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - if (!$util.isString(message.csharp_namespace)) - return "csharp_namespace: string expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - if (typeof message[".gogoproto.goproto_getters_all"] !== "boolean") - return ".gogoproto.goproto_getters_all: boolean expected"; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - if (typeof message[".gogoproto.goproto_enum_prefix_all"] !== "boolean") - return ".gogoproto.goproto_enum_prefix_all: boolean expected"; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - if (typeof message[".gogoproto.goproto_stringer_all"] !== "boolean") - return ".gogoproto.goproto_stringer_all: boolean expected"; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - if (typeof message[".gogoproto.verbose_equal_all"] !== "boolean") - return ".gogoproto.verbose_equal_all: boolean expected"; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - if (typeof message[".gogoproto.face_all"] !== "boolean") - return ".gogoproto.face_all: boolean expected"; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - if (typeof message[".gogoproto.gostring_all"] !== "boolean") - return ".gogoproto.gostring_all: boolean expected"; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - if (typeof message[".gogoproto.populate_all"] !== "boolean") - return ".gogoproto.populate_all: boolean expected"; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - if (typeof message[".gogoproto.stringer_all"] !== "boolean") - return ".gogoproto.stringer_all: boolean expected"; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - if (typeof message[".gogoproto.onlyone_all"] !== "boolean") - return ".gogoproto.onlyone_all: boolean expected"; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - if (typeof message[".gogoproto.equal_all"] !== "boolean") - return ".gogoproto.equal_all: boolean expected"; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - if (typeof message[".gogoproto.description_all"] !== "boolean") - return ".gogoproto.description_all: boolean expected"; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - if (typeof message[".gogoproto.testgen_all"] !== "boolean") - return ".gogoproto.testgen_all: boolean expected"; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - if (typeof message[".gogoproto.benchgen_all"] !== "boolean") - return ".gogoproto.benchgen_all: boolean expected"; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - if (typeof message[".gogoproto.marshaler_all"] !== "boolean") - return ".gogoproto.marshaler_all: boolean expected"; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - if (typeof message[".gogoproto.unmarshaler_all"] !== "boolean") - return ".gogoproto.unmarshaler_all: boolean expected"; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - if (typeof message[".gogoproto.stable_marshaler_all"] !== "boolean") - return ".gogoproto.stable_marshaler_all: boolean expected"; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - if (typeof message[".gogoproto.sizer_all"] !== "boolean") - return ".gogoproto.sizer_all: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - if (typeof message[".gogoproto.goproto_enum_stringer_all"] !== "boolean") - return ".gogoproto.goproto_enum_stringer_all: boolean expected"; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - if (typeof message[".gogoproto.enum_stringer_all"] !== "boolean") - return ".gogoproto.enum_stringer_all: boolean expected"; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - if (typeof message[".gogoproto.unsafe_marshaler_all"] !== "boolean") - return ".gogoproto.unsafe_marshaler_all: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - if (typeof message[".gogoproto.unsafe_unmarshaler_all"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler_all: boolean expected"; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - if (typeof message[".gogoproto.goproto_extensions_map_all"] !== "boolean") - return ".gogoproto.goproto_extensions_map_all: boolean expected"; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - if (typeof message[".gogoproto.goproto_unrecognized_all"] !== "boolean") - return ".gogoproto.goproto_unrecognized_all: boolean expected"; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - if (typeof message[".gogoproto.gogoproto_import"] !== "boolean") - return ".gogoproto.gogoproto_import: boolean expected"; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - if (typeof message[".gogoproto.protosizer_all"] !== "boolean") - return ".gogoproto.protosizer_all: boolean expected"; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - if (typeof message[".gogoproto.compare_all"] !== "boolean") - return ".gogoproto.compare_all: boolean expected"; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - if (typeof message[".gogoproto.typedecl_all"] !== "boolean") - return ".gogoproto.typedecl_all: boolean expected"; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - if (typeof message[".gogoproto.enumdecl_all"] !== "boolean") - return ".gogoproto.enumdecl_all: boolean expected"; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - if (typeof message[".gogoproto.goproto_registration"] !== "boolean") - return ".gogoproto.goproto_registration: boolean expected"; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - if (typeof message[".gogoproto.messagename_all"] !== "boolean") - return ".gogoproto.messagename_all: boolean expected"; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - if (typeof message[".gogoproto.goproto_sizecache_all"] !== "boolean") - return ".gogoproto.goproto_sizecache_all: boolean expected"; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - if (typeof message[".gogoproto.goproto_unkeyed_all"] !== "boolean") - return ".gogoproto.goproto_unkeyed_all: boolean expected"; - if (message[".cosmos_proto.declare_interface"] != null && message.hasOwnProperty(".cosmos_proto.declare_interface")) { - if (!Array.isArray(message[".cosmos_proto.declare_interface"])) - return ".cosmos_proto.declare_interface: array expected"; - for (let i = 0; i < message[".cosmos_proto.declare_interface"].length; ++i) { - let error = $root.cosmos_proto.InterfaceDescriptor.verify(message[".cosmos_proto.declare_interface"][i]); - if (error) - return ".cosmos_proto.declare_interface." + error; - } - } - if (message[".cosmos_proto.declare_scalar"] != null && message.hasOwnProperty(".cosmos_proto.declare_scalar")) { - if (!Array.isArray(message[".cosmos_proto.declare_scalar"])) - return ".cosmos_proto.declare_scalar: array expected"; - for (let i = 0; i < message[".cosmos_proto.declare_scalar"].length; ++i) { - let error = $root.cosmos_proto.ScalarDescriptor.verify(message[".cosmos_proto.declare_scalar"][i]); - if (error) - return ".cosmos_proto.declare_scalar." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - let message = new $root.google.protobuf.FileOptions(); - if (object.java_package != null) - message.java_package = String(object.java_package); - if (object.java_outer_classname != null) - message.java_outer_classname = String(object.java_outer_classname); - if (object.java_multiple_files != null) - message.java_multiple_files = Boolean(object.java_multiple_files); - if (object.java_generate_equals_and_hash != null) - message.java_generate_equals_and_hash = Boolean(object.java_generate_equals_and_hash); - if (object.java_string_check_utf8 != null) - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - switch (object.optimize_for) { - case "SPEED": - case 1: - message.optimize_for = 1; - break; - case "CODE_SIZE": - case 2: - message.optimize_for = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimize_for = 3; - break; - } - if (object.go_package != null) - message.go_package = String(object.go_package); - if (object.cc_generic_services != null) - message.cc_generic_services = Boolean(object.cc_generic_services); - if (object.java_generic_services != null) - message.java_generic_services = Boolean(object.java_generic_services); - if (object.py_generic_services != null) - message.py_generic_services = Boolean(object.py_generic_services); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.cc_enable_arenas != null) - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - if (object.objc_class_prefix != null) - message.objc_class_prefix = String(object.objc_class_prefix); - if (object.csharp_namespace != null) - message.csharp_namespace = String(object.csharp_namespace); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters_all"] != null) - message[".gogoproto.goproto_getters_all"] = Boolean(object[".gogoproto.goproto_getters_all"]); - if (object[".gogoproto.goproto_enum_prefix_all"] != null) - message[".gogoproto.goproto_enum_prefix_all"] = Boolean(object[".gogoproto.goproto_enum_prefix_all"]); - if (object[".gogoproto.goproto_stringer_all"] != null) - message[".gogoproto.goproto_stringer_all"] = Boolean(object[".gogoproto.goproto_stringer_all"]); - if (object[".gogoproto.verbose_equal_all"] != null) - message[".gogoproto.verbose_equal_all"] = Boolean(object[".gogoproto.verbose_equal_all"]); - if (object[".gogoproto.face_all"] != null) - message[".gogoproto.face_all"] = Boolean(object[".gogoproto.face_all"]); - if (object[".gogoproto.gostring_all"] != null) - message[".gogoproto.gostring_all"] = Boolean(object[".gogoproto.gostring_all"]); - if (object[".gogoproto.populate_all"] != null) - message[".gogoproto.populate_all"] = Boolean(object[".gogoproto.populate_all"]); - if (object[".gogoproto.stringer_all"] != null) - message[".gogoproto.stringer_all"] = Boolean(object[".gogoproto.stringer_all"]); - if (object[".gogoproto.onlyone_all"] != null) - message[".gogoproto.onlyone_all"] = Boolean(object[".gogoproto.onlyone_all"]); - if (object[".gogoproto.equal_all"] != null) - message[".gogoproto.equal_all"] = Boolean(object[".gogoproto.equal_all"]); - if (object[".gogoproto.description_all"] != null) - message[".gogoproto.description_all"] = Boolean(object[".gogoproto.description_all"]); - if (object[".gogoproto.testgen_all"] != null) - message[".gogoproto.testgen_all"] = Boolean(object[".gogoproto.testgen_all"]); - if (object[".gogoproto.benchgen_all"] != null) - message[".gogoproto.benchgen_all"] = Boolean(object[".gogoproto.benchgen_all"]); - if (object[".gogoproto.marshaler_all"] != null) - message[".gogoproto.marshaler_all"] = Boolean(object[".gogoproto.marshaler_all"]); - if (object[".gogoproto.unmarshaler_all"] != null) - message[".gogoproto.unmarshaler_all"] = Boolean(object[".gogoproto.unmarshaler_all"]); - if (object[".gogoproto.stable_marshaler_all"] != null) - message[".gogoproto.stable_marshaler_all"] = Boolean(object[".gogoproto.stable_marshaler_all"]); - if (object[".gogoproto.sizer_all"] != null) - message[".gogoproto.sizer_all"] = Boolean(object[".gogoproto.sizer_all"]); - if (object[".gogoproto.goproto_enum_stringer_all"] != null) - message[".gogoproto.goproto_enum_stringer_all"] = Boolean(object[".gogoproto.goproto_enum_stringer_all"]); - if (object[".gogoproto.enum_stringer_all"] != null) - message[".gogoproto.enum_stringer_all"] = Boolean(object[".gogoproto.enum_stringer_all"]); - if (object[".gogoproto.unsafe_marshaler_all"] != null) - message[".gogoproto.unsafe_marshaler_all"] = Boolean(object[".gogoproto.unsafe_marshaler_all"]); - if (object[".gogoproto.unsafe_unmarshaler_all"] != null) - message[".gogoproto.unsafe_unmarshaler_all"] = Boolean(object[".gogoproto.unsafe_unmarshaler_all"]); - if (object[".gogoproto.goproto_extensions_map_all"] != null) - message[".gogoproto.goproto_extensions_map_all"] = Boolean(object[".gogoproto.goproto_extensions_map_all"]); - if (object[".gogoproto.goproto_unrecognized_all"] != null) - message[".gogoproto.goproto_unrecognized_all"] = Boolean(object[".gogoproto.goproto_unrecognized_all"]); - if (object[".gogoproto.gogoproto_import"] != null) - message[".gogoproto.gogoproto_import"] = Boolean(object[".gogoproto.gogoproto_import"]); - if (object[".gogoproto.protosizer_all"] != null) - message[".gogoproto.protosizer_all"] = Boolean(object[".gogoproto.protosizer_all"]); - if (object[".gogoproto.compare_all"] != null) - message[".gogoproto.compare_all"] = Boolean(object[".gogoproto.compare_all"]); - if (object[".gogoproto.typedecl_all"] != null) - message[".gogoproto.typedecl_all"] = Boolean(object[".gogoproto.typedecl_all"]); - if (object[".gogoproto.enumdecl_all"] != null) - message[".gogoproto.enumdecl_all"] = Boolean(object[".gogoproto.enumdecl_all"]); - if (object[".gogoproto.goproto_registration"] != null) - message[".gogoproto.goproto_registration"] = Boolean(object[".gogoproto.goproto_registration"]); - if (object[".gogoproto.messagename_all"] != null) - message[".gogoproto.messagename_all"] = Boolean(object[".gogoproto.messagename_all"]); - if (object[".gogoproto.goproto_sizecache_all"] != null) - message[".gogoproto.goproto_sizecache_all"] = Boolean(object[".gogoproto.goproto_sizecache_all"]); - if (object[".gogoproto.goproto_unkeyed_all"] != null) - message[".gogoproto.goproto_unkeyed_all"] = Boolean(object[".gogoproto.goproto_unkeyed_all"]); - if (object[".cosmos_proto.declare_interface"]) { - if (!Array.isArray(object[".cosmos_proto.declare_interface"])) - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_interface: array expected"); - message[".cosmos_proto.declare_interface"] = []; - for (let i = 0; i < object[".cosmos_proto.declare_interface"].length; ++i) { - if (typeof object[".cosmos_proto.declare_interface"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_interface: object expected"); - message[".cosmos_proto.declare_interface"][i] = $root.cosmos_proto.InterfaceDescriptor.fromObject(object[".cosmos_proto.declare_interface"][i]); - } - } - if (object[".cosmos_proto.declare_scalar"]) { - if (!Array.isArray(object[".cosmos_proto.declare_scalar"])) - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_scalar: array expected"); - message[".cosmos_proto.declare_scalar"] = []; - for (let i = 0; i < object[".cosmos_proto.declare_scalar"].length; ++i) { - if (typeof object[".cosmos_proto.declare_scalar"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_scalar: object expected"); - message[".cosmos_proto.declare_scalar"][i] = $root.cosmos_proto.ScalarDescriptor.fromObject(object[".cosmos_proto.declare_scalar"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.uninterpreted_option = []; - object[".cosmos_proto.declare_interface"] = []; - object[".cosmos_proto.declare_scalar"] = []; - } - if (options.defaults) { - object.java_package = ""; - object.java_outer_classname = ""; - object.optimize_for = options.enums === String ? "SPEED" : 1; - object.java_multiple_files = false; - object.go_package = ""; - object.cc_generic_services = false; - object.java_generic_services = false; - object.py_generic_services = false; - object.java_generate_equals_and_hash = false; - object.deprecated = false; - object.java_string_check_utf8 = false; - object.cc_enable_arenas = false; - object.objc_class_prefix = ""; - object.csharp_namespace = ""; - object[".gogoproto.goproto_getters_all"] = false; - object[".gogoproto.goproto_enum_prefix_all"] = false; - object[".gogoproto.goproto_stringer_all"] = false; - object[".gogoproto.verbose_equal_all"] = false; - object[".gogoproto.face_all"] = false; - object[".gogoproto.gostring_all"] = false; - object[".gogoproto.populate_all"] = false; - object[".gogoproto.stringer_all"] = false; - object[".gogoproto.onlyone_all"] = false; - object[".gogoproto.equal_all"] = false; - object[".gogoproto.description_all"] = false; - object[".gogoproto.testgen_all"] = false; - object[".gogoproto.benchgen_all"] = false; - object[".gogoproto.marshaler_all"] = false; - object[".gogoproto.unmarshaler_all"] = false; - object[".gogoproto.stable_marshaler_all"] = false; - object[".gogoproto.sizer_all"] = false; - object[".gogoproto.goproto_enum_stringer_all"] = false; - object[".gogoproto.enum_stringer_all"] = false; - object[".gogoproto.unsafe_marshaler_all"] = false; - object[".gogoproto.unsafe_unmarshaler_all"] = false; - object[".gogoproto.goproto_extensions_map_all"] = false; - object[".gogoproto.goproto_unrecognized_all"] = false; - object[".gogoproto.gogoproto_import"] = false; - object[".gogoproto.protosizer_all"] = false; - object[".gogoproto.compare_all"] = false; - object[".gogoproto.typedecl_all"] = false; - object[".gogoproto.enumdecl_all"] = false; - object[".gogoproto.goproto_registration"] = false; - object[".gogoproto.messagename_all"] = false; - object[".gogoproto.goproto_sizecache_all"] = false; - object[".gogoproto.goproto_unkeyed_all"] = false; - } - if (message.java_package != null && message.hasOwnProperty("java_package")) - object.java_package = message.java_package; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - object.java_outer_classname = message.java_outer_classname; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - object.optimize_for = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimize_for] : message.optimize_for; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - object.java_multiple_files = message.java_multiple_files; - if (message.go_package != null && message.hasOwnProperty("go_package")) - object.go_package = message.go_package; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - object.cc_generic_services = message.cc_generic_services; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - object.java_generic_services = message.java_generic_services; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - object.py_generic_services = message.py_generic_services; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - object.java_generate_equals_and_hash = message.java_generate_equals_and_hash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - object.java_string_check_utf8 = message.java_string_check_utf8; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - object.cc_enable_arenas = message.cc_enable_arenas; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - object.objc_class_prefix = message.objc_class_prefix; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - object.csharp_namespace = message.csharp_namespace; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - object[".gogoproto.goproto_getters_all"] = message[".gogoproto.goproto_getters_all"]; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - object[".gogoproto.goproto_enum_prefix_all"] = message[".gogoproto.goproto_enum_prefix_all"]; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - object[".gogoproto.goproto_stringer_all"] = message[".gogoproto.goproto_stringer_all"]; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - object[".gogoproto.verbose_equal_all"] = message[".gogoproto.verbose_equal_all"]; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - object[".gogoproto.face_all"] = message[".gogoproto.face_all"]; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - object[".gogoproto.gostring_all"] = message[".gogoproto.gostring_all"]; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - object[".gogoproto.populate_all"] = message[".gogoproto.populate_all"]; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - object[".gogoproto.stringer_all"] = message[".gogoproto.stringer_all"]; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - object[".gogoproto.onlyone_all"] = message[".gogoproto.onlyone_all"]; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - object[".gogoproto.equal_all"] = message[".gogoproto.equal_all"]; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - object[".gogoproto.description_all"] = message[".gogoproto.description_all"]; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - object[".gogoproto.testgen_all"] = message[".gogoproto.testgen_all"]; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - object[".gogoproto.benchgen_all"] = message[".gogoproto.benchgen_all"]; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - object[".gogoproto.marshaler_all"] = message[".gogoproto.marshaler_all"]; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - object[".gogoproto.unmarshaler_all"] = message[".gogoproto.unmarshaler_all"]; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - object[".gogoproto.stable_marshaler_all"] = message[".gogoproto.stable_marshaler_all"]; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - object[".gogoproto.sizer_all"] = message[".gogoproto.sizer_all"]; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - object[".gogoproto.goproto_enum_stringer_all"] = message[".gogoproto.goproto_enum_stringer_all"]; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - object[".gogoproto.enum_stringer_all"] = message[".gogoproto.enum_stringer_all"]; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - object[".gogoproto.unsafe_marshaler_all"] = message[".gogoproto.unsafe_marshaler_all"]; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - object[".gogoproto.unsafe_unmarshaler_all"] = message[".gogoproto.unsafe_unmarshaler_all"]; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - object[".gogoproto.goproto_extensions_map_all"] = message[".gogoproto.goproto_extensions_map_all"]; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - object[".gogoproto.goproto_unrecognized_all"] = message[".gogoproto.goproto_unrecognized_all"]; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - object[".gogoproto.gogoproto_import"] = message[".gogoproto.gogoproto_import"]; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - object[".gogoproto.protosizer_all"] = message[".gogoproto.protosizer_all"]; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - object[".gogoproto.compare_all"] = message[".gogoproto.compare_all"]; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - object[".gogoproto.typedecl_all"] = message[".gogoproto.typedecl_all"]; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - object[".gogoproto.enumdecl_all"] = message[".gogoproto.enumdecl_all"]; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - object[".gogoproto.goproto_registration"] = message[".gogoproto.goproto_registration"]; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - object[".gogoproto.messagename_all"] = message[".gogoproto.messagename_all"]; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - object[".gogoproto.goproto_sizecache_all"] = message[".gogoproto.goproto_sizecache_all"]; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - object[".gogoproto.goproto_unkeyed_all"] = message[".gogoproto.goproto_unkeyed_all"]; - if (message[".cosmos_proto.declare_interface"] && message[".cosmos_proto.declare_interface"].length) { - object[".cosmos_proto.declare_interface"] = []; - for (let j = 0; j < message[".cosmos_proto.declare_interface"].length; ++j) - object[".cosmos_proto.declare_interface"][j] = $root.cosmos_proto.InterfaceDescriptor.toObject(message[".cosmos_proto.declare_interface"][j], options); - } - if (message[".cosmos_proto.declare_scalar"] && message[".cosmos_proto.declare_scalar"].length) { - object[".cosmos_proto.declare_scalar"] = []; - for (let j = 0; j < message[".cosmos_proto.declare_scalar"].length; ++j) - object[".cosmos_proto.declare_scalar"][j] = $root.cosmos_proto.ScalarDescriptor.toObject(message[".cosmos_proto.declare_scalar"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [message_set_wire_format] MessageOptions message_set_wire_format - * @property {boolean|null} [no_standard_descriptor_accessor] MessageOptions no_standard_descriptor_accessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [map_entry] MessageOptions map_entry - * @property {Array.|null} [uninterpreted_option] MessageOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters"] MessageOptions .gogoproto.goproto_getters - * @property {boolean|null} [".gogoproto.goproto_stringer"] MessageOptions .gogoproto.goproto_stringer - * @property {boolean|null} [".gogoproto.verbose_equal"] MessageOptions .gogoproto.verbose_equal - * @property {boolean|null} [".gogoproto.face"] MessageOptions .gogoproto.face - * @property {boolean|null} [".gogoproto.gostring"] MessageOptions .gogoproto.gostring - * @property {boolean|null} [".gogoproto.populate"] MessageOptions .gogoproto.populate - * @property {boolean|null} [".gogoproto.stringer"] MessageOptions .gogoproto.stringer - * @property {boolean|null} [".gogoproto.onlyone"] MessageOptions .gogoproto.onlyone - * @property {boolean|null} [".gogoproto.equal"] MessageOptions .gogoproto.equal - * @property {boolean|null} [".gogoproto.description"] MessageOptions .gogoproto.description - * @property {boolean|null} [".gogoproto.testgen"] MessageOptions .gogoproto.testgen - * @property {boolean|null} [".gogoproto.benchgen"] MessageOptions .gogoproto.benchgen - * @property {boolean|null} [".gogoproto.marshaler"] MessageOptions .gogoproto.marshaler - * @property {boolean|null} [".gogoproto.unmarshaler"] MessageOptions .gogoproto.unmarshaler - * @property {boolean|null} [".gogoproto.stable_marshaler"] MessageOptions .gogoproto.stable_marshaler - * @property {boolean|null} [".gogoproto.sizer"] MessageOptions .gogoproto.sizer - * @property {boolean|null} [".gogoproto.unsafe_marshaler"] MessageOptions .gogoproto.unsafe_marshaler - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler"] MessageOptions .gogoproto.unsafe_unmarshaler - * @property {boolean|null} [".gogoproto.goproto_extensions_map"] MessageOptions .gogoproto.goproto_extensions_map - * @property {boolean|null} [".gogoproto.goproto_unrecognized"] MessageOptions .gogoproto.goproto_unrecognized - * @property {boolean|null} [".gogoproto.protosizer"] MessageOptions .gogoproto.protosizer - * @property {boolean|null} [".gogoproto.compare"] MessageOptions .gogoproto.compare - * @property {boolean|null} [".gogoproto.typedecl"] MessageOptions .gogoproto.typedecl - * @property {boolean|null} [".gogoproto.messagename"] MessageOptions .gogoproto.messagename - * @property {boolean|null} [".gogoproto.goproto_sizecache"] MessageOptions .gogoproto.goproto_sizecache - * @property {boolean|null} [".gogoproto.goproto_unkeyed"] MessageOptions .gogoproto.goproto_unkeyed - * @property {Array.|null} [".cosmos_proto.implements_interface"] MessageOptions .cosmos_proto.implements_interface - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpreted_option = []; - this[".cosmos_proto.implements_interface"] = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions message_set_wire_format. - * @member {boolean} message_set_wire_format - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.message_set_wire_format = false; - - /** - * MessageOptions no_standard_descriptor_accessor. - * @member {boolean} no_standard_descriptor_accessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.no_standard_descriptor_accessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions map_entry. - * @member {boolean} map_entry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.map_entry = false; - - /** - * MessageOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MessageOptions .gogoproto.goproto_getters. - * @member {boolean} .gogoproto.goproto_getters - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_getters"] = false; - - /** - * MessageOptions .gogoproto.goproto_stringer. - * @member {boolean} .gogoproto.goproto_stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_stringer"] = false; - - /** - * MessageOptions .gogoproto.verbose_equal. - * @member {boolean} .gogoproto.verbose_equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.verbose_equal"] = false; - - /** - * MessageOptions .gogoproto.face. - * @member {boolean} .gogoproto.face - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.face"] = false; - - /** - * MessageOptions .gogoproto.gostring. - * @member {boolean} .gogoproto.gostring - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.gostring"] = false; - - /** - * MessageOptions .gogoproto.populate. - * @member {boolean} .gogoproto.populate - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.populate"] = false; - - /** - * MessageOptions .gogoproto.stringer. - * @member {boolean} .gogoproto.stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stringer"] = false; - - /** - * MessageOptions .gogoproto.onlyone. - * @member {boolean} .gogoproto.onlyone - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.onlyone"] = false; - - /** - * MessageOptions .gogoproto.equal. - * @member {boolean} .gogoproto.equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.equal"] = false; - - /** - * MessageOptions .gogoproto.description. - * @member {boolean} .gogoproto.description - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.description"] = false; - - /** - * MessageOptions .gogoproto.testgen. - * @member {boolean} .gogoproto.testgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.testgen"] = false; - - /** - * MessageOptions .gogoproto.benchgen. - * @member {boolean} .gogoproto.benchgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.benchgen"] = false; - - /** - * MessageOptions .gogoproto.marshaler. - * @member {boolean} .gogoproto.marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.marshaler"] = false; - - /** - * MessageOptions .gogoproto.unmarshaler. - * @member {boolean} .gogoproto.unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.stable_marshaler. - * @member {boolean} .gogoproto.stable_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stable_marshaler"] = false; - - /** - * MessageOptions .gogoproto.sizer. - * @member {boolean} .gogoproto.sizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.sizer"] = false; - - /** - * MessageOptions .gogoproto.unsafe_marshaler. - * @member {boolean} .gogoproto.unsafe_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_marshaler"] = false; - - /** - * MessageOptions .gogoproto.unsafe_unmarshaler. - * @member {boolean} .gogoproto.unsafe_unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.goproto_extensions_map. - * @member {boolean} .gogoproto.goproto_extensions_map - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_extensions_map"] = false; - - /** - * MessageOptions .gogoproto.goproto_unrecognized. - * @member {boolean} .gogoproto.goproto_unrecognized - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unrecognized"] = false; - - /** - * MessageOptions .gogoproto.protosizer. - * @member {boolean} .gogoproto.protosizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.protosizer"] = false; - - /** - * MessageOptions .gogoproto.compare. - * @member {boolean} .gogoproto.compare - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.compare"] = false; - - /** - * MessageOptions .gogoproto.typedecl. - * @member {boolean} .gogoproto.typedecl - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.typedecl"] = false; - - /** - * MessageOptions .gogoproto.messagename. - * @member {boolean} .gogoproto.messagename - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.messagename"] = false; - - /** - * MessageOptions .gogoproto.goproto_sizecache. - * @member {boolean} .gogoproto.goproto_sizecache - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_sizecache"] = false; - - /** - * MessageOptions .gogoproto.goproto_unkeyed. - * @member {boolean} .gogoproto.goproto_unkeyed - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unkeyed"] = false; - - /** - * MessageOptions .cosmos_proto.implements_interface. - * @member {Array.} .cosmos_proto.implements_interface - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".cosmos_proto.implements_interface"] = $util.emptyArray; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message_set_wire_format != null && Object.hasOwnProperty.call(message, "message_set_wire_format")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.message_set_wire_format); - if (message.no_standard_descriptor_accessor != null && Object.hasOwnProperty.call(message, "no_standard_descriptor_accessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.no_standard_descriptor_accessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.map_entry != null && Object.hasOwnProperty.call(message, "map_entry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.map_entry); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters")) - writer.uint32(/* id 64001, wireType 0 =*/512008).bool(message[".gogoproto.goproto_getters"]); - if (message[".gogoproto.goproto_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer")) - writer.uint32(/* id 64003, wireType 0 =*/512024).bool(message[".gogoproto.goproto_stringer"]); - if (message[".gogoproto.verbose_equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal")) - writer.uint32(/* id 64004, wireType 0 =*/512032).bool(message[".gogoproto.verbose_equal"]); - if (message[".gogoproto.face"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face")) - writer.uint32(/* id 64005, wireType 0 =*/512040).bool(message[".gogoproto.face"]); - if (message[".gogoproto.gostring"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring")) - writer.uint32(/* id 64006, wireType 0 =*/512048).bool(message[".gogoproto.gostring"]); - if (message[".gogoproto.populate"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate")) - writer.uint32(/* id 64007, wireType 0 =*/512056).bool(message[".gogoproto.populate"]); - if (message[".gogoproto.onlyone"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone")) - writer.uint32(/* id 64009, wireType 0 =*/512072).bool(message[".gogoproto.onlyone"]); - if (message[".gogoproto.equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal")) - writer.uint32(/* id 64013, wireType 0 =*/512104).bool(message[".gogoproto.equal"]); - if (message[".gogoproto.description"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description")) - writer.uint32(/* id 64014, wireType 0 =*/512112).bool(message[".gogoproto.description"]); - if (message[".gogoproto.testgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen")) - writer.uint32(/* id 64015, wireType 0 =*/512120).bool(message[".gogoproto.testgen"]); - if (message[".gogoproto.benchgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen")) - writer.uint32(/* id 64016, wireType 0 =*/512128).bool(message[".gogoproto.benchgen"]); - if (message[".gogoproto.marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler")) - writer.uint32(/* id 64017, wireType 0 =*/512136).bool(message[".gogoproto.marshaler"]); - if (message[".gogoproto.unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler")) - writer.uint32(/* id 64018, wireType 0 =*/512144).bool(message[".gogoproto.unmarshaler"]); - if (message[".gogoproto.stable_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler")) - writer.uint32(/* id 64019, wireType 0 =*/512152).bool(message[".gogoproto.stable_marshaler"]); - if (message[".gogoproto.sizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer")) - writer.uint32(/* id 64020, wireType 0 =*/512160).bool(message[".gogoproto.sizer"]); - if (message[".gogoproto.unsafe_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler")) - writer.uint32(/* id 64023, wireType 0 =*/512184).bool(message[".gogoproto.unsafe_marshaler"]); - if (message[".gogoproto.unsafe_unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler")) - writer.uint32(/* id 64024, wireType 0 =*/512192).bool(message[".gogoproto.unsafe_unmarshaler"]); - if (message[".gogoproto.goproto_extensions_map"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map")) - writer.uint32(/* id 64025, wireType 0 =*/512200).bool(message[".gogoproto.goproto_extensions_map"]); - if (message[".gogoproto.goproto_unrecognized"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized")) - writer.uint32(/* id 64026, wireType 0 =*/512208).bool(message[".gogoproto.goproto_unrecognized"]); - if (message[".gogoproto.protosizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer")) - writer.uint32(/* id 64028, wireType 0 =*/512224).bool(message[".gogoproto.protosizer"]); - if (message[".gogoproto.compare"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare")) - writer.uint32(/* id 64029, wireType 0 =*/512232).bool(message[".gogoproto.compare"]); - if (message[".gogoproto.typedecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl")) - writer.uint32(/* id 64030, wireType 0 =*/512240).bool(message[".gogoproto.typedecl"]); - if (message[".gogoproto.messagename"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename")) - writer.uint32(/* id 64033, wireType 0 =*/512264).bool(message[".gogoproto.messagename"]); - if (message[".gogoproto.goproto_sizecache"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache")) - writer.uint32(/* id 64034, wireType 0 =*/512272).bool(message[".gogoproto.goproto_sizecache"]); - if (message[".gogoproto.goproto_unkeyed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed")) - writer.uint32(/* id 64035, wireType 0 =*/512280).bool(message[".gogoproto.goproto_unkeyed"]); - if (message[".gogoproto.stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer")) - writer.uint32(/* id 67008, wireType 0 =*/536064).bool(message[".gogoproto.stringer"]); - if (message[".cosmos_proto.implements_interface"] != null && message[".cosmos_proto.implements_interface"].length) - for (let i = 0; i < message[".cosmos_proto.implements_interface"].length; ++i) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.implements_interface"][i]); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 64001: - message[".gogoproto.goproto_getters"] = reader.bool(); - break; - case 64003: - message[".gogoproto.goproto_stringer"] = reader.bool(); - break; - case 64004: - message[".gogoproto.verbose_equal"] = reader.bool(); - break; - case 64005: - message[".gogoproto.face"] = reader.bool(); - break; - case 64006: - message[".gogoproto.gostring"] = reader.bool(); - break; - case 64007: - message[".gogoproto.populate"] = reader.bool(); - break; - case 67008: - message[".gogoproto.stringer"] = reader.bool(); - break; - case 64009: - message[".gogoproto.onlyone"] = reader.bool(); - break; - case 64013: - message[".gogoproto.equal"] = reader.bool(); - break; - case 64014: - message[".gogoproto.description"] = reader.bool(); - break; - case 64015: - message[".gogoproto.testgen"] = reader.bool(); - break; - case 64016: - message[".gogoproto.benchgen"] = reader.bool(); - break; - case 64017: - message[".gogoproto.marshaler"] = reader.bool(); - break; - case 64018: - message[".gogoproto.unmarshaler"] = reader.bool(); - break; - case 64019: - message[".gogoproto.stable_marshaler"] = reader.bool(); - break; - case 64020: - message[".gogoproto.sizer"] = reader.bool(); - break; - case 64023: - message[".gogoproto.unsafe_marshaler"] = reader.bool(); - break; - case 64024: - message[".gogoproto.unsafe_unmarshaler"] = reader.bool(); - break; - case 64025: - message[".gogoproto.goproto_extensions_map"] = reader.bool(); - break; - case 64026: - message[".gogoproto.goproto_unrecognized"] = reader.bool(); - break; - case 64028: - message[".gogoproto.protosizer"] = reader.bool(); - break; - case 64029: - message[".gogoproto.compare"] = reader.bool(); - break; - case 64030: - message[".gogoproto.typedecl"] = reader.bool(); - break; - case 64033: - message[".gogoproto.messagename"] = reader.bool(); - break; - case 64034: - message[".gogoproto.goproto_sizecache"] = reader.bool(); - break; - case 64035: - message[".gogoproto.goproto_unkeyed"] = reader.bool(); - break; - case 93001: - if (!(message[".cosmos_proto.implements_interface"] && message[".cosmos_proto.implements_interface"].length)) - message[".cosmos_proto.implements_interface"] = []; - message[".cosmos_proto.implements_interface"].push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - if (typeof message.message_set_wire_format !== "boolean") - return "message_set_wire_format: boolean expected"; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - if (typeof message.no_standard_descriptor_accessor !== "boolean") - return "no_standard_descriptor_accessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - if (typeof message.map_entry !== "boolean") - return "map_entry: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - if (typeof message[".gogoproto.goproto_getters"] !== "boolean") - return ".gogoproto.goproto_getters: boolean expected"; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - if (typeof message[".gogoproto.goproto_stringer"] !== "boolean") - return ".gogoproto.goproto_stringer: boolean expected"; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - if (typeof message[".gogoproto.verbose_equal"] !== "boolean") - return ".gogoproto.verbose_equal: boolean expected"; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - if (typeof message[".gogoproto.face"] !== "boolean") - return ".gogoproto.face: boolean expected"; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - if (typeof message[".gogoproto.gostring"] !== "boolean") - return ".gogoproto.gostring: boolean expected"; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - if (typeof message[".gogoproto.populate"] !== "boolean") - return ".gogoproto.populate: boolean expected"; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - if (typeof message[".gogoproto.stringer"] !== "boolean") - return ".gogoproto.stringer: boolean expected"; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - if (typeof message[".gogoproto.onlyone"] !== "boolean") - return ".gogoproto.onlyone: boolean expected"; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - if (typeof message[".gogoproto.equal"] !== "boolean") - return ".gogoproto.equal: boolean expected"; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - if (typeof message[".gogoproto.description"] !== "boolean") - return ".gogoproto.description: boolean expected"; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - if (typeof message[".gogoproto.testgen"] !== "boolean") - return ".gogoproto.testgen: boolean expected"; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - if (typeof message[".gogoproto.benchgen"] !== "boolean") - return ".gogoproto.benchgen: boolean expected"; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - if (typeof message[".gogoproto.marshaler"] !== "boolean") - return ".gogoproto.marshaler: boolean expected"; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - if (typeof message[".gogoproto.unmarshaler"] !== "boolean") - return ".gogoproto.unmarshaler: boolean expected"; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - if (typeof message[".gogoproto.stable_marshaler"] !== "boolean") - return ".gogoproto.stable_marshaler: boolean expected"; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - if (typeof message[".gogoproto.sizer"] !== "boolean") - return ".gogoproto.sizer: boolean expected"; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - if (typeof message[".gogoproto.unsafe_marshaler"] !== "boolean") - return ".gogoproto.unsafe_marshaler: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - if (typeof message[".gogoproto.unsafe_unmarshaler"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler: boolean expected"; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - if (typeof message[".gogoproto.goproto_extensions_map"] !== "boolean") - return ".gogoproto.goproto_extensions_map: boolean expected"; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - if (typeof message[".gogoproto.goproto_unrecognized"] !== "boolean") - return ".gogoproto.goproto_unrecognized: boolean expected"; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - if (typeof message[".gogoproto.protosizer"] !== "boolean") - return ".gogoproto.protosizer: boolean expected"; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - if (typeof message[".gogoproto.compare"] !== "boolean") - return ".gogoproto.compare: boolean expected"; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - if (typeof message[".gogoproto.typedecl"] !== "boolean") - return ".gogoproto.typedecl: boolean expected"; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - if (typeof message[".gogoproto.messagename"] !== "boolean") - return ".gogoproto.messagename: boolean expected"; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - if (typeof message[".gogoproto.goproto_sizecache"] !== "boolean") - return ".gogoproto.goproto_sizecache: boolean expected"; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - if (typeof message[".gogoproto.goproto_unkeyed"] !== "boolean") - return ".gogoproto.goproto_unkeyed: boolean expected"; - if (message[".cosmos_proto.implements_interface"] != null && message.hasOwnProperty(".cosmos_proto.implements_interface")) { - if (!Array.isArray(message[".cosmos_proto.implements_interface"])) - return ".cosmos_proto.implements_interface: array expected"; - for (let i = 0; i < message[".cosmos_proto.implements_interface"].length; ++i) - if (!$util.isString(message[".cosmos_proto.implements_interface"][i])) - return ".cosmos_proto.implements_interface: string[] expected"; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - let message = new $root.google.protobuf.MessageOptions(); - if (object.message_set_wire_format != null) - message.message_set_wire_format = Boolean(object.message_set_wire_format); - if (object.no_standard_descriptor_accessor != null) - message.no_standard_descriptor_accessor = Boolean(object.no_standard_descriptor_accessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.map_entry != null) - message.map_entry = Boolean(object.map_entry); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters"] != null) - message[".gogoproto.goproto_getters"] = Boolean(object[".gogoproto.goproto_getters"]); - if (object[".gogoproto.goproto_stringer"] != null) - message[".gogoproto.goproto_stringer"] = Boolean(object[".gogoproto.goproto_stringer"]); - if (object[".gogoproto.verbose_equal"] != null) - message[".gogoproto.verbose_equal"] = Boolean(object[".gogoproto.verbose_equal"]); - if (object[".gogoproto.face"] != null) - message[".gogoproto.face"] = Boolean(object[".gogoproto.face"]); - if (object[".gogoproto.gostring"] != null) - message[".gogoproto.gostring"] = Boolean(object[".gogoproto.gostring"]); - if (object[".gogoproto.populate"] != null) - message[".gogoproto.populate"] = Boolean(object[".gogoproto.populate"]); - if (object[".gogoproto.stringer"] != null) - message[".gogoproto.stringer"] = Boolean(object[".gogoproto.stringer"]); - if (object[".gogoproto.onlyone"] != null) - message[".gogoproto.onlyone"] = Boolean(object[".gogoproto.onlyone"]); - if (object[".gogoproto.equal"] != null) - message[".gogoproto.equal"] = Boolean(object[".gogoproto.equal"]); - if (object[".gogoproto.description"] != null) - message[".gogoproto.description"] = Boolean(object[".gogoproto.description"]); - if (object[".gogoproto.testgen"] != null) - message[".gogoproto.testgen"] = Boolean(object[".gogoproto.testgen"]); - if (object[".gogoproto.benchgen"] != null) - message[".gogoproto.benchgen"] = Boolean(object[".gogoproto.benchgen"]); - if (object[".gogoproto.marshaler"] != null) - message[".gogoproto.marshaler"] = Boolean(object[".gogoproto.marshaler"]); - if (object[".gogoproto.unmarshaler"] != null) - message[".gogoproto.unmarshaler"] = Boolean(object[".gogoproto.unmarshaler"]); - if (object[".gogoproto.stable_marshaler"] != null) - message[".gogoproto.stable_marshaler"] = Boolean(object[".gogoproto.stable_marshaler"]); - if (object[".gogoproto.sizer"] != null) - message[".gogoproto.sizer"] = Boolean(object[".gogoproto.sizer"]); - if (object[".gogoproto.unsafe_marshaler"] != null) - message[".gogoproto.unsafe_marshaler"] = Boolean(object[".gogoproto.unsafe_marshaler"]); - if (object[".gogoproto.unsafe_unmarshaler"] != null) - message[".gogoproto.unsafe_unmarshaler"] = Boolean(object[".gogoproto.unsafe_unmarshaler"]); - if (object[".gogoproto.goproto_extensions_map"] != null) - message[".gogoproto.goproto_extensions_map"] = Boolean(object[".gogoproto.goproto_extensions_map"]); - if (object[".gogoproto.goproto_unrecognized"] != null) - message[".gogoproto.goproto_unrecognized"] = Boolean(object[".gogoproto.goproto_unrecognized"]); - if (object[".gogoproto.protosizer"] != null) - message[".gogoproto.protosizer"] = Boolean(object[".gogoproto.protosizer"]); - if (object[".gogoproto.compare"] != null) - message[".gogoproto.compare"] = Boolean(object[".gogoproto.compare"]); - if (object[".gogoproto.typedecl"] != null) - message[".gogoproto.typedecl"] = Boolean(object[".gogoproto.typedecl"]); - if (object[".gogoproto.messagename"] != null) - message[".gogoproto.messagename"] = Boolean(object[".gogoproto.messagename"]); - if (object[".gogoproto.goproto_sizecache"] != null) - message[".gogoproto.goproto_sizecache"] = Boolean(object[".gogoproto.goproto_sizecache"]); - if (object[".gogoproto.goproto_unkeyed"] != null) - message[".gogoproto.goproto_unkeyed"] = Boolean(object[".gogoproto.goproto_unkeyed"]); - if (object[".cosmos_proto.implements_interface"]) { - if (!Array.isArray(object[".cosmos_proto.implements_interface"])) - throw TypeError(".google.protobuf.MessageOptions..cosmos_proto.implements_interface: array expected"); - message[".cosmos_proto.implements_interface"] = []; - for (let i = 0; i < object[".cosmos_proto.implements_interface"].length; ++i) - message[".cosmos_proto.implements_interface"][i] = String(object[".cosmos_proto.implements_interface"][i]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.uninterpreted_option = []; - object[".cosmos_proto.implements_interface"] = []; - } - if (options.defaults) { - object.message_set_wire_format = false; - object.no_standard_descriptor_accessor = false; - object.deprecated = false; - object.map_entry = false; - object[".gogoproto.goproto_getters"] = false; - object[".gogoproto.goproto_stringer"] = false; - object[".gogoproto.verbose_equal"] = false; - object[".gogoproto.face"] = false; - object[".gogoproto.gostring"] = false; - object[".gogoproto.populate"] = false; - object[".gogoproto.onlyone"] = false; - object[".gogoproto.equal"] = false; - object[".gogoproto.description"] = false; - object[".gogoproto.testgen"] = false; - object[".gogoproto.benchgen"] = false; - object[".gogoproto.marshaler"] = false; - object[".gogoproto.unmarshaler"] = false; - object[".gogoproto.stable_marshaler"] = false; - object[".gogoproto.sizer"] = false; - object[".gogoproto.unsafe_marshaler"] = false; - object[".gogoproto.unsafe_unmarshaler"] = false; - object[".gogoproto.goproto_extensions_map"] = false; - object[".gogoproto.goproto_unrecognized"] = false; - object[".gogoproto.protosizer"] = false; - object[".gogoproto.compare"] = false; - object[".gogoproto.typedecl"] = false; - object[".gogoproto.messagename"] = false; - object[".gogoproto.goproto_sizecache"] = false; - object[".gogoproto.goproto_unkeyed"] = false; - object[".gogoproto.stringer"] = false; - } - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - object.message_set_wire_format = message.message_set_wire_format; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - object.no_standard_descriptor_accessor = message.no_standard_descriptor_accessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - object.map_entry = message.map_entry; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - object[".gogoproto.goproto_getters"] = message[".gogoproto.goproto_getters"]; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - object[".gogoproto.goproto_stringer"] = message[".gogoproto.goproto_stringer"]; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - object[".gogoproto.verbose_equal"] = message[".gogoproto.verbose_equal"]; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - object[".gogoproto.face"] = message[".gogoproto.face"]; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - object[".gogoproto.gostring"] = message[".gogoproto.gostring"]; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - object[".gogoproto.populate"] = message[".gogoproto.populate"]; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - object[".gogoproto.onlyone"] = message[".gogoproto.onlyone"]; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - object[".gogoproto.equal"] = message[".gogoproto.equal"]; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - object[".gogoproto.description"] = message[".gogoproto.description"]; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - object[".gogoproto.testgen"] = message[".gogoproto.testgen"]; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - object[".gogoproto.benchgen"] = message[".gogoproto.benchgen"]; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - object[".gogoproto.marshaler"] = message[".gogoproto.marshaler"]; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - object[".gogoproto.unmarshaler"] = message[".gogoproto.unmarshaler"]; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - object[".gogoproto.stable_marshaler"] = message[".gogoproto.stable_marshaler"]; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - object[".gogoproto.sizer"] = message[".gogoproto.sizer"]; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - object[".gogoproto.unsafe_marshaler"] = message[".gogoproto.unsafe_marshaler"]; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - object[".gogoproto.unsafe_unmarshaler"] = message[".gogoproto.unsafe_unmarshaler"]; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - object[".gogoproto.goproto_extensions_map"] = message[".gogoproto.goproto_extensions_map"]; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - object[".gogoproto.goproto_unrecognized"] = message[".gogoproto.goproto_unrecognized"]; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - object[".gogoproto.protosizer"] = message[".gogoproto.protosizer"]; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - object[".gogoproto.compare"] = message[".gogoproto.compare"]; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - object[".gogoproto.typedecl"] = message[".gogoproto.typedecl"]; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - object[".gogoproto.messagename"] = message[".gogoproto.messagename"]; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - object[".gogoproto.goproto_sizecache"] = message[".gogoproto.goproto_sizecache"]; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - object[".gogoproto.goproto_unkeyed"] = message[".gogoproto.goproto_unkeyed"]; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - object[".gogoproto.stringer"] = message[".gogoproto.stringer"]; - if (message[".cosmos_proto.implements_interface"] && message[".cosmos_proto.implements_interface"].length) { - object[".cosmos_proto.implements_interface"] = []; - for (let j = 0; j < message[".cosmos_proto.implements_interface"].length; ++j) - object[".cosmos_proto.implements_interface"][j] = message[".cosmos_proto.implements_interface"][j]; - } - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpreted_option] FieldOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.nullable"] FieldOptions .gogoproto.nullable - * @property {boolean|null} [".gogoproto.embed"] FieldOptions .gogoproto.embed - * @property {string|null} [".gogoproto.customtype"] FieldOptions .gogoproto.customtype - * @property {string|null} [".gogoproto.customname"] FieldOptions .gogoproto.customname - * @property {string|null} [".gogoproto.jsontag"] FieldOptions .gogoproto.jsontag - * @property {string|null} [".gogoproto.moretags"] FieldOptions .gogoproto.moretags - * @property {string|null} [".gogoproto.casttype"] FieldOptions .gogoproto.casttype - * @property {string|null} [".gogoproto.castkey"] FieldOptions .gogoproto.castkey - * @property {string|null} [".gogoproto.castvalue"] FieldOptions .gogoproto.castvalue - * @property {boolean|null} [".gogoproto.stdtime"] FieldOptions .gogoproto.stdtime - * @property {boolean|null} [".gogoproto.stdduration"] FieldOptions .gogoproto.stdduration - * @property {boolean|null} [".gogoproto.wktpointer"] FieldOptions .gogoproto.wktpointer - * @property {string|null} [".gogoproto.castrepeated"] FieldOptions .gogoproto.castrepeated - * @property {string|null} [".cosmos_proto.accepts_interface"] FieldOptions .cosmos_proto.accepts_interface - * @property {string|null} [".cosmos_proto.scalar"] FieldOptions .cosmos_proto.scalar - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FieldOptions .gogoproto.nullable. - * @member {boolean} .gogoproto.nullable - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.nullable"] = false; - - /** - * FieldOptions .gogoproto.embed. - * @member {boolean} .gogoproto.embed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.embed"] = false; - - /** - * FieldOptions .gogoproto.customtype. - * @member {string} .gogoproto.customtype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customtype"] = ""; - - /** - * FieldOptions .gogoproto.customname. - * @member {string} .gogoproto.customname - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customname"] = ""; - - /** - * FieldOptions .gogoproto.jsontag. - * @member {string} .gogoproto.jsontag - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.jsontag"] = ""; - - /** - * FieldOptions .gogoproto.moretags. - * @member {string} .gogoproto.moretags - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.moretags"] = ""; - - /** - * FieldOptions .gogoproto.casttype. - * @member {string} .gogoproto.casttype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.casttype"] = ""; - - /** - * FieldOptions .gogoproto.castkey. - * @member {string} .gogoproto.castkey - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castkey"] = ""; - - /** - * FieldOptions .gogoproto.castvalue. - * @member {string} .gogoproto.castvalue - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castvalue"] = ""; - - /** - * FieldOptions .gogoproto.stdtime. - * @member {boolean} .gogoproto.stdtime - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdtime"] = false; - - /** - * FieldOptions .gogoproto.stdduration. - * @member {boolean} .gogoproto.stdduration - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdduration"] = false; - - /** - * FieldOptions .gogoproto.wktpointer. - * @member {boolean} .gogoproto.wktpointer - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.wktpointer"] = false; - - /** - * FieldOptions .gogoproto.castrepeated. - * @member {string} .gogoproto.castrepeated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castrepeated"] = ""; - - /** - * FieldOptions .cosmos_proto.accepts_interface. - * @member {string} .cosmos_proto.accepts_interface - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".cosmos_proto.accepts_interface"] = ""; - - /** - * FieldOptions .cosmos_proto.scalar. - * @member {string} .cosmos_proto.scalar - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".cosmos_proto.scalar"] = ""; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.nullable"] != null && Object.hasOwnProperty.call(message, ".gogoproto.nullable")) - writer.uint32(/* id 65001, wireType 0 =*/520008).bool(message[".gogoproto.nullable"]); - if (message[".gogoproto.embed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.embed")) - writer.uint32(/* id 65002, wireType 0 =*/520016).bool(message[".gogoproto.embed"]); - if (message[".gogoproto.customtype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customtype")) - writer.uint32(/* id 65003, wireType 2 =*/520026).string(message[".gogoproto.customtype"]); - if (message[".gogoproto.customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customname")) - writer.uint32(/* id 65004, wireType 2 =*/520034).string(message[".gogoproto.customname"]); - if (message[".gogoproto.jsontag"] != null && Object.hasOwnProperty.call(message, ".gogoproto.jsontag")) - writer.uint32(/* id 65005, wireType 2 =*/520042).string(message[".gogoproto.jsontag"]); - if (message[".gogoproto.moretags"] != null && Object.hasOwnProperty.call(message, ".gogoproto.moretags")) - writer.uint32(/* id 65006, wireType 2 =*/520050).string(message[".gogoproto.moretags"]); - if (message[".gogoproto.casttype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.casttype")) - writer.uint32(/* id 65007, wireType 2 =*/520058).string(message[".gogoproto.casttype"]); - if (message[".gogoproto.castkey"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castkey")) - writer.uint32(/* id 65008, wireType 2 =*/520066).string(message[".gogoproto.castkey"]); - if (message[".gogoproto.castvalue"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castvalue")) - writer.uint32(/* id 65009, wireType 2 =*/520074).string(message[".gogoproto.castvalue"]); - if (message[".gogoproto.stdtime"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdtime")) - writer.uint32(/* id 65010, wireType 0 =*/520080).bool(message[".gogoproto.stdtime"]); - if (message[".gogoproto.stdduration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdduration")) - writer.uint32(/* id 65011, wireType 0 =*/520088).bool(message[".gogoproto.stdduration"]); - if (message[".gogoproto.wktpointer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.wktpointer")) - writer.uint32(/* id 65012, wireType 0 =*/520096).bool(message[".gogoproto.wktpointer"]); - if (message[".gogoproto.castrepeated"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castrepeated")) - writer.uint32(/* id 65013, wireType 2 =*/520106).string(message[".gogoproto.castrepeated"]); - if (message[".cosmos_proto.accepts_interface"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.accepts_interface")) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.accepts_interface"]); - if (message[".cosmos_proto.scalar"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.scalar")) - writer.uint32(/* id 93002, wireType 2 =*/744018).string(message[".cosmos_proto.scalar"]); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 65001: - message[".gogoproto.nullable"] = reader.bool(); - break; - case 65002: - message[".gogoproto.embed"] = reader.bool(); - break; - case 65003: - message[".gogoproto.customtype"] = reader.string(); - break; - case 65004: - message[".gogoproto.customname"] = reader.string(); - break; - case 65005: - message[".gogoproto.jsontag"] = reader.string(); - break; - case 65006: - message[".gogoproto.moretags"] = reader.string(); - break; - case 65007: - message[".gogoproto.casttype"] = reader.string(); - break; - case 65008: - message[".gogoproto.castkey"] = reader.string(); - break; - case 65009: - message[".gogoproto.castvalue"] = reader.string(); - break; - case 65010: - message[".gogoproto.stdtime"] = reader.bool(); - break; - case 65011: - message[".gogoproto.stdduration"] = reader.bool(); - break; - case 65012: - message[".gogoproto.wktpointer"] = reader.bool(); - break; - case 65013: - message[".gogoproto.castrepeated"] = reader.string(); - break; - case 93001: - message[".cosmos_proto.accepts_interface"] = reader.string(); - break; - case 93002: - message[".cosmos_proto.scalar"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - if (typeof message[".gogoproto.nullable"] !== "boolean") - return ".gogoproto.nullable: boolean expected"; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - if (typeof message[".gogoproto.embed"] !== "boolean") - return ".gogoproto.embed: boolean expected"; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - if (!$util.isString(message[".gogoproto.customtype"])) - return ".gogoproto.customtype: string expected"; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - if (!$util.isString(message[".gogoproto.customname"])) - return ".gogoproto.customname: string expected"; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - if (!$util.isString(message[".gogoproto.jsontag"])) - return ".gogoproto.jsontag: string expected"; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - if (!$util.isString(message[".gogoproto.moretags"])) - return ".gogoproto.moretags: string expected"; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - if (!$util.isString(message[".gogoproto.casttype"])) - return ".gogoproto.casttype: string expected"; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - if (!$util.isString(message[".gogoproto.castkey"])) - return ".gogoproto.castkey: string expected"; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - if (!$util.isString(message[".gogoproto.castvalue"])) - return ".gogoproto.castvalue: string expected"; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - if (typeof message[".gogoproto.stdtime"] !== "boolean") - return ".gogoproto.stdtime: boolean expected"; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - if (typeof message[".gogoproto.stdduration"] !== "boolean") - return ".gogoproto.stdduration: boolean expected"; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - if (typeof message[".gogoproto.wktpointer"] !== "boolean") - return ".gogoproto.wktpointer: boolean expected"; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - if (!$util.isString(message[".gogoproto.castrepeated"])) - return ".gogoproto.castrepeated: string expected"; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - if (!$util.isString(message[".cosmos_proto.accepts_interface"])) - return ".cosmos_proto.accepts_interface: string expected"; - if (message[".cosmos_proto.scalar"] != null && message.hasOwnProperty(".cosmos_proto.scalar")) - if (!$util.isString(message[".cosmos_proto.scalar"])) - return ".cosmos_proto.scalar: string expected"; - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - let message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.nullable"] != null) - message[".gogoproto.nullable"] = Boolean(object[".gogoproto.nullable"]); - if (object[".gogoproto.embed"] != null) - message[".gogoproto.embed"] = Boolean(object[".gogoproto.embed"]); - if (object[".gogoproto.customtype"] != null) - message[".gogoproto.customtype"] = String(object[".gogoproto.customtype"]); - if (object[".gogoproto.customname"] != null) - message[".gogoproto.customname"] = String(object[".gogoproto.customname"]); - if (object[".gogoproto.jsontag"] != null) - message[".gogoproto.jsontag"] = String(object[".gogoproto.jsontag"]); - if (object[".gogoproto.moretags"] != null) - message[".gogoproto.moretags"] = String(object[".gogoproto.moretags"]); - if (object[".gogoproto.casttype"] != null) - message[".gogoproto.casttype"] = String(object[".gogoproto.casttype"]); - if (object[".gogoproto.castkey"] != null) - message[".gogoproto.castkey"] = String(object[".gogoproto.castkey"]); - if (object[".gogoproto.castvalue"] != null) - message[".gogoproto.castvalue"] = String(object[".gogoproto.castvalue"]); - if (object[".gogoproto.stdtime"] != null) - message[".gogoproto.stdtime"] = Boolean(object[".gogoproto.stdtime"]); - if (object[".gogoproto.stdduration"] != null) - message[".gogoproto.stdduration"] = Boolean(object[".gogoproto.stdduration"]); - if (object[".gogoproto.wktpointer"] != null) - message[".gogoproto.wktpointer"] = Boolean(object[".gogoproto.wktpointer"]); - if (object[".gogoproto.castrepeated"] != null) - message[".gogoproto.castrepeated"] = String(object[".gogoproto.castrepeated"]); - if (object[".cosmos_proto.accepts_interface"] != null) - message[".cosmos_proto.accepts_interface"] = String(object[".cosmos_proto.accepts_interface"]); - if (object[".cosmos_proto.scalar"] != null) - message[".cosmos_proto.scalar"] = String(object[".cosmos_proto.scalar"]); - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object[".gogoproto.nullable"] = false; - object[".gogoproto.embed"] = false; - object[".gogoproto.customtype"] = ""; - object[".gogoproto.customname"] = ""; - object[".gogoproto.jsontag"] = ""; - object[".gogoproto.moretags"] = ""; - object[".gogoproto.casttype"] = ""; - object[".gogoproto.castkey"] = ""; - object[".gogoproto.castvalue"] = ""; - object[".gogoproto.stdtime"] = false; - object[".gogoproto.stdduration"] = false; - object[".gogoproto.wktpointer"] = false; - object[".gogoproto.castrepeated"] = ""; - object[".cosmos_proto.accepts_interface"] = ""; - object[".cosmos_proto.scalar"] = ""; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - object[".gogoproto.nullable"] = message[".gogoproto.nullable"]; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - object[".gogoproto.embed"] = message[".gogoproto.embed"]; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - object[".gogoproto.customtype"] = message[".gogoproto.customtype"]; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - object[".gogoproto.customname"] = message[".gogoproto.customname"]; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - object[".gogoproto.jsontag"] = message[".gogoproto.jsontag"]; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - object[".gogoproto.moretags"] = message[".gogoproto.moretags"]; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - object[".gogoproto.casttype"] = message[".gogoproto.casttype"]; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - object[".gogoproto.castkey"] = message[".gogoproto.castkey"]; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - object[".gogoproto.castvalue"] = message[".gogoproto.castvalue"]; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - object[".gogoproto.stdtime"] = message[".gogoproto.stdtime"]; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - object[".gogoproto.stdduration"] = message[".gogoproto.stdduration"]; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - object[".gogoproto.wktpointer"] = message[".gogoproto.wktpointer"]; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - object[".gogoproto.castrepeated"] = message[".gogoproto.castrepeated"]; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - object[".cosmos_proto.accepts_interface"] = message[".cosmos_proto.accepts_interface"]; - if (message[".cosmos_proto.scalar"] != null && message.hasOwnProperty(".cosmos_proto.scalar")) - object[".cosmos_proto.scalar"] = message[".cosmos_proto.scalar"]; - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpreted_option] OneofOptions uninterpreted_option - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - let message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allow_alias] EnumOptions allow_alias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_enum_prefix"] EnumOptions .gogoproto.goproto_enum_prefix - * @property {boolean|null} [".gogoproto.goproto_enum_stringer"] EnumOptions .gogoproto.goproto_enum_stringer - * @property {boolean|null} [".gogoproto.enum_stringer"] EnumOptions .gogoproto.enum_stringer - * @property {string|null} [".gogoproto.enum_customname"] EnumOptions .gogoproto.enum_customname - * @property {boolean|null} [".gogoproto.enumdecl"] EnumOptions .gogoproto.enumdecl - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allow_alias. - * @member {boolean} allow_alias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allow_alias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumOptions .gogoproto.goproto_enum_prefix. - * @member {boolean} .gogoproto.goproto_enum_prefix - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_prefix"] = false; - - /** - * EnumOptions .gogoproto.goproto_enum_stringer. - * @member {boolean} .gogoproto.goproto_enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_stringer. - * @member {boolean} .gogoproto.enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_customname. - * @member {string} .gogoproto.enum_customname - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_customname"] = ""; - - /** - * EnumOptions .gogoproto.enumdecl. - * @member {boolean} .gogoproto.enumdecl - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enumdecl"] = false; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allow_alias != null && Object.hasOwnProperty.call(message, "allow_alias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allow_alias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_enum_prefix"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix")) - writer.uint32(/* id 62001, wireType 0 =*/496008).bool(message[".gogoproto.goproto_enum_prefix"]); - if (message[".gogoproto.goproto_enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer")) - writer.uint32(/* id 62021, wireType 0 =*/496168).bool(message[".gogoproto.goproto_enum_stringer"]); - if (message[".gogoproto.enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer")) - writer.uint32(/* id 62022, wireType 0 =*/496176).bool(message[".gogoproto.enum_stringer"]); - if (message[".gogoproto.enum_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_customname")) - writer.uint32(/* id 62023, wireType 2 =*/496186).string(message[".gogoproto.enum_customname"]); - if (message[".gogoproto.enumdecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl")) - writer.uint32(/* id 62024, wireType 0 =*/496192).bool(message[".gogoproto.enumdecl"]); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 62001: - message[".gogoproto.goproto_enum_prefix"] = reader.bool(); - break; - case 62021: - message[".gogoproto.goproto_enum_stringer"] = reader.bool(); - break; - case 62022: - message[".gogoproto.enum_stringer"] = reader.bool(); - break; - case 62023: - message[".gogoproto.enum_customname"] = reader.string(); - break; - case 62024: - message[".gogoproto.enumdecl"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - if (typeof message.allow_alias !== "boolean") - return "allow_alias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - if (typeof message[".gogoproto.goproto_enum_prefix"] !== "boolean") - return ".gogoproto.goproto_enum_prefix: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - if (typeof message[".gogoproto.goproto_enum_stringer"] !== "boolean") - return ".gogoproto.goproto_enum_stringer: boolean expected"; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - if (typeof message[".gogoproto.enum_stringer"] !== "boolean") - return ".gogoproto.enum_stringer: boolean expected"; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - if (!$util.isString(message[".gogoproto.enum_customname"])) - return ".gogoproto.enum_customname: string expected"; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - if (typeof message[".gogoproto.enumdecl"] !== "boolean") - return ".gogoproto.enumdecl: boolean expected"; - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - let message = new $root.google.protobuf.EnumOptions(); - if (object.allow_alias != null) - message.allow_alias = Boolean(object.allow_alias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_enum_prefix"] != null) - message[".gogoproto.goproto_enum_prefix"] = Boolean(object[".gogoproto.goproto_enum_prefix"]); - if (object[".gogoproto.goproto_enum_stringer"] != null) - message[".gogoproto.goproto_enum_stringer"] = Boolean(object[".gogoproto.goproto_enum_stringer"]); - if (object[".gogoproto.enum_stringer"] != null) - message[".gogoproto.enum_stringer"] = Boolean(object[".gogoproto.enum_stringer"]); - if (object[".gogoproto.enum_customname"] != null) - message[".gogoproto.enum_customname"] = String(object[".gogoproto.enum_customname"]); - if (object[".gogoproto.enumdecl"] != null) - message[".gogoproto.enumdecl"] = Boolean(object[".gogoproto.enumdecl"]); - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.allow_alias = false; - object.deprecated = false; - object[".gogoproto.goproto_enum_prefix"] = false; - object[".gogoproto.goproto_enum_stringer"] = false; - object[".gogoproto.enum_stringer"] = false; - object[".gogoproto.enum_customname"] = ""; - object[".gogoproto.enumdecl"] = false; - } - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - object.allow_alias = message.allow_alias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - object[".gogoproto.goproto_enum_prefix"] = message[".gogoproto.goproto_enum_prefix"]; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - object[".gogoproto.goproto_enum_stringer"] = message[".gogoproto.goproto_enum_stringer"]; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - object[".gogoproto.enum_stringer"] = message[".gogoproto.enum_stringer"]; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - object[".gogoproto.enum_customname"] = message[".gogoproto.enum_customname"]; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - object[".gogoproto.enumdecl"] = message[".gogoproto.enumdecl"]; - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumValueOptions uninterpreted_option - * @property {string|null} [".gogoproto.enumvalue_customname"] EnumValueOptions .gogoproto.enumvalue_customname - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumValueOptions .gogoproto.enumvalue_customname. - * @member {string} .gogoproto.enumvalue_customname - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype[".gogoproto.enumvalue_customname"] = ""; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.enumvalue_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumvalue_customname")) - writer.uint32(/* id 66001, wireType 2 =*/528010).string(message[".gogoproto.enumvalue_customname"]); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 66001: - message[".gogoproto.enumvalue_customname"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - if (!$util.isString(message[".gogoproto.enumvalue_customname"])) - return ".gogoproto.enumvalue_customname: string expected"; - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - let message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.enumvalue_customname"] != null) - message[".gogoproto.enumvalue_customname"] = String(object[".gogoproto.enumvalue_customname"]); - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".gogoproto.enumvalue_customname"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - object[".gogoproto.enumvalue_customname"] = message[".gogoproto.enumvalue_customname"]; - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpreted_option] ServiceOptions uninterpreted_option - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - let message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {Array.|null} [uninterpreted_option] MethodOptions uninterpreted_option - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - let error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - let message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifier_value] UninterpretedOption identifier_value - * @property {Long|null} [positive_int_value] UninterpretedOption positive_int_value - * @property {Long|null} [negative_int_value] UninterpretedOption negative_int_value - * @property {number|null} [double_value] UninterpretedOption double_value - * @property {Uint8Array|null} [string_value] UninterpretedOption string_value - * @property {string|null} [aggregate_value] UninterpretedOption aggregate_value - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifier_value. - * @member {string} identifier_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifier_value = ""; - - /** - * UninterpretedOption positive_int_value. - * @member {Long} positive_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positive_int_value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negative_int_value. - * @member {Long} negative_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negative_int_value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption double_value. - * @member {number} double_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.double_value = 0; - - /** - * UninterpretedOption string_value. - * @member {Uint8Array} string_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.string_value = $util.newBuffer([]); - - /** - * UninterpretedOption aggregate_value. - * @member {string} aggregate_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregate_value = ""; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (let i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifier_value != null && Object.hasOwnProperty.call(message, "identifier_value")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifier_value); - if (message.positive_int_value != null && Object.hasOwnProperty.call(message, "positive_int_value")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positive_int_value); - if (message.negative_int_value != null && Object.hasOwnProperty.call(message, "negative_int_value")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negative_int_value); - if (message.double_value != null && Object.hasOwnProperty.call(message, "double_value")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.double_value); - if (message.string_value != null && Object.hasOwnProperty.call(message, "string_value")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.string_value); - if (message.aggregate_value != null && Object.hasOwnProperty.call(message, "aggregate_value")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregate_value); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = reader.uint64(); - break; - case 5: - message.negative_int_value = reader.int64(); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (let i = 0; i < message.name.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - if (!$util.isString(message.identifier_value)) - return "identifier_value: string expected"; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (!$util.isInteger(message.positive_int_value) && !(message.positive_int_value && $util.isInteger(message.positive_int_value.low) && $util.isInteger(message.positive_int_value.high))) - return "positive_int_value: integer|Long expected"; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (!$util.isInteger(message.negative_int_value) && !(message.negative_int_value && $util.isInteger(message.negative_int_value.low) && $util.isInteger(message.negative_int_value.high))) - return "negative_int_value: integer|Long expected"; - if (message.double_value != null && message.hasOwnProperty("double_value")) - if (typeof message.double_value !== "number") - return "double_value: number expected"; - if (message.string_value != null && message.hasOwnProperty("string_value")) - if (!(message.string_value && typeof message.string_value.length === "number" || $util.isString(message.string_value))) - return "string_value: buffer expected"; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - if (!$util.isString(message.aggregate_value)) - return "aggregate_value: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - let message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (let i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifier_value != null) - message.identifier_value = String(object.identifier_value); - if (object.positive_int_value != null) - if ($util.Long) - (message.positive_int_value = $util.Long.fromValue(object.positive_int_value)).unsigned = true; - else if (typeof object.positive_int_value === "string") - message.positive_int_value = parseInt(object.positive_int_value, 10); - else if (typeof object.positive_int_value === "number") - message.positive_int_value = object.positive_int_value; - else if (typeof object.positive_int_value === "object") - message.positive_int_value = new $util.LongBits(object.positive_int_value.low >>> 0, object.positive_int_value.high >>> 0).toNumber(true); - if (object.negative_int_value != null) - if ($util.Long) - (message.negative_int_value = $util.Long.fromValue(object.negative_int_value)).unsigned = false; - else if (typeof object.negative_int_value === "string") - message.negative_int_value = parseInt(object.negative_int_value, 10); - else if (typeof object.negative_int_value === "number") - message.negative_int_value = object.negative_int_value; - else if (typeof object.negative_int_value === "object") - message.negative_int_value = new $util.LongBits(object.negative_int_value.low >>> 0, object.negative_int_value.high >>> 0).toNumber(); - if (object.double_value != null) - message.double_value = Number(object.double_value); - if (object.string_value != null) - if (typeof object.string_value === "string") - $util.base64.decode(object.string_value, message.string_value = $util.newBuffer($util.base64.length(object.string_value)), 0); - else if (object.string_value.length) - message.string_value = object.string_value; - if (object.aggregate_value != null) - message.aggregate_value = String(object.aggregate_value); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifier_value = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.positive_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positive_int_value = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.negative_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negative_int_value = options.longs === String ? "0" : 0; - object.double_value = 0; - if (options.bytes === String) - object.string_value = ""; - else { - object.string_value = []; - if (options.bytes !== Array) - object.string_value = $util.newBuffer(object.string_value); - } - object.aggregate_value = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (let j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - object.identifier_value = message.identifier_value; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (typeof message.positive_int_value === "number") - object.positive_int_value = options.longs === String ? String(message.positive_int_value) : message.positive_int_value; - else - object.positive_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.positive_int_value) : options.longs === Number ? new $util.LongBits(message.positive_int_value.low >>> 0, message.positive_int_value.high >>> 0).toNumber(true) : message.positive_int_value; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (typeof message.negative_int_value === "number") - object.negative_int_value = options.longs === String ? String(message.negative_int_value) : message.negative_int_value; - else - object.negative_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.negative_int_value) : options.longs === Number ? new $util.LongBits(message.negative_int_value.low >>> 0, message.negative_int_value.high >>> 0).toNumber() : message.negative_int_value; - if (message.double_value != null && message.hasOwnProperty("double_value")) - object.double_value = options.json && !isFinite(message.double_value) ? String(message.double_value) : message.double_value; - if (message.string_value != null && message.hasOwnProperty("string_value")) - object.string_value = options.bytes === String ? $util.base64.encode(message.string_value, 0, message.string_value.length) : options.bytes === Array ? Array.prototype.slice.call(message.string_value) : message.string_value; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - object.aggregate_value = message.aggregate_value; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} name_part NamePart name_part - * @property {boolean} is_extension NamePart is_extension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart name_part. - * @member {string} name_part - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.name_part = ""; - - /** - * NamePart is_extension. - * @member {boolean} is_extension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.is_extension = false; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name_part); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_extension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("name_part")) - throw $util.ProtocolError("missing required 'name_part'", { instance: message }); - if (!message.hasOwnProperty("is_extension")) - throw $util.ProtocolError("missing required 'is_extension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.name_part)) - return "name_part: string expected"; - if (typeof message.is_extension !== "boolean") - return "is_extension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - let message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.name_part != null) - message.name_part = String(object.name_part); - if (object.is_extension != null) - message.is_extension = Boolean(object.is_extension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name_part = ""; - object.is_extension = false; - } - if (message.name_part != null && message.hasOwnProperty("name_part")) - object.name_part = message.name_part; - if (message.is_extension != null && message.hasOwnProperty("is_extension")) - object.is_extension = message.is_extension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (let i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (let i = 0; i < message.location.length; ++i) { - let error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - let message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (let i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (let j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leading_comments] Location leading_comments - * @property {string|null} [trailing_comments] Location trailing_comments - * @property {Array.|null} [leading_detached_comments] Location leading_detached_comments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leading_detached_comments = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leading_comments. - * @member {string} leading_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_comments = ""; - - /** - * Location trailing_comments. - * @member {string} trailing_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailing_comments = ""; - - /** - * Location leading_detached_comments. - * @member {Array.} leading_detached_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_detached_comments = $util.emptyArray; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (let i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (let i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leading_comments != null && Object.hasOwnProperty.call(message, "leading_comments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leading_comments); - if (message.trailing_comments != null && Object.hasOwnProperty.call(message, "trailing_comments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailing_comments); - if (message.leading_detached_comments != null && message.leading_detached_comments.length) - for (let i = 0; i < message.leading_detached_comments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leading_detached_comments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - if (!(message.leading_detached_comments && message.leading_detached_comments.length)) - message.leading_detached_comments = []; - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (let i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (let i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - if (!$util.isString(message.leading_comments)) - return "leading_comments: string expected"; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - if (!$util.isString(message.trailing_comments)) - return "trailing_comments: string expected"; - if (message.leading_detached_comments != null && message.hasOwnProperty("leading_detached_comments")) { - if (!Array.isArray(message.leading_detached_comments)) - return "leading_detached_comments: array expected"; - for (let i = 0; i < message.leading_detached_comments.length; ++i) - if (!$util.isString(message.leading_detached_comments[i])) - return "leading_detached_comments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - let message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (let i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (let i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leading_comments != null) - message.leading_comments = String(object.leading_comments); - if (object.trailing_comments != null) - message.trailing_comments = String(object.trailing_comments); - if (object.leading_detached_comments) { - if (!Array.isArray(object.leading_detached_comments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leading_detached_comments: array expected"); - message.leading_detached_comments = []; - for (let i = 0; i < object.leading_detached_comments.length; ++i) - message.leading_detached_comments[i] = String(object.leading_detached_comments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leading_detached_comments = []; - } - if (options.defaults) { - object.leading_comments = ""; - object.trailing_comments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (let j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (let j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - object.leading_comments = message.leading_comments; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - object.trailing_comments = message.trailing_comments; - if (message.leading_detached_comments && message.leading_detached_comments.length) { - object.leading_detached_comments = []; - for (let j = 0; j < message.leading_detached_comments.length; ++j) - object.leading_detached_comments[j] = message.leading_detached_comments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (let i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (let i = 0; i < message.annotation.length; ++i) { - let error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - let message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (let i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (let j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [source_file] Annotation source_file - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation source_file. - * @member {string} source_file - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.source_file = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (let i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.source_file != null && Object.hasOwnProperty.call(message, "source_file")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_file); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.source_file = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (let i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - if (!$util.isString(message.source_file)) - return "source_file: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - let message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (let i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.source_file != null) - message.source_file = String(object.source_file); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.source_file = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (let j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - object.source_file = message.source_file; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - let message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Any; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - let message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Timestamp; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - let message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Duration; - })(); - - return protobuf; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - const api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fully_decode_reserved_expansion] Http fully_decode_reserved_expansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fully_decode_reserved_expansion. - * @member {boolean} fully_decode_reserved_expansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fully_decode_reserved_expansion = false; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (let i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fully_decode_reserved_expansion != null && Object.hasOwnProperty.call(message, "fully_decode_reserved_expansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fully_decode_reserved_expansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (let i = 0; i < message.rules.length; ++i) { - let error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - if (typeof message.fully_decode_reserved_expansion !== "boolean") - return "fully_decode_reserved_expansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - let message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (let i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fully_decode_reserved_expansion != null) - message.fully_decode_reserved_expansion = Boolean(object.fully_decode_reserved_expansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fully_decode_reserved_expansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (let j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - object.fully_decode_reserved_expansion = message.fully_decode_reserved_expansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [response_body] HttpRule response_body - * @property {Array.|null} [additional_bindings] HttpRule additional_bindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additional_bindings = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule response_body. - * @member {string} response_body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.response_body = ""; - - /** - * HttpRule additional_bindings. - * @member {Array.} additional_bindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additional_bindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - let $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additional_bindings != null && message.additional_bindings.length) - for (let i = 0; i < message.additional_bindings.length; ++i) - $root.google.api.HttpRule.encode(message.additional_bindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.response_body != null && Object.hasOwnProperty.call(message, "response_body")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.response_body); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.response_body = reader.string(); - break; - case 11: - if (!(message.additional_bindings && message.additional_bindings.length)) - message.additional_bindings = []; - message.additional_bindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - let error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.response_body != null && message.hasOwnProperty("response_body")) - if (!$util.isString(message.response_body)) - return "response_body: string expected"; - if (message.additional_bindings != null && message.hasOwnProperty("additional_bindings")) { - if (!Array.isArray(message.additional_bindings)) - return "additional_bindings: array expected"; - for (let i = 0; i < message.additional_bindings.length; ++i) { - let error = $root.google.api.HttpRule.verify(message.additional_bindings[i]); - if (error) - return "additional_bindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - let message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.response_body != null) - message.response_body = String(object.response_body); - if (object.additional_bindings) { - if (!Array.isArray(object.additional_bindings)) - throw TypeError(".google.api.HttpRule.additional_bindings: array expected"); - message.additional_bindings = []; - for (let i = 0; i < object.additional_bindings.length; ++i) { - if (typeof object.additional_bindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additional_bindings: object expected"); - message.additional_bindings[i] = $root.google.api.HttpRule.fromObject(object.additional_bindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.additional_bindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.response_body = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additional_bindings && message.additional_bindings.length) { - object.additional_bindings = []; - for (let j = 0; j < message.additional_bindings.length; ++j) - object.additional_bindings[j] = $root.google.api.HttpRule.toObject(message.additional_bindings[j], options); - } - if (message.response_body != null && message.hasOwnProperty("response_body")) - object.response_body = message.response_body; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - let message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CustomHttpPattern; - })(); - - return api; - })(); - - return google; -})(); - -export { $root as default }; diff --git a/src/generated/ibc/proto.cjs b/src/generated/ibc/proto.cjs deleted file mode 100644 index 623b6379..00000000 --- a/src/generated/ibc/proto.cjs +++ /dev/null @@ -1,83964 +0,0 @@ -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("protobufjs/minimal")); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots["@cosmos-client/ibc"] || ($protobuf.roots["@cosmos-client/ibc"] = {}); - - $root.cosmos = (function() { - - /** - * Namespace cosmos. - * @exports cosmos - * @namespace - */ - var cosmos = {}; - - cosmos.adminmodule = (function() { - - /** - * Namespace adminmodule. - * @memberof cosmos - * @namespace - */ - var adminmodule = {}; - - adminmodule.adminmodule = (function() { - - /** - * Namespace adminmodule. - * @memberof cosmos.adminmodule - * @namespace - */ - var adminmodule = {}; - - adminmodule.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#deleteAdmin}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef DeleteAdminCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} [response] MsgDeleteAdminResponse - */ - - /** - * Calls DeleteAdmin. - * @function deleteAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} request MsgDeleteAdmin message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.DeleteAdminCallback} callback Node-style callback called with the error, if any, and MsgDeleteAdminResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.deleteAdmin = function deleteAdmin(request, callback) { - return this.rpcCall(deleteAdmin, $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin, $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse, request, callback); - }, "name", { value: "DeleteAdmin" }); - - /** - * Calls DeleteAdmin. - * @function deleteAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} request MsgDeleteAdmin message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#addAdmin}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef AddAdminCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} [response] MsgAddAdminResponse - */ - - /** - * Calls AddAdmin. - * @function addAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} request MsgAddAdmin message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.AddAdminCallback} callback Node-style callback called with the error, if any, and MsgAddAdminResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.addAdmin = function addAdmin(request, callback) { - return this.rpcCall(addAdmin, $root.cosmos.adminmodule.adminmodule.MsgAddAdmin, $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse, request, callback); - }, "name", { value: "AddAdmin" }); - - /** - * Calls AddAdmin. - * @function addAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} request MsgAddAdmin message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#submitProposal}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef SubmitProposalCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} [response] MsgSubmitProposalResponse - */ - - /** - * Calls SubmitProposal. - * @function submitProposal - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} request MsgSubmitProposal message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.SubmitProposalCallback} callback Node-style callback called with the error, if any, and MsgSubmitProposalResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.submitProposal = function submitProposal(request, callback) { - return this.rpcCall(submitProposal, $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal, $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse, request, callback); - }, "name", { value: "SubmitProposal" }); - - /** - * Calls SubmitProposal. - * @function submitProposal - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} request MsgSubmitProposal message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - adminmodule.MsgDeleteAdmin = (function() { - - /** - * Properties of a MsgDeleteAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgDeleteAdmin - * @property {string|null} [creator] MsgDeleteAdmin creator - * @property {string|null} [admin] MsgDeleteAdmin admin - */ - - /** - * Constructs a new MsgDeleteAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgDeleteAdmin. - * @implements IMsgDeleteAdmin - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin=} [properties] Properties to set - */ - function MsgDeleteAdmin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgDeleteAdmin creator. - * @member {string} creator - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - */ - MsgDeleteAdmin.prototype.creator = ""; - - /** - * MsgDeleteAdmin admin. - * @member {string} admin - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - */ - MsgDeleteAdmin.prototype.admin = ""; - - /** - * Encodes the specified MsgDeleteAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} message MsgDeleteAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdmin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.admin); - return writer; - }; - - /** - * Encodes the specified MsgDeleteAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} message MsgDeleteAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdmin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdmin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdmin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeleteAdmin message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeleteAdmin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.admin != null && message.hasOwnProperty("admin")) - if (!$util.isString(message.admin)) - return "admin: string expected"; - return null; - }; - - /** - * Creates a MsgDeleteAdmin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - */ - MsgDeleteAdmin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin(); - if (object.creator != null) - message.creator = String(object.creator); - if (object.admin != null) - message.admin = String(object.admin); - return message; - }; - - /** - * Creates a plain object from a MsgDeleteAdmin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} message MsgDeleteAdmin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeleteAdmin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.creator = ""; - object.admin = ""; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.admin != null && message.hasOwnProperty("admin")) - object.admin = message.admin; - return object; - }; - - /** - * Converts this MsgDeleteAdmin to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - * @returns {Object.} JSON object - */ - MsgDeleteAdmin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeleteAdmin; - })(); - - adminmodule.MsgDeleteAdminResponse = (function() { - - /** - * Properties of a MsgDeleteAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgDeleteAdminResponse - */ - - /** - * Constructs a new MsgDeleteAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgDeleteAdminResponse. - * @implements IMsgDeleteAdminResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse=} [properties] Properties to set - */ - function MsgDeleteAdminResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgDeleteAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse} message MsgDeleteAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdminResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgDeleteAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse} message MsgDeleteAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdminResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdminResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdminResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeleteAdminResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeleteAdminResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgDeleteAdminResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - */ - MsgDeleteAdminResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse) - return object; - return new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse(); - }; - - /** - * Creates a plain object from a MsgDeleteAdminResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} message MsgDeleteAdminResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeleteAdminResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgDeleteAdminResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @instance - * @returns {Object.} JSON object - */ - MsgDeleteAdminResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeleteAdminResponse; - })(); - - adminmodule.MsgAddAdmin = (function() { - - /** - * Properties of a MsgAddAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgAddAdmin - * @property {string|null} [creator] MsgAddAdmin creator - * @property {string|null} [admin] MsgAddAdmin admin - */ - - /** - * Constructs a new MsgAddAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgAddAdmin. - * @implements IMsgAddAdmin - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin=} [properties] Properties to set - */ - function MsgAddAdmin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgAddAdmin creator. - * @member {string} creator - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - */ - MsgAddAdmin.prototype.creator = ""; - - /** - * MsgAddAdmin admin. - * @member {string} admin - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - */ - MsgAddAdmin.prototype.admin = ""; - - /** - * Encodes the specified MsgAddAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} message MsgAddAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdmin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.admin); - return writer; - }; - - /** - * Encodes the specified MsgAddAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} message MsgAddAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdmin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdmin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdmin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdmin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAddAdmin message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAddAdmin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.admin != null && message.hasOwnProperty("admin")) - if (!$util.isString(message.admin)) - return "admin: string expected"; - return null; - }; - - /** - * Creates a MsgAddAdmin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - */ - MsgAddAdmin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgAddAdmin) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdmin(); - if (object.creator != null) - message.creator = String(object.creator); - if (object.admin != null) - message.admin = String(object.admin); - return message; - }; - - /** - * Creates a plain object from a MsgAddAdmin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.MsgAddAdmin} message MsgAddAdmin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAddAdmin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.creator = ""; - object.admin = ""; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.admin != null && message.hasOwnProperty("admin")) - object.admin = message.admin; - return object; - }; - - /** - * Converts this MsgAddAdmin to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - * @returns {Object.} JSON object - */ - MsgAddAdmin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAddAdmin; - })(); - - adminmodule.MsgAddAdminResponse = (function() { - - /** - * Properties of a MsgAddAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgAddAdminResponse - */ - - /** - * Constructs a new MsgAddAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgAddAdminResponse. - * @implements IMsgAddAdminResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse=} [properties] Properties to set - */ - function MsgAddAdminResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgAddAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse} message MsgAddAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdminResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgAddAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse} message MsgAddAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdminResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdminResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdminResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAddAdminResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAddAdminResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgAddAdminResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - */ - MsgAddAdminResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse) - return object; - return new $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse(); - }; - - /** - * Creates a plain object from a MsgAddAdminResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} message MsgAddAdminResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAddAdminResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgAddAdminResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @instance - * @returns {Object.} JSON object - */ - MsgAddAdminResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAddAdminResponse; - })(); - - adminmodule.MsgSubmitProposal = (function() { - - /** - * Properties of a MsgSubmitProposal. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgSubmitProposal - * @property {google.protobuf.IAny|null} [content] MsgSubmitProposal content - * @property {string|null} [proposer] MsgSubmitProposal proposer - */ - - /** - * Constructs a new MsgSubmitProposal. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgSubmitProposal. - * @implements IMsgSubmitProposal - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal=} [properties] Properties to set - */ - function MsgSubmitProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitProposal content. - * @member {google.protobuf.IAny|null|undefined} content - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - */ - MsgSubmitProposal.prototype.content = null; - - /** - * MsgSubmitProposal proposer. - * @member {string} proposer - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - */ - MsgSubmitProposal.prototype.proposer = ""; - - /** - * Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.proposer); - return writer; - }; - - /** - * Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.proposer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitProposal message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) { - var error = $root.google.protobuf.Any.verify(message.content); - if (error) - return "content." + error; - } - if (message.proposer != null && message.hasOwnProperty("proposer")) - if (!$util.isString(message.proposer)) - return "proposer: string expected"; - return null; - }; - - /** - * Creates a MsgSubmitProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - */ - MsgSubmitProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal(); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".cosmos.adminmodule.adminmodule.MsgSubmitProposal.content: object expected"); - message.content = $root.google.protobuf.Any.fromObject(object.content); - } - if (object.proposer != null) - message.proposer = String(object.proposer); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposal} message MsgSubmitProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = null; - object.proposer = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.protobuf.Any.toObject(message.content, options); - if (message.proposer != null && message.hasOwnProperty("proposer")) - object.proposer = message.proposer; - return object; - }; - - /** - * Converts this MsgSubmitProposal to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitProposal; - })(); - - adminmodule.MsgSubmitProposalResponse = (function() { - - /** - * Properties of a MsgSubmitProposalResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgSubmitProposalResponse - * @property {Long|null} [proposal_id] MsgSubmitProposalResponse proposal_id - */ - - /** - * Constructs a new MsgSubmitProposalResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgSubmitProposalResponse. - * @implements IMsgSubmitProposalResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse=} [properties] Properties to set - */ - function MsgSubmitProposalResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitProposalResponse proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @instance - */ - MsgSubmitProposalResponse.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposalResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - return writer; - }; - - /** - * Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposalResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposalResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposalResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitProposalResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitProposalResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - return null; - }; - - /** - * Creates a MsgSubmitProposalResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - */ - MsgSubmitProposalResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitProposalResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} message MsgSubmitProposalResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitProposalResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - return object; - }; - - /** - * Converts this MsgSubmitProposalResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitProposalResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitProposalResponse; - })(); - - adminmodule.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#admins}. - * @memberof cosmos.adminmodule.adminmodule.Query - * @typedef AdminsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.QueryAdminsResponse} [response] QueryAdminsResponse - */ - - /** - * Calls Admins. - * @function admins - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} request QueryAdminsRequest message or plain object - * @param {cosmos.adminmodule.adminmodule.Query.AdminsCallback} callback Node-style callback called with the error, if any, and QueryAdminsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.admins = function admins(request, callback) { - return this.rpcCall(admins, $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest, $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse, request, callback); - }, "name", { value: "Admins" }); - - /** - * Calls Admins. - * @function admins - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} request QueryAdminsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#archivedProposals}. - * @memberof cosmos.adminmodule.adminmodule.Query - * @typedef ArchivedProposalsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} [response] QueryArchivedProposalsResponse - */ - - /** - * Calls ArchivedProposals. - * @function archivedProposals - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} request QueryArchivedProposalsRequest message or plain object - * @param {cosmos.adminmodule.adminmodule.Query.ArchivedProposalsCallback} callback Node-style callback called with the error, if any, and QueryArchivedProposalsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.archivedProposals = function archivedProposals(request, callback) { - return this.rpcCall(archivedProposals, $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest, $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse, request, callback); - }, "name", { value: "ArchivedProposals" }); - - /** - * Calls ArchivedProposals. - * @function archivedProposals - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} request QueryArchivedProposalsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - adminmodule.QueryAdminsRequest = (function() { - - /** - * Properties of a QueryAdminsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryAdminsRequest - */ - - /** - * Constructs a new QueryAdminsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryAdminsRequest. - * @implements IQueryAdminsRequest - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest=} [properties] Properties to set - */ - function QueryAdminsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryAdminsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} message QueryAdminsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryAdminsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} message QueryAdminsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdminsRequest message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdminsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryAdminsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - */ - QueryAdminsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest) - return object; - return new $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest(); - }; - - /** - * Creates a plain object from a QueryAdminsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.QueryAdminsRequest} message QueryAdminsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdminsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryAdminsRequest to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryAdminsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryAdminsRequest; - })(); - - adminmodule.QueryAdminsResponse = (function() { - - /** - * Properties of a QueryAdminsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryAdminsResponse - * @property {Array.|null} [admins] QueryAdminsResponse admins - */ - - /** - * Constructs a new QueryAdminsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryAdminsResponse. - * @implements IQueryAdminsResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse=} [properties] Properties to set - */ - function QueryAdminsResponse(properties) { - this.admins = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryAdminsResponse admins. - * @member {Array.} admins - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @instance - */ - QueryAdminsResponse.prototype.admins = $util.emptyArray; - - /** - * Encodes the specified QueryAdminsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse} message QueryAdminsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.admins != null && message.admins.length) - for (var i = 0; i < message.admins.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.admins[i]); - return writer; - }; - - /** - * Encodes the specified QueryAdminsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse} message QueryAdminsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.admins && message.admins.length)) - message.admins = []; - message.admins.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdminsResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdminsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.admins != null && message.hasOwnProperty("admins")) { - if (!Array.isArray(message.admins)) - return "admins: array expected"; - for (var i = 0; i < message.admins.length; ++i) - if (!$util.isString(message.admins[i])) - return "admins: string[] expected"; - } - return null; - }; - - /** - * Creates a QueryAdminsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - */ - QueryAdminsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse(); - if (object.admins) { - if (!Array.isArray(object.admins)) - throw TypeError(".cosmos.adminmodule.adminmodule.QueryAdminsResponse.admins: array expected"); - message.admins = []; - for (var i = 0; i < object.admins.length; ++i) - message.admins[i] = String(object.admins[i]); - } - return message; - }; - - /** - * Creates a plain object from a QueryAdminsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.QueryAdminsResponse} message QueryAdminsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdminsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.admins = []; - if (message.admins && message.admins.length) { - object.admins = []; - for (var j = 0; j < message.admins.length; ++j) - object.admins[j] = message.admins[j]; - } - return object; - }; - - /** - * Converts this QueryAdminsResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryAdminsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryAdminsResponse; - })(); - - adminmodule.QueryArchivedProposalsRequest = (function() { - - /** - * Properties of a QueryArchivedProposalsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryArchivedProposalsRequest - */ - - /** - * Constructs a new QueryArchivedProposalsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryArchivedProposalsRequest. - * @implements IQueryArchivedProposalsRequest - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest=} [properties] Properties to set - */ - function QueryArchivedProposalsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryArchivedProposalsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} message QueryArchivedProposalsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryArchivedProposalsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} message QueryArchivedProposalsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryArchivedProposalsRequest message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryArchivedProposalsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryArchivedProposalsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - */ - QueryArchivedProposalsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest) - return object; - return new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest(); - }; - - /** - * Creates a plain object from a QueryArchivedProposalsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} message QueryArchivedProposalsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryArchivedProposalsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryArchivedProposalsRequest to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryArchivedProposalsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryArchivedProposalsRequest; - })(); - - adminmodule.QueryArchivedProposalsResponse = (function() { - - /** - * Properties of a QueryArchivedProposalsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryArchivedProposalsResponse - * @property {Array.|null} [proposals] QueryArchivedProposalsResponse proposals - */ - - /** - * Constructs a new QueryArchivedProposalsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryArchivedProposalsResponse. - * @implements IQueryArchivedProposalsResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse=} [properties] Properties to set - */ - function QueryArchivedProposalsResponse(properties) { - this.proposals = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryArchivedProposalsResponse proposals. - * @member {Array.} proposals - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @instance - */ - QueryArchivedProposalsResponse.prototype.proposals = $util.emptyArray; - - /** - * Encodes the specified QueryArchivedProposalsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse} message QueryArchivedProposalsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposals != null && message.proposals.length) - for (var i = 0; i < message.proposals.length; ++i) - $root.cosmos.gov.v1beta1.Proposal.encode(message.proposals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryArchivedProposalsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse} message QueryArchivedProposalsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.proposals && message.proposals.length)) - message.proposals = []; - message.proposals.push($root.cosmos.gov.v1beta1.Proposal.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryArchivedProposalsResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryArchivedProposalsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposals != null && message.hasOwnProperty("proposals")) { - if (!Array.isArray(message.proposals)) - return "proposals: array expected"; - for (var i = 0; i < message.proposals.length; ++i) { - var error = $root.cosmos.gov.v1beta1.Proposal.verify(message.proposals[i]); - if (error) - return "proposals." + error; - } - } - return null; - }; - - /** - * Creates a QueryArchivedProposalsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - */ - QueryArchivedProposalsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse(); - if (object.proposals) { - if (!Array.isArray(object.proposals)) - throw TypeError(".cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.proposals: array expected"); - message.proposals = []; - for (var i = 0; i < object.proposals.length; ++i) { - if (typeof object.proposals[i] !== "object") - throw TypeError(".cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.proposals: object expected"); - message.proposals[i] = $root.cosmos.gov.v1beta1.Proposal.fromObject(object.proposals[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryArchivedProposalsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} message QueryArchivedProposalsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryArchivedProposalsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.proposals = []; - if (message.proposals && message.proposals.length) { - object.proposals = []; - for (var j = 0; j < message.proposals.length; ++j) - object.proposals[j] = $root.cosmos.gov.v1beta1.Proposal.toObject(message.proposals[j], options); - } - return object; - }; - - /** - * Converts this QueryArchivedProposalsResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryArchivedProposalsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryArchivedProposalsResponse; - })(); - - adminmodule.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof cosmos.adminmodule.adminmodule - * @interface IGenesisState - * @property {Array.|null} [admins] GenesisState admins - */ - - /** - * Constructs a new GenesisState. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {cosmos.adminmodule.adminmodule.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.admins = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState admins. - * @member {Array.} admins - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @instance - */ - GenesisState.prototype.admins = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.admins != null && message.admins.length) - for (var i = 0; i < message.admins.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.admins[i]); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.admins && message.admins.length)) - message.admins = []; - message.admins.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.admins != null && message.hasOwnProperty("admins")) { - if (!Array.isArray(message.admins)) - return "admins: array expected"; - for (var i = 0; i < message.admins.length; ++i) - if (!$util.isString(message.admins[i])) - return "admins: string[] expected"; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.GenesisState) - return object; - var message = new $root.cosmos.adminmodule.adminmodule.GenesisState(); - if (object.admins) { - if (!Array.isArray(object.admins)) - throw TypeError(".cosmos.adminmodule.adminmodule.GenesisState.admins: array expected"); - message.admins = []; - for (var i = 0; i < object.admins.length; ++i) - message.admins[i] = String(object.admins[i]); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.admins = []; - if (message.admins && message.admins.length) { - object.admins = []; - for (var j = 0; j < message.admins.length; ++j) - object.admins[j] = message.admins[j]; - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return adminmodule; - })(); - - return adminmodule; - })(); - - cosmos.gov = (function() { - - /** - * Namespace gov. - * @memberof cosmos - * @namespace - */ - var gov = {}; - - gov.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.gov - * @namespace - */ - var v1beta1 = {}; - - /** - * VoteOption enum. - * @name cosmos.gov.v1beta1.VoteOption - * @enum {number} - * @property {number} VOTE_OPTION_UNSPECIFIED=0 VOTE_OPTION_UNSPECIFIED value - * @property {number} VOTE_OPTION_YES=1 VOTE_OPTION_YES value - * @property {number} VOTE_OPTION_ABSTAIN=2 VOTE_OPTION_ABSTAIN value - * @property {number} VOTE_OPTION_NO=3 VOTE_OPTION_NO value - * @property {number} VOTE_OPTION_NO_WITH_VETO=4 VOTE_OPTION_NO_WITH_VETO value - */ - v1beta1.VoteOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VOTE_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "VOTE_OPTION_YES"] = 1; - values[valuesById[2] = "VOTE_OPTION_ABSTAIN"] = 2; - values[valuesById[3] = "VOTE_OPTION_NO"] = 3; - values[valuesById[4] = "VOTE_OPTION_NO_WITH_VETO"] = 4; - return values; - })(); - - v1beta1.WeightedVoteOption = (function() { - - /** - * Properties of a WeightedVoteOption. - * @memberof cosmos.gov.v1beta1 - * @interface IWeightedVoteOption - * @property {cosmos.gov.v1beta1.VoteOption|null} [option] WeightedVoteOption option - * @property {string|null} [weight] WeightedVoteOption weight - */ - - /** - * Constructs a new WeightedVoteOption. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a WeightedVoteOption. - * @implements IWeightedVoteOption - * @constructor - * @param {cosmos.gov.v1beta1.IWeightedVoteOption=} [properties] Properties to set - */ - function WeightedVoteOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WeightedVoteOption option. - * @member {cosmos.gov.v1beta1.VoteOption} option - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - */ - WeightedVoteOption.prototype.option = 0; - - /** - * WeightedVoteOption weight. - * @member {string} weight - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - */ - WeightedVoteOption.prototype.weight = ""; - - /** - * Encodes the specified WeightedVoteOption message. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.IWeightedVoteOption} message WeightedVoteOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedVoteOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.option != null && Object.hasOwnProperty.call(message, "option")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.option); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.weight); - return writer; - }; - - /** - * Encodes the specified WeightedVoteOption message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.IWeightedVoteOption} message WeightedVoteOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedVoteOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedVoteOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.WeightedVoteOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.option = reader.int32(); - break; - case 2: - message.weight = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedVoteOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WeightedVoteOption message. - * @function verify - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeightedVoteOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.option != null && message.hasOwnProperty("option")) - switch (message.option) { - default: - return "option: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.weight != null && message.hasOwnProperty("weight")) - if (!$util.isString(message.weight)) - return "weight: string expected"; - return null; - }; - - /** - * Creates a WeightedVoteOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - */ - WeightedVoteOption.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.WeightedVoteOption) - return object; - var message = new $root.cosmos.gov.v1beta1.WeightedVoteOption(); - switch (object.option) { - case "VOTE_OPTION_UNSPECIFIED": - case 0: - message.option = 0; - break; - case "VOTE_OPTION_YES": - case 1: - message.option = 1; - break; - case "VOTE_OPTION_ABSTAIN": - case 2: - message.option = 2; - break; - case "VOTE_OPTION_NO": - case 3: - message.option = 3; - break; - case "VOTE_OPTION_NO_WITH_VETO": - case 4: - message.option = 4; - break; - } - if (object.weight != null) - message.weight = String(object.weight); - return message; - }; - - /** - * Creates a plain object from a WeightedVoteOption message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.WeightedVoteOption} message WeightedVoteOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeightedVoteOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; - object.weight = ""; - } - if (message.option != null && message.hasOwnProperty("option")) - object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; - if (message.weight != null && message.hasOwnProperty("weight")) - object.weight = message.weight; - return object; - }; - - /** - * Converts this WeightedVoteOption to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - * @returns {Object.} JSON object - */ - WeightedVoteOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WeightedVoteOption; - })(); - - v1beta1.TextProposal = (function() { - - /** - * Properties of a TextProposal. - * @memberof cosmos.gov.v1beta1 - * @interface ITextProposal - * @property {string|null} [title] TextProposal title - * @property {string|null} [description] TextProposal description - */ - - /** - * Constructs a new TextProposal. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TextProposal. - * @implements ITextProposal - * @constructor - * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set - */ - function TextProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TextProposal title. - * @member {string} title - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - */ - TextProposal.prototype.title = ""; - - /** - * TextProposal description. - * @member {string} description - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - */ - TextProposal.prototype.description = ""; - - /** - * Encodes the specified TextProposal message. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified TextProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TextProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextProposal message. - * @function verify - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a TextProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - */ - TextProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TextProposal) - return object; - var message = new $root.cosmos.gov.v1beta1.TextProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a TextProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.TextProposal} message TextProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this TextProposal to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - * @returns {Object.} JSON object - */ - TextProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TextProposal; - })(); - - v1beta1.Deposit = (function() { - - /** - * Properties of a Deposit. - * @memberof cosmos.gov.v1beta1 - * @interface IDeposit - * @property {Long|null} [proposal_id] Deposit proposal_id - * @property {string|null} [depositor] Deposit depositor - * @property {Array.|null} [amount] Deposit amount - */ - - /** - * Constructs a new Deposit. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Deposit. - * @implements IDeposit - * @constructor - * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set - */ - function Deposit(properties) { - this.amount = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Deposit proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Deposit depositor. - * @member {string} depositor - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.depositor = ""; - - /** - * Deposit amount. - * @member {Array.} amount - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.amount = $util.emptyArray; - - /** - * Encodes the specified Deposit message. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deposit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); - if (message.amount != null && message.amount.length) - for (var i = 0; i < message.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Deposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deposit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Deposit message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deposit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Deposit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.depositor = reader.string(); - break; - case 3: - if (!(message.amount && message.amount.length)) - message.amount = []; - message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Deposit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deposit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Deposit message. - * @function verify - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Deposit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.depositor != null && message.hasOwnProperty("depositor")) - if (!$util.isString(message.depositor)) - return "depositor: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - if (!Array.isArray(message.amount)) - return "amount: array expected"; - for (var i = 0; i < message.amount.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); - if (error) - return "amount." + error; - } - } - return null; - }; - - /** - * Creates a Deposit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - */ - Deposit.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Deposit) - return object; - var message = new $root.cosmos.gov.v1beta1.Deposit(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.depositor != null) - message.depositor = String(object.depositor); - if (object.amount) { - if (!Array.isArray(object.amount)) - throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: array expected"); - message.amount = []; - for (var i = 0; i < object.amount.length; ++i) { - if (typeof object.amount[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: object expected"); - message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Deposit message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.Deposit} message Deposit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Deposit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.amount = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.depositor = ""; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.depositor != null && message.hasOwnProperty("depositor")) - object.depositor = message.depositor; - if (message.amount && message.amount.length) { - object.amount = []; - for (var j = 0; j < message.amount.length; ++j) - object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); - } - return object; - }; - - /** - * Converts this Deposit to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - * @returns {Object.} JSON object - */ - Deposit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Deposit; - })(); - - v1beta1.Proposal = (function() { - - /** - * Properties of a Proposal. - * @memberof cosmos.gov.v1beta1 - * @interface IProposal - * @property {Long|null} [proposal_id] Proposal proposal_id - * @property {google.protobuf.IAny|null} [content] Proposal content - * @property {cosmos.gov.v1beta1.ProposalStatus|null} [status] Proposal status - * @property {cosmos.gov.v1beta1.ITallyResult|null} [final_tally_result] Proposal final_tally_result - * @property {google.protobuf.ITimestamp|null} [submit_time] Proposal submit_time - * @property {google.protobuf.ITimestamp|null} [deposit_end_time] Proposal deposit_end_time - * @property {Array.|null} [total_deposit] Proposal total_deposit - * @property {google.protobuf.ITimestamp|null} [voting_start_time] Proposal voting_start_time - * @property {google.protobuf.ITimestamp|null} [voting_end_time] Proposal voting_end_time - */ - - /** - * Constructs a new Proposal. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Proposal. - * @implements IProposal - * @constructor - * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set - */ - function Proposal(properties) { - this.total_deposit = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proposal proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Proposal content. - * @member {google.protobuf.IAny|null|undefined} content - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.content = null; - - /** - * Proposal status. - * @member {cosmos.gov.v1beta1.ProposalStatus} status - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.status = 0; - - /** - * Proposal final_tally_result. - * @member {cosmos.gov.v1beta1.ITallyResult|null|undefined} final_tally_result - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.final_tally_result = null; - - /** - * Proposal submit_time. - * @member {google.protobuf.ITimestamp|null|undefined} submit_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.submit_time = null; - - /** - * Proposal deposit_end_time. - * @member {google.protobuf.ITimestamp|null|undefined} deposit_end_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.deposit_end_time = null; - - /** - * Proposal total_deposit. - * @member {Array.} total_deposit - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.total_deposit = $util.emptyArray; - - /** - * Proposal voting_start_time. - * @member {google.protobuf.ITimestamp|null|undefined} voting_start_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.voting_start_time = null; - - /** - * Proposal voting_end_time. - * @member {google.protobuf.ITimestamp|null|undefined} voting_end_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.voting_end_time = null; - - /** - * Encodes the specified Proposal message. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); - if (message.final_tally_result != null && Object.hasOwnProperty.call(message, "final_tally_result")) - $root.cosmos.gov.v1beta1.TallyResult.encode(message.final_tally_result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.submit_time != null && Object.hasOwnProperty.call(message, "submit_time")) - $root.google.protobuf.Timestamp.encode(message.submit_time, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deposit_end_time != null && Object.hasOwnProperty.call(message, "deposit_end_time")) - $root.google.protobuf.Timestamp.encode(message.deposit_end_time, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.total_deposit != null && message.total_deposit.length) - for (var i = 0; i < message.total_deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.total_deposit[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.voting_start_time != null && Object.hasOwnProperty.call(message, "voting_start_time")) - $root.google.protobuf.Timestamp.encode(message.voting_start_time, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.voting_end_time != null && Object.hasOwnProperty.call(message, "voting_end_time")) - $root.google.protobuf.Timestamp.encode(message.voting_end_time, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Proposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.status = reader.int32(); - break; - case 4: - message.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.decode(reader, reader.uint32()); - break; - case 5: - message.submit_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.deposit_end_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - if (!(message.total_deposit && message.total_deposit.length)) - message.total_deposit = []; - message.total_deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 8: - message.voting_start_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 9: - message.voting_end_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proposal message. - * @function verify - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.content != null && message.hasOwnProperty("content")) { - var error = $root.google.protobuf.Any.verify(message.content); - if (error) - return "content." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.final_tally_result != null && message.hasOwnProperty("final_tally_result")) { - var error = $root.cosmos.gov.v1beta1.TallyResult.verify(message.final_tally_result); - if (error) - return "final_tally_result." + error; - } - if (message.submit_time != null && message.hasOwnProperty("submit_time")) { - var error = $root.google.protobuf.Timestamp.verify(message.submit_time); - if (error) - return "submit_time." + error; - } - if (message.deposit_end_time != null && message.hasOwnProperty("deposit_end_time")) { - var error = $root.google.protobuf.Timestamp.verify(message.deposit_end_time); - if (error) - return "deposit_end_time." + error; - } - if (message.total_deposit != null && message.hasOwnProperty("total_deposit")) { - if (!Array.isArray(message.total_deposit)) - return "total_deposit: array expected"; - for (var i = 0; i < message.total_deposit.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.total_deposit[i]); - if (error) - return "total_deposit." + error; - } - } - if (message.voting_start_time != null && message.hasOwnProperty("voting_start_time")) { - var error = $root.google.protobuf.Timestamp.verify(message.voting_start_time); - if (error) - return "voting_start_time." + error; - } - if (message.voting_end_time != null && message.hasOwnProperty("voting_end_time")) { - var error = $root.google.protobuf.Timestamp.verify(message.voting_end_time); - if (error) - return "voting_end_time." + error; - } - return null; - }; - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - */ - Proposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Proposal) - return object; - var message = new $root.cosmos.gov.v1beta1.Proposal(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.content: object expected"); - message.content = $root.google.protobuf.Any.fromObject(object.content); - } - switch (object.status) { - case "PROPOSAL_STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "PROPOSAL_STATUS_DEPOSIT_PERIOD": - case 1: - message.status = 1; - break; - case "PROPOSAL_STATUS_VOTING_PERIOD": - case 2: - message.status = 2; - break; - case "PROPOSAL_STATUS_PASSED": - case 3: - message.status = 3; - break; - case "PROPOSAL_STATUS_REJECTED": - case 4: - message.status = 4; - break; - case "PROPOSAL_STATUS_FAILED": - case 5: - message.status = 5; - break; - } - if (object.final_tally_result != null) { - if (typeof object.final_tally_result !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.final_tally_result: object expected"); - message.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.fromObject(object.final_tally_result); - } - if (object.submit_time != null) { - if (typeof object.submit_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.submit_time: object expected"); - message.submit_time = $root.google.protobuf.Timestamp.fromObject(object.submit_time); - } - if (object.deposit_end_time != null) { - if (typeof object.deposit_end_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.deposit_end_time: object expected"); - message.deposit_end_time = $root.google.protobuf.Timestamp.fromObject(object.deposit_end_time); - } - if (object.total_deposit) { - if (!Array.isArray(object.total_deposit)) - throw TypeError(".cosmos.gov.v1beta1.Proposal.total_deposit: array expected"); - message.total_deposit = []; - for (var i = 0; i < object.total_deposit.length; ++i) { - if (typeof object.total_deposit[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.total_deposit: object expected"); - message.total_deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.total_deposit[i]); - } - } - if (object.voting_start_time != null) { - if (typeof object.voting_start_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.voting_start_time: object expected"); - message.voting_start_time = $root.google.protobuf.Timestamp.fromObject(object.voting_start_time); - } - if (object.voting_end_time != null) { - if (typeof object.voting_end_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.voting_end_time: object expected"); - message.voting_end_time = $root.google.protobuf.Timestamp.fromObject(object.voting_end_time); - } - return message; - }; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.Proposal} message Proposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.total_deposit = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.content = null; - object.status = options.enums === String ? "PROPOSAL_STATUS_UNSPECIFIED" : 0; - object.final_tally_result = null; - object.submit_time = null; - object.deposit_end_time = null; - object.voting_start_time = null; - object.voting_end_time = null; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.protobuf.Any.toObject(message.content, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.cosmos.gov.v1beta1.ProposalStatus[message.status] : message.status; - if (message.final_tally_result != null && message.hasOwnProperty("final_tally_result")) - object.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.toObject(message.final_tally_result, options); - if (message.submit_time != null && message.hasOwnProperty("submit_time")) - object.submit_time = $root.google.protobuf.Timestamp.toObject(message.submit_time, options); - if (message.deposit_end_time != null && message.hasOwnProperty("deposit_end_time")) - object.deposit_end_time = $root.google.protobuf.Timestamp.toObject(message.deposit_end_time, options); - if (message.total_deposit && message.total_deposit.length) { - object.total_deposit = []; - for (var j = 0; j < message.total_deposit.length; ++j) - object.total_deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.total_deposit[j], options); - } - if (message.voting_start_time != null && message.hasOwnProperty("voting_start_time")) - object.voting_start_time = $root.google.protobuf.Timestamp.toObject(message.voting_start_time, options); - if (message.voting_end_time != null && message.hasOwnProperty("voting_end_time")) - object.voting_end_time = $root.google.protobuf.Timestamp.toObject(message.voting_end_time, options); - return object; - }; - - /** - * Converts this Proposal to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - * @returns {Object.} JSON object - */ - Proposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proposal; - })(); - - /** - * ProposalStatus enum. - * @name cosmos.gov.v1beta1.ProposalStatus - * @enum {number} - * @property {number} PROPOSAL_STATUS_UNSPECIFIED=0 PROPOSAL_STATUS_UNSPECIFIED value - * @property {number} PROPOSAL_STATUS_DEPOSIT_PERIOD=1 PROPOSAL_STATUS_DEPOSIT_PERIOD value - * @property {number} PROPOSAL_STATUS_VOTING_PERIOD=2 PROPOSAL_STATUS_VOTING_PERIOD value - * @property {number} PROPOSAL_STATUS_PASSED=3 PROPOSAL_STATUS_PASSED value - * @property {number} PROPOSAL_STATUS_REJECTED=4 PROPOSAL_STATUS_REJECTED value - * @property {number} PROPOSAL_STATUS_FAILED=5 PROPOSAL_STATUS_FAILED value - */ - v1beta1.ProposalStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROPOSAL_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROPOSAL_STATUS_DEPOSIT_PERIOD"] = 1; - values[valuesById[2] = "PROPOSAL_STATUS_VOTING_PERIOD"] = 2; - values[valuesById[3] = "PROPOSAL_STATUS_PASSED"] = 3; - values[valuesById[4] = "PROPOSAL_STATUS_REJECTED"] = 4; - values[valuesById[5] = "PROPOSAL_STATUS_FAILED"] = 5; - return values; - })(); - - v1beta1.TallyResult = (function() { - - /** - * Properties of a TallyResult. - * @memberof cosmos.gov.v1beta1 - * @interface ITallyResult - * @property {string|null} [yes] TallyResult yes - * @property {string|null} [abstain] TallyResult abstain - * @property {string|null} [no] TallyResult no - * @property {string|null} [no_with_veto] TallyResult no_with_veto - */ - - /** - * Constructs a new TallyResult. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TallyResult. - * @implements ITallyResult - * @constructor - * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set - */ - function TallyResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TallyResult yes. - * @member {string} yes - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.yes = ""; - - /** - * TallyResult abstain. - * @member {string} abstain - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.abstain = ""; - - /** - * TallyResult no. - * @member {string} no - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.no = ""; - - /** - * TallyResult no_with_veto. - * @member {string} no_with_veto - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.no_with_veto = ""; - - /** - * Encodes the specified TallyResult message. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.yes != null && Object.hasOwnProperty.call(message, "yes")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.yes); - if (message.abstain != null && Object.hasOwnProperty.call(message, "abstain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.abstain); - if (message.no != null && Object.hasOwnProperty.call(message, "no")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.no); - if (message.no_with_veto != null && Object.hasOwnProperty.call(message, "no_with_veto")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.no_with_veto); - return writer; - }; - - /** - * Encodes the specified TallyResult message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TallyResult message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.yes = reader.string(); - break; - case 2: - message.abstain = reader.string(); - break; - case 3: - message.no = reader.string(); - break; - case 4: - message.no_with_veto = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TallyResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TallyResult message. - * @function verify - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TallyResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.yes != null && message.hasOwnProperty("yes")) - if (!$util.isString(message.yes)) - return "yes: string expected"; - if (message.abstain != null && message.hasOwnProperty("abstain")) - if (!$util.isString(message.abstain)) - return "abstain: string expected"; - if (message.no != null && message.hasOwnProperty("no")) - if (!$util.isString(message.no)) - return "no: string expected"; - if (message.no_with_veto != null && message.hasOwnProperty("no_with_veto")) - if (!$util.isString(message.no_with_veto)) - return "no_with_veto: string expected"; - return null; - }; - - /** - * Creates a TallyResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - */ - TallyResult.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TallyResult) - return object; - var message = new $root.cosmos.gov.v1beta1.TallyResult(); - if (object.yes != null) - message.yes = String(object.yes); - if (object.abstain != null) - message.abstain = String(object.abstain); - if (object.no != null) - message.no = String(object.no); - if (object.no_with_veto != null) - message.no_with_veto = String(object.no_with_veto); - return message; - }; - - /** - * Creates a plain object from a TallyResult message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.TallyResult} message TallyResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TallyResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.yes = ""; - object.abstain = ""; - object.no = ""; - object.no_with_veto = ""; - } - if (message.yes != null && message.hasOwnProperty("yes")) - object.yes = message.yes; - if (message.abstain != null && message.hasOwnProperty("abstain")) - object.abstain = message.abstain; - if (message.no != null && message.hasOwnProperty("no")) - object.no = message.no; - if (message.no_with_veto != null && message.hasOwnProperty("no_with_veto")) - object.no_with_veto = message.no_with_veto; - return object; - }; - - /** - * Converts this TallyResult to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - * @returns {Object.} JSON object - */ - TallyResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TallyResult; - })(); - - v1beta1.Vote = (function() { - - /** - * Properties of a Vote. - * @memberof cosmos.gov.v1beta1 - * @interface IVote - * @property {Long|null} [proposal_id] Vote proposal_id - * @property {string|null} [voter] Vote voter - * @property {cosmos.gov.v1beta1.VoteOption|null} [option] Vote option - * @property {Array.|null} [options] Vote options - */ - - /** - * Constructs a new Vote. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Vote. - * @implements IVote - * @constructor - * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set - */ - function Vote(properties) { - this.options = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Vote proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Vote voter. - * @member {string} voter - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.voter = ""; - - /** - * Vote option. - * @member {cosmos.gov.v1beta1.VoteOption} option - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.option = 0; - - /** - * Vote options. - * @member {Array.} options - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.options = $util.emptyArray; - - /** - * Encodes the specified Vote message. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); - if (message.option != null && Object.hasOwnProperty.call(message, "option")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); - if (message.options != null && message.options.length) - for (var i = 0; i < message.options.length; ++i) - $root.cosmos.gov.v1beta1.WeightedVoteOption.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Vote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.option = reader.int32(); - break; - case 4: - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.cosmos.gov.v1beta1.WeightedVoteOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vote message. - * @function verify - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.voter != null && message.hasOwnProperty("voter")) - if (!$util.isString(message.voter)) - return "voter: string expected"; - if (message.option != null && message.hasOwnProperty("option")) - switch (message.option) { - default: - return "option: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.options != null && message.hasOwnProperty("options")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (var i = 0; i < message.options.length; ++i) { - var error = $root.cosmos.gov.v1beta1.WeightedVoteOption.verify(message.options[i]); - if (error) - return "options." + error; - } - } - return null; - }; - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Vote} Vote - */ - Vote.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Vote) - return object; - var message = new $root.cosmos.gov.v1beta1.Vote(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.voter != null) - message.voter = String(object.voter); - switch (object.option) { - case "VOTE_OPTION_UNSPECIFIED": - case 0: - message.option = 0; - break; - case "VOTE_OPTION_YES": - case 1: - message.option = 1; - break; - case "VOTE_OPTION_ABSTAIN": - case 2: - message.option = 2; - break; - case "VOTE_OPTION_NO": - case 3: - message.option = 3; - break; - case "VOTE_OPTION_NO_WITH_VETO": - case 4: - message.option = 4; - break; - } - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".cosmos.gov.v1beta1.Vote.options: array expected"); - message.options = []; - for (var i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Vote.options: object expected"); - message.options[i] = $root.cosmos.gov.v1beta1.WeightedVoteOption.fromObject(object.options[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.Vote} message Vote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.options = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.voter = ""; - object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.voter != null && message.hasOwnProperty("voter")) - object.voter = message.voter; - if (message.option != null && message.hasOwnProperty("option")) - object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; - if (message.options && message.options.length) { - object.options = []; - for (var j = 0; j < message.options.length; ++j) - object.options[j] = $root.cosmos.gov.v1beta1.WeightedVoteOption.toObject(message.options[j], options); - } - return object; - }; - - /** - * Converts this Vote to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Vote - * @instance - * @returns {Object.} JSON object - */ - Vote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Vote; - })(); - - v1beta1.DepositParams = (function() { - - /** - * Properties of a DepositParams. - * @memberof cosmos.gov.v1beta1 - * @interface IDepositParams - * @property {Array.|null} [min_deposit] DepositParams min_deposit - * @property {google.protobuf.IDuration|null} [max_deposit_period] DepositParams max_deposit_period - */ - - /** - * Constructs a new DepositParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a DepositParams. - * @implements IDepositParams - * @constructor - * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set - */ - function DepositParams(properties) { - this.min_deposit = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DepositParams min_deposit. - * @member {Array.} min_deposit - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - */ - DepositParams.prototype.min_deposit = $util.emptyArray; - - /** - * DepositParams max_deposit_period. - * @member {google.protobuf.IDuration|null|undefined} max_deposit_period - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - */ - DepositParams.prototype.max_deposit_period = null; - - /** - * Encodes the specified DepositParams message. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DepositParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.min_deposit != null && message.min_deposit.length) - for (var i = 0; i < message.min_deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.min_deposit[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.max_deposit_period != null && Object.hasOwnProperty.call(message, "max_deposit_period")) - $root.google.protobuf.Duration.encode(message.max_deposit_period, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DepositParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DepositParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DepositParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DepositParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.DepositParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.min_deposit && message.min_deposit.length)) - message.min_deposit = []; - message.min_deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 2: - message.max_deposit_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DepositParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DepositParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DepositParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DepositParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.min_deposit != null && message.hasOwnProperty("min_deposit")) { - if (!Array.isArray(message.min_deposit)) - return "min_deposit: array expected"; - for (var i = 0; i < message.min_deposit.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.min_deposit[i]); - if (error) - return "min_deposit." + error; - } - } - if (message.max_deposit_period != null && message.hasOwnProperty("max_deposit_period")) { - var error = $root.google.protobuf.Duration.verify(message.max_deposit_period); - if (error) - return "max_deposit_period." + error; - } - return null; - }; - - /** - * Creates a DepositParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - */ - DepositParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.DepositParams) - return object; - var message = new $root.cosmos.gov.v1beta1.DepositParams(); - if (object.min_deposit) { - if (!Array.isArray(object.min_deposit)) - throw TypeError(".cosmos.gov.v1beta1.DepositParams.min_deposit: array expected"); - message.min_deposit = []; - for (var i = 0; i < object.min_deposit.length; ++i) { - if (typeof object.min_deposit[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.DepositParams.min_deposit: object expected"); - message.min_deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.min_deposit[i]); - } - } - if (object.max_deposit_period != null) { - if (typeof object.max_deposit_period !== "object") - throw TypeError(".cosmos.gov.v1beta1.DepositParams.max_deposit_period: object expected"); - message.max_deposit_period = $root.google.protobuf.Duration.fromObject(object.max_deposit_period); - } - return message; - }; - - /** - * Creates a plain object from a DepositParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.DepositParams} message DepositParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DepositParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.min_deposit = []; - if (options.defaults) - object.max_deposit_period = null; - if (message.min_deposit && message.min_deposit.length) { - object.min_deposit = []; - for (var j = 0; j < message.min_deposit.length; ++j) - object.min_deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.min_deposit[j], options); - } - if (message.max_deposit_period != null && message.hasOwnProperty("max_deposit_period")) - object.max_deposit_period = $root.google.protobuf.Duration.toObject(message.max_deposit_period, options); - return object; - }; - - /** - * Converts this DepositParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - * @returns {Object.} JSON object - */ - DepositParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DepositParams; - })(); - - v1beta1.VotingParams = (function() { - - /** - * Properties of a VotingParams. - * @memberof cosmos.gov.v1beta1 - * @interface IVotingParams - * @property {google.protobuf.IDuration|null} [voting_period] VotingParams voting_period - */ - - /** - * Constructs a new VotingParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a VotingParams. - * @implements IVotingParams - * @constructor - * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set - */ - function VotingParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VotingParams voting_period. - * @member {google.protobuf.IDuration|null|undefined} voting_period - * @memberof cosmos.gov.v1beta1.VotingParams - * @instance - */ - VotingParams.prototype.voting_period = null; - - /** - * Encodes the specified VotingParams message. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VotingParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voting_period != null && Object.hasOwnProperty.call(message, "voting_period")) - $root.google.protobuf.Duration.encode(message.voting_period, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VotingParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VotingParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VotingParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VotingParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.VotingParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.voting_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VotingParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VotingParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VotingParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VotingParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voting_period != null && message.hasOwnProperty("voting_period")) { - var error = $root.google.protobuf.Duration.verify(message.voting_period); - if (error) - return "voting_period." + error; - } - return null; - }; - - /** - * Creates a VotingParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - */ - VotingParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.VotingParams) - return object; - var message = new $root.cosmos.gov.v1beta1.VotingParams(); - if (object.voting_period != null) { - if (typeof object.voting_period !== "object") - throw TypeError(".cosmos.gov.v1beta1.VotingParams.voting_period: object expected"); - message.voting_period = $root.google.protobuf.Duration.fromObject(object.voting_period); - } - return message; - }; - - /** - * Creates a plain object from a VotingParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.VotingParams} message VotingParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VotingParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.voting_period = null; - if (message.voting_period != null && message.hasOwnProperty("voting_period")) - object.voting_period = $root.google.protobuf.Duration.toObject(message.voting_period, options); - return object; - }; - - /** - * Converts this VotingParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.VotingParams - * @instance - * @returns {Object.} JSON object - */ - VotingParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VotingParams; - })(); - - v1beta1.TallyParams = (function() { - - /** - * Properties of a TallyParams. - * @memberof cosmos.gov.v1beta1 - * @interface ITallyParams - * @property {Uint8Array|null} [quorum] TallyParams quorum - * @property {Uint8Array|null} [threshold] TallyParams threshold - * @property {Uint8Array|null} [veto_threshold] TallyParams veto_threshold - */ - - /** - * Constructs a new TallyParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TallyParams. - * @implements ITallyParams - * @constructor - * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set - */ - function TallyParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TallyParams quorum. - * @member {Uint8Array} quorum - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.quorum = $util.newBuffer([]); - - /** - * TallyParams threshold. - * @member {Uint8Array} threshold - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.threshold = $util.newBuffer([]); - - /** - * TallyParams veto_threshold. - * @member {Uint8Array} veto_threshold - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.veto_threshold = $util.newBuffer([]); - - /** - * Encodes the specified TallyParams message. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quorum != null && Object.hasOwnProperty.call(message, "quorum")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorum); - if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.threshold); - if (message.veto_threshold != null && Object.hasOwnProperty.call(message, "veto_threshold")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.veto_threshold); - return writer; - }; - - /** - * Encodes the specified TallyParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TallyParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quorum = reader.bytes(); - break; - case 2: - message.threshold = reader.bytes(); - break; - case 3: - message.veto_threshold = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TallyParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TallyParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TallyParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quorum != null && message.hasOwnProperty("quorum")) - if (!(message.quorum && typeof message.quorum.length === "number" || $util.isString(message.quorum))) - return "quorum: buffer expected"; - if (message.threshold != null && message.hasOwnProperty("threshold")) - if (!(message.threshold && typeof message.threshold.length === "number" || $util.isString(message.threshold))) - return "threshold: buffer expected"; - if (message.veto_threshold != null && message.hasOwnProperty("veto_threshold")) - if (!(message.veto_threshold && typeof message.veto_threshold.length === "number" || $util.isString(message.veto_threshold))) - return "veto_threshold: buffer expected"; - return null; - }; - - /** - * Creates a TallyParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - */ - TallyParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TallyParams) - return object; - var message = new $root.cosmos.gov.v1beta1.TallyParams(); - if (object.quorum != null) - if (typeof object.quorum === "string") - $util.base64.decode(object.quorum, message.quorum = $util.newBuffer($util.base64.length(object.quorum)), 0); - else if (object.quorum.length) - message.quorum = object.quorum; - if (object.threshold != null) - if (typeof object.threshold === "string") - $util.base64.decode(object.threshold, message.threshold = $util.newBuffer($util.base64.length(object.threshold)), 0); - else if (object.threshold.length) - message.threshold = object.threshold; - if (object.veto_threshold != null) - if (typeof object.veto_threshold === "string") - $util.base64.decode(object.veto_threshold, message.veto_threshold = $util.newBuffer($util.base64.length(object.veto_threshold)), 0); - else if (object.veto_threshold.length) - message.veto_threshold = object.veto_threshold; - return message; - }; - - /** - * Creates a plain object from a TallyParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.TallyParams} message TallyParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TallyParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.quorum = ""; - else { - object.quorum = []; - if (options.bytes !== Array) - object.quorum = $util.newBuffer(object.quorum); - } - if (options.bytes === String) - object.threshold = ""; - else { - object.threshold = []; - if (options.bytes !== Array) - object.threshold = $util.newBuffer(object.threshold); - } - if (options.bytes === String) - object.veto_threshold = ""; - else { - object.veto_threshold = []; - if (options.bytes !== Array) - object.veto_threshold = $util.newBuffer(object.veto_threshold); - } - } - if (message.quorum != null && message.hasOwnProperty("quorum")) - object.quorum = options.bytes === String ? $util.base64.encode(message.quorum, 0, message.quorum.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorum) : message.quorum; - if (message.threshold != null && message.hasOwnProperty("threshold")) - object.threshold = options.bytes === String ? $util.base64.encode(message.threshold, 0, message.threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.threshold) : message.threshold; - if (message.veto_threshold != null && message.hasOwnProperty("veto_threshold")) - object.veto_threshold = options.bytes === String ? $util.base64.encode(message.veto_threshold, 0, message.veto_threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.veto_threshold) : message.veto_threshold; - return object; - }; - - /** - * Converts this TallyParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - * @returns {Object.} JSON object - */ - TallyParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TallyParams; - })(); - - return v1beta1; - })(); - - return gov; - })(); - - cosmos.base = (function() { - - /** - * Namespace base. - * @memberof cosmos - * @namespace - */ - var base = {}; - - base.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base - * @namespace - */ - var v1beta1 = {}; - - v1beta1.Coin = (function() { - - /** - * Properties of a Coin. - * @memberof cosmos.base.v1beta1 - * @interface ICoin - * @property {string|null} [denom] Coin denom - * @property {string|null} [amount] Coin amount - */ - - /** - * Constructs a new Coin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a Coin. - * @implements ICoin - * @constructor - * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set - */ - function Coin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Coin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.denom = ""; - - /** - * Coin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.amount = ""; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Coin message. - * @function verify - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Coin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.Coin} Coin - */ - Coin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.Coin) - return object; - var message = new $root.cosmos.base.v1beta1.Coin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.Coin} message Coin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Coin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this Coin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.Coin - * @instance - * @returns {Object.} JSON object - */ - Coin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Coin; - })(); - - v1beta1.DecCoin = (function() { - - /** - * Properties of a DecCoin. - * @memberof cosmos.base.v1beta1 - * @interface IDecCoin - * @property {string|null} [denom] DecCoin denom - * @property {string|null} [amount] DecCoin amount - */ - - /** - * Constructs a new DecCoin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecCoin. - * @implements IDecCoin - * @constructor - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - */ - function DecCoin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecCoin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.denom = ""; - - /** - * DecCoin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.amount = ""; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecCoin message. - * @function verify - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecCoin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - */ - DecCoin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecCoin) - return object; - var message = new $root.cosmos.base.v1beta1.DecCoin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.DecCoin} message DecCoin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecCoin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this DecCoin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - * @returns {Object.} JSON object - */ - DecCoin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecCoin; - })(); - - v1beta1.IntProto = (function() { - - /** - * Properties of an IntProto. - * @memberof cosmos.base.v1beta1 - * @interface IIntProto - * @property {string|null} [int] IntProto int - */ - - /** - * Constructs a new IntProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents an IntProto. - * @implements IIntProto - * @constructor - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - */ - function IntProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IntProto int. - * @member {string} int - * @memberof cosmos.base.v1beta1.IntProto - * @instance - */ - IntProto.prototype.int = ""; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.int != null && Object.hasOwnProperty.call(message, "int")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); - return writer; - }; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntProto message. - * @function verify - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.int != null && message.hasOwnProperty("int")) - if (!$util.isString(message.int)) - return "int: string expected"; - return null; - }; - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.IntProto} IntProto - */ - IntProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.IntProto) - return object; - var message = new $root.cosmos.base.v1beta1.IntProto(); - if (object.int != null) - message.int = String(object.int); - return message; - }; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IntProto} message IntProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.int = ""; - if (message.int != null && message.hasOwnProperty("int")) - object.int = message.int; - return object; - }; - - /** - * Converts this IntProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.IntProto - * @instance - * @returns {Object.} JSON object - */ - IntProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IntProto; - })(); - - v1beta1.DecProto = (function() { - - /** - * Properties of a DecProto. - * @memberof cosmos.base.v1beta1 - * @interface IDecProto - * @property {string|null} [dec] DecProto dec - */ - - /** - * Constructs a new DecProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecProto. - * @implements IDecProto - * @constructor - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - */ - function DecProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecProto dec. - * @member {string} dec - * @memberof cosmos.base.v1beta1.DecProto - * @instance - */ - DecProto.prototype.dec = ""; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); - return writer; - }; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dec = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecProto message. - * @function verify - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dec != null && message.hasOwnProperty("dec")) - if (!$util.isString(message.dec)) - return "dec: string expected"; - return null; - }; - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecProto} DecProto - */ - DecProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecProto) - return object; - var message = new $root.cosmos.base.v1beta1.DecProto(); - if (object.dec != null) - message.dec = String(object.dec); - return message; - }; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.DecProto} message DecProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.dec = ""; - if (message.dec != null && message.hasOwnProperty("dec")) - object.dec = message.dec; - return object; - }; - - /** - * Converts this DecProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecProto - * @instance - * @returns {Object.} JSON object - */ - DecProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecProto; - })(); - - return v1beta1; - })(); - - base.query = (function() { - - /** - * Namespace query. - * @memberof cosmos.base - * @namespace - */ - var query = {}; - - query.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base.query - * @namespace - */ - var v1beta1 = {}; - - v1beta1.PageRequest = (function() { - - /** - * Properties of a PageRequest. - * @memberof cosmos.base.query.v1beta1 - * @interface IPageRequest - * @property {Uint8Array|null} [key] PageRequest key - * @property {Long|null} [offset] PageRequest offset - * @property {Long|null} [limit] PageRequest limit - * @property {boolean|null} [count_total] PageRequest count_total - */ - - /** - * Constructs a new PageRequest. - * @memberof cosmos.base.query.v1beta1 - * @classdesc Represents a PageRequest. - * @implements IPageRequest - * @constructor - * @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set - */ - function PageRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PageRequest key. - * @member {Uint8Array} key - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.key = $util.newBuffer([]); - - /** - * PageRequest offset. - * @member {Long} offset - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PageRequest limit. - * @member {Long} limit - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PageRequest count_total. - * @member {boolean} count_total - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.count_total = false; - - /** - * Encodes the specified PageRequest message. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.offset); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.limit); - if (message.count_total != null && Object.hasOwnProperty.call(message, "count_total")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.count_total); - return writer; - }; - - /** - * Encodes the specified PageRequest message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PageRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = reader.uint64(); - break; - case 3: - message.limit = reader.uint64(); - break; - case 4: - message.count_total = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PageRequest message. - * @function verify - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PageRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) - return "offset: integer|Long expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) - return "limit: integer|Long expected"; - if (message.count_total != null && message.hasOwnProperty("count_total")) - if (typeof message.count_total !== "boolean") - return "count_total: boolean expected"; - return null; - }; - - /** - * Creates a PageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest - */ - PageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.query.v1beta1.PageRequest) - return object; - var message = new $root.cosmos.base.query.v1beta1.PageRequest(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.offset != null) - if ($util.Long) - (message.offset = $util.Long.fromValue(object.offset)).unsigned = true; - else if (typeof object.offset === "string") - message.offset = parseInt(object.offset, 10); - else if (typeof object.offset === "number") - message.offset = object.offset; - else if (typeof object.offset === "object") - message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(true); - if (object.limit != null) - if ($util.Long) - (message.limit = $util.Long.fromValue(object.limit)).unsigned = true; - else if (typeof object.limit === "string") - message.limit = parseInt(object.limit, 10); - else if (typeof object.limit === "number") - message.limit = object.limit; - else if (typeof object.limit === "object") - message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(true); - if (object.count_total != null) - message.count_total = Boolean(object.count_total); - return message; - }; - - /** - * Creates a plain object from a PageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {cosmos.base.query.v1beta1.PageRequest} message PageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PageRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.offset = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.limit = options.longs === String ? "0" : 0; - object.count_total = false; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.offset != null && message.hasOwnProperty("offset")) - if (typeof message.offset === "number") - object.offset = options.longs === String ? String(message.offset) : message.offset; - else - object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber(true) : message.offset; - if (message.limit != null && message.hasOwnProperty("limit")) - if (typeof message.limit === "number") - object.limit = options.longs === String ? String(message.limit) : message.limit; - else - object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber(true) : message.limit; - if (message.count_total != null && message.hasOwnProperty("count_total")) - object.count_total = message.count_total; - return object; - }; - - /** - * Converts this PageRequest to JSON. - * @function toJSON - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - * @returns {Object.} JSON object - */ - PageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PageRequest; - })(); - - v1beta1.PageResponse = (function() { - - /** - * Properties of a PageResponse. - * @memberof cosmos.base.query.v1beta1 - * @interface IPageResponse - * @property {Uint8Array|null} [next_key] PageResponse next_key - * @property {Long|null} [total] PageResponse total - */ - - /** - * Constructs a new PageResponse. - * @memberof cosmos.base.query.v1beta1 - * @classdesc Represents a PageResponse. - * @implements IPageResponse - * @constructor - * @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set - */ - function PageResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PageResponse next_key. - * @member {Uint8Array} next_key - * @memberof cosmos.base.query.v1beta1.PageResponse - * @instance - */ - PageResponse.prototype.next_key = $util.newBuffer([]); - - /** - * PageResponse total. - * @member {Long} total - * @memberof cosmos.base.query.v1beta1.PageResponse - * @instance - */ - PageResponse.prototype.total = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified PageResponse message. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.next_key != null && Object.hasOwnProperty.call(message, "next_key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.next_key); - if (message.total != null && Object.hasOwnProperty.call(message, "total")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.total); - return writer; - }; - - /** - * Encodes the specified PageResponse message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PageResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PageResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PageResponse message. - * @function verify - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PageResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.next_key != null && message.hasOwnProperty("next_key")) - if (!(message.next_key && typeof message.next_key.length === "number" || $util.isString(message.next_key))) - return "next_key: buffer expected"; - if (message.total != null && message.hasOwnProperty("total")) - if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) - return "total: integer|Long expected"; - return null; - }; - - /** - * Creates a PageResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse - */ - PageResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.query.v1beta1.PageResponse) - return object; - var message = new $root.cosmos.base.query.v1beta1.PageResponse(); - if (object.next_key != null) - if (typeof object.next_key === "string") - $util.base64.decode(object.next_key, message.next_key = $util.newBuffer($util.base64.length(object.next_key)), 0); - else if (object.next_key.length) - message.next_key = object.next_key; - if (object.total != null) - if ($util.Long) - (message.total = $util.Long.fromValue(object.total)).unsigned = true; - else if (typeof object.total === "string") - message.total = parseInt(object.total, 10); - else if (typeof object.total === "number") - message.total = object.total; - else if (typeof object.total === "object") - message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PageResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {cosmos.base.query.v1beta1.PageResponse} message PageResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PageResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.next_key = ""; - else { - object.next_key = []; - if (options.bytes !== Array) - object.next_key = $util.newBuffer(object.next_key); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total = options.longs === String ? "0" : 0; - } - if (message.next_key != null && message.hasOwnProperty("next_key")) - object.next_key = options.bytes === String ? $util.base64.encode(message.next_key, 0, message.next_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.next_key) : message.next_key; - if (message.total != null && message.hasOwnProperty("total")) - if (typeof message.total === "number") - object.total = options.longs === String ? String(message.total) : message.total; - else - object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber(true) : message.total; - return object; - }; - - /** - * Converts this PageResponse to JSON. - * @function toJSON - * @memberof cosmos.base.query.v1beta1.PageResponse - * @instance - * @returns {Object.} JSON object - */ - PageResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PageResponse; - })(); - - return v1beta1; - })(); - - return query; - })(); - - return base; - })(); - - cosmos.upgrade = (function() { - - /** - * Namespace upgrade. - * @memberof cosmos - * @namespace - */ - var upgrade = {}; - - upgrade.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.upgrade - * @namespace - */ - var v1beta1 = {}; - - v1beta1.Plan = (function() { - - /** - * Properties of a Plan. - * @memberof cosmos.upgrade.v1beta1 - * @interface IPlan - * @property {string|null} [name] Plan name - * @property {google.protobuf.ITimestamp|null} [time] Plan time - * @property {Long|null} [height] Plan height - * @property {string|null} [info] Plan info - */ - - /** - * Constructs a new Plan. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a Plan. - * @implements IPlan - * @constructor - * @param {cosmos.upgrade.v1beta1.IPlan=} [properties] Properties to set - */ - function Plan(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Plan name. - * @member {string} name - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.name = ""; - - /** - * Plan time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.time = null; - - /** - * Plan height. - * @member {Long} height - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Plan info. - * @member {string} info - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.info = ""; - - /** - * Encodes the specified Plan message. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {cosmos.upgrade.v1beta1.IPlan} message Plan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Plan.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); - return writer; - }; - - /** - * Encodes the specified Plan message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {cosmos.upgrade.v1beta1.IPlan} message Plan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Plan.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Plan message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.Plan} Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Plan.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.Plan(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.height = reader.int64(); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Plan message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.Plan} Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Plan.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Plan message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Plan.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.info != null && message.hasOwnProperty("info")) - if (!$util.isString(message.info)) - return "info: string expected"; - return null; - }; - - /** - * Creates a Plan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.Plan} Plan - */ - Plan.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.Plan) - return object; - var message = new $root.cosmos.upgrade.v1beta1.Plan(); - if (object.name != null) - message.name = String(object.name); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".cosmos.upgrade.v1beta1.Plan.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.info != null) - message.info = String(object.info); - return message; - }; - - /** - * Creates a plain object from a Plan message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {cosmos.upgrade.v1beta1.Plan} message Plan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Plan.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.time = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.info = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.info != null && message.hasOwnProperty("info")) - object.info = message.info; - return object; - }; - - /** - * Converts this Plan to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - * @returns {Object.} JSON object - */ - Plan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Plan; - })(); - - v1beta1.SoftwareUpgradeProposal = (function() { - - /** - * Properties of a SoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @interface ISoftwareUpgradeProposal - * @property {string|null} [title] SoftwareUpgradeProposal title - * @property {string|null} [description] SoftwareUpgradeProposal description - * @property {cosmos.upgrade.v1beta1.IPlan|null} [plan] SoftwareUpgradeProposal plan - */ - - /** - * Constructs a new SoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a SoftwareUpgradeProposal. - * @implements ISoftwareUpgradeProposal - * @constructor - * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal=} [properties] Properties to set - */ - function SoftwareUpgradeProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SoftwareUpgradeProposal title. - * @member {string} title - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - */ - SoftwareUpgradeProposal.prototype.title = ""; - - /** - * SoftwareUpgradeProposal description. - * @member {string} description - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - */ - SoftwareUpgradeProposal.prototype.description = ""; - - /** - * SoftwareUpgradeProposal plan. - * @member {cosmos.upgrade.v1beta1.IPlan|null|undefined} plan - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - */ - SoftwareUpgradeProposal.prototype.plan = null; - - /** - * Encodes the specified SoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal} message SoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SoftwareUpgradeProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) - $root.cosmos.upgrade.v1beta1.Plan.encode(message.plan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal} message SoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SoftwareUpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SoftwareUpgradeProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = $root.cosmos.upgrade.v1beta1.Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SoftwareUpgradeProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SoftwareUpgradeProposal message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SoftwareUpgradeProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.plan != null && message.hasOwnProperty("plan")) { - var error = $root.cosmos.upgrade.v1beta1.Plan.verify(message.plan); - if (error) - return "plan." + error; - } - return null; - }; - - /** - * Creates a SoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal - */ - SoftwareUpgradeProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) - return object; - var message = new $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.plan != null) { - if (typeof object.plan !== "object") - throw TypeError(".cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.plan: object expected"); - message.plan = $root.cosmos.upgrade.v1beta1.Plan.fromObject(object.plan); - } - return message; - }; - - /** - * Creates a plain object from a SoftwareUpgradeProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} message SoftwareUpgradeProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SoftwareUpgradeProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.plan = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.plan != null && message.hasOwnProperty("plan")) - object.plan = $root.cosmos.upgrade.v1beta1.Plan.toObject(message.plan, options); - return object; - }; - - /** - * Converts this SoftwareUpgradeProposal to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - * @returns {Object.} JSON object - */ - SoftwareUpgradeProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SoftwareUpgradeProposal; - })(); - - v1beta1.CancelSoftwareUpgradeProposal = (function() { - - /** - * Properties of a CancelSoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @interface ICancelSoftwareUpgradeProposal - * @property {string|null} [title] CancelSoftwareUpgradeProposal title - * @property {string|null} [description] CancelSoftwareUpgradeProposal description - */ - - /** - * Constructs a new CancelSoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a CancelSoftwareUpgradeProposal. - * @implements ICancelSoftwareUpgradeProposal - * @constructor - * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal=} [properties] Properties to set - */ - function CancelSoftwareUpgradeProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelSoftwareUpgradeProposal title. - * @member {string} title - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @instance - */ - CancelSoftwareUpgradeProposal.prototype.title = ""; - - /** - * CancelSoftwareUpgradeProposal description. - * @member {string} description - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @instance - */ - CancelSoftwareUpgradeProposal.prototype.description = ""; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelSoftwareUpgradeProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelSoftwareUpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelSoftwareUpgradeProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelSoftwareUpgradeProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelSoftwareUpgradeProposal message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelSoftwareUpgradeProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a CancelSoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal - */ - CancelSoftwareUpgradeProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) - return object; - var message = new $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a CancelSoftwareUpgradeProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelSoftwareUpgradeProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this CancelSoftwareUpgradeProposal to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @instance - * @returns {Object.} JSON object - */ - CancelSoftwareUpgradeProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CancelSoftwareUpgradeProposal; - })(); - - return v1beta1; - })(); - - return upgrade; - })(); - - cosmos.auth = (function() { - - /** - * Namespace auth. - * @memberof cosmos - * @namespace - */ - var auth = {}; - - auth.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.auth - * @namespace - */ - var v1beta1 = {}; - - v1beta1.BaseAccount = (function() { - - /** - * Properties of a BaseAccount. - * @memberof cosmos.auth.v1beta1 - * @interface IBaseAccount - * @property {string|null} [address] BaseAccount address - * @property {google.protobuf.IAny|null} [pub_key] BaseAccount pub_key - * @property {Long|null} [account_number] BaseAccount account_number - * @property {Long|null} [sequence] BaseAccount sequence - */ - - /** - * Constructs a new BaseAccount. - * @memberof cosmos.auth.v1beta1 - * @classdesc Represents a BaseAccount. - * @implements IBaseAccount - * @constructor - * @param {cosmos.auth.v1beta1.IBaseAccount=} [properties] Properties to set - */ - function BaseAccount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BaseAccount address. - * @member {string} address - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - */ - BaseAccount.prototype.address = ""; - - /** - * BaseAccount pub_key. - * @member {google.protobuf.IAny|null|undefined} pub_key - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - */ - BaseAccount.prototype.pub_key = null; - - /** - * BaseAccount account_number. - * @member {Long} account_number - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - */ - BaseAccount.prototype.account_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * BaseAccount sequence. - * @member {Long} sequence - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - */ - BaseAccount.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified BaseAccount message. Does not implicitly {@link cosmos.auth.v1beta1.BaseAccount.verify|verify} messages. - * @function encode - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {cosmos.auth.v1beta1.IBaseAccount} message BaseAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BaseAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); - if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key")) - $root.google.protobuf.Any.encode(message.pub_key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.account_number != null && Object.hasOwnProperty.call(message, "account_number")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.account_number); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified BaseAccount message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.BaseAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {cosmos.auth.v1beta1.IBaseAccount} message BaseAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BaseAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BaseAccount message from the specified reader or buffer. - * @function decode - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BaseAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.BaseAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.pub_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.account_number = reader.uint64(); - break; - case 4: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BaseAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BaseAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BaseAccount message. - * @function verify - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BaseAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) { - var error = $root.google.protobuf.Any.verify(message.pub_key); - if (error) - return "pub_key." + error; - } - if (message.account_number != null && message.hasOwnProperty("account_number")) - if (!$util.isInteger(message.account_number) && !(message.account_number && $util.isInteger(message.account_number.low) && $util.isInteger(message.account_number.high))) - return "account_number: integer|Long expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a BaseAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {Object.} object Plain object - * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount - */ - BaseAccount.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.auth.v1beta1.BaseAccount) - return object; - var message = new $root.cosmos.auth.v1beta1.BaseAccount(); - if (object.address != null) - message.address = String(object.address); - if (object.pub_key != null) { - if (typeof object.pub_key !== "object") - throw TypeError(".cosmos.auth.v1beta1.BaseAccount.pub_key: object expected"); - message.pub_key = $root.google.protobuf.Any.fromObject(object.pub_key); - } - if (object.account_number != null) - if ($util.Long) - (message.account_number = $util.Long.fromValue(object.account_number)).unsigned = true; - else if (typeof object.account_number === "string") - message.account_number = parseInt(object.account_number, 10); - else if (typeof object.account_number === "number") - message.account_number = object.account_number; - else if (typeof object.account_number === "object") - message.account_number = new $util.LongBits(object.account_number.low >>> 0, object.account_number.high >>> 0).toNumber(true); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a BaseAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {cosmos.auth.v1beta1.BaseAccount} message BaseAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BaseAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.address = ""; - object.pub_key = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.account_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.account_number = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) - object.pub_key = $root.google.protobuf.Any.toObject(message.pub_key, options); - if (message.account_number != null && message.hasOwnProperty("account_number")) - if (typeof message.account_number === "number") - object.account_number = options.longs === String ? String(message.account_number) : message.account_number; - else - object.account_number = options.longs === String ? $util.Long.prototype.toString.call(message.account_number) : options.longs === Number ? new $util.LongBits(message.account_number.low >>> 0, message.account_number.high >>> 0).toNumber(true) : message.account_number; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this BaseAccount to JSON. - * @function toJSON - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - * @returns {Object.} JSON object - */ - BaseAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BaseAccount; - })(); - - v1beta1.ModuleAccount = (function() { - - /** - * Properties of a ModuleAccount. - * @memberof cosmos.auth.v1beta1 - * @interface IModuleAccount - * @property {cosmos.auth.v1beta1.IBaseAccount|null} [base_account] ModuleAccount base_account - * @property {string|null} [name] ModuleAccount name - * @property {Array.|null} [permissions] ModuleAccount permissions - */ - - /** - * Constructs a new ModuleAccount. - * @memberof cosmos.auth.v1beta1 - * @classdesc Represents a ModuleAccount. - * @implements IModuleAccount - * @constructor - * @param {cosmos.auth.v1beta1.IModuleAccount=} [properties] Properties to set - */ - function ModuleAccount(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModuleAccount base_account. - * @member {cosmos.auth.v1beta1.IBaseAccount|null|undefined} base_account - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @instance - */ - ModuleAccount.prototype.base_account = null; - - /** - * ModuleAccount name. - * @member {string} name - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @instance - */ - ModuleAccount.prototype.name = ""; - - /** - * ModuleAccount permissions. - * @member {Array.} permissions - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @instance - */ - ModuleAccount.prototype.permissions = $util.emptyArray; - - /** - * Encodes the specified ModuleAccount message. Does not implicitly {@link cosmos.auth.v1beta1.ModuleAccount.verify|verify} messages. - * @function encode - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {cosmos.auth.v1beta1.IModuleAccount} message ModuleAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModuleAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.base_account != null && Object.hasOwnProperty.call(message, "base_account")) - $root.cosmos.auth.v1beta1.BaseAccount.encode(message.base_account, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified ModuleAccount message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.ModuleAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {cosmos.auth.v1beta1.IModuleAccount} message ModuleAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModuleAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModuleAccount message from the specified reader or buffer. - * @function decode - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModuleAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.ModuleAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_account = $root.cosmos.auth.v1beta1.BaseAccount.decode(reader, reader.uint32()); - break; - case 2: - message.name = reader.string(); - break; - case 3: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModuleAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModuleAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModuleAccount message. - * @function verify - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModuleAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.base_account != null && message.hasOwnProperty("base_account")) { - var error = $root.cosmos.auth.v1beta1.BaseAccount.verify(message.base_account); - if (error) - return "base_account." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a ModuleAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {Object.} object Plain object - * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount - */ - ModuleAccount.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.auth.v1beta1.ModuleAccount) - return object; - var message = new $root.cosmos.auth.v1beta1.ModuleAccount(); - if (object.base_account != null) { - if (typeof object.base_account !== "object") - throw TypeError(".cosmos.auth.v1beta1.ModuleAccount.base_account: object expected"); - message.base_account = $root.cosmos.auth.v1beta1.BaseAccount.fromObject(object.base_account); - } - if (object.name != null) - message.name = String(object.name); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".cosmos.auth.v1beta1.ModuleAccount.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a ModuleAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {cosmos.auth.v1beta1.ModuleAccount} message ModuleAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModuleAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) { - object.base_account = null; - object.name = ""; - } - if (message.base_account != null && message.hasOwnProperty("base_account")) - object.base_account = $root.cosmos.auth.v1beta1.BaseAccount.toObject(message.base_account, options); - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this ModuleAccount to JSON. - * @function toJSON - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @instance - * @returns {Object.} JSON object - */ - ModuleAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ModuleAccount; - })(); - - v1beta1.Params = (function() { - - /** - * Properties of a Params. - * @memberof cosmos.auth.v1beta1 - * @interface IParams - * @property {Long|null} [max_memo_characters] Params max_memo_characters - * @property {Long|null} [tx_sig_limit] Params tx_sig_limit - * @property {Long|null} [tx_size_cost_per_byte] Params tx_size_cost_per_byte - * @property {Long|null} [sig_verify_cost_ed25519] Params sig_verify_cost_ed25519 - * @property {Long|null} [sig_verify_cost_secp256k1] Params sig_verify_cost_secp256k1 - */ - - /** - * Constructs a new Params. - * @memberof cosmos.auth.v1beta1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {cosmos.auth.v1beta1.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params max_memo_characters. - * @member {Long} max_memo_characters - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.max_memo_characters = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Params tx_sig_limit. - * @member {Long} tx_sig_limit - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.tx_sig_limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Params tx_size_cost_per_byte. - * @member {Long} tx_size_cost_per_byte - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.tx_size_cost_per_byte = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Params sig_verify_cost_ed25519. - * @member {Long} sig_verify_cost_ed25519 - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.sig_verify_cost_ed25519 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Params sig_verify_cost_secp256k1. - * @member {Long} sig_verify_cost_secp256k1 - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.sig_verify_cost_secp256k1 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Params message. Does not implicitly {@link cosmos.auth.v1beta1.Params.verify|verify} messages. - * @function encode - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {cosmos.auth.v1beta1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.max_memo_characters != null && Object.hasOwnProperty.call(message, "max_memo_characters")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.max_memo_characters); - if (message.tx_sig_limit != null && Object.hasOwnProperty.call(message, "tx_sig_limit")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.tx_sig_limit); - if (message.tx_size_cost_per_byte != null && Object.hasOwnProperty.call(message, "tx_size_cost_per_byte")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.tx_size_cost_per_byte); - if (message.sig_verify_cost_ed25519 != null && Object.hasOwnProperty.call(message, "sig_verify_cost_ed25519")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sig_verify_cost_ed25519); - if (message.sig_verify_cost_secp256k1 != null && Object.hasOwnProperty.call(message, "sig_verify_cost_secp256k1")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.sig_verify_cost_secp256k1); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {cosmos.auth.v1beta1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.auth.v1beta1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_memo_characters = reader.uint64(); - break; - case 2: - message.tx_sig_limit = reader.uint64(); - break; - case 3: - message.tx_size_cost_per_byte = reader.uint64(); - break; - case 4: - message.sig_verify_cost_ed25519 = reader.uint64(); - break; - case 5: - message.sig_verify_cost_secp256k1 = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.auth.v1beta1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.max_memo_characters != null && message.hasOwnProperty("max_memo_characters")) - if (!$util.isInteger(message.max_memo_characters) && !(message.max_memo_characters && $util.isInteger(message.max_memo_characters.low) && $util.isInteger(message.max_memo_characters.high))) - return "max_memo_characters: integer|Long expected"; - if (message.tx_sig_limit != null && message.hasOwnProperty("tx_sig_limit")) - if (!$util.isInteger(message.tx_sig_limit) && !(message.tx_sig_limit && $util.isInteger(message.tx_sig_limit.low) && $util.isInteger(message.tx_sig_limit.high))) - return "tx_sig_limit: integer|Long expected"; - if (message.tx_size_cost_per_byte != null && message.hasOwnProperty("tx_size_cost_per_byte")) - if (!$util.isInteger(message.tx_size_cost_per_byte) && !(message.tx_size_cost_per_byte && $util.isInteger(message.tx_size_cost_per_byte.low) && $util.isInteger(message.tx_size_cost_per_byte.high))) - return "tx_size_cost_per_byte: integer|Long expected"; - if (message.sig_verify_cost_ed25519 != null && message.hasOwnProperty("sig_verify_cost_ed25519")) - if (!$util.isInteger(message.sig_verify_cost_ed25519) && !(message.sig_verify_cost_ed25519 && $util.isInteger(message.sig_verify_cost_ed25519.low) && $util.isInteger(message.sig_verify_cost_ed25519.high))) - return "sig_verify_cost_ed25519: integer|Long expected"; - if (message.sig_verify_cost_secp256k1 != null && message.hasOwnProperty("sig_verify_cost_secp256k1")) - if (!$util.isInteger(message.sig_verify_cost_secp256k1) && !(message.sig_verify_cost_secp256k1 && $util.isInteger(message.sig_verify_cost_secp256k1.low) && $util.isInteger(message.sig_verify_cost_secp256k1.high))) - return "sig_verify_cost_secp256k1: integer|Long expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {Object.} object Plain object - * @returns {cosmos.auth.v1beta1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.auth.v1beta1.Params) - return object; - var message = new $root.cosmos.auth.v1beta1.Params(); - if (object.max_memo_characters != null) - if ($util.Long) - (message.max_memo_characters = $util.Long.fromValue(object.max_memo_characters)).unsigned = true; - else if (typeof object.max_memo_characters === "string") - message.max_memo_characters = parseInt(object.max_memo_characters, 10); - else if (typeof object.max_memo_characters === "number") - message.max_memo_characters = object.max_memo_characters; - else if (typeof object.max_memo_characters === "object") - message.max_memo_characters = new $util.LongBits(object.max_memo_characters.low >>> 0, object.max_memo_characters.high >>> 0).toNumber(true); - if (object.tx_sig_limit != null) - if ($util.Long) - (message.tx_sig_limit = $util.Long.fromValue(object.tx_sig_limit)).unsigned = true; - else if (typeof object.tx_sig_limit === "string") - message.tx_sig_limit = parseInt(object.tx_sig_limit, 10); - else if (typeof object.tx_sig_limit === "number") - message.tx_sig_limit = object.tx_sig_limit; - else if (typeof object.tx_sig_limit === "object") - message.tx_sig_limit = new $util.LongBits(object.tx_sig_limit.low >>> 0, object.tx_sig_limit.high >>> 0).toNumber(true); - if (object.tx_size_cost_per_byte != null) - if ($util.Long) - (message.tx_size_cost_per_byte = $util.Long.fromValue(object.tx_size_cost_per_byte)).unsigned = true; - else if (typeof object.tx_size_cost_per_byte === "string") - message.tx_size_cost_per_byte = parseInt(object.tx_size_cost_per_byte, 10); - else if (typeof object.tx_size_cost_per_byte === "number") - message.tx_size_cost_per_byte = object.tx_size_cost_per_byte; - else if (typeof object.tx_size_cost_per_byte === "object") - message.tx_size_cost_per_byte = new $util.LongBits(object.tx_size_cost_per_byte.low >>> 0, object.tx_size_cost_per_byte.high >>> 0).toNumber(true); - if (object.sig_verify_cost_ed25519 != null) - if ($util.Long) - (message.sig_verify_cost_ed25519 = $util.Long.fromValue(object.sig_verify_cost_ed25519)).unsigned = true; - else if (typeof object.sig_verify_cost_ed25519 === "string") - message.sig_verify_cost_ed25519 = parseInt(object.sig_verify_cost_ed25519, 10); - else if (typeof object.sig_verify_cost_ed25519 === "number") - message.sig_verify_cost_ed25519 = object.sig_verify_cost_ed25519; - else if (typeof object.sig_verify_cost_ed25519 === "object") - message.sig_verify_cost_ed25519 = new $util.LongBits(object.sig_verify_cost_ed25519.low >>> 0, object.sig_verify_cost_ed25519.high >>> 0).toNumber(true); - if (object.sig_verify_cost_secp256k1 != null) - if ($util.Long) - (message.sig_verify_cost_secp256k1 = $util.Long.fromValue(object.sig_verify_cost_secp256k1)).unsigned = true; - else if (typeof object.sig_verify_cost_secp256k1 === "string") - message.sig_verify_cost_secp256k1 = parseInt(object.sig_verify_cost_secp256k1, 10); - else if (typeof object.sig_verify_cost_secp256k1 === "number") - message.sig_verify_cost_secp256k1 = object.sig_verify_cost_secp256k1; - else if (typeof object.sig_verify_cost_secp256k1 === "object") - message.sig_verify_cost_secp256k1 = new $util.LongBits(object.sig_verify_cost_secp256k1.low >>> 0, object.sig_verify_cost_secp256k1.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {cosmos.auth.v1beta1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.max_memo_characters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_memo_characters = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tx_sig_limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tx_sig_limit = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tx_size_cost_per_byte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tx_size_cost_per_byte = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sig_verify_cost_ed25519 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sig_verify_cost_ed25519 = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sig_verify_cost_secp256k1 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sig_verify_cost_secp256k1 = options.longs === String ? "0" : 0; - } - if (message.max_memo_characters != null && message.hasOwnProperty("max_memo_characters")) - if (typeof message.max_memo_characters === "number") - object.max_memo_characters = options.longs === String ? String(message.max_memo_characters) : message.max_memo_characters; - else - object.max_memo_characters = options.longs === String ? $util.Long.prototype.toString.call(message.max_memo_characters) : options.longs === Number ? new $util.LongBits(message.max_memo_characters.low >>> 0, message.max_memo_characters.high >>> 0).toNumber(true) : message.max_memo_characters; - if (message.tx_sig_limit != null && message.hasOwnProperty("tx_sig_limit")) - if (typeof message.tx_sig_limit === "number") - object.tx_sig_limit = options.longs === String ? String(message.tx_sig_limit) : message.tx_sig_limit; - else - object.tx_sig_limit = options.longs === String ? $util.Long.prototype.toString.call(message.tx_sig_limit) : options.longs === Number ? new $util.LongBits(message.tx_sig_limit.low >>> 0, message.tx_sig_limit.high >>> 0).toNumber(true) : message.tx_sig_limit; - if (message.tx_size_cost_per_byte != null && message.hasOwnProperty("tx_size_cost_per_byte")) - if (typeof message.tx_size_cost_per_byte === "number") - object.tx_size_cost_per_byte = options.longs === String ? String(message.tx_size_cost_per_byte) : message.tx_size_cost_per_byte; - else - object.tx_size_cost_per_byte = options.longs === String ? $util.Long.prototype.toString.call(message.tx_size_cost_per_byte) : options.longs === Number ? new $util.LongBits(message.tx_size_cost_per_byte.low >>> 0, message.tx_size_cost_per_byte.high >>> 0).toNumber(true) : message.tx_size_cost_per_byte; - if (message.sig_verify_cost_ed25519 != null && message.hasOwnProperty("sig_verify_cost_ed25519")) - if (typeof message.sig_verify_cost_ed25519 === "number") - object.sig_verify_cost_ed25519 = options.longs === String ? String(message.sig_verify_cost_ed25519) : message.sig_verify_cost_ed25519; - else - object.sig_verify_cost_ed25519 = options.longs === String ? $util.Long.prototype.toString.call(message.sig_verify_cost_ed25519) : options.longs === Number ? new $util.LongBits(message.sig_verify_cost_ed25519.low >>> 0, message.sig_verify_cost_ed25519.high >>> 0).toNumber(true) : message.sig_verify_cost_ed25519; - if (message.sig_verify_cost_secp256k1 != null && message.hasOwnProperty("sig_verify_cost_secp256k1")) - if (typeof message.sig_verify_cost_secp256k1 === "number") - object.sig_verify_cost_secp256k1 = options.longs === String ? String(message.sig_verify_cost_secp256k1) : message.sig_verify_cost_secp256k1; - else - object.sig_verify_cost_secp256k1 = options.longs === String ? $util.Long.prototype.toString.call(message.sig_verify_cost_secp256k1) : options.longs === Number ? new $util.LongBits(message.sig_verify_cost_secp256k1.low >>> 0, message.sig_verify_cost_secp256k1.high >>> 0).toNumber(true) : message.sig_verify_cost_secp256k1; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof cosmos.auth.v1beta1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - return v1beta1; - })(); - - return auth; - })(); - - return cosmos; - })(); - - $root.gogoproto = (function() { - - /** - * Namespace gogoproto. - * @exports gogoproto - * @namespace - */ - var gogoproto = {}; - - return gogoproto; - })(); - - $root.cosmos_proto = (function() { - - /** - * Namespace cosmos_proto. - * @exports cosmos_proto - * @namespace - */ - var cosmos_proto = {}; - - return cosmos_proto; - })(); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorSet; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [public_dependency] FileDescriptorProto public_dependency - * @property {Array.|null} [weak_dependency] FileDescriptorProto weak_dependency - * @property {Array.|null} [message_type] FileDescriptorProto message_type - * @property {Array.|null} [enum_type] FileDescriptorProto enum_type - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [source_code_info] FileDescriptorProto source_code_info - * @property {string|null} [syntax] FileDescriptorProto syntax - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.public_dependency = []; - this.weak_dependency = []; - this.message_type = []; - this.enum_type = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto public_dependency. - * @member {Array.} public_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.public_dependency = $util.emptyArray; - - /** - * FileDescriptorProto weak_dependency. - * @member {Array.} weak_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weak_dependency = $util.emptyArray; - - /** - * FileDescriptorProto message_type. - * @member {Array.} message_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.message_type = $util.emptyArray; - - /** - * FileDescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto source_code_info. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} source_code_info - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.source_code_info = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.message_type != null && message.message_type.length) - for (var i = 0; i < message.message_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.message_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (var i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.source_code_info != null && Object.hasOwnProperty.call(message, "source_code_info")) - $root.google.protobuf.SourceCodeInfo.encode(message.source_code_info, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.public_dependency != null && message.public_dependency.length) - for (var i = 0; i < message.public_dependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.public_dependency[i]); - if (message.weak_dependency != null && message.weak_dependency.length) - for (var i = 0; i < message.weak_dependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weak_dependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.public_dependency && message.public_dependency.length)) - message.public_dependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.public_dependency.push(reader.int32()); - } else - message.public_dependency.push(reader.int32()); - break; - case 11: - if (!(message.weak_dependency && message.weak_dependency.length)) - message.weak_dependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weak_dependency.push(reader.int32()); - } else - message.weak_dependency.push(reader.int32()); - break; - case 4: - if (!(message.message_type && message.message_type.length)) - message.message_type = []; - message.message_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.source_code_info = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.public_dependency != null && message.hasOwnProperty("public_dependency")) { - if (!Array.isArray(message.public_dependency)) - return "public_dependency: array expected"; - for (var i = 0; i < message.public_dependency.length; ++i) - if (!$util.isInteger(message.public_dependency[i])) - return "public_dependency: integer[] expected"; - } - if (message.weak_dependency != null && message.hasOwnProperty("weak_dependency")) { - if (!Array.isArray(message.weak_dependency)) - return "weak_dependency: array expected"; - for (var i = 0; i < message.weak_dependency.length; ++i) - if (!$util.isInteger(message.weak_dependency[i])) - return "weak_dependency: integer[] expected"; - } - if (message.message_type != null && message.hasOwnProperty("message_type")) { - if (!Array.isArray(message.message_type)) - return "message_type: array expected"; - for (var i = 0; i < message.message_type.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.message_type[i]); - if (error) - return "message_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (var i = 0; i < message.enum_type.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.source_code_info); - if (error) - return "source_code_info." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.public_dependency) { - if (!Array.isArray(object.public_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.public_dependency: array expected"); - message.public_dependency = []; - for (var i = 0; i < object.public_dependency.length; ++i) - message.public_dependency[i] = object.public_dependency[i] | 0; - } - if (object.weak_dependency) { - if (!Array.isArray(object.weak_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weak_dependency: array expected"); - message.weak_dependency = []; - for (var i = 0; i < object.weak_dependency.length; ++i) - message.weak_dependency[i] = object.weak_dependency[i] | 0; - } - if (object.message_type) { - if (!Array.isArray(object.message_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: array expected"); - message.message_type = []; - for (var i = 0; i < object.message_type.length; ++i) { - if (typeof object.message_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: object expected"); - message.message_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.message_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (var i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.source_code_info != null) { - if (typeof object.source_code_info !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.source_code_info: object expected"); - message.source_code_info = $root.google.protobuf.SourceCodeInfo.fromObject(object.source_code_info); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.message_type = []; - object.enum_type = []; - object.service = []; - object.extension = []; - object.public_dependency = []; - object.weak_dependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.source_code_info = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.message_type && message.message_type.length) { - object.message_type = []; - for (var j = 0; j < message.message_type.length; ++j) - object.message_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.message_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (var j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) - object.source_code_info = $root.google.protobuf.SourceCodeInfo.toObject(message.source_code_info, options); - if (message.public_dependency && message.public_dependency.length) { - object.public_dependency = []; - for (var j = 0; j < message.public_dependency.length; ++j) - object.public_dependency[j] = message.public_dependency[j]; - } - if (message.weak_dependency && message.weak_dependency.length) { - object.weak_dependency = []; - for (var j = 0; j < message.weak_dependency.length; ++j) - object.weak_dependency[j] = message.weak_dependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nested_type] DescriptorProto nested_type - * @property {Array.|null} [enum_type] DescriptorProto enum_type - * @property {Array.|null} [extension_range] DescriptorProto extension_range - * @property {Array.|null} [oneof_decl] DescriptorProto oneof_decl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reserved_range] DescriptorProto reserved_range - * @property {Array.|null} [reserved_name] DescriptorProto reserved_name - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nested_type = []; - this.enum_type = []; - this.extension_range = []; - this.oneof_decl = []; - this.reserved_range = []; - this.reserved_name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nested_type. - * @member {Array.} nested_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nested_type = $util.emptyArray; - - /** - * DescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * DescriptorProto extension_range. - * @member {Array.} extension_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension_range = $util.emptyArray; - - /** - * DescriptorProto oneof_decl. - * @member {Array.} oneof_decl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneof_decl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reserved_range. - * @member {Array.} reserved_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_range = $util.emptyArray; - - /** - * DescriptorProto reserved_name. - * @member {Array.} reserved_name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_name = $util.emptyArray; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nested_type != null && message.nested_type.length) - for (var i = 0; i < message.nested_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nested_type[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (var i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extension_range != null && message.extension_range.length) - for (var i = 0; i < message.extension_range.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extension_range[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneof_decl != null && message.oneof_decl.length) - for (var i = 0; i < message.oneof_decl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneof_decl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reserved_range != null && message.reserved_range.length) - for (var i = 0; i < message.reserved_range.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reserved_range[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reserved_name != null && message.reserved_name.length) - for (var i = 0; i < message.reserved_name.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reserved_name[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nested_type && message.nested_type.length)) - message.nested_type = []; - message.nested_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extension_range && message.extension_range.length)) - message.extension_range = []; - message.extension_range.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneof_decl && message.oneof_decl.length)) - message.oneof_decl = []; - message.oneof_decl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reserved_range && message.reserved_range.length)) - message.reserved_range = []; - message.reserved_range.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reserved_name && message.reserved_name.length)) - message.reserved_name = []; - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nested_type != null && message.hasOwnProperty("nested_type")) { - if (!Array.isArray(message.nested_type)) - return "nested_type: array expected"; - for (var i = 0; i < message.nested_type.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nested_type[i]); - if (error) - return "nested_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (var i = 0; i < message.enum_type.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.extension_range != null && message.hasOwnProperty("extension_range")) { - if (!Array.isArray(message.extension_range)) - return "extension_range: array expected"; - for (var i = 0; i < message.extension_range.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extension_range[i]); - if (error) - return "extension_range." + error; - } - } - if (message.oneof_decl != null && message.hasOwnProperty("oneof_decl")) { - if (!Array.isArray(message.oneof_decl)) - return "oneof_decl: array expected"; - for (var i = 0; i < message.oneof_decl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneof_decl[i]); - if (error) - return "oneof_decl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reserved_range != null && message.hasOwnProperty("reserved_range")) { - if (!Array.isArray(message.reserved_range)) - return "reserved_range: array expected"; - for (var i = 0; i < message.reserved_range.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reserved_range[i]); - if (error) - return "reserved_range." + error; - } - } - if (message.reserved_name != null && message.hasOwnProperty("reserved_name")) { - if (!Array.isArray(message.reserved_name)) - return "reserved_name: array expected"; - for (var i = 0; i < message.reserved_name.length; ++i) - if (!$util.isString(message.reserved_name[i])) - return "reserved_name: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nested_type) { - if (!Array.isArray(object.nested_type)) - throw TypeError(".google.protobuf.DescriptorProto.nested_type: array expected"); - message.nested_type = []; - for (var i = 0; i < object.nested_type.length; ++i) { - if (typeof object.nested_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nested_type: object expected"); - message.nested_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nested_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.DescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (var i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.extension_range) { - if (!Array.isArray(object.extension_range)) - throw TypeError(".google.protobuf.DescriptorProto.extension_range: array expected"); - message.extension_range = []; - for (var i = 0; i < object.extension_range.length; ++i) { - if (typeof object.extension_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension_range: object expected"); - message.extension_range[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extension_range[i]); - } - } - if (object.oneof_decl) { - if (!Array.isArray(object.oneof_decl)) - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: array expected"); - message.oneof_decl = []; - for (var i = 0; i < object.oneof_decl.length; ++i) { - if (typeof object.oneof_decl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: object expected"); - message.oneof_decl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneof_decl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reserved_range) { - if (!Array.isArray(object.reserved_range)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: array expected"); - message.reserved_range = []; - for (var i = 0; i < object.reserved_range.length; ++i) { - if (typeof object.reserved_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: object expected"); - message.reserved_range[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reserved_range[i]); - } - } - if (object.reserved_name) { - if (!Array.isArray(object.reserved_name)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_name: array expected"); - message.reserved_name = []; - for (var i = 0; i < object.reserved_name.length; ++i) - message.reserved_name[i] = String(object.reserved_name[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nested_type = []; - object.enum_type = []; - object.extension_range = []; - object.extension = []; - object.oneof_decl = []; - object.reserved_range = []; - object.reserved_name = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nested_type && message.nested_type.length) { - object.nested_type = []; - for (var j = 0; j < message.nested_type.length; ++j) - object.nested_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.nested_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (var j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.extension_range && message.extension_range.length) { - object.extension_range = []; - for (var j = 0; j < message.extension_range.length; ++j) - object.extension_range[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extension_range[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneof_decl && message.oneof_decl.length) { - object.oneof_decl = []; - for (var j = 0; j < message.oneof_decl.length; ++j) - object.oneof_decl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneof_decl[j], options); - } - if (message.reserved_range && message.reserved_range.length) { - object.reserved_range = []; - for (var j = 0; j < message.reserved_range.length; ++j) - object.reserved_range[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reserved_range[j], options); - } - if (message.reserved_name && message.reserved_name.length) { - object.reserved_name = []; - for (var j = 0; j < message.reserved_name.length; ++j) - object.reserved_name[j] = message.reserved_name[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [type_name] FieldDescriptorProto type_name - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [default_value] FieldDescriptorProto default_value - * @property {number|null} [oneof_index] FieldDescriptorProto oneof_index - * @property {string|null} [json_name] FieldDescriptorProto json_name - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto type_name. - * @member {string} type_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type_name = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto default_value. - * @member {string} default_value - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.default_value = ""; - - /** - * FieldDescriptorProto oneof_index. - * @member {number} oneof_index - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneof_index = 0; - - /** - * FieldDescriptorProto json_name. - * @member {string} json_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.json_name = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.type_name != null && Object.hasOwnProperty.call(message, "type_name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.type_name); - if (message.default_value != null && Object.hasOwnProperty.call(message, "default_value")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.default_value); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneof_index != null && Object.hasOwnProperty.call(message, "oneof_index")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneof_index); - if (message.json_name != null && Object.hasOwnProperty.call(message, "json_name")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.json_name); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.type_name != null && message.hasOwnProperty("type_name")) - if (!$util.isString(message.type_name)) - return "type_name: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.default_value != null && message.hasOwnProperty("default_value")) - if (!$util.isString(message.default_value)) - return "default_value: string expected"; - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - if (!$util.isInteger(message.oneof_index)) - return "oneof_index: integer expected"; - if (message.json_name != null && message.hasOwnProperty("json_name")) - if (!$util.isString(message.json_name)) - return "json_name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.type_name != null) - message.type_name = String(object.type_name); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.default_value != null) - message.default_value = String(object.default_value); - if (object.oneof_index != null) - message.oneof_index = object.oneof_index | 0; - if (object.json_name != null) - message.json_name = String(object.json_name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.type_name = ""; - object.default_value = ""; - object.options = null; - object.oneof_index = 0; - object.json_name = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.type_name != null && message.hasOwnProperty("type_name")) - object.type_name = message.type_name; - if (message.default_value != null && message.hasOwnProperty("default_value")) - object.default_value = message.default_value; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - object.oneof_index = message.oneof_index; - if (message.json_name != null && message.hasOwnProperty("json_name")) - object.json_name = message.json_name; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.value = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [input_type] MethodDescriptorProto input_type - * @property {string|null} [output_type] MethodDescriptorProto output_type - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [client_streaming] MethodDescriptorProto client_streaming - * @property {boolean|null} [server_streaming] MethodDescriptorProto server_streaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto input_type. - * @member {string} input_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.input_type = ""; - - /** - * MethodDescriptorProto output_type. - * @member {string} output_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.output_type = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto client_streaming. - * @member {boolean} client_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.client_streaming = false; - - /** - * MethodDescriptorProto server_streaming. - * @member {boolean} server_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.server_streaming = false; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.input_type != null && Object.hasOwnProperty.call(message, "input_type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.input_type); - if (message.output_type != null && Object.hasOwnProperty.call(message, "output_type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.output_type); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.client_streaming != null && Object.hasOwnProperty.call(message, "client_streaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.client_streaming); - if (message.server_streaming != null && Object.hasOwnProperty.call(message, "server_streaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.server_streaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.input_type != null && message.hasOwnProperty("input_type")) - if (!$util.isString(message.input_type)) - return "input_type: string expected"; - if (message.output_type != null && message.hasOwnProperty("output_type")) - if (!$util.isString(message.output_type)) - return "output_type: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - if (typeof message.client_streaming !== "boolean") - return "client_streaming: boolean expected"; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - if (typeof message.server_streaming !== "boolean") - return "server_streaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.input_type != null) - message.input_type = String(object.input_type); - if (object.output_type != null) - message.output_type = String(object.output_type); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.client_streaming != null) - message.client_streaming = Boolean(object.client_streaming); - if (object.server_streaming != null) - message.server_streaming = Boolean(object.server_streaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.input_type = ""; - object.output_type = ""; - object.options = null; - object.client_streaming = false; - object.server_streaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.input_type != null && message.hasOwnProperty("input_type")) - object.input_type = message.input_type; - if (message.output_type != null && message.hasOwnProperty("output_type")) - object.output_type = message.output_type; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - object.client_streaming = message.client_streaming; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - object.server_streaming = message.server_streaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [java_package] FileOptions java_package - * @property {string|null} [java_outer_classname] FileOptions java_outer_classname - * @property {boolean|null} [java_multiple_files] FileOptions java_multiple_files - * @property {boolean|null} [java_generate_equals_and_hash] FileOptions java_generate_equals_and_hash - * @property {boolean|null} [java_string_check_utf8] FileOptions java_string_check_utf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimize_for] FileOptions optimize_for - * @property {string|null} [go_package] FileOptions go_package - * @property {boolean|null} [cc_generic_services] FileOptions cc_generic_services - * @property {boolean|null} [java_generic_services] FileOptions java_generic_services - * @property {boolean|null} [py_generic_services] FileOptions py_generic_services - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [cc_enable_arenas] FileOptions cc_enable_arenas - * @property {string|null} [objc_class_prefix] FileOptions objc_class_prefix - * @property {string|null} [csharp_namespace] FileOptions csharp_namespace - * @property {Array.|null} [uninterpreted_option] FileOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters_all"] FileOptions .gogoproto.goproto_getters_all - * @property {boolean|null} [".gogoproto.goproto_enum_prefix_all"] FileOptions .gogoproto.goproto_enum_prefix_all - * @property {boolean|null} [".gogoproto.goproto_stringer_all"] FileOptions .gogoproto.goproto_stringer_all - * @property {boolean|null} [".gogoproto.verbose_equal_all"] FileOptions .gogoproto.verbose_equal_all - * @property {boolean|null} [".gogoproto.face_all"] FileOptions .gogoproto.face_all - * @property {boolean|null} [".gogoproto.gostring_all"] FileOptions .gogoproto.gostring_all - * @property {boolean|null} [".gogoproto.populate_all"] FileOptions .gogoproto.populate_all - * @property {boolean|null} [".gogoproto.stringer_all"] FileOptions .gogoproto.stringer_all - * @property {boolean|null} [".gogoproto.onlyone_all"] FileOptions .gogoproto.onlyone_all - * @property {boolean|null} [".gogoproto.equal_all"] FileOptions .gogoproto.equal_all - * @property {boolean|null} [".gogoproto.description_all"] FileOptions .gogoproto.description_all - * @property {boolean|null} [".gogoproto.testgen_all"] FileOptions .gogoproto.testgen_all - * @property {boolean|null} [".gogoproto.benchgen_all"] FileOptions .gogoproto.benchgen_all - * @property {boolean|null} [".gogoproto.marshaler_all"] FileOptions .gogoproto.marshaler_all - * @property {boolean|null} [".gogoproto.unmarshaler_all"] FileOptions .gogoproto.unmarshaler_all - * @property {boolean|null} [".gogoproto.stable_marshaler_all"] FileOptions .gogoproto.stable_marshaler_all - * @property {boolean|null} [".gogoproto.sizer_all"] FileOptions .gogoproto.sizer_all - * @property {boolean|null} [".gogoproto.goproto_enum_stringer_all"] FileOptions .gogoproto.goproto_enum_stringer_all - * @property {boolean|null} [".gogoproto.enum_stringer_all"] FileOptions .gogoproto.enum_stringer_all - * @property {boolean|null} [".gogoproto.unsafe_marshaler_all"] FileOptions .gogoproto.unsafe_marshaler_all - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler_all"] FileOptions .gogoproto.unsafe_unmarshaler_all - * @property {boolean|null} [".gogoproto.goproto_extensions_map_all"] FileOptions .gogoproto.goproto_extensions_map_all - * @property {boolean|null} [".gogoproto.goproto_unrecognized_all"] FileOptions .gogoproto.goproto_unrecognized_all - * @property {boolean|null} [".gogoproto.gogoproto_import"] FileOptions .gogoproto.gogoproto_import - * @property {boolean|null} [".gogoproto.protosizer_all"] FileOptions .gogoproto.protosizer_all - * @property {boolean|null} [".gogoproto.compare_all"] FileOptions .gogoproto.compare_all - * @property {boolean|null} [".gogoproto.typedecl_all"] FileOptions .gogoproto.typedecl_all - * @property {boolean|null} [".gogoproto.enumdecl_all"] FileOptions .gogoproto.enumdecl_all - * @property {boolean|null} [".gogoproto.goproto_registration"] FileOptions .gogoproto.goproto_registration - * @property {boolean|null} [".gogoproto.messagename_all"] FileOptions .gogoproto.messagename_all - * @property {boolean|null} [".gogoproto.goproto_sizecache_all"] FileOptions .gogoproto.goproto_sizecache_all - * @property {boolean|null} [".gogoproto.goproto_unkeyed_all"] FileOptions .gogoproto.goproto_unkeyed_all - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions java_package. - * @member {string} java_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_package = ""; - - /** - * FileOptions java_outer_classname. - * @member {string} java_outer_classname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_outer_classname = ""; - - /** - * FileOptions java_multiple_files. - * @member {boolean} java_multiple_files - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_multiple_files = false; - - /** - * FileOptions java_generate_equals_and_hash. - * @member {boolean} java_generate_equals_and_hash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generate_equals_and_hash = false; - - /** - * FileOptions java_string_check_utf8. - * @member {boolean} java_string_check_utf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_string_check_utf8 = false; - - /** - * FileOptions optimize_for. - * @member {google.protobuf.FileOptions.OptimizeMode} optimize_for - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimize_for = 1; - - /** - * FileOptions go_package. - * @member {string} go_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.go_package = ""; - - /** - * FileOptions cc_generic_services. - * @member {boolean} cc_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_generic_services = false; - - /** - * FileOptions java_generic_services. - * @member {boolean} java_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generic_services = false; - - /** - * FileOptions py_generic_services. - * @member {boolean} py_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.py_generic_services = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions cc_enable_arenas. - * @member {boolean} cc_enable_arenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_enable_arenas = false; - - /** - * FileOptions objc_class_prefix. - * @member {string} objc_class_prefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objc_class_prefix = ""; - - /** - * FileOptions csharp_namespace. - * @member {string} csharp_namespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharp_namespace = ""; - - /** - * FileOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FileOptions .gogoproto.goproto_getters_all. - * @member {boolean} .gogoproto.goproto_getters_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_getters_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_prefix_all. - * @member {boolean} .gogoproto.goproto_enum_prefix_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_prefix_all"] = false; - - /** - * FileOptions .gogoproto.goproto_stringer_all. - * @member {boolean} .gogoproto.goproto_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_stringer_all"] = false; - - /** - * FileOptions .gogoproto.verbose_equal_all. - * @member {boolean} .gogoproto.verbose_equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.verbose_equal_all"] = false; - - /** - * FileOptions .gogoproto.face_all. - * @member {boolean} .gogoproto.face_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.face_all"] = false; - - /** - * FileOptions .gogoproto.gostring_all. - * @member {boolean} .gogoproto.gostring_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gostring_all"] = false; - - /** - * FileOptions .gogoproto.populate_all. - * @member {boolean} .gogoproto.populate_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.populate_all"] = false; - - /** - * FileOptions .gogoproto.stringer_all. - * @member {boolean} .gogoproto.stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stringer_all"] = false; - - /** - * FileOptions .gogoproto.onlyone_all. - * @member {boolean} .gogoproto.onlyone_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.onlyone_all"] = false; - - /** - * FileOptions .gogoproto.equal_all. - * @member {boolean} .gogoproto.equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.equal_all"] = false; - - /** - * FileOptions .gogoproto.description_all. - * @member {boolean} .gogoproto.description_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.description_all"] = false; - - /** - * FileOptions .gogoproto.testgen_all. - * @member {boolean} .gogoproto.testgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.testgen_all"] = false; - - /** - * FileOptions .gogoproto.benchgen_all. - * @member {boolean} .gogoproto.benchgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.benchgen_all"] = false; - - /** - * FileOptions .gogoproto.marshaler_all. - * @member {boolean} .gogoproto.marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unmarshaler_all. - * @member {boolean} .gogoproto.unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.stable_marshaler_all. - * @member {boolean} .gogoproto.stable_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stable_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.sizer_all. - * @member {boolean} .gogoproto.sizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.sizer_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_stringer_all. - * @member {boolean} .gogoproto.goproto_enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.enum_stringer_all. - * @member {boolean} .gogoproto.enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_marshaler_all. - * @member {boolean} .gogoproto.unsafe_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_unmarshaler_all. - * @member {boolean} .gogoproto.unsafe_unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.goproto_extensions_map_all. - * @member {boolean} .gogoproto.goproto_extensions_map_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_extensions_map_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unrecognized_all. - * @member {boolean} .gogoproto.goproto_unrecognized_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unrecognized_all"] = false; - - /** - * FileOptions .gogoproto.gogoproto_import. - * @member {boolean} .gogoproto.gogoproto_import - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gogoproto_import"] = false; - - /** - * FileOptions .gogoproto.protosizer_all. - * @member {boolean} .gogoproto.protosizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.protosizer_all"] = false; - - /** - * FileOptions .gogoproto.compare_all. - * @member {boolean} .gogoproto.compare_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.compare_all"] = false; - - /** - * FileOptions .gogoproto.typedecl_all. - * @member {boolean} .gogoproto.typedecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.typedecl_all"] = false; - - /** - * FileOptions .gogoproto.enumdecl_all. - * @member {boolean} .gogoproto.enumdecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enumdecl_all"] = false; - - /** - * FileOptions .gogoproto.goproto_registration. - * @member {boolean} .gogoproto.goproto_registration - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_registration"] = false; - - /** - * FileOptions .gogoproto.messagename_all. - * @member {boolean} .gogoproto.messagename_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.messagename_all"] = false; - - /** - * FileOptions .gogoproto.goproto_sizecache_all. - * @member {boolean} .gogoproto.goproto_sizecache_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_sizecache_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unkeyed_all. - * @member {boolean} .gogoproto.goproto_unkeyed_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unkeyed_all"] = false; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.java_package != null && Object.hasOwnProperty.call(message, "java_package")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.java_package); - if (message.java_outer_classname != null && Object.hasOwnProperty.call(message, "java_outer_classname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.java_outer_classname); - if (message.optimize_for != null && Object.hasOwnProperty.call(message, "optimize_for")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimize_for); - if (message.java_multiple_files != null && Object.hasOwnProperty.call(message, "java_multiple_files")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.java_multiple_files); - if (message.go_package != null && Object.hasOwnProperty.call(message, "go_package")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.go_package); - if (message.cc_generic_services != null && Object.hasOwnProperty.call(message, "cc_generic_services")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.cc_generic_services); - if (message.java_generic_services != null && Object.hasOwnProperty.call(message, "java_generic_services")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.java_generic_services); - if (message.py_generic_services != null && Object.hasOwnProperty.call(message, "py_generic_services")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.py_generic_services); - if (message.java_generate_equals_and_hash != null && Object.hasOwnProperty.call(message, "java_generate_equals_and_hash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.java_generate_equals_and_hash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.java_string_check_utf8 != null && Object.hasOwnProperty.call(message, "java_string_check_utf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.java_string_check_utf8); - if (message.cc_enable_arenas != null && Object.hasOwnProperty.call(message, "cc_enable_arenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.cc_enable_arenas); - if (message.objc_class_prefix != null && Object.hasOwnProperty.call(message, "objc_class_prefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objc_class_prefix); - if (message.csharp_namespace != null && Object.hasOwnProperty.call(message, "csharp_namespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharp_namespace); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters_all")) - writer.uint32(/* id 63001, wireType 0 =*/504008).bool(message[".gogoproto.goproto_getters_all"]); - if (message[".gogoproto.goproto_enum_prefix_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix_all")) - writer.uint32(/* id 63002, wireType 0 =*/504016).bool(message[".gogoproto.goproto_enum_prefix_all"]); - if (message[".gogoproto.goproto_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer_all")) - writer.uint32(/* id 63003, wireType 0 =*/504024).bool(message[".gogoproto.goproto_stringer_all"]); - if (message[".gogoproto.verbose_equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal_all")) - writer.uint32(/* id 63004, wireType 0 =*/504032).bool(message[".gogoproto.verbose_equal_all"]); - if (message[".gogoproto.face_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face_all")) - writer.uint32(/* id 63005, wireType 0 =*/504040).bool(message[".gogoproto.face_all"]); - if (message[".gogoproto.gostring_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring_all")) - writer.uint32(/* id 63006, wireType 0 =*/504048).bool(message[".gogoproto.gostring_all"]); - if (message[".gogoproto.populate_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate_all")) - writer.uint32(/* id 63007, wireType 0 =*/504056).bool(message[".gogoproto.populate_all"]); - if (message[".gogoproto.stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer_all")) - writer.uint32(/* id 63008, wireType 0 =*/504064).bool(message[".gogoproto.stringer_all"]); - if (message[".gogoproto.onlyone_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone_all")) - writer.uint32(/* id 63009, wireType 0 =*/504072).bool(message[".gogoproto.onlyone_all"]); - if (message[".gogoproto.equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal_all")) - writer.uint32(/* id 63013, wireType 0 =*/504104).bool(message[".gogoproto.equal_all"]); - if (message[".gogoproto.description_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description_all")) - writer.uint32(/* id 63014, wireType 0 =*/504112).bool(message[".gogoproto.description_all"]); - if (message[".gogoproto.testgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen_all")) - writer.uint32(/* id 63015, wireType 0 =*/504120).bool(message[".gogoproto.testgen_all"]); - if (message[".gogoproto.benchgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen_all")) - writer.uint32(/* id 63016, wireType 0 =*/504128).bool(message[".gogoproto.benchgen_all"]); - if (message[".gogoproto.marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler_all")) - writer.uint32(/* id 63017, wireType 0 =*/504136).bool(message[".gogoproto.marshaler_all"]); - if (message[".gogoproto.unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler_all")) - writer.uint32(/* id 63018, wireType 0 =*/504144).bool(message[".gogoproto.unmarshaler_all"]); - if (message[".gogoproto.stable_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler_all")) - writer.uint32(/* id 63019, wireType 0 =*/504152).bool(message[".gogoproto.stable_marshaler_all"]); - if (message[".gogoproto.sizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer_all")) - writer.uint32(/* id 63020, wireType 0 =*/504160).bool(message[".gogoproto.sizer_all"]); - if (message[".gogoproto.goproto_enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer_all")) - writer.uint32(/* id 63021, wireType 0 =*/504168).bool(message[".gogoproto.goproto_enum_stringer_all"]); - if (message[".gogoproto.enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer_all")) - writer.uint32(/* id 63022, wireType 0 =*/504176).bool(message[".gogoproto.enum_stringer_all"]); - if (message[".gogoproto.unsafe_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler_all")) - writer.uint32(/* id 63023, wireType 0 =*/504184).bool(message[".gogoproto.unsafe_marshaler_all"]); - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler_all")) - writer.uint32(/* id 63024, wireType 0 =*/504192).bool(message[".gogoproto.unsafe_unmarshaler_all"]); - if (message[".gogoproto.goproto_extensions_map_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map_all")) - writer.uint32(/* id 63025, wireType 0 =*/504200).bool(message[".gogoproto.goproto_extensions_map_all"]); - if (message[".gogoproto.goproto_unrecognized_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized_all")) - writer.uint32(/* id 63026, wireType 0 =*/504208).bool(message[".gogoproto.goproto_unrecognized_all"]); - if (message[".gogoproto.gogoproto_import"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gogoproto_import")) - writer.uint32(/* id 63027, wireType 0 =*/504216).bool(message[".gogoproto.gogoproto_import"]); - if (message[".gogoproto.protosizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer_all")) - writer.uint32(/* id 63028, wireType 0 =*/504224).bool(message[".gogoproto.protosizer_all"]); - if (message[".gogoproto.compare_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare_all")) - writer.uint32(/* id 63029, wireType 0 =*/504232).bool(message[".gogoproto.compare_all"]); - if (message[".gogoproto.typedecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl_all")) - writer.uint32(/* id 63030, wireType 0 =*/504240).bool(message[".gogoproto.typedecl_all"]); - if (message[".gogoproto.enumdecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl_all")) - writer.uint32(/* id 63031, wireType 0 =*/504248).bool(message[".gogoproto.enumdecl_all"]); - if (message[".gogoproto.goproto_registration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_registration")) - writer.uint32(/* id 63032, wireType 0 =*/504256).bool(message[".gogoproto.goproto_registration"]); - if (message[".gogoproto.messagename_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename_all")) - writer.uint32(/* id 63033, wireType 0 =*/504264).bool(message[".gogoproto.messagename_all"]); - if (message[".gogoproto.goproto_sizecache_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache_all")) - writer.uint32(/* id 63034, wireType 0 =*/504272).bool(message[".gogoproto.goproto_sizecache_all"]); - if (message[".gogoproto.goproto_unkeyed_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed_all")) - writer.uint32(/* id 63035, wireType 0 =*/504280).bool(message[".gogoproto.goproto_unkeyed_all"]); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32(); - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 63001: - message[".gogoproto.goproto_getters_all"] = reader.bool(); - break; - case 63002: - message[".gogoproto.goproto_enum_prefix_all"] = reader.bool(); - break; - case 63003: - message[".gogoproto.goproto_stringer_all"] = reader.bool(); - break; - case 63004: - message[".gogoproto.verbose_equal_all"] = reader.bool(); - break; - case 63005: - message[".gogoproto.face_all"] = reader.bool(); - break; - case 63006: - message[".gogoproto.gostring_all"] = reader.bool(); - break; - case 63007: - message[".gogoproto.populate_all"] = reader.bool(); - break; - case 63008: - message[".gogoproto.stringer_all"] = reader.bool(); - break; - case 63009: - message[".gogoproto.onlyone_all"] = reader.bool(); - break; - case 63013: - message[".gogoproto.equal_all"] = reader.bool(); - break; - case 63014: - message[".gogoproto.description_all"] = reader.bool(); - break; - case 63015: - message[".gogoproto.testgen_all"] = reader.bool(); - break; - case 63016: - message[".gogoproto.benchgen_all"] = reader.bool(); - break; - case 63017: - message[".gogoproto.marshaler_all"] = reader.bool(); - break; - case 63018: - message[".gogoproto.unmarshaler_all"] = reader.bool(); - break; - case 63019: - message[".gogoproto.stable_marshaler_all"] = reader.bool(); - break; - case 63020: - message[".gogoproto.sizer_all"] = reader.bool(); - break; - case 63021: - message[".gogoproto.goproto_enum_stringer_all"] = reader.bool(); - break; - case 63022: - message[".gogoproto.enum_stringer_all"] = reader.bool(); - break; - case 63023: - message[".gogoproto.unsafe_marshaler_all"] = reader.bool(); - break; - case 63024: - message[".gogoproto.unsafe_unmarshaler_all"] = reader.bool(); - break; - case 63025: - message[".gogoproto.goproto_extensions_map_all"] = reader.bool(); - break; - case 63026: - message[".gogoproto.goproto_unrecognized_all"] = reader.bool(); - break; - case 63027: - message[".gogoproto.gogoproto_import"] = reader.bool(); - break; - case 63028: - message[".gogoproto.protosizer_all"] = reader.bool(); - break; - case 63029: - message[".gogoproto.compare_all"] = reader.bool(); - break; - case 63030: - message[".gogoproto.typedecl_all"] = reader.bool(); - break; - case 63031: - message[".gogoproto.enumdecl_all"] = reader.bool(); - break; - case 63032: - message[".gogoproto.goproto_registration"] = reader.bool(); - break; - case 63033: - message[".gogoproto.messagename_all"] = reader.bool(); - break; - case 63034: - message[".gogoproto.goproto_sizecache_all"] = reader.bool(); - break; - case 63035: - message[".gogoproto.goproto_unkeyed_all"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.java_package != null && message.hasOwnProperty("java_package")) - if (!$util.isString(message.java_package)) - return "java_package: string expected"; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - if (!$util.isString(message.java_outer_classname)) - return "java_outer_classname: string expected"; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - if (typeof message.java_multiple_files !== "boolean") - return "java_multiple_files: boolean expected"; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - if (typeof message.java_generate_equals_and_hash !== "boolean") - return "java_generate_equals_and_hash: boolean expected"; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - if (typeof message.java_string_check_utf8 !== "boolean") - return "java_string_check_utf8: boolean expected"; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - switch (message.optimize_for) { - default: - return "optimize_for: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.go_package != null && message.hasOwnProperty("go_package")) - if (!$util.isString(message.go_package)) - return "go_package: string expected"; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - if (typeof message.cc_generic_services !== "boolean") - return "cc_generic_services: boolean expected"; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - if (typeof message.java_generic_services !== "boolean") - return "java_generic_services: boolean expected"; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - if (typeof message.py_generic_services !== "boolean") - return "py_generic_services: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - if (typeof message.cc_enable_arenas !== "boolean") - return "cc_enable_arenas: boolean expected"; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - if (!$util.isString(message.objc_class_prefix)) - return "objc_class_prefix: string expected"; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - if (!$util.isString(message.csharp_namespace)) - return "csharp_namespace: string expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - if (typeof message[".gogoproto.goproto_getters_all"] !== "boolean") - return ".gogoproto.goproto_getters_all: boolean expected"; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - if (typeof message[".gogoproto.goproto_enum_prefix_all"] !== "boolean") - return ".gogoproto.goproto_enum_prefix_all: boolean expected"; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - if (typeof message[".gogoproto.goproto_stringer_all"] !== "boolean") - return ".gogoproto.goproto_stringer_all: boolean expected"; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - if (typeof message[".gogoproto.verbose_equal_all"] !== "boolean") - return ".gogoproto.verbose_equal_all: boolean expected"; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - if (typeof message[".gogoproto.face_all"] !== "boolean") - return ".gogoproto.face_all: boolean expected"; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - if (typeof message[".gogoproto.gostring_all"] !== "boolean") - return ".gogoproto.gostring_all: boolean expected"; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - if (typeof message[".gogoproto.populate_all"] !== "boolean") - return ".gogoproto.populate_all: boolean expected"; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - if (typeof message[".gogoproto.stringer_all"] !== "boolean") - return ".gogoproto.stringer_all: boolean expected"; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - if (typeof message[".gogoproto.onlyone_all"] !== "boolean") - return ".gogoproto.onlyone_all: boolean expected"; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - if (typeof message[".gogoproto.equal_all"] !== "boolean") - return ".gogoproto.equal_all: boolean expected"; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - if (typeof message[".gogoproto.description_all"] !== "boolean") - return ".gogoproto.description_all: boolean expected"; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - if (typeof message[".gogoproto.testgen_all"] !== "boolean") - return ".gogoproto.testgen_all: boolean expected"; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - if (typeof message[".gogoproto.benchgen_all"] !== "boolean") - return ".gogoproto.benchgen_all: boolean expected"; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - if (typeof message[".gogoproto.marshaler_all"] !== "boolean") - return ".gogoproto.marshaler_all: boolean expected"; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - if (typeof message[".gogoproto.unmarshaler_all"] !== "boolean") - return ".gogoproto.unmarshaler_all: boolean expected"; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - if (typeof message[".gogoproto.stable_marshaler_all"] !== "boolean") - return ".gogoproto.stable_marshaler_all: boolean expected"; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - if (typeof message[".gogoproto.sizer_all"] !== "boolean") - return ".gogoproto.sizer_all: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - if (typeof message[".gogoproto.goproto_enum_stringer_all"] !== "boolean") - return ".gogoproto.goproto_enum_stringer_all: boolean expected"; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - if (typeof message[".gogoproto.enum_stringer_all"] !== "boolean") - return ".gogoproto.enum_stringer_all: boolean expected"; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - if (typeof message[".gogoproto.unsafe_marshaler_all"] !== "boolean") - return ".gogoproto.unsafe_marshaler_all: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - if (typeof message[".gogoproto.unsafe_unmarshaler_all"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler_all: boolean expected"; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - if (typeof message[".gogoproto.goproto_extensions_map_all"] !== "boolean") - return ".gogoproto.goproto_extensions_map_all: boolean expected"; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - if (typeof message[".gogoproto.goproto_unrecognized_all"] !== "boolean") - return ".gogoproto.goproto_unrecognized_all: boolean expected"; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - if (typeof message[".gogoproto.gogoproto_import"] !== "boolean") - return ".gogoproto.gogoproto_import: boolean expected"; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - if (typeof message[".gogoproto.protosizer_all"] !== "boolean") - return ".gogoproto.protosizer_all: boolean expected"; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - if (typeof message[".gogoproto.compare_all"] !== "boolean") - return ".gogoproto.compare_all: boolean expected"; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - if (typeof message[".gogoproto.typedecl_all"] !== "boolean") - return ".gogoproto.typedecl_all: boolean expected"; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - if (typeof message[".gogoproto.enumdecl_all"] !== "boolean") - return ".gogoproto.enumdecl_all: boolean expected"; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - if (typeof message[".gogoproto.goproto_registration"] !== "boolean") - return ".gogoproto.goproto_registration: boolean expected"; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - if (typeof message[".gogoproto.messagename_all"] !== "boolean") - return ".gogoproto.messagename_all: boolean expected"; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - if (typeof message[".gogoproto.goproto_sizecache_all"] !== "boolean") - return ".gogoproto.goproto_sizecache_all: boolean expected"; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - if (typeof message[".gogoproto.goproto_unkeyed_all"] !== "boolean") - return ".gogoproto.goproto_unkeyed_all: boolean expected"; - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.java_package != null) - message.java_package = String(object.java_package); - if (object.java_outer_classname != null) - message.java_outer_classname = String(object.java_outer_classname); - if (object.java_multiple_files != null) - message.java_multiple_files = Boolean(object.java_multiple_files); - if (object.java_generate_equals_and_hash != null) - message.java_generate_equals_and_hash = Boolean(object.java_generate_equals_and_hash); - if (object.java_string_check_utf8 != null) - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - switch (object.optimize_for) { - case "SPEED": - case 1: - message.optimize_for = 1; - break; - case "CODE_SIZE": - case 2: - message.optimize_for = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimize_for = 3; - break; - } - if (object.go_package != null) - message.go_package = String(object.go_package); - if (object.cc_generic_services != null) - message.cc_generic_services = Boolean(object.cc_generic_services); - if (object.java_generic_services != null) - message.java_generic_services = Boolean(object.java_generic_services); - if (object.py_generic_services != null) - message.py_generic_services = Boolean(object.py_generic_services); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.cc_enable_arenas != null) - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - if (object.objc_class_prefix != null) - message.objc_class_prefix = String(object.objc_class_prefix); - if (object.csharp_namespace != null) - message.csharp_namespace = String(object.csharp_namespace); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters_all"] != null) - message[".gogoproto.goproto_getters_all"] = Boolean(object[".gogoproto.goproto_getters_all"]); - if (object[".gogoproto.goproto_enum_prefix_all"] != null) - message[".gogoproto.goproto_enum_prefix_all"] = Boolean(object[".gogoproto.goproto_enum_prefix_all"]); - if (object[".gogoproto.goproto_stringer_all"] != null) - message[".gogoproto.goproto_stringer_all"] = Boolean(object[".gogoproto.goproto_stringer_all"]); - if (object[".gogoproto.verbose_equal_all"] != null) - message[".gogoproto.verbose_equal_all"] = Boolean(object[".gogoproto.verbose_equal_all"]); - if (object[".gogoproto.face_all"] != null) - message[".gogoproto.face_all"] = Boolean(object[".gogoproto.face_all"]); - if (object[".gogoproto.gostring_all"] != null) - message[".gogoproto.gostring_all"] = Boolean(object[".gogoproto.gostring_all"]); - if (object[".gogoproto.populate_all"] != null) - message[".gogoproto.populate_all"] = Boolean(object[".gogoproto.populate_all"]); - if (object[".gogoproto.stringer_all"] != null) - message[".gogoproto.stringer_all"] = Boolean(object[".gogoproto.stringer_all"]); - if (object[".gogoproto.onlyone_all"] != null) - message[".gogoproto.onlyone_all"] = Boolean(object[".gogoproto.onlyone_all"]); - if (object[".gogoproto.equal_all"] != null) - message[".gogoproto.equal_all"] = Boolean(object[".gogoproto.equal_all"]); - if (object[".gogoproto.description_all"] != null) - message[".gogoproto.description_all"] = Boolean(object[".gogoproto.description_all"]); - if (object[".gogoproto.testgen_all"] != null) - message[".gogoproto.testgen_all"] = Boolean(object[".gogoproto.testgen_all"]); - if (object[".gogoproto.benchgen_all"] != null) - message[".gogoproto.benchgen_all"] = Boolean(object[".gogoproto.benchgen_all"]); - if (object[".gogoproto.marshaler_all"] != null) - message[".gogoproto.marshaler_all"] = Boolean(object[".gogoproto.marshaler_all"]); - if (object[".gogoproto.unmarshaler_all"] != null) - message[".gogoproto.unmarshaler_all"] = Boolean(object[".gogoproto.unmarshaler_all"]); - if (object[".gogoproto.stable_marshaler_all"] != null) - message[".gogoproto.stable_marshaler_all"] = Boolean(object[".gogoproto.stable_marshaler_all"]); - if (object[".gogoproto.sizer_all"] != null) - message[".gogoproto.sizer_all"] = Boolean(object[".gogoproto.sizer_all"]); - if (object[".gogoproto.goproto_enum_stringer_all"] != null) - message[".gogoproto.goproto_enum_stringer_all"] = Boolean(object[".gogoproto.goproto_enum_stringer_all"]); - if (object[".gogoproto.enum_stringer_all"] != null) - message[".gogoproto.enum_stringer_all"] = Boolean(object[".gogoproto.enum_stringer_all"]); - if (object[".gogoproto.unsafe_marshaler_all"] != null) - message[".gogoproto.unsafe_marshaler_all"] = Boolean(object[".gogoproto.unsafe_marshaler_all"]); - if (object[".gogoproto.unsafe_unmarshaler_all"] != null) - message[".gogoproto.unsafe_unmarshaler_all"] = Boolean(object[".gogoproto.unsafe_unmarshaler_all"]); - if (object[".gogoproto.goproto_extensions_map_all"] != null) - message[".gogoproto.goproto_extensions_map_all"] = Boolean(object[".gogoproto.goproto_extensions_map_all"]); - if (object[".gogoproto.goproto_unrecognized_all"] != null) - message[".gogoproto.goproto_unrecognized_all"] = Boolean(object[".gogoproto.goproto_unrecognized_all"]); - if (object[".gogoproto.gogoproto_import"] != null) - message[".gogoproto.gogoproto_import"] = Boolean(object[".gogoproto.gogoproto_import"]); - if (object[".gogoproto.protosizer_all"] != null) - message[".gogoproto.protosizer_all"] = Boolean(object[".gogoproto.protosizer_all"]); - if (object[".gogoproto.compare_all"] != null) - message[".gogoproto.compare_all"] = Boolean(object[".gogoproto.compare_all"]); - if (object[".gogoproto.typedecl_all"] != null) - message[".gogoproto.typedecl_all"] = Boolean(object[".gogoproto.typedecl_all"]); - if (object[".gogoproto.enumdecl_all"] != null) - message[".gogoproto.enumdecl_all"] = Boolean(object[".gogoproto.enumdecl_all"]); - if (object[".gogoproto.goproto_registration"] != null) - message[".gogoproto.goproto_registration"] = Boolean(object[".gogoproto.goproto_registration"]); - if (object[".gogoproto.messagename_all"] != null) - message[".gogoproto.messagename_all"] = Boolean(object[".gogoproto.messagename_all"]); - if (object[".gogoproto.goproto_sizecache_all"] != null) - message[".gogoproto.goproto_sizecache_all"] = Boolean(object[".gogoproto.goproto_sizecache_all"]); - if (object[".gogoproto.goproto_unkeyed_all"] != null) - message[".gogoproto.goproto_unkeyed_all"] = Boolean(object[".gogoproto.goproto_unkeyed_all"]); - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.java_package = ""; - object.java_outer_classname = ""; - object.optimize_for = options.enums === String ? "SPEED" : 1; - object.java_multiple_files = false; - object.go_package = ""; - object.cc_generic_services = false; - object.java_generic_services = false; - object.py_generic_services = false; - object.java_generate_equals_and_hash = false; - object.deprecated = false; - object.java_string_check_utf8 = false; - object.cc_enable_arenas = false; - object.objc_class_prefix = ""; - object.csharp_namespace = ""; - object[".gogoproto.goproto_getters_all"] = false; - object[".gogoproto.goproto_enum_prefix_all"] = false; - object[".gogoproto.goproto_stringer_all"] = false; - object[".gogoproto.verbose_equal_all"] = false; - object[".gogoproto.face_all"] = false; - object[".gogoproto.gostring_all"] = false; - object[".gogoproto.populate_all"] = false; - object[".gogoproto.stringer_all"] = false; - object[".gogoproto.onlyone_all"] = false; - object[".gogoproto.equal_all"] = false; - object[".gogoproto.description_all"] = false; - object[".gogoproto.testgen_all"] = false; - object[".gogoproto.benchgen_all"] = false; - object[".gogoproto.marshaler_all"] = false; - object[".gogoproto.unmarshaler_all"] = false; - object[".gogoproto.stable_marshaler_all"] = false; - object[".gogoproto.sizer_all"] = false; - object[".gogoproto.goproto_enum_stringer_all"] = false; - object[".gogoproto.enum_stringer_all"] = false; - object[".gogoproto.unsafe_marshaler_all"] = false; - object[".gogoproto.unsafe_unmarshaler_all"] = false; - object[".gogoproto.goproto_extensions_map_all"] = false; - object[".gogoproto.goproto_unrecognized_all"] = false; - object[".gogoproto.gogoproto_import"] = false; - object[".gogoproto.protosizer_all"] = false; - object[".gogoproto.compare_all"] = false; - object[".gogoproto.typedecl_all"] = false; - object[".gogoproto.enumdecl_all"] = false; - object[".gogoproto.goproto_registration"] = false; - object[".gogoproto.messagename_all"] = false; - object[".gogoproto.goproto_sizecache_all"] = false; - object[".gogoproto.goproto_unkeyed_all"] = false; - } - if (message.java_package != null && message.hasOwnProperty("java_package")) - object.java_package = message.java_package; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - object.java_outer_classname = message.java_outer_classname; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - object.optimize_for = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimize_for] : message.optimize_for; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - object.java_multiple_files = message.java_multiple_files; - if (message.go_package != null && message.hasOwnProperty("go_package")) - object.go_package = message.go_package; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - object.cc_generic_services = message.cc_generic_services; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - object.java_generic_services = message.java_generic_services; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - object.py_generic_services = message.py_generic_services; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - object.java_generate_equals_and_hash = message.java_generate_equals_and_hash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - object.java_string_check_utf8 = message.java_string_check_utf8; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - object.cc_enable_arenas = message.cc_enable_arenas; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - object.objc_class_prefix = message.objc_class_prefix; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - object.csharp_namespace = message.csharp_namespace; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - object[".gogoproto.goproto_getters_all"] = message[".gogoproto.goproto_getters_all"]; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - object[".gogoproto.goproto_enum_prefix_all"] = message[".gogoproto.goproto_enum_prefix_all"]; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - object[".gogoproto.goproto_stringer_all"] = message[".gogoproto.goproto_stringer_all"]; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - object[".gogoproto.verbose_equal_all"] = message[".gogoproto.verbose_equal_all"]; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - object[".gogoproto.face_all"] = message[".gogoproto.face_all"]; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - object[".gogoproto.gostring_all"] = message[".gogoproto.gostring_all"]; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - object[".gogoproto.populate_all"] = message[".gogoproto.populate_all"]; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - object[".gogoproto.stringer_all"] = message[".gogoproto.stringer_all"]; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - object[".gogoproto.onlyone_all"] = message[".gogoproto.onlyone_all"]; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - object[".gogoproto.equal_all"] = message[".gogoproto.equal_all"]; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - object[".gogoproto.description_all"] = message[".gogoproto.description_all"]; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - object[".gogoproto.testgen_all"] = message[".gogoproto.testgen_all"]; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - object[".gogoproto.benchgen_all"] = message[".gogoproto.benchgen_all"]; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - object[".gogoproto.marshaler_all"] = message[".gogoproto.marshaler_all"]; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - object[".gogoproto.unmarshaler_all"] = message[".gogoproto.unmarshaler_all"]; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - object[".gogoproto.stable_marshaler_all"] = message[".gogoproto.stable_marshaler_all"]; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - object[".gogoproto.sizer_all"] = message[".gogoproto.sizer_all"]; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - object[".gogoproto.goproto_enum_stringer_all"] = message[".gogoproto.goproto_enum_stringer_all"]; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - object[".gogoproto.enum_stringer_all"] = message[".gogoproto.enum_stringer_all"]; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - object[".gogoproto.unsafe_marshaler_all"] = message[".gogoproto.unsafe_marshaler_all"]; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - object[".gogoproto.unsafe_unmarshaler_all"] = message[".gogoproto.unsafe_unmarshaler_all"]; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - object[".gogoproto.goproto_extensions_map_all"] = message[".gogoproto.goproto_extensions_map_all"]; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - object[".gogoproto.goproto_unrecognized_all"] = message[".gogoproto.goproto_unrecognized_all"]; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - object[".gogoproto.gogoproto_import"] = message[".gogoproto.gogoproto_import"]; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - object[".gogoproto.protosizer_all"] = message[".gogoproto.protosizer_all"]; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - object[".gogoproto.compare_all"] = message[".gogoproto.compare_all"]; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - object[".gogoproto.typedecl_all"] = message[".gogoproto.typedecl_all"]; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - object[".gogoproto.enumdecl_all"] = message[".gogoproto.enumdecl_all"]; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - object[".gogoproto.goproto_registration"] = message[".gogoproto.goproto_registration"]; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - object[".gogoproto.messagename_all"] = message[".gogoproto.messagename_all"]; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - object[".gogoproto.goproto_sizecache_all"] = message[".gogoproto.goproto_sizecache_all"]; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - object[".gogoproto.goproto_unkeyed_all"] = message[".gogoproto.goproto_unkeyed_all"]; - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [message_set_wire_format] MessageOptions message_set_wire_format - * @property {boolean|null} [no_standard_descriptor_accessor] MessageOptions no_standard_descriptor_accessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [map_entry] MessageOptions map_entry - * @property {Array.|null} [uninterpreted_option] MessageOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters"] MessageOptions .gogoproto.goproto_getters - * @property {boolean|null} [".gogoproto.goproto_stringer"] MessageOptions .gogoproto.goproto_stringer - * @property {boolean|null} [".gogoproto.verbose_equal"] MessageOptions .gogoproto.verbose_equal - * @property {boolean|null} [".gogoproto.face"] MessageOptions .gogoproto.face - * @property {boolean|null} [".gogoproto.gostring"] MessageOptions .gogoproto.gostring - * @property {boolean|null} [".gogoproto.populate"] MessageOptions .gogoproto.populate - * @property {boolean|null} [".gogoproto.stringer"] MessageOptions .gogoproto.stringer - * @property {boolean|null} [".gogoproto.onlyone"] MessageOptions .gogoproto.onlyone - * @property {boolean|null} [".gogoproto.equal"] MessageOptions .gogoproto.equal - * @property {boolean|null} [".gogoproto.description"] MessageOptions .gogoproto.description - * @property {boolean|null} [".gogoproto.testgen"] MessageOptions .gogoproto.testgen - * @property {boolean|null} [".gogoproto.benchgen"] MessageOptions .gogoproto.benchgen - * @property {boolean|null} [".gogoproto.marshaler"] MessageOptions .gogoproto.marshaler - * @property {boolean|null} [".gogoproto.unmarshaler"] MessageOptions .gogoproto.unmarshaler - * @property {boolean|null} [".gogoproto.stable_marshaler"] MessageOptions .gogoproto.stable_marshaler - * @property {boolean|null} [".gogoproto.sizer"] MessageOptions .gogoproto.sizer - * @property {boolean|null} [".gogoproto.unsafe_marshaler"] MessageOptions .gogoproto.unsafe_marshaler - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler"] MessageOptions .gogoproto.unsafe_unmarshaler - * @property {boolean|null} [".gogoproto.goproto_extensions_map"] MessageOptions .gogoproto.goproto_extensions_map - * @property {boolean|null} [".gogoproto.goproto_unrecognized"] MessageOptions .gogoproto.goproto_unrecognized - * @property {boolean|null} [".gogoproto.protosizer"] MessageOptions .gogoproto.protosizer - * @property {boolean|null} [".gogoproto.compare"] MessageOptions .gogoproto.compare - * @property {boolean|null} [".gogoproto.typedecl"] MessageOptions .gogoproto.typedecl - * @property {boolean|null} [".gogoproto.messagename"] MessageOptions .gogoproto.messagename - * @property {boolean|null} [".gogoproto.goproto_sizecache"] MessageOptions .gogoproto.goproto_sizecache - * @property {boolean|null} [".gogoproto.goproto_unkeyed"] MessageOptions .gogoproto.goproto_unkeyed - * @property {string|null} [".cosmos_proto.interface_type"] MessageOptions .cosmos_proto.interface_type - * @property {string|null} [".cosmos_proto.implements_interface"] MessageOptions .cosmos_proto.implements_interface - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions message_set_wire_format. - * @member {boolean} message_set_wire_format - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.message_set_wire_format = false; - - /** - * MessageOptions no_standard_descriptor_accessor. - * @member {boolean} no_standard_descriptor_accessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.no_standard_descriptor_accessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions map_entry. - * @member {boolean} map_entry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.map_entry = false; - - /** - * MessageOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MessageOptions .gogoproto.goproto_getters. - * @member {boolean} .gogoproto.goproto_getters - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_getters"] = false; - - /** - * MessageOptions .gogoproto.goproto_stringer. - * @member {boolean} .gogoproto.goproto_stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_stringer"] = false; - - /** - * MessageOptions .gogoproto.verbose_equal. - * @member {boolean} .gogoproto.verbose_equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.verbose_equal"] = false; - - /** - * MessageOptions .gogoproto.face. - * @member {boolean} .gogoproto.face - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.face"] = false; - - /** - * MessageOptions .gogoproto.gostring. - * @member {boolean} .gogoproto.gostring - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.gostring"] = false; - - /** - * MessageOptions .gogoproto.populate. - * @member {boolean} .gogoproto.populate - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.populate"] = false; - - /** - * MessageOptions .gogoproto.stringer. - * @member {boolean} .gogoproto.stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stringer"] = false; - - /** - * MessageOptions .gogoproto.onlyone. - * @member {boolean} .gogoproto.onlyone - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.onlyone"] = false; - - /** - * MessageOptions .gogoproto.equal. - * @member {boolean} .gogoproto.equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.equal"] = false; - - /** - * MessageOptions .gogoproto.description. - * @member {boolean} .gogoproto.description - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.description"] = false; - - /** - * MessageOptions .gogoproto.testgen. - * @member {boolean} .gogoproto.testgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.testgen"] = false; - - /** - * MessageOptions .gogoproto.benchgen. - * @member {boolean} .gogoproto.benchgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.benchgen"] = false; - - /** - * MessageOptions .gogoproto.marshaler. - * @member {boolean} .gogoproto.marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.marshaler"] = false; - - /** - * MessageOptions .gogoproto.unmarshaler. - * @member {boolean} .gogoproto.unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.stable_marshaler. - * @member {boolean} .gogoproto.stable_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stable_marshaler"] = false; - - /** - * MessageOptions .gogoproto.sizer. - * @member {boolean} .gogoproto.sizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.sizer"] = false; - - /** - * MessageOptions .gogoproto.unsafe_marshaler. - * @member {boolean} .gogoproto.unsafe_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_marshaler"] = false; - - /** - * MessageOptions .gogoproto.unsafe_unmarshaler. - * @member {boolean} .gogoproto.unsafe_unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.goproto_extensions_map. - * @member {boolean} .gogoproto.goproto_extensions_map - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_extensions_map"] = false; - - /** - * MessageOptions .gogoproto.goproto_unrecognized. - * @member {boolean} .gogoproto.goproto_unrecognized - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unrecognized"] = false; - - /** - * MessageOptions .gogoproto.protosizer. - * @member {boolean} .gogoproto.protosizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.protosizer"] = false; - - /** - * MessageOptions .gogoproto.compare. - * @member {boolean} .gogoproto.compare - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.compare"] = false; - - /** - * MessageOptions .gogoproto.typedecl. - * @member {boolean} .gogoproto.typedecl - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.typedecl"] = false; - - /** - * MessageOptions .gogoproto.messagename. - * @member {boolean} .gogoproto.messagename - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.messagename"] = false; - - /** - * MessageOptions .gogoproto.goproto_sizecache. - * @member {boolean} .gogoproto.goproto_sizecache - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_sizecache"] = false; - - /** - * MessageOptions .gogoproto.goproto_unkeyed. - * @member {boolean} .gogoproto.goproto_unkeyed - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unkeyed"] = false; - - /** - * MessageOptions .cosmos_proto.interface_type. - * @member {string} .cosmos_proto.interface_type - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".cosmos_proto.interface_type"] = ""; - - /** - * MessageOptions .cosmos_proto.implements_interface. - * @member {string} .cosmos_proto.implements_interface - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".cosmos_proto.implements_interface"] = ""; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message_set_wire_format != null && Object.hasOwnProperty.call(message, "message_set_wire_format")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.message_set_wire_format); - if (message.no_standard_descriptor_accessor != null && Object.hasOwnProperty.call(message, "no_standard_descriptor_accessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.no_standard_descriptor_accessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.map_entry != null && Object.hasOwnProperty.call(message, "map_entry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.map_entry); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters")) - writer.uint32(/* id 64001, wireType 0 =*/512008).bool(message[".gogoproto.goproto_getters"]); - if (message[".gogoproto.goproto_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer")) - writer.uint32(/* id 64003, wireType 0 =*/512024).bool(message[".gogoproto.goproto_stringer"]); - if (message[".gogoproto.verbose_equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal")) - writer.uint32(/* id 64004, wireType 0 =*/512032).bool(message[".gogoproto.verbose_equal"]); - if (message[".gogoproto.face"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face")) - writer.uint32(/* id 64005, wireType 0 =*/512040).bool(message[".gogoproto.face"]); - if (message[".gogoproto.gostring"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring")) - writer.uint32(/* id 64006, wireType 0 =*/512048).bool(message[".gogoproto.gostring"]); - if (message[".gogoproto.populate"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate")) - writer.uint32(/* id 64007, wireType 0 =*/512056).bool(message[".gogoproto.populate"]); - if (message[".gogoproto.onlyone"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone")) - writer.uint32(/* id 64009, wireType 0 =*/512072).bool(message[".gogoproto.onlyone"]); - if (message[".gogoproto.equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal")) - writer.uint32(/* id 64013, wireType 0 =*/512104).bool(message[".gogoproto.equal"]); - if (message[".gogoproto.description"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description")) - writer.uint32(/* id 64014, wireType 0 =*/512112).bool(message[".gogoproto.description"]); - if (message[".gogoproto.testgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen")) - writer.uint32(/* id 64015, wireType 0 =*/512120).bool(message[".gogoproto.testgen"]); - if (message[".gogoproto.benchgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen")) - writer.uint32(/* id 64016, wireType 0 =*/512128).bool(message[".gogoproto.benchgen"]); - if (message[".gogoproto.marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler")) - writer.uint32(/* id 64017, wireType 0 =*/512136).bool(message[".gogoproto.marshaler"]); - if (message[".gogoproto.unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler")) - writer.uint32(/* id 64018, wireType 0 =*/512144).bool(message[".gogoproto.unmarshaler"]); - if (message[".gogoproto.stable_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler")) - writer.uint32(/* id 64019, wireType 0 =*/512152).bool(message[".gogoproto.stable_marshaler"]); - if (message[".gogoproto.sizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer")) - writer.uint32(/* id 64020, wireType 0 =*/512160).bool(message[".gogoproto.sizer"]); - if (message[".gogoproto.unsafe_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler")) - writer.uint32(/* id 64023, wireType 0 =*/512184).bool(message[".gogoproto.unsafe_marshaler"]); - if (message[".gogoproto.unsafe_unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler")) - writer.uint32(/* id 64024, wireType 0 =*/512192).bool(message[".gogoproto.unsafe_unmarshaler"]); - if (message[".gogoproto.goproto_extensions_map"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map")) - writer.uint32(/* id 64025, wireType 0 =*/512200).bool(message[".gogoproto.goproto_extensions_map"]); - if (message[".gogoproto.goproto_unrecognized"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized")) - writer.uint32(/* id 64026, wireType 0 =*/512208).bool(message[".gogoproto.goproto_unrecognized"]); - if (message[".gogoproto.protosizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer")) - writer.uint32(/* id 64028, wireType 0 =*/512224).bool(message[".gogoproto.protosizer"]); - if (message[".gogoproto.compare"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare")) - writer.uint32(/* id 64029, wireType 0 =*/512232).bool(message[".gogoproto.compare"]); - if (message[".gogoproto.typedecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl")) - writer.uint32(/* id 64030, wireType 0 =*/512240).bool(message[".gogoproto.typedecl"]); - if (message[".gogoproto.messagename"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename")) - writer.uint32(/* id 64033, wireType 0 =*/512264).bool(message[".gogoproto.messagename"]); - if (message[".gogoproto.goproto_sizecache"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache")) - writer.uint32(/* id 64034, wireType 0 =*/512272).bool(message[".gogoproto.goproto_sizecache"]); - if (message[".gogoproto.goproto_unkeyed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed")) - writer.uint32(/* id 64035, wireType 0 =*/512280).bool(message[".gogoproto.goproto_unkeyed"]); - if (message[".gogoproto.stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer")) - writer.uint32(/* id 67008, wireType 0 =*/536064).bool(message[".gogoproto.stringer"]); - if (message[".cosmos_proto.interface_type"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.interface_type")) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.interface_type"]); - if (message[".cosmos_proto.implements_interface"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.implements_interface")) - writer.uint32(/* id 93002, wireType 2 =*/744018).string(message[".cosmos_proto.implements_interface"]); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 64001: - message[".gogoproto.goproto_getters"] = reader.bool(); - break; - case 64003: - message[".gogoproto.goproto_stringer"] = reader.bool(); - break; - case 64004: - message[".gogoproto.verbose_equal"] = reader.bool(); - break; - case 64005: - message[".gogoproto.face"] = reader.bool(); - break; - case 64006: - message[".gogoproto.gostring"] = reader.bool(); - break; - case 64007: - message[".gogoproto.populate"] = reader.bool(); - break; - case 67008: - message[".gogoproto.stringer"] = reader.bool(); - break; - case 64009: - message[".gogoproto.onlyone"] = reader.bool(); - break; - case 64013: - message[".gogoproto.equal"] = reader.bool(); - break; - case 64014: - message[".gogoproto.description"] = reader.bool(); - break; - case 64015: - message[".gogoproto.testgen"] = reader.bool(); - break; - case 64016: - message[".gogoproto.benchgen"] = reader.bool(); - break; - case 64017: - message[".gogoproto.marshaler"] = reader.bool(); - break; - case 64018: - message[".gogoproto.unmarshaler"] = reader.bool(); - break; - case 64019: - message[".gogoproto.stable_marshaler"] = reader.bool(); - break; - case 64020: - message[".gogoproto.sizer"] = reader.bool(); - break; - case 64023: - message[".gogoproto.unsafe_marshaler"] = reader.bool(); - break; - case 64024: - message[".gogoproto.unsafe_unmarshaler"] = reader.bool(); - break; - case 64025: - message[".gogoproto.goproto_extensions_map"] = reader.bool(); - break; - case 64026: - message[".gogoproto.goproto_unrecognized"] = reader.bool(); - break; - case 64028: - message[".gogoproto.protosizer"] = reader.bool(); - break; - case 64029: - message[".gogoproto.compare"] = reader.bool(); - break; - case 64030: - message[".gogoproto.typedecl"] = reader.bool(); - break; - case 64033: - message[".gogoproto.messagename"] = reader.bool(); - break; - case 64034: - message[".gogoproto.goproto_sizecache"] = reader.bool(); - break; - case 64035: - message[".gogoproto.goproto_unkeyed"] = reader.bool(); - break; - case 93001: - message[".cosmos_proto.interface_type"] = reader.string(); - break; - case 93002: - message[".cosmos_proto.implements_interface"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - if (typeof message.message_set_wire_format !== "boolean") - return "message_set_wire_format: boolean expected"; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - if (typeof message.no_standard_descriptor_accessor !== "boolean") - return "no_standard_descriptor_accessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - if (typeof message.map_entry !== "boolean") - return "map_entry: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - if (typeof message[".gogoproto.goproto_getters"] !== "boolean") - return ".gogoproto.goproto_getters: boolean expected"; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - if (typeof message[".gogoproto.goproto_stringer"] !== "boolean") - return ".gogoproto.goproto_stringer: boolean expected"; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - if (typeof message[".gogoproto.verbose_equal"] !== "boolean") - return ".gogoproto.verbose_equal: boolean expected"; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - if (typeof message[".gogoproto.face"] !== "boolean") - return ".gogoproto.face: boolean expected"; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - if (typeof message[".gogoproto.gostring"] !== "boolean") - return ".gogoproto.gostring: boolean expected"; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - if (typeof message[".gogoproto.populate"] !== "boolean") - return ".gogoproto.populate: boolean expected"; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - if (typeof message[".gogoproto.stringer"] !== "boolean") - return ".gogoproto.stringer: boolean expected"; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - if (typeof message[".gogoproto.onlyone"] !== "boolean") - return ".gogoproto.onlyone: boolean expected"; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - if (typeof message[".gogoproto.equal"] !== "boolean") - return ".gogoproto.equal: boolean expected"; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - if (typeof message[".gogoproto.description"] !== "boolean") - return ".gogoproto.description: boolean expected"; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - if (typeof message[".gogoproto.testgen"] !== "boolean") - return ".gogoproto.testgen: boolean expected"; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - if (typeof message[".gogoproto.benchgen"] !== "boolean") - return ".gogoproto.benchgen: boolean expected"; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - if (typeof message[".gogoproto.marshaler"] !== "boolean") - return ".gogoproto.marshaler: boolean expected"; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - if (typeof message[".gogoproto.unmarshaler"] !== "boolean") - return ".gogoproto.unmarshaler: boolean expected"; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - if (typeof message[".gogoproto.stable_marshaler"] !== "boolean") - return ".gogoproto.stable_marshaler: boolean expected"; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - if (typeof message[".gogoproto.sizer"] !== "boolean") - return ".gogoproto.sizer: boolean expected"; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - if (typeof message[".gogoproto.unsafe_marshaler"] !== "boolean") - return ".gogoproto.unsafe_marshaler: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - if (typeof message[".gogoproto.unsafe_unmarshaler"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler: boolean expected"; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - if (typeof message[".gogoproto.goproto_extensions_map"] !== "boolean") - return ".gogoproto.goproto_extensions_map: boolean expected"; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - if (typeof message[".gogoproto.goproto_unrecognized"] !== "boolean") - return ".gogoproto.goproto_unrecognized: boolean expected"; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - if (typeof message[".gogoproto.protosizer"] !== "boolean") - return ".gogoproto.protosizer: boolean expected"; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - if (typeof message[".gogoproto.compare"] !== "boolean") - return ".gogoproto.compare: boolean expected"; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - if (typeof message[".gogoproto.typedecl"] !== "boolean") - return ".gogoproto.typedecl: boolean expected"; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - if (typeof message[".gogoproto.messagename"] !== "boolean") - return ".gogoproto.messagename: boolean expected"; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - if (typeof message[".gogoproto.goproto_sizecache"] !== "boolean") - return ".gogoproto.goproto_sizecache: boolean expected"; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - if (typeof message[".gogoproto.goproto_unkeyed"] !== "boolean") - return ".gogoproto.goproto_unkeyed: boolean expected"; - if (message[".cosmos_proto.interface_type"] != null && message.hasOwnProperty(".cosmos_proto.interface_type")) - if (!$util.isString(message[".cosmos_proto.interface_type"])) - return ".cosmos_proto.interface_type: string expected"; - if (message[".cosmos_proto.implements_interface"] != null && message.hasOwnProperty(".cosmos_proto.implements_interface")) - if (!$util.isString(message[".cosmos_proto.implements_interface"])) - return ".cosmos_proto.implements_interface: string expected"; - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.message_set_wire_format != null) - message.message_set_wire_format = Boolean(object.message_set_wire_format); - if (object.no_standard_descriptor_accessor != null) - message.no_standard_descriptor_accessor = Boolean(object.no_standard_descriptor_accessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.map_entry != null) - message.map_entry = Boolean(object.map_entry); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters"] != null) - message[".gogoproto.goproto_getters"] = Boolean(object[".gogoproto.goproto_getters"]); - if (object[".gogoproto.goproto_stringer"] != null) - message[".gogoproto.goproto_stringer"] = Boolean(object[".gogoproto.goproto_stringer"]); - if (object[".gogoproto.verbose_equal"] != null) - message[".gogoproto.verbose_equal"] = Boolean(object[".gogoproto.verbose_equal"]); - if (object[".gogoproto.face"] != null) - message[".gogoproto.face"] = Boolean(object[".gogoproto.face"]); - if (object[".gogoproto.gostring"] != null) - message[".gogoproto.gostring"] = Boolean(object[".gogoproto.gostring"]); - if (object[".gogoproto.populate"] != null) - message[".gogoproto.populate"] = Boolean(object[".gogoproto.populate"]); - if (object[".gogoproto.stringer"] != null) - message[".gogoproto.stringer"] = Boolean(object[".gogoproto.stringer"]); - if (object[".gogoproto.onlyone"] != null) - message[".gogoproto.onlyone"] = Boolean(object[".gogoproto.onlyone"]); - if (object[".gogoproto.equal"] != null) - message[".gogoproto.equal"] = Boolean(object[".gogoproto.equal"]); - if (object[".gogoproto.description"] != null) - message[".gogoproto.description"] = Boolean(object[".gogoproto.description"]); - if (object[".gogoproto.testgen"] != null) - message[".gogoproto.testgen"] = Boolean(object[".gogoproto.testgen"]); - if (object[".gogoproto.benchgen"] != null) - message[".gogoproto.benchgen"] = Boolean(object[".gogoproto.benchgen"]); - if (object[".gogoproto.marshaler"] != null) - message[".gogoproto.marshaler"] = Boolean(object[".gogoproto.marshaler"]); - if (object[".gogoproto.unmarshaler"] != null) - message[".gogoproto.unmarshaler"] = Boolean(object[".gogoproto.unmarshaler"]); - if (object[".gogoproto.stable_marshaler"] != null) - message[".gogoproto.stable_marshaler"] = Boolean(object[".gogoproto.stable_marshaler"]); - if (object[".gogoproto.sizer"] != null) - message[".gogoproto.sizer"] = Boolean(object[".gogoproto.sizer"]); - if (object[".gogoproto.unsafe_marshaler"] != null) - message[".gogoproto.unsafe_marshaler"] = Boolean(object[".gogoproto.unsafe_marshaler"]); - if (object[".gogoproto.unsafe_unmarshaler"] != null) - message[".gogoproto.unsafe_unmarshaler"] = Boolean(object[".gogoproto.unsafe_unmarshaler"]); - if (object[".gogoproto.goproto_extensions_map"] != null) - message[".gogoproto.goproto_extensions_map"] = Boolean(object[".gogoproto.goproto_extensions_map"]); - if (object[".gogoproto.goproto_unrecognized"] != null) - message[".gogoproto.goproto_unrecognized"] = Boolean(object[".gogoproto.goproto_unrecognized"]); - if (object[".gogoproto.protosizer"] != null) - message[".gogoproto.protosizer"] = Boolean(object[".gogoproto.protosizer"]); - if (object[".gogoproto.compare"] != null) - message[".gogoproto.compare"] = Boolean(object[".gogoproto.compare"]); - if (object[".gogoproto.typedecl"] != null) - message[".gogoproto.typedecl"] = Boolean(object[".gogoproto.typedecl"]); - if (object[".gogoproto.messagename"] != null) - message[".gogoproto.messagename"] = Boolean(object[".gogoproto.messagename"]); - if (object[".gogoproto.goproto_sizecache"] != null) - message[".gogoproto.goproto_sizecache"] = Boolean(object[".gogoproto.goproto_sizecache"]); - if (object[".gogoproto.goproto_unkeyed"] != null) - message[".gogoproto.goproto_unkeyed"] = Boolean(object[".gogoproto.goproto_unkeyed"]); - if (object[".cosmos_proto.interface_type"] != null) - message[".cosmos_proto.interface_type"] = String(object[".cosmos_proto.interface_type"]); - if (object[".cosmos_proto.implements_interface"] != null) - message[".cosmos_proto.implements_interface"] = String(object[".cosmos_proto.implements_interface"]); - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.message_set_wire_format = false; - object.no_standard_descriptor_accessor = false; - object.deprecated = false; - object.map_entry = false; - object[".gogoproto.goproto_getters"] = false; - object[".gogoproto.goproto_stringer"] = false; - object[".gogoproto.verbose_equal"] = false; - object[".gogoproto.face"] = false; - object[".gogoproto.gostring"] = false; - object[".gogoproto.populate"] = false; - object[".gogoproto.onlyone"] = false; - object[".gogoproto.equal"] = false; - object[".gogoproto.description"] = false; - object[".gogoproto.testgen"] = false; - object[".gogoproto.benchgen"] = false; - object[".gogoproto.marshaler"] = false; - object[".gogoproto.unmarshaler"] = false; - object[".gogoproto.stable_marshaler"] = false; - object[".gogoproto.sizer"] = false; - object[".gogoproto.unsafe_marshaler"] = false; - object[".gogoproto.unsafe_unmarshaler"] = false; - object[".gogoproto.goproto_extensions_map"] = false; - object[".gogoproto.goproto_unrecognized"] = false; - object[".gogoproto.protosizer"] = false; - object[".gogoproto.compare"] = false; - object[".gogoproto.typedecl"] = false; - object[".gogoproto.messagename"] = false; - object[".gogoproto.goproto_sizecache"] = false; - object[".gogoproto.goproto_unkeyed"] = false; - object[".gogoproto.stringer"] = false; - object[".cosmos_proto.interface_type"] = ""; - object[".cosmos_proto.implements_interface"] = ""; - } - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - object.message_set_wire_format = message.message_set_wire_format; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - object.no_standard_descriptor_accessor = message.no_standard_descriptor_accessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - object.map_entry = message.map_entry; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - object[".gogoproto.goproto_getters"] = message[".gogoproto.goproto_getters"]; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - object[".gogoproto.goproto_stringer"] = message[".gogoproto.goproto_stringer"]; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - object[".gogoproto.verbose_equal"] = message[".gogoproto.verbose_equal"]; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - object[".gogoproto.face"] = message[".gogoproto.face"]; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - object[".gogoproto.gostring"] = message[".gogoproto.gostring"]; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - object[".gogoproto.populate"] = message[".gogoproto.populate"]; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - object[".gogoproto.onlyone"] = message[".gogoproto.onlyone"]; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - object[".gogoproto.equal"] = message[".gogoproto.equal"]; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - object[".gogoproto.description"] = message[".gogoproto.description"]; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - object[".gogoproto.testgen"] = message[".gogoproto.testgen"]; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - object[".gogoproto.benchgen"] = message[".gogoproto.benchgen"]; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - object[".gogoproto.marshaler"] = message[".gogoproto.marshaler"]; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - object[".gogoproto.unmarshaler"] = message[".gogoproto.unmarshaler"]; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - object[".gogoproto.stable_marshaler"] = message[".gogoproto.stable_marshaler"]; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - object[".gogoproto.sizer"] = message[".gogoproto.sizer"]; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - object[".gogoproto.unsafe_marshaler"] = message[".gogoproto.unsafe_marshaler"]; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - object[".gogoproto.unsafe_unmarshaler"] = message[".gogoproto.unsafe_unmarshaler"]; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - object[".gogoproto.goproto_extensions_map"] = message[".gogoproto.goproto_extensions_map"]; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - object[".gogoproto.goproto_unrecognized"] = message[".gogoproto.goproto_unrecognized"]; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - object[".gogoproto.protosizer"] = message[".gogoproto.protosizer"]; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - object[".gogoproto.compare"] = message[".gogoproto.compare"]; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - object[".gogoproto.typedecl"] = message[".gogoproto.typedecl"]; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - object[".gogoproto.messagename"] = message[".gogoproto.messagename"]; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - object[".gogoproto.goproto_sizecache"] = message[".gogoproto.goproto_sizecache"]; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - object[".gogoproto.goproto_unkeyed"] = message[".gogoproto.goproto_unkeyed"]; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - object[".gogoproto.stringer"] = message[".gogoproto.stringer"]; - if (message[".cosmos_proto.interface_type"] != null && message.hasOwnProperty(".cosmos_proto.interface_type")) - object[".cosmos_proto.interface_type"] = message[".cosmos_proto.interface_type"]; - if (message[".cosmos_proto.implements_interface"] != null && message.hasOwnProperty(".cosmos_proto.implements_interface")) - object[".cosmos_proto.implements_interface"] = message[".cosmos_proto.implements_interface"]; - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpreted_option] FieldOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.nullable"] FieldOptions .gogoproto.nullable - * @property {boolean|null} [".gogoproto.embed"] FieldOptions .gogoproto.embed - * @property {string|null} [".gogoproto.customtype"] FieldOptions .gogoproto.customtype - * @property {string|null} [".gogoproto.customname"] FieldOptions .gogoproto.customname - * @property {string|null} [".gogoproto.jsontag"] FieldOptions .gogoproto.jsontag - * @property {string|null} [".gogoproto.moretags"] FieldOptions .gogoproto.moretags - * @property {string|null} [".gogoproto.casttype"] FieldOptions .gogoproto.casttype - * @property {string|null} [".gogoproto.castkey"] FieldOptions .gogoproto.castkey - * @property {string|null} [".gogoproto.castvalue"] FieldOptions .gogoproto.castvalue - * @property {boolean|null} [".gogoproto.stdtime"] FieldOptions .gogoproto.stdtime - * @property {boolean|null} [".gogoproto.stdduration"] FieldOptions .gogoproto.stdduration - * @property {boolean|null} [".gogoproto.wktpointer"] FieldOptions .gogoproto.wktpointer - * @property {string|null} [".gogoproto.castrepeated"] FieldOptions .gogoproto.castrepeated - * @property {string|null} [".cosmos_proto.accepts_interface"] FieldOptions .cosmos_proto.accepts_interface - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FieldOptions .gogoproto.nullable. - * @member {boolean} .gogoproto.nullable - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.nullable"] = false; - - /** - * FieldOptions .gogoproto.embed. - * @member {boolean} .gogoproto.embed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.embed"] = false; - - /** - * FieldOptions .gogoproto.customtype. - * @member {string} .gogoproto.customtype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customtype"] = ""; - - /** - * FieldOptions .gogoproto.customname. - * @member {string} .gogoproto.customname - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customname"] = ""; - - /** - * FieldOptions .gogoproto.jsontag. - * @member {string} .gogoproto.jsontag - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.jsontag"] = ""; - - /** - * FieldOptions .gogoproto.moretags. - * @member {string} .gogoproto.moretags - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.moretags"] = ""; - - /** - * FieldOptions .gogoproto.casttype. - * @member {string} .gogoproto.casttype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.casttype"] = ""; - - /** - * FieldOptions .gogoproto.castkey. - * @member {string} .gogoproto.castkey - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castkey"] = ""; - - /** - * FieldOptions .gogoproto.castvalue. - * @member {string} .gogoproto.castvalue - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castvalue"] = ""; - - /** - * FieldOptions .gogoproto.stdtime. - * @member {boolean} .gogoproto.stdtime - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdtime"] = false; - - /** - * FieldOptions .gogoproto.stdduration. - * @member {boolean} .gogoproto.stdduration - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdduration"] = false; - - /** - * FieldOptions .gogoproto.wktpointer. - * @member {boolean} .gogoproto.wktpointer - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.wktpointer"] = false; - - /** - * FieldOptions .gogoproto.castrepeated. - * @member {string} .gogoproto.castrepeated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castrepeated"] = ""; - - /** - * FieldOptions .cosmos_proto.accepts_interface. - * @member {string} .cosmos_proto.accepts_interface - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".cosmos_proto.accepts_interface"] = ""; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.nullable"] != null && Object.hasOwnProperty.call(message, ".gogoproto.nullable")) - writer.uint32(/* id 65001, wireType 0 =*/520008).bool(message[".gogoproto.nullable"]); - if (message[".gogoproto.embed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.embed")) - writer.uint32(/* id 65002, wireType 0 =*/520016).bool(message[".gogoproto.embed"]); - if (message[".gogoproto.customtype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customtype")) - writer.uint32(/* id 65003, wireType 2 =*/520026).string(message[".gogoproto.customtype"]); - if (message[".gogoproto.customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customname")) - writer.uint32(/* id 65004, wireType 2 =*/520034).string(message[".gogoproto.customname"]); - if (message[".gogoproto.jsontag"] != null && Object.hasOwnProperty.call(message, ".gogoproto.jsontag")) - writer.uint32(/* id 65005, wireType 2 =*/520042).string(message[".gogoproto.jsontag"]); - if (message[".gogoproto.moretags"] != null && Object.hasOwnProperty.call(message, ".gogoproto.moretags")) - writer.uint32(/* id 65006, wireType 2 =*/520050).string(message[".gogoproto.moretags"]); - if (message[".gogoproto.casttype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.casttype")) - writer.uint32(/* id 65007, wireType 2 =*/520058).string(message[".gogoproto.casttype"]); - if (message[".gogoproto.castkey"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castkey")) - writer.uint32(/* id 65008, wireType 2 =*/520066).string(message[".gogoproto.castkey"]); - if (message[".gogoproto.castvalue"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castvalue")) - writer.uint32(/* id 65009, wireType 2 =*/520074).string(message[".gogoproto.castvalue"]); - if (message[".gogoproto.stdtime"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdtime")) - writer.uint32(/* id 65010, wireType 0 =*/520080).bool(message[".gogoproto.stdtime"]); - if (message[".gogoproto.stdduration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdduration")) - writer.uint32(/* id 65011, wireType 0 =*/520088).bool(message[".gogoproto.stdduration"]); - if (message[".gogoproto.wktpointer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.wktpointer")) - writer.uint32(/* id 65012, wireType 0 =*/520096).bool(message[".gogoproto.wktpointer"]); - if (message[".gogoproto.castrepeated"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castrepeated")) - writer.uint32(/* id 65013, wireType 2 =*/520106).string(message[".gogoproto.castrepeated"]); - if (message[".cosmos_proto.accepts_interface"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.accepts_interface")) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.accepts_interface"]); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 65001: - message[".gogoproto.nullable"] = reader.bool(); - break; - case 65002: - message[".gogoproto.embed"] = reader.bool(); - break; - case 65003: - message[".gogoproto.customtype"] = reader.string(); - break; - case 65004: - message[".gogoproto.customname"] = reader.string(); - break; - case 65005: - message[".gogoproto.jsontag"] = reader.string(); - break; - case 65006: - message[".gogoproto.moretags"] = reader.string(); - break; - case 65007: - message[".gogoproto.casttype"] = reader.string(); - break; - case 65008: - message[".gogoproto.castkey"] = reader.string(); - break; - case 65009: - message[".gogoproto.castvalue"] = reader.string(); - break; - case 65010: - message[".gogoproto.stdtime"] = reader.bool(); - break; - case 65011: - message[".gogoproto.stdduration"] = reader.bool(); - break; - case 65012: - message[".gogoproto.wktpointer"] = reader.bool(); - break; - case 65013: - message[".gogoproto.castrepeated"] = reader.string(); - break; - case 93001: - message[".cosmos_proto.accepts_interface"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - if (typeof message[".gogoproto.nullable"] !== "boolean") - return ".gogoproto.nullable: boolean expected"; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - if (typeof message[".gogoproto.embed"] !== "boolean") - return ".gogoproto.embed: boolean expected"; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - if (!$util.isString(message[".gogoproto.customtype"])) - return ".gogoproto.customtype: string expected"; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - if (!$util.isString(message[".gogoproto.customname"])) - return ".gogoproto.customname: string expected"; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - if (!$util.isString(message[".gogoproto.jsontag"])) - return ".gogoproto.jsontag: string expected"; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - if (!$util.isString(message[".gogoproto.moretags"])) - return ".gogoproto.moretags: string expected"; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - if (!$util.isString(message[".gogoproto.casttype"])) - return ".gogoproto.casttype: string expected"; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - if (!$util.isString(message[".gogoproto.castkey"])) - return ".gogoproto.castkey: string expected"; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - if (!$util.isString(message[".gogoproto.castvalue"])) - return ".gogoproto.castvalue: string expected"; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - if (typeof message[".gogoproto.stdtime"] !== "boolean") - return ".gogoproto.stdtime: boolean expected"; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - if (typeof message[".gogoproto.stdduration"] !== "boolean") - return ".gogoproto.stdduration: boolean expected"; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - if (typeof message[".gogoproto.wktpointer"] !== "boolean") - return ".gogoproto.wktpointer: boolean expected"; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - if (!$util.isString(message[".gogoproto.castrepeated"])) - return ".gogoproto.castrepeated: string expected"; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - if (!$util.isString(message[".cosmos_proto.accepts_interface"])) - return ".cosmos_proto.accepts_interface: string expected"; - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.nullable"] != null) - message[".gogoproto.nullable"] = Boolean(object[".gogoproto.nullable"]); - if (object[".gogoproto.embed"] != null) - message[".gogoproto.embed"] = Boolean(object[".gogoproto.embed"]); - if (object[".gogoproto.customtype"] != null) - message[".gogoproto.customtype"] = String(object[".gogoproto.customtype"]); - if (object[".gogoproto.customname"] != null) - message[".gogoproto.customname"] = String(object[".gogoproto.customname"]); - if (object[".gogoproto.jsontag"] != null) - message[".gogoproto.jsontag"] = String(object[".gogoproto.jsontag"]); - if (object[".gogoproto.moretags"] != null) - message[".gogoproto.moretags"] = String(object[".gogoproto.moretags"]); - if (object[".gogoproto.casttype"] != null) - message[".gogoproto.casttype"] = String(object[".gogoproto.casttype"]); - if (object[".gogoproto.castkey"] != null) - message[".gogoproto.castkey"] = String(object[".gogoproto.castkey"]); - if (object[".gogoproto.castvalue"] != null) - message[".gogoproto.castvalue"] = String(object[".gogoproto.castvalue"]); - if (object[".gogoproto.stdtime"] != null) - message[".gogoproto.stdtime"] = Boolean(object[".gogoproto.stdtime"]); - if (object[".gogoproto.stdduration"] != null) - message[".gogoproto.stdduration"] = Boolean(object[".gogoproto.stdduration"]); - if (object[".gogoproto.wktpointer"] != null) - message[".gogoproto.wktpointer"] = Boolean(object[".gogoproto.wktpointer"]); - if (object[".gogoproto.castrepeated"] != null) - message[".gogoproto.castrepeated"] = String(object[".gogoproto.castrepeated"]); - if (object[".cosmos_proto.accepts_interface"] != null) - message[".cosmos_proto.accepts_interface"] = String(object[".cosmos_proto.accepts_interface"]); - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object[".gogoproto.nullable"] = false; - object[".gogoproto.embed"] = false; - object[".gogoproto.customtype"] = ""; - object[".gogoproto.customname"] = ""; - object[".gogoproto.jsontag"] = ""; - object[".gogoproto.moretags"] = ""; - object[".gogoproto.casttype"] = ""; - object[".gogoproto.castkey"] = ""; - object[".gogoproto.castvalue"] = ""; - object[".gogoproto.stdtime"] = false; - object[".gogoproto.stdduration"] = false; - object[".gogoproto.wktpointer"] = false; - object[".gogoproto.castrepeated"] = ""; - object[".cosmos_proto.accepts_interface"] = ""; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - object[".gogoproto.nullable"] = message[".gogoproto.nullable"]; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - object[".gogoproto.embed"] = message[".gogoproto.embed"]; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - object[".gogoproto.customtype"] = message[".gogoproto.customtype"]; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - object[".gogoproto.customname"] = message[".gogoproto.customname"]; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - object[".gogoproto.jsontag"] = message[".gogoproto.jsontag"]; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - object[".gogoproto.moretags"] = message[".gogoproto.moretags"]; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - object[".gogoproto.casttype"] = message[".gogoproto.casttype"]; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - object[".gogoproto.castkey"] = message[".gogoproto.castkey"]; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - object[".gogoproto.castvalue"] = message[".gogoproto.castvalue"]; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - object[".gogoproto.stdtime"] = message[".gogoproto.stdtime"]; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - object[".gogoproto.stdduration"] = message[".gogoproto.stdduration"]; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - object[".gogoproto.wktpointer"] = message[".gogoproto.wktpointer"]; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - object[".gogoproto.castrepeated"] = message[".gogoproto.castrepeated"]; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - object[".cosmos_proto.accepts_interface"] = message[".cosmos_proto.accepts_interface"]; - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpreted_option] OneofOptions uninterpreted_option - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allow_alias] EnumOptions allow_alias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_enum_prefix"] EnumOptions .gogoproto.goproto_enum_prefix - * @property {boolean|null} [".gogoproto.goproto_enum_stringer"] EnumOptions .gogoproto.goproto_enum_stringer - * @property {boolean|null} [".gogoproto.enum_stringer"] EnumOptions .gogoproto.enum_stringer - * @property {string|null} [".gogoproto.enum_customname"] EnumOptions .gogoproto.enum_customname - * @property {boolean|null} [".gogoproto.enumdecl"] EnumOptions .gogoproto.enumdecl - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allow_alias. - * @member {boolean} allow_alias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allow_alias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumOptions .gogoproto.goproto_enum_prefix. - * @member {boolean} .gogoproto.goproto_enum_prefix - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_prefix"] = false; - - /** - * EnumOptions .gogoproto.goproto_enum_stringer. - * @member {boolean} .gogoproto.goproto_enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_stringer. - * @member {boolean} .gogoproto.enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_customname. - * @member {string} .gogoproto.enum_customname - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_customname"] = ""; - - /** - * EnumOptions .gogoproto.enumdecl. - * @member {boolean} .gogoproto.enumdecl - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enumdecl"] = false; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allow_alias != null && Object.hasOwnProperty.call(message, "allow_alias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allow_alias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_enum_prefix"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix")) - writer.uint32(/* id 62001, wireType 0 =*/496008).bool(message[".gogoproto.goproto_enum_prefix"]); - if (message[".gogoproto.goproto_enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer")) - writer.uint32(/* id 62021, wireType 0 =*/496168).bool(message[".gogoproto.goproto_enum_stringer"]); - if (message[".gogoproto.enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer")) - writer.uint32(/* id 62022, wireType 0 =*/496176).bool(message[".gogoproto.enum_stringer"]); - if (message[".gogoproto.enum_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_customname")) - writer.uint32(/* id 62023, wireType 2 =*/496186).string(message[".gogoproto.enum_customname"]); - if (message[".gogoproto.enumdecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl")) - writer.uint32(/* id 62024, wireType 0 =*/496192).bool(message[".gogoproto.enumdecl"]); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 62001: - message[".gogoproto.goproto_enum_prefix"] = reader.bool(); - break; - case 62021: - message[".gogoproto.goproto_enum_stringer"] = reader.bool(); - break; - case 62022: - message[".gogoproto.enum_stringer"] = reader.bool(); - break; - case 62023: - message[".gogoproto.enum_customname"] = reader.string(); - break; - case 62024: - message[".gogoproto.enumdecl"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - if (typeof message.allow_alias !== "boolean") - return "allow_alias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - if (typeof message[".gogoproto.goproto_enum_prefix"] !== "boolean") - return ".gogoproto.goproto_enum_prefix: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - if (typeof message[".gogoproto.goproto_enum_stringer"] !== "boolean") - return ".gogoproto.goproto_enum_stringer: boolean expected"; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - if (typeof message[".gogoproto.enum_stringer"] !== "boolean") - return ".gogoproto.enum_stringer: boolean expected"; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - if (!$util.isString(message[".gogoproto.enum_customname"])) - return ".gogoproto.enum_customname: string expected"; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - if (typeof message[".gogoproto.enumdecl"] !== "boolean") - return ".gogoproto.enumdecl: boolean expected"; - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allow_alias != null) - message.allow_alias = Boolean(object.allow_alias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_enum_prefix"] != null) - message[".gogoproto.goproto_enum_prefix"] = Boolean(object[".gogoproto.goproto_enum_prefix"]); - if (object[".gogoproto.goproto_enum_stringer"] != null) - message[".gogoproto.goproto_enum_stringer"] = Boolean(object[".gogoproto.goproto_enum_stringer"]); - if (object[".gogoproto.enum_stringer"] != null) - message[".gogoproto.enum_stringer"] = Boolean(object[".gogoproto.enum_stringer"]); - if (object[".gogoproto.enum_customname"] != null) - message[".gogoproto.enum_customname"] = String(object[".gogoproto.enum_customname"]); - if (object[".gogoproto.enumdecl"] != null) - message[".gogoproto.enumdecl"] = Boolean(object[".gogoproto.enumdecl"]); - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.allow_alias = false; - object.deprecated = false; - object[".gogoproto.goproto_enum_prefix"] = false; - object[".gogoproto.goproto_enum_stringer"] = false; - object[".gogoproto.enum_stringer"] = false; - object[".gogoproto.enum_customname"] = ""; - object[".gogoproto.enumdecl"] = false; - } - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - object.allow_alias = message.allow_alias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - object[".gogoproto.goproto_enum_prefix"] = message[".gogoproto.goproto_enum_prefix"]; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - object[".gogoproto.goproto_enum_stringer"] = message[".gogoproto.goproto_enum_stringer"]; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - object[".gogoproto.enum_stringer"] = message[".gogoproto.enum_stringer"]; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - object[".gogoproto.enum_customname"] = message[".gogoproto.enum_customname"]; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - object[".gogoproto.enumdecl"] = message[".gogoproto.enumdecl"]; - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumValueOptions uninterpreted_option - * @property {string|null} [".gogoproto.enumvalue_customname"] EnumValueOptions .gogoproto.enumvalue_customname - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumValueOptions .gogoproto.enumvalue_customname. - * @member {string} .gogoproto.enumvalue_customname - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype[".gogoproto.enumvalue_customname"] = ""; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.enumvalue_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumvalue_customname")) - writer.uint32(/* id 66001, wireType 2 =*/528010).string(message[".gogoproto.enumvalue_customname"]); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 66001: - message[".gogoproto.enumvalue_customname"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - if (!$util.isString(message[".gogoproto.enumvalue_customname"])) - return ".gogoproto.enumvalue_customname: string expected"; - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.enumvalue_customname"] != null) - message[".gogoproto.enumvalue_customname"] = String(object[".gogoproto.enumvalue_customname"]); - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".gogoproto.enumvalue_customname"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - object[".gogoproto.enumvalue_customname"] = message[".gogoproto.enumvalue_customname"]; - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpreted_option] ServiceOptions uninterpreted_option - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {Array.|null} [uninterpreted_option] MethodOptions uninterpreted_option - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifier_value] UninterpretedOption identifier_value - * @property {Long|null} [positive_int_value] UninterpretedOption positive_int_value - * @property {Long|null} [negative_int_value] UninterpretedOption negative_int_value - * @property {number|null} [double_value] UninterpretedOption double_value - * @property {Uint8Array|null} [string_value] UninterpretedOption string_value - * @property {string|null} [aggregate_value] UninterpretedOption aggregate_value - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifier_value. - * @member {string} identifier_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifier_value = ""; - - /** - * UninterpretedOption positive_int_value. - * @member {Long} positive_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positive_int_value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negative_int_value. - * @member {Long} negative_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negative_int_value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption double_value. - * @member {number} double_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.double_value = 0; - - /** - * UninterpretedOption string_value. - * @member {Uint8Array} string_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.string_value = $util.newBuffer([]); - - /** - * UninterpretedOption aggregate_value. - * @member {string} aggregate_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregate_value = ""; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifier_value != null && Object.hasOwnProperty.call(message, "identifier_value")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifier_value); - if (message.positive_int_value != null && Object.hasOwnProperty.call(message, "positive_int_value")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positive_int_value); - if (message.negative_int_value != null && Object.hasOwnProperty.call(message, "negative_int_value")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negative_int_value); - if (message.double_value != null && Object.hasOwnProperty.call(message, "double_value")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.double_value); - if (message.string_value != null && Object.hasOwnProperty.call(message, "string_value")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.string_value); - if (message.aggregate_value != null && Object.hasOwnProperty.call(message, "aggregate_value")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregate_value); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = reader.uint64(); - break; - case 5: - message.negative_int_value = reader.int64(); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - if (!$util.isString(message.identifier_value)) - return "identifier_value: string expected"; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (!$util.isInteger(message.positive_int_value) && !(message.positive_int_value && $util.isInteger(message.positive_int_value.low) && $util.isInteger(message.positive_int_value.high))) - return "positive_int_value: integer|Long expected"; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (!$util.isInteger(message.negative_int_value) && !(message.negative_int_value && $util.isInteger(message.negative_int_value.low) && $util.isInteger(message.negative_int_value.high))) - return "negative_int_value: integer|Long expected"; - if (message.double_value != null && message.hasOwnProperty("double_value")) - if (typeof message.double_value !== "number") - return "double_value: number expected"; - if (message.string_value != null && message.hasOwnProperty("string_value")) - if (!(message.string_value && typeof message.string_value.length === "number" || $util.isString(message.string_value))) - return "string_value: buffer expected"; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - if (!$util.isString(message.aggregate_value)) - return "aggregate_value: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifier_value != null) - message.identifier_value = String(object.identifier_value); - if (object.positive_int_value != null) - if ($util.Long) - (message.positive_int_value = $util.Long.fromValue(object.positive_int_value)).unsigned = true; - else if (typeof object.positive_int_value === "string") - message.positive_int_value = parseInt(object.positive_int_value, 10); - else if (typeof object.positive_int_value === "number") - message.positive_int_value = object.positive_int_value; - else if (typeof object.positive_int_value === "object") - message.positive_int_value = new $util.LongBits(object.positive_int_value.low >>> 0, object.positive_int_value.high >>> 0).toNumber(true); - if (object.negative_int_value != null) - if ($util.Long) - (message.negative_int_value = $util.Long.fromValue(object.negative_int_value)).unsigned = false; - else if (typeof object.negative_int_value === "string") - message.negative_int_value = parseInt(object.negative_int_value, 10); - else if (typeof object.negative_int_value === "number") - message.negative_int_value = object.negative_int_value; - else if (typeof object.negative_int_value === "object") - message.negative_int_value = new $util.LongBits(object.negative_int_value.low >>> 0, object.negative_int_value.high >>> 0).toNumber(); - if (object.double_value != null) - message.double_value = Number(object.double_value); - if (object.string_value != null) - if (typeof object.string_value === "string") - $util.base64.decode(object.string_value, message.string_value = $util.newBuffer($util.base64.length(object.string_value)), 0); - else if (object.string_value.length) - message.string_value = object.string_value; - if (object.aggregate_value != null) - message.aggregate_value = String(object.aggregate_value); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifier_value = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positive_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positive_int_value = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negative_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negative_int_value = options.longs === String ? "0" : 0; - object.double_value = 0; - if (options.bytes === String) - object.string_value = ""; - else { - object.string_value = []; - if (options.bytes !== Array) - object.string_value = $util.newBuffer(object.string_value); - } - object.aggregate_value = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - object.identifier_value = message.identifier_value; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (typeof message.positive_int_value === "number") - object.positive_int_value = options.longs === String ? String(message.positive_int_value) : message.positive_int_value; - else - object.positive_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.positive_int_value) : options.longs === Number ? new $util.LongBits(message.positive_int_value.low >>> 0, message.positive_int_value.high >>> 0).toNumber(true) : message.positive_int_value; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (typeof message.negative_int_value === "number") - object.negative_int_value = options.longs === String ? String(message.negative_int_value) : message.negative_int_value; - else - object.negative_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.negative_int_value) : options.longs === Number ? new $util.LongBits(message.negative_int_value.low >>> 0, message.negative_int_value.high >>> 0).toNumber() : message.negative_int_value; - if (message.double_value != null && message.hasOwnProperty("double_value")) - object.double_value = options.json && !isFinite(message.double_value) ? String(message.double_value) : message.double_value; - if (message.string_value != null && message.hasOwnProperty("string_value")) - object.string_value = options.bytes === String ? $util.base64.encode(message.string_value, 0, message.string_value.length) : options.bytes === Array ? Array.prototype.slice.call(message.string_value) : message.string_value; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - object.aggregate_value = message.aggregate_value; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} name_part NamePart name_part - * @property {boolean} is_extension NamePart is_extension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart name_part. - * @member {string} name_part - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.name_part = ""; - - /** - * NamePart is_extension. - * @member {boolean} is_extension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.is_extension = false; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name_part); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_extension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("name_part")) - throw $util.ProtocolError("missing required 'name_part'", { instance: message }); - if (!message.hasOwnProperty("is_extension")) - throw $util.ProtocolError("missing required 'is_extension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.name_part)) - return "name_part: string expected"; - if (typeof message.is_extension !== "boolean") - return "is_extension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.name_part != null) - message.name_part = String(object.name_part); - if (object.is_extension != null) - message.is_extension = Boolean(object.is_extension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name_part = ""; - object.is_extension = false; - } - if (message.name_part != null && message.hasOwnProperty("name_part")) - object.name_part = message.name_part; - if (message.is_extension != null && message.hasOwnProperty("is_extension")) - object.is_extension = message.is_extension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leading_comments] Location leading_comments - * @property {string|null} [trailing_comments] Location trailing_comments - * @property {Array.|null} [leading_detached_comments] Location leading_detached_comments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leading_detached_comments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leading_comments. - * @member {string} leading_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_comments = ""; - - /** - * Location trailing_comments. - * @member {string} trailing_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailing_comments = ""; - - /** - * Location leading_detached_comments. - * @member {Array.} leading_detached_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_detached_comments = $util.emptyArray; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leading_comments != null && Object.hasOwnProperty.call(message, "leading_comments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leading_comments); - if (message.trailing_comments != null && Object.hasOwnProperty.call(message, "trailing_comments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailing_comments); - if (message.leading_detached_comments != null && message.leading_detached_comments.length) - for (var i = 0; i < message.leading_detached_comments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leading_detached_comments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - if (!(message.leading_detached_comments && message.leading_detached_comments.length)) - message.leading_detached_comments = []; - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - if (!$util.isString(message.leading_comments)) - return "leading_comments: string expected"; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - if (!$util.isString(message.trailing_comments)) - return "trailing_comments: string expected"; - if (message.leading_detached_comments != null && message.hasOwnProperty("leading_detached_comments")) { - if (!Array.isArray(message.leading_detached_comments)) - return "leading_detached_comments: array expected"; - for (var i = 0; i < message.leading_detached_comments.length; ++i) - if (!$util.isString(message.leading_detached_comments[i])) - return "leading_detached_comments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leading_comments != null) - message.leading_comments = String(object.leading_comments); - if (object.trailing_comments != null) - message.trailing_comments = String(object.trailing_comments); - if (object.leading_detached_comments) { - if (!Array.isArray(object.leading_detached_comments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leading_detached_comments: array expected"); - message.leading_detached_comments = []; - for (var i = 0; i < object.leading_detached_comments.length; ++i) - message.leading_detached_comments[i] = String(object.leading_detached_comments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leading_detached_comments = []; - } - if (options.defaults) { - object.leading_comments = ""; - object.trailing_comments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - object.leading_comments = message.leading_comments; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - object.trailing_comments = message.trailing_comments; - if (message.leading_detached_comments && message.leading_detached_comments.length) { - object.leading_detached_comments = []; - for (var j = 0; j < message.leading_detached_comments.length; ++j) - object.leading_detached_comments[j] = message.leading_detached_comments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [source_file] Annotation source_file - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation source_file. - * @member {string} source_file - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.source_file = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.source_file != null && Object.hasOwnProperty.call(message, "source_file")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_file); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.source_file = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - if (!$util.isString(message.source_file)) - return "source_file: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.source_file != null) - message.source_file = String(object.source_file); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.source_file = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - object.source_file = message.source_file; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Any; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Timestamp; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Duration; - })(); - - return protobuf; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fully_decode_reserved_expansion] Http fully_decode_reserved_expansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fully_decode_reserved_expansion. - * @member {boolean} fully_decode_reserved_expansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fully_decode_reserved_expansion = false; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fully_decode_reserved_expansion != null && Object.hasOwnProperty.call(message, "fully_decode_reserved_expansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fully_decode_reserved_expansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - if (typeof message.fully_decode_reserved_expansion !== "boolean") - return "fully_decode_reserved_expansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fully_decode_reserved_expansion != null) - message.fully_decode_reserved_expansion = Boolean(object.fully_decode_reserved_expansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fully_decode_reserved_expansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - object.fully_decode_reserved_expansion = message.fully_decode_reserved_expansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [response_body] HttpRule response_body - * @property {Array.|null} [additional_bindings] HttpRule additional_bindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additional_bindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule response_body. - * @member {string} response_body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.response_body = ""; - - /** - * HttpRule additional_bindings. - * @member {Array.} additional_bindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additional_bindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additional_bindings != null && message.additional_bindings.length) - for (var i = 0; i < message.additional_bindings.length; ++i) - $root.google.api.HttpRule.encode(message.additional_bindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.response_body != null && Object.hasOwnProperty.call(message, "response_body")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.response_body); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.response_body = reader.string(); - break; - case 11: - if (!(message.additional_bindings && message.additional_bindings.length)) - message.additional_bindings = []; - message.additional_bindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.response_body != null && message.hasOwnProperty("response_body")) - if (!$util.isString(message.response_body)) - return "response_body: string expected"; - if (message.additional_bindings != null && message.hasOwnProperty("additional_bindings")) { - if (!Array.isArray(message.additional_bindings)) - return "additional_bindings: array expected"; - for (var i = 0; i < message.additional_bindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additional_bindings[i]); - if (error) - return "additional_bindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.response_body != null) - message.response_body = String(object.response_body); - if (object.additional_bindings) { - if (!Array.isArray(object.additional_bindings)) - throw TypeError(".google.api.HttpRule.additional_bindings: array expected"); - message.additional_bindings = []; - for (var i = 0; i < object.additional_bindings.length; ++i) { - if (typeof object.additional_bindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additional_bindings: object expected"); - message.additional_bindings[i] = $root.google.api.HttpRule.fromObject(object.additional_bindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additional_bindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.response_body = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additional_bindings && message.additional_bindings.length) { - object.additional_bindings = []; - for (var j = 0; j < message.additional_bindings.length; ++j) - object.additional_bindings[j] = $root.google.api.HttpRule.toObject(message.additional_bindings[j], options); - } - if (message.response_body != null && message.hasOwnProperty("response_body")) - object.response_body = message.response_body; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CustomHttpPattern; - })(); - - return api; - })(); - - return google; - })(); - - $root.ibc = (function() { - - /** - * Namespace ibc. - * @exports ibc - * @namespace - */ - var ibc = {}; - - ibc.applications = (function() { - - /** - * Namespace applications. - * @memberof ibc - * @namespace - */ - var applications = {}; - - applications.fee = (function() { - - /** - * Namespace fee. - * @memberof ibc.applications - * @namespace - */ - var fee = {}; - - fee.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.fee - * @namespace - */ - var v1 = {}; - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#registerPayee}. - * @memberof ibc.applications.fee.v1.Msg - * @typedef RegisterPayeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.MsgRegisterPayeeResponse} [response] MsgRegisterPayeeResponse - */ - - /** - * Calls RegisterPayee. - * @function registerPayee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgRegisterPayee} request MsgRegisterPayee message or plain object - * @param {ibc.applications.fee.v1.Msg.RegisterPayeeCallback} callback Node-style callback called with the error, if any, and MsgRegisterPayeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.registerPayee = function registerPayee(request, callback) { - return this.rpcCall(registerPayee, $root.ibc.applications.fee.v1.MsgRegisterPayee, $root.ibc.applications.fee.v1.MsgRegisterPayeeResponse, request, callback); - }, "name", { value: "RegisterPayee" }); - - /** - * Calls RegisterPayee. - * @function registerPayee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgRegisterPayee} request MsgRegisterPayee message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#registerCounterpartyPayee}. - * @memberof ibc.applications.fee.v1.Msg - * @typedef RegisterCounterpartyPayeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} [response] MsgRegisterCounterpartyPayeeResponse - */ - - /** - * Calls RegisterCounterpartyPayee. - * @function registerCounterpartyPayee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee} request MsgRegisterCounterpartyPayee message or plain object - * @param {ibc.applications.fee.v1.Msg.RegisterCounterpartyPayeeCallback} callback Node-style callback called with the error, if any, and MsgRegisterCounterpartyPayeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.registerCounterpartyPayee = function registerCounterpartyPayee(request, callback) { - return this.rpcCall(registerCounterpartyPayee, $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayee, $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse, request, callback); - }, "name", { value: "RegisterCounterpartyPayee" }); - - /** - * Calls RegisterCounterpartyPayee. - * @function registerCounterpartyPayee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee} request MsgRegisterCounterpartyPayee message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#payPacketFee}. - * @memberof ibc.applications.fee.v1.Msg - * @typedef PayPacketFeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.MsgPayPacketFeeResponse} [response] MsgPayPacketFeeResponse - */ - - /** - * Calls PayPacketFee. - * @function payPacketFee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgPayPacketFee} request MsgPayPacketFee message or plain object - * @param {ibc.applications.fee.v1.Msg.PayPacketFeeCallback} callback Node-style callback called with the error, if any, and MsgPayPacketFeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.payPacketFee = function payPacketFee(request, callback) { - return this.rpcCall(payPacketFee, $root.ibc.applications.fee.v1.MsgPayPacketFee, $root.ibc.applications.fee.v1.MsgPayPacketFeeResponse, request, callback); - }, "name", { value: "PayPacketFee" }); - - /** - * Calls PayPacketFee. - * @function payPacketFee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgPayPacketFee} request MsgPayPacketFee message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#payPacketFeeAsync}. - * @memberof ibc.applications.fee.v1.Msg - * @typedef PayPacketFeeAsyncCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} [response] MsgPayPacketFeeAsyncResponse - */ - - /** - * Calls PayPacketFeeAsync. - * @function payPacketFeeAsync - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync} request MsgPayPacketFeeAsync message or plain object - * @param {ibc.applications.fee.v1.Msg.PayPacketFeeAsyncCallback} callback Node-style callback called with the error, if any, and MsgPayPacketFeeAsyncResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.payPacketFeeAsync = function payPacketFeeAsync(request, callback) { - return this.rpcCall(payPacketFeeAsync, $root.ibc.applications.fee.v1.MsgPayPacketFeeAsync, $root.ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse, request, callback); - }, "name", { value: "PayPacketFeeAsync" }); - - /** - * Calls PayPacketFeeAsync. - * @function payPacketFeeAsync - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync} request MsgPayPacketFeeAsync message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1.MsgRegisterPayee = (function() { - - /** - * Properties of a MsgRegisterPayee. - * @memberof ibc.applications.fee.v1 - * @interface IMsgRegisterPayee - * @property {string|null} [port_id] MsgRegisterPayee port_id - * @property {string|null} [channel_id] MsgRegisterPayee channel_id - * @property {string|null} [relayer] MsgRegisterPayee relayer - * @property {string|null} [payee] MsgRegisterPayee payee - */ - - /** - * Constructs a new MsgRegisterPayee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgRegisterPayee. - * @implements IMsgRegisterPayee - * @constructor - * @param {ibc.applications.fee.v1.IMsgRegisterPayee=} [properties] Properties to set - */ - function MsgRegisterPayee(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRegisterPayee port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - */ - MsgRegisterPayee.prototype.port_id = ""; - - /** - * MsgRegisterPayee channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - */ - MsgRegisterPayee.prototype.channel_id = ""; - - /** - * MsgRegisterPayee relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - */ - MsgRegisterPayee.prototype.relayer = ""; - - /** - * MsgRegisterPayee payee. - * @member {string} payee - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - */ - MsgRegisterPayee.prototype.payee = ""; - - /** - * Encodes the specified MsgRegisterPayee message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterPayee} message MsgRegisterPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterPayee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relayer); - if (message.payee != null && Object.hasOwnProperty.call(message, "payee")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.payee); - return writer; - }; - - /** - * Encodes the specified MsgRegisterPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterPayee} message MsgRegisterPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterPayee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterPayee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgRegisterPayee} MsgRegisterPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterPayee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgRegisterPayee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.relayer = reader.string(); - break; - case 4: - message.payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterPayee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgRegisterPayee} MsgRegisterPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterPayee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterPayee message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterPayee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - if (message.payee != null && message.hasOwnProperty("payee")) - if (!$util.isString(message.payee)) - return "payee: string expected"; - return null; - }; - - /** - * Creates a MsgRegisterPayee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgRegisterPayee} MsgRegisterPayee - */ - MsgRegisterPayee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgRegisterPayee) - return object; - var message = new $root.ibc.applications.fee.v1.MsgRegisterPayee(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - if (object.payee != null) - message.payee = String(object.payee); - return message; - }; - - /** - * Creates a plain object from a MsgRegisterPayee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {ibc.applications.fee.v1.MsgRegisterPayee} message MsgRegisterPayee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterPayee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.relayer = ""; - object.payee = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - if (message.payee != null && message.hasOwnProperty("payee")) - object.payee = message.payee; - return object; - }; - - /** - * Converts this MsgRegisterPayee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterPayee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterPayee; - })(); - - v1.MsgRegisterPayeeResponse = (function() { - - /** - * Properties of a MsgRegisterPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IMsgRegisterPayeeResponse - */ - - /** - * Constructs a new MsgRegisterPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgRegisterPayeeResponse. - * @implements IMsgRegisterPayeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IMsgRegisterPayeeResponse=} [properties] Properties to set - */ - function MsgRegisterPayeeResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgRegisterPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterPayeeResponse} message MsgRegisterPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterPayeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgRegisterPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterPayeeResponse} message MsgRegisterPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterPayeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterPayeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgRegisterPayeeResponse} MsgRegisterPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterPayeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgRegisterPayeeResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterPayeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgRegisterPayeeResponse} MsgRegisterPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterPayeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterPayeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterPayeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgRegisterPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgRegisterPayeeResponse} MsgRegisterPayeeResponse - */ - MsgRegisterPayeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgRegisterPayeeResponse) - return object; - return new $root.ibc.applications.fee.v1.MsgRegisterPayeeResponse(); - }; - - /** - * Creates a plain object from a MsgRegisterPayeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {ibc.applications.fee.v1.MsgRegisterPayeeResponse} message MsgRegisterPayeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterPayeeResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgRegisterPayeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterPayeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterPayeeResponse; - })(); - - v1.MsgRegisterCounterpartyPayee = (function() { - - /** - * Properties of a MsgRegisterCounterpartyPayee. - * @memberof ibc.applications.fee.v1 - * @interface IMsgRegisterCounterpartyPayee - * @property {string|null} [port_id] MsgRegisterCounterpartyPayee port_id - * @property {string|null} [channel_id] MsgRegisterCounterpartyPayee channel_id - * @property {string|null} [relayer] MsgRegisterCounterpartyPayee relayer - * @property {string|null} [counterparty_payee] MsgRegisterCounterpartyPayee counterparty_payee - */ - - /** - * Constructs a new MsgRegisterCounterpartyPayee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgRegisterCounterpartyPayee. - * @implements IMsgRegisterCounterpartyPayee - * @constructor - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee=} [properties] Properties to set - */ - function MsgRegisterCounterpartyPayee(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRegisterCounterpartyPayee port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - */ - MsgRegisterCounterpartyPayee.prototype.port_id = ""; - - /** - * MsgRegisterCounterpartyPayee channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - */ - MsgRegisterCounterpartyPayee.prototype.channel_id = ""; - - /** - * MsgRegisterCounterpartyPayee relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - */ - MsgRegisterCounterpartyPayee.prototype.relayer = ""; - - /** - * MsgRegisterCounterpartyPayee counterparty_payee. - * @member {string} counterparty_payee - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - */ - MsgRegisterCounterpartyPayee.prototype.counterparty_payee = ""; - - /** - * Encodes the specified MsgRegisterCounterpartyPayee message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee} message MsgRegisterCounterpartyPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterCounterpartyPayee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relayer); - if (message.counterparty_payee != null && Object.hasOwnProperty.call(message, "counterparty_payee")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.counterparty_payee); - return writer; - }; - - /** - * Encodes the specified MsgRegisterCounterpartyPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee} message MsgRegisterCounterpartyPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterCounterpartyPayee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterCounterpartyPayee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayee} MsgRegisterCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterCounterpartyPayee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.relayer = reader.string(); - break; - case 4: - message.counterparty_payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterCounterpartyPayee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayee} MsgRegisterCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterCounterpartyPayee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterCounterpartyPayee message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterCounterpartyPayee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - if (!$util.isString(message.counterparty_payee)) - return "counterparty_payee: string expected"; - return null; - }; - - /** - * Creates a MsgRegisterCounterpartyPayee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayee} MsgRegisterCounterpartyPayee - */ - MsgRegisterCounterpartyPayee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayee) - return object; - var message = new $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayee(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - if (object.counterparty_payee != null) - message.counterparty_payee = String(object.counterparty_payee); - return message; - }; - - /** - * Creates a plain object from a MsgRegisterCounterpartyPayee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.MsgRegisterCounterpartyPayee} message MsgRegisterCounterpartyPayee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterCounterpartyPayee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.relayer = ""; - object.counterparty_payee = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - object.counterparty_payee = message.counterparty_payee; - return object; - }; - - /** - * Converts this MsgRegisterCounterpartyPayee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterCounterpartyPayee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterCounterpartyPayee; - })(); - - v1.MsgRegisterCounterpartyPayeeResponse = (function() { - - /** - * Properties of a MsgRegisterCounterpartyPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IMsgRegisterCounterpartyPayeeResponse - */ - - /** - * Constructs a new MsgRegisterCounterpartyPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgRegisterCounterpartyPayeeResponse. - * @implements IMsgRegisterCounterpartyPayeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayeeResponse=} [properties] Properties to set - */ - function MsgRegisterCounterpartyPayeeResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgRegisterCounterpartyPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayeeResponse} message MsgRegisterCounterpartyPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterCounterpartyPayeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgRegisterCounterpartyPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayeeResponse} message MsgRegisterCounterpartyPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterCounterpartyPayeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterCounterpartyPayeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} MsgRegisterCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterCounterpartyPayeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterCounterpartyPayeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} MsgRegisterCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterCounterpartyPayeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterCounterpartyPayeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterCounterpartyPayeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgRegisterCounterpartyPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} MsgRegisterCounterpartyPayeeResponse - */ - MsgRegisterCounterpartyPayeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse) - return object; - return new $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse(); - }; - - /** - * Creates a plain object from a MsgRegisterCounterpartyPayeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} message MsgRegisterCounterpartyPayeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterCounterpartyPayeeResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgRegisterCounterpartyPayeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterCounterpartyPayeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterCounterpartyPayeeResponse; - })(); - - v1.MsgPayPacketFee = (function() { - - /** - * Properties of a MsgPayPacketFee. - * @memberof ibc.applications.fee.v1 - * @interface IMsgPayPacketFee - * @property {ibc.applications.fee.v1.IFee|null} [fee] MsgPayPacketFee fee - * @property {string|null} [source_port_id] MsgPayPacketFee source_port_id - * @property {string|null} [source_channel_id] MsgPayPacketFee source_channel_id - * @property {string|null} [signer] MsgPayPacketFee signer - * @property {Array.|null} [relayers] MsgPayPacketFee relayers - */ - - /** - * Constructs a new MsgPayPacketFee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgPayPacketFee. - * @implements IMsgPayPacketFee - * @constructor - * @param {ibc.applications.fee.v1.IMsgPayPacketFee=} [properties] Properties to set - */ - function MsgPayPacketFee(properties) { - this.relayers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgPayPacketFee fee. - * @member {ibc.applications.fee.v1.IFee|null|undefined} fee - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.fee = null; - - /** - * MsgPayPacketFee source_port_id. - * @member {string} source_port_id - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.source_port_id = ""; - - /** - * MsgPayPacketFee source_channel_id. - * @member {string} source_channel_id - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.source_channel_id = ""; - - /** - * MsgPayPacketFee signer. - * @member {string} signer - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.signer = ""; - - /** - * MsgPayPacketFee relayers. - * @member {Array.} relayers - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.relayers = $util.emptyArray; - - /** - * Encodes the specified MsgPayPacketFee message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFee} message MsgPayPacketFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) - $root.ibc.applications.fee.v1.Fee.encode(message.fee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.source_port_id != null && Object.hasOwnProperty.call(message, "source_port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_port_id); - if (message.source_channel_id != null && Object.hasOwnProperty.call(message, "source_channel_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.source_channel_id); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.signer); - if (message.relayers != null && message.relayers.length) - for (var i = 0; i < message.relayers.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.relayers[i]); - return writer; - }; - - /** - * Encodes the specified MsgPayPacketFee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFee} message MsgPayPacketFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgPayPacketFee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgPayPacketFee} MsgPayPacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgPayPacketFee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee = $root.ibc.applications.fee.v1.Fee.decode(reader, reader.uint32()); - break; - case 2: - message.source_port_id = reader.string(); - break; - case 3: - message.source_channel_id = reader.string(); - break; - case 4: - message.signer = reader.string(); - break; - case 5: - if (!(message.relayers && message.relayers.length)) - message.relayers = []; - message.relayers.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgPayPacketFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgPayPacketFee} MsgPayPacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgPayPacketFee message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgPayPacketFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee != null && message.hasOwnProperty("fee")) { - var error = $root.ibc.applications.fee.v1.Fee.verify(message.fee); - if (error) - return "fee." + error; - } - if (message.source_port_id != null && message.hasOwnProperty("source_port_id")) - if (!$util.isString(message.source_port_id)) - return "source_port_id: string expected"; - if (message.source_channel_id != null && message.hasOwnProperty("source_channel_id")) - if (!$util.isString(message.source_channel_id)) - return "source_channel_id: string expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - if (message.relayers != null && message.hasOwnProperty("relayers")) { - if (!Array.isArray(message.relayers)) - return "relayers: array expected"; - for (var i = 0; i < message.relayers.length; ++i) - if (!$util.isString(message.relayers[i])) - return "relayers: string[] expected"; - } - return null; - }; - - /** - * Creates a MsgPayPacketFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgPayPacketFee} MsgPayPacketFee - */ - MsgPayPacketFee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgPayPacketFee) - return object; - var message = new $root.ibc.applications.fee.v1.MsgPayPacketFee(); - if (object.fee != null) { - if (typeof object.fee !== "object") - throw TypeError(".ibc.applications.fee.v1.MsgPayPacketFee.fee: object expected"); - message.fee = $root.ibc.applications.fee.v1.Fee.fromObject(object.fee); - } - if (object.source_port_id != null) - message.source_port_id = String(object.source_port_id); - if (object.source_channel_id != null) - message.source_channel_id = String(object.source_channel_id); - if (object.signer != null) - message.signer = String(object.signer); - if (object.relayers) { - if (!Array.isArray(object.relayers)) - throw TypeError(".ibc.applications.fee.v1.MsgPayPacketFee.relayers: array expected"); - message.relayers = []; - for (var i = 0; i < object.relayers.length; ++i) - message.relayers[i] = String(object.relayers[i]); - } - return message; - }; - - /** - * Creates a plain object from a MsgPayPacketFee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {ibc.applications.fee.v1.MsgPayPacketFee} message MsgPayPacketFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgPayPacketFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.relayers = []; - if (options.defaults) { - object.fee = null; - object.source_port_id = ""; - object.source_channel_id = ""; - object.signer = ""; - } - if (message.fee != null && message.hasOwnProperty("fee")) - object.fee = $root.ibc.applications.fee.v1.Fee.toObject(message.fee, options); - if (message.source_port_id != null && message.hasOwnProperty("source_port_id")) - object.source_port_id = message.source_port_id; - if (message.source_channel_id != null && message.hasOwnProperty("source_channel_id")) - object.source_channel_id = message.source_channel_id; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - if (message.relayers && message.relayers.length) { - object.relayers = []; - for (var j = 0; j < message.relayers.length; ++j) - object.relayers[j] = message.relayers[j]; - } - return object; - }; - - /** - * Converts this MsgPayPacketFee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - * @returns {Object.} JSON object - */ - MsgPayPacketFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgPayPacketFee; - })(); - - v1.MsgPayPacketFeeResponse = (function() { - - /** - * Properties of a MsgPayPacketFeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IMsgPayPacketFeeResponse - */ - - /** - * Constructs a new MsgPayPacketFeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgPayPacketFeeResponse. - * @implements IMsgPayPacketFeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeResponse=} [properties] Properties to set - */ - function MsgPayPacketFeeResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgPayPacketFeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeResponse} message MsgPayPacketFeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgPayPacketFeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeResponse} message MsgPayPacketFeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgPayPacketFeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeResponse} MsgPayPacketFeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgPayPacketFeeResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgPayPacketFeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeResponse} MsgPayPacketFeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgPayPacketFeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgPayPacketFeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgPayPacketFeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeResponse} MsgPayPacketFeeResponse - */ - MsgPayPacketFeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgPayPacketFeeResponse) - return object; - return new $root.ibc.applications.fee.v1.MsgPayPacketFeeResponse(); - }; - - /** - * Creates a plain object from a MsgPayPacketFeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {ibc.applications.fee.v1.MsgPayPacketFeeResponse} message MsgPayPacketFeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgPayPacketFeeResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgPayPacketFeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @instance - * @returns {Object.} JSON object - */ - MsgPayPacketFeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgPayPacketFeeResponse; - })(); - - v1.MsgPayPacketFeeAsync = (function() { - - /** - * Properties of a MsgPayPacketFeeAsync. - * @memberof ibc.applications.fee.v1 - * @interface IMsgPayPacketFeeAsync - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] MsgPayPacketFeeAsync packet_id - * @property {ibc.applications.fee.v1.IPacketFee|null} [packet_fee] MsgPayPacketFeeAsync packet_fee - */ - - /** - * Constructs a new MsgPayPacketFeeAsync. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgPayPacketFeeAsync. - * @implements IMsgPayPacketFeeAsync - * @constructor - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync=} [properties] Properties to set - */ - function MsgPayPacketFeeAsync(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgPayPacketFeeAsync packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @instance - */ - MsgPayPacketFeeAsync.prototype.packet_id = null; - - /** - * MsgPayPacketFeeAsync packet_fee. - * @member {ibc.applications.fee.v1.IPacketFee|null|undefined} packet_fee - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @instance - */ - MsgPayPacketFeeAsync.prototype.packet_fee = null; - - /** - * Encodes the specified MsgPayPacketFeeAsync message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsync.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync} message MsgPayPacketFeeAsync message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeAsync.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.packet_fee != null && Object.hasOwnProperty.call(message, "packet_fee")) - $root.ibc.applications.fee.v1.PacketFee.encode(message.packet_fee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MsgPayPacketFeeAsync message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsync.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync} message MsgPayPacketFeeAsync message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeAsync.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgPayPacketFeeAsync message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsync} MsgPayPacketFeeAsync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeAsync.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgPayPacketFeeAsync(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - case 2: - message.packet_fee = $root.ibc.applications.fee.v1.PacketFee.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgPayPacketFeeAsync message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsync} MsgPayPacketFeeAsync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeAsync.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgPayPacketFeeAsync message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgPayPacketFeeAsync.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - var error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - if (message.packet_fee != null && message.hasOwnProperty("packet_fee")) { - var error = $root.ibc.applications.fee.v1.PacketFee.verify(message.packet_fee); - if (error) - return "packet_fee." + error; - } - return null; - }; - - /** - * Creates a MsgPayPacketFeeAsync message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsync} MsgPayPacketFeeAsync - */ - MsgPayPacketFeeAsync.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgPayPacketFeeAsync) - return object; - var message = new $root.ibc.applications.fee.v1.MsgPayPacketFeeAsync(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.MsgPayPacketFeeAsync.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - if (object.packet_fee != null) { - if (typeof object.packet_fee !== "object") - throw TypeError(".ibc.applications.fee.v1.MsgPayPacketFeeAsync.packet_fee: object expected"); - message.packet_fee = $root.ibc.applications.fee.v1.PacketFee.fromObject(object.packet_fee); - } - return message; - }; - - /** - * Creates a plain object from a MsgPayPacketFeeAsync message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {ibc.applications.fee.v1.MsgPayPacketFeeAsync} message MsgPayPacketFeeAsync - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgPayPacketFeeAsync.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.packet_id = null; - object.packet_fee = null; - } - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - if (message.packet_fee != null && message.hasOwnProperty("packet_fee")) - object.packet_fee = $root.ibc.applications.fee.v1.PacketFee.toObject(message.packet_fee, options); - return object; - }; - - /** - * Converts this MsgPayPacketFeeAsync to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @instance - * @returns {Object.} JSON object - */ - MsgPayPacketFeeAsync.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgPayPacketFeeAsync; - })(); - - v1.MsgPayPacketFeeAsyncResponse = (function() { - - /** - * Properties of a MsgPayPacketFeeAsyncResponse. - * @memberof ibc.applications.fee.v1 - * @interface IMsgPayPacketFeeAsyncResponse - */ - - /** - * Constructs a new MsgPayPacketFeeAsyncResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgPayPacketFeeAsyncResponse. - * @implements IMsgPayPacketFeeAsyncResponse - * @constructor - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsyncResponse=} [properties] Properties to set - */ - function MsgPayPacketFeeAsyncResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgPayPacketFeeAsyncResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsyncResponse} message MsgPayPacketFeeAsyncResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeAsyncResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgPayPacketFeeAsyncResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsyncResponse} message MsgPayPacketFeeAsyncResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeAsyncResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgPayPacketFeeAsyncResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} MsgPayPacketFeeAsyncResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeAsyncResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgPayPacketFeeAsyncResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} MsgPayPacketFeeAsyncResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeAsyncResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgPayPacketFeeAsyncResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgPayPacketFeeAsyncResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgPayPacketFeeAsyncResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} MsgPayPacketFeeAsyncResponse - */ - MsgPayPacketFeeAsyncResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse) - return object; - return new $root.ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse(); - }; - - /** - * Creates a plain object from a MsgPayPacketFeeAsyncResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} message MsgPayPacketFeeAsyncResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgPayPacketFeeAsyncResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgPayPacketFeeAsyncResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @instance - * @returns {Object.} JSON object - */ - MsgPayPacketFeeAsyncResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgPayPacketFeeAsyncResponse; - })(); - - v1.Fee = (function() { - - /** - * Properties of a Fee. - * @memberof ibc.applications.fee.v1 - * @interface IFee - * @property {Array.|null} [recv_fee] Fee recv_fee - * @property {Array.|null} [ack_fee] Fee ack_fee - * @property {Array.|null} [timeout_fee] Fee timeout_fee - */ - - /** - * Constructs a new Fee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a Fee. - * @implements IFee - * @constructor - * @param {ibc.applications.fee.v1.IFee=} [properties] Properties to set - */ - function Fee(properties) { - this.recv_fee = []; - this.ack_fee = []; - this.timeout_fee = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Fee recv_fee. - * @member {Array.} recv_fee - * @memberof ibc.applications.fee.v1.Fee - * @instance - */ - Fee.prototype.recv_fee = $util.emptyArray; - - /** - * Fee ack_fee. - * @member {Array.} ack_fee - * @memberof ibc.applications.fee.v1.Fee - * @instance - */ - Fee.prototype.ack_fee = $util.emptyArray; - - /** - * Fee timeout_fee. - * @member {Array.} timeout_fee - * @memberof ibc.applications.fee.v1.Fee - * @instance - */ - Fee.prototype.timeout_fee = $util.emptyArray; - - /** - * Encodes the specified Fee message. Does not implicitly {@link ibc.applications.fee.v1.Fee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {ibc.applications.fee.v1.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recv_fee != null && message.recv_fee.length) - for (var i = 0; i < message.recv_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.recv_fee[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.ack_fee != null && message.ack_fee.length) - for (var i = 0; i < message.ack_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.ack_fee[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.timeout_fee != null && message.timeout_fee.length) - for (var i = 0; i < message.timeout_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.timeout_fee[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.Fee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {ibc.applications.fee.v1.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.Fee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.recv_fee && message.recv_fee.length)) - message.recv_fee = []; - message.recv_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.ack_fee && message.ack_fee.length)) - message.ack_fee = []; - message.ack_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.timeout_fee && message.timeout_fee.length)) - message.timeout_fee = []; - message.timeout_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Fee message. - * @function verify - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Fee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recv_fee != null && message.hasOwnProperty("recv_fee")) { - if (!Array.isArray(message.recv_fee)) - return "recv_fee: array expected"; - for (var i = 0; i < message.recv_fee.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.recv_fee[i]); - if (error) - return "recv_fee." + error; - } - } - if (message.ack_fee != null && message.hasOwnProperty("ack_fee")) { - if (!Array.isArray(message.ack_fee)) - return "ack_fee: array expected"; - for (var i = 0; i < message.ack_fee.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.ack_fee[i]); - if (error) - return "ack_fee." + error; - } - } - if (message.timeout_fee != null && message.hasOwnProperty("timeout_fee")) { - if (!Array.isArray(message.timeout_fee)) - return "timeout_fee: array expected"; - for (var i = 0; i < message.timeout_fee.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.timeout_fee[i]); - if (error) - return "timeout_fee." + error; - } - } - return null; - }; - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.Fee} Fee - */ - Fee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.Fee) - return object; - var message = new $root.ibc.applications.fee.v1.Fee(); - if (object.recv_fee) { - if (!Array.isArray(object.recv_fee)) - throw TypeError(".ibc.applications.fee.v1.Fee.recv_fee: array expected"); - message.recv_fee = []; - for (var i = 0; i < object.recv_fee.length; ++i) { - if (typeof object.recv_fee[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.Fee.recv_fee: object expected"); - message.recv_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.recv_fee[i]); - } - } - if (object.ack_fee) { - if (!Array.isArray(object.ack_fee)) - throw TypeError(".ibc.applications.fee.v1.Fee.ack_fee: array expected"); - message.ack_fee = []; - for (var i = 0; i < object.ack_fee.length; ++i) { - if (typeof object.ack_fee[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.Fee.ack_fee: object expected"); - message.ack_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.ack_fee[i]); - } - } - if (object.timeout_fee) { - if (!Array.isArray(object.timeout_fee)) - throw TypeError(".ibc.applications.fee.v1.Fee.timeout_fee: array expected"); - message.timeout_fee = []; - for (var i = 0; i < object.timeout_fee.length; ++i) { - if (typeof object.timeout_fee[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.Fee.timeout_fee: object expected"); - message.timeout_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.timeout_fee[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {ibc.applications.fee.v1.Fee} message Fee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Fee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.recv_fee = []; - object.ack_fee = []; - object.timeout_fee = []; - } - if (message.recv_fee && message.recv_fee.length) { - object.recv_fee = []; - for (var j = 0; j < message.recv_fee.length; ++j) - object.recv_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.recv_fee[j], options); - } - if (message.ack_fee && message.ack_fee.length) { - object.ack_fee = []; - for (var j = 0; j < message.ack_fee.length; ++j) - object.ack_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.ack_fee[j], options); - } - if (message.timeout_fee && message.timeout_fee.length) { - object.timeout_fee = []; - for (var j = 0; j < message.timeout_fee.length; ++j) - object.timeout_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.timeout_fee[j], options); - } - return object; - }; - - /** - * Converts this Fee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.Fee - * @instance - * @returns {Object.} JSON object - */ - Fee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Fee; - })(); - - v1.PacketFee = (function() { - - /** - * Properties of a PacketFee. - * @memberof ibc.applications.fee.v1 - * @interface IPacketFee - * @property {ibc.applications.fee.v1.IFee|null} [fee] PacketFee fee - * @property {string|null} [refund_address] PacketFee refund_address - * @property {Array.|null} [relayers] PacketFee relayers - */ - - /** - * Constructs a new PacketFee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a PacketFee. - * @implements IPacketFee - * @constructor - * @param {ibc.applications.fee.v1.IPacketFee=} [properties] Properties to set - */ - function PacketFee(properties) { - this.relayers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketFee fee. - * @member {ibc.applications.fee.v1.IFee|null|undefined} fee - * @memberof ibc.applications.fee.v1.PacketFee - * @instance - */ - PacketFee.prototype.fee = null; - - /** - * PacketFee refund_address. - * @member {string} refund_address - * @memberof ibc.applications.fee.v1.PacketFee - * @instance - */ - PacketFee.prototype.refund_address = ""; - - /** - * PacketFee relayers. - * @member {Array.} relayers - * @memberof ibc.applications.fee.v1.PacketFee - * @instance - */ - PacketFee.prototype.relayers = $util.emptyArray; - - /** - * Encodes the specified PacketFee message. Does not implicitly {@link ibc.applications.fee.v1.PacketFee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {ibc.applications.fee.v1.IPacketFee} message PacketFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) - $root.ibc.applications.fee.v1.Fee.encode(message.fee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.refund_address != null && Object.hasOwnProperty.call(message, "refund_address")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.refund_address); - if (message.relayers != null && message.relayers.length) - for (var i = 0; i < message.relayers.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relayers[i]); - return writer; - }; - - /** - * Encodes the specified PacketFee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.PacketFee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {ibc.applications.fee.v1.IPacketFee} message PacketFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketFee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.PacketFee} PacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketFee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.PacketFee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee = $root.ibc.applications.fee.v1.Fee.decode(reader, reader.uint32()); - break; - case 2: - message.refund_address = reader.string(); - break; - case 3: - if (!(message.relayers && message.relayers.length)) - message.relayers = []; - message.relayers.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.PacketFee} PacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketFee message. - * @function verify - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee != null && message.hasOwnProperty("fee")) { - var error = $root.ibc.applications.fee.v1.Fee.verify(message.fee); - if (error) - return "fee." + error; - } - if (message.refund_address != null && message.hasOwnProperty("refund_address")) - if (!$util.isString(message.refund_address)) - return "refund_address: string expected"; - if (message.relayers != null && message.hasOwnProperty("relayers")) { - if (!Array.isArray(message.relayers)) - return "relayers: array expected"; - for (var i = 0; i < message.relayers.length; ++i) - if (!$util.isString(message.relayers[i])) - return "relayers: string[] expected"; - } - return null; - }; - - /** - * Creates a PacketFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.PacketFee} PacketFee - */ - PacketFee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.PacketFee) - return object; - var message = new $root.ibc.applications.fee.v1.PacketFee(); - if (object.fee != null) { - if (typeof object.fee !== "object") - throw TypeError(".ibc.applications.fee.v1.PacketFee.fee: object expected"); - message.fee = $root.ibc.applications.fee.v1.Fee.fromObject(object.fee); - } - if (object.refund_address != null) - message.refund_address = String(object.refund_address); - if (object.relayers) { - if (!Array.isArray(object.relayers)) - throw TypeError(".ibc.applications.fee.v1.PacketFee.relayers: array expected"); - message.relayers = []; - for (var i = 0; i < object.relayers.length; ++i) - message.relayers[i] = String(object.relayers[i]); - } - return message; - }; - - /** - * Creates a plain object from a PacketFee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {ibc.applications.fee.v1.PacketFee} message PacketFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.relayers = []; - if (options.defaults) { - object.fee = null; - object.refund_address = ""; - } - if (message.fee != null && message.hasOwnProperty("fee")) - object.fee = $root.ibc.applications.fee.v1.Fee.toObject(message.fee, options); - if (message.refund_address != null && message.hasOwnProperty("refund_address")) - object.refund_address = message.refund_address; - if (message.relayers && message.relayers.length) { - object.relayers = []; - for (var j = 0; j < message.relayers.length; ++j) - object.relayers[j] = message.relayers[j]; - } - return object; - }; - - /** - * Converts this PacketFee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.PacketFee - * @instance - * @returns {Object.} JSON object - */ - PacketFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketFee; - })(); - - v1.PacketFees = (function() { - - /** - * Properties of a PacketFees. - * @memberof ibc.applications.fee.v1 - * @interface IPacketFees - * @property {Array.|null} [packet_fees] PacketFees packet_fees - */ - - /** - * Constructs a new PacketFees. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a PacketFees. - * @implements IPacketFees - * @constructor - * @param {ibc.applications.fee.v1.IPacketFees=} [properties] Properties to set - */ - function PacketFees(properties) { - this.packet_fees = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketFees packet_fees. - * @member {Array.} packet_fees - * @memberof ibc.applications.fee.v1.PacketFees - * @instance - */ - PacketFees.prototype.packet_fees = $util.emptyArray; - - /** - * Encodes the specified PacketFees message. Does not implicitly {@link ibc.applications.fee.v1.PacketFees.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {ibc.applications.fee.v1.IPacketFees} message PacketFees message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketFees.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_fees != null && message.packet_fees.length) - for (var i = 0; i < message.packet_fees.length; ++i) - $root.ibc.applications.fee.v1.PacketFee.encode(message.packet_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PacketFees message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.PacketFees.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {ibc.applications.fee.v1.IPacketFees} message PacketFees message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketFees.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketFees message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.PacketFees} PacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketFees.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.PacketFees(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.packet_fees && message.packet_fees.length)) - message.packet_fees = []; - message.packet_fees.push($root.ibc.applications.fee.v1.PacketFee.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketFees message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.PacketFees} PacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketFees.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketFees message. - * @function verify - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketFees.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_fees != null && message.hasOwnProperty("packet_fees")) { - if (!Array.isArray(message.packet_fees)) - return "packet_fees: array expected"; - for (var i = 0; i < message.packet_fees.length; ++i) { - var error = $root.ibc.applications.fee.v1.PacketFee.verify(message.packet_fees[i]); - if (error) - return "packet_fees." + error; - } - } - return null; - }; - - /** - * Creates a PacketFees message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.PacketFees} PacketFees - */ - PacketFees.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.PacketFees) - return object; - var message = new $root.ibc.applications.fee.v1.PacketFees(); - if (object.packet_fees) { - if (!Array.isArray(object.packet_fees)) - throw TypeError(".ibc.applications.fee.v1.PacketFees.packet_fees: array expected"); - message.packet_fees = []; - for (var i = 0; i < object.packet_fees.length; ++i) { - if (typeof object.packet_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.PacketFees.packet_fees: object expected"); - message.packet_fees[i] = $root.ibc.applications.fee.v1.PacketFee.fromObject(object.packet_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PacketFees message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {ibc.applications.fee.v1.PacketFees} message PacketFees - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketFees.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.packet_fees = []; - if (message.packet_fees && message.packet_fees.length) { - object.packet_fees = []; - for (var j = 0; j < message.packet_fees.length; ++j) - object.packet_fees[j] = $root.ibc.applications.fee.v1.PacketFee.toObject(message.packet_fees[j], options); - } - return object; - }; - - /** - * Converts this PacketFees to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.PacketFees - * @instance - * @returns {Object.} JSON object - */ - PacketFees.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketFees; - })(); - - v1.IdentifiedPacketFees = (function() { - - /** - * Properties of an IdentifiedPacketFees. - * @memberof ibc.applications.fee.v1 - * @interface IIdentifiedPacketFees - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] IdentifiedPacketFees packet_id - * @property {Array.|null} [packet_fees] IdentifiedPacketFees packet_fees - */ - - /** - * Constructs a new IdentifiedPacketFees. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents an IdentifiedPacketFees. - * @implements IIdentifiedPacketFees - * @constructor - * @param {ibc.applications.fee.v1.IIdentifiedPacketFees=} [properties] Properties to set - */ - function IdentifiedPacketFees(properties) { - this.packet_fees = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedPacketFees packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @instance - */ - IdentifiedPacketFees.prototype.packet_id = null; - - /** - * IdentifiedPacketFees packet_fees. - * @member {Array.} packet_fees - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @instance - */ - IdentifiedPacketFees.prototype.packet_fees = $util.emptyArray; - - /** - * Encodes the specified IdentifiedPacketFees message. Does not implicitly {@link ibc.applications.fee.v1.IdentifiedPacketFees.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {ibc.applications.fee.v1.IIdentifiedPacketFees} message IdentifiedPacketFees message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedPacketFees.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.packet_fees != null && message.packet_fees.length) - for (var i = 0; i < message.packet_fees.length; ++i) - $root.ibc.applications.fee.v1.PacketFee.encode(message.packet_fees[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentifiedPacketFees message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.IdentifiedPacketFees.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {ibc.applications.fee.v1.IIdentifiedPacketFees} message IdentifiedPacketFees message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedPacketFees.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedPacketFees message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.IdentifiedPacketFees} IdentifiedPacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedPacketFees.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.IdentifiedPacketFees(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.packet_fees && message.packet_fees.length)) - message.packet_fees = []; - message.packet_fees.push($root.ibc.applications.fee.v1.PacketFee.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedPacketFees message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.IdentifiedPacketFees} IdentifiedPacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedPacketFees.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedPacketFees message. - * @function verify - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedPacketFees.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - var error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - if (message.packet_fees != null && message.hasOwnProperty("packet_fees")) { - if (!Array.isArray(message.packet_fees)) - return "packet_fees: array expected"; - for (var i = 0; i < message.packet_fees.length; ++i) { - var error = $root.ibc.applications.fee.v1.PacketFee.verify(message.packet_fees[i]); - if (error) - return "packet_fees." + error; - } - } - return null; - }; - - /** - * Creates an IdentifiedPacketFees message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.IdentifiedPacketFees} IdentifiedPacketFees - */ - IdentifiedPacketFees.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.IdentifiedPacketFees) - return object; - var message = new $root.ibc.applications.fee.v1.IdentifiedPacketFees(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.IdentifiedPacketFees.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - if (object.packet_fees) { - if (!Array.isArray(object.packet_fees)) - throw TypeError(".ibc.applications.fee.v1.IdentifiedPacketFees.packet_fees: array expected"); - message.packet_fees = []; - for (var i = 0; i < object.packet_fees.length; ++i) { - if (typeof object.packet_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.IdentifiedPacketFees.packet_fees: object expected"); - message.packet_fees[i] = $root.ibc.applications.fee.v1.PacketFee.fromObject(object.packet_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentifiedPacketFees message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {ibc.applications.fee.v1.IdentifiedPacketFees} message IdentifiedPacketFees - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedPacketFees.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.packet_fees = []; - if (options.defaults) - object.packet_id = null; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - if (message.packet_fees && message.packet_fees.length) { - object.packet_fees = []; - for (var j = 0; j < message.packet_fees.length; ++j) - object.packet_fees[j] = $root.ibc.applications.fee.v1.PacketFee.toObject(message.packet_fees[j], options); - } - return object; - }; - - /** - * Converts this IdentifiedPacketFees to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @instance - * @returns {Object.} JSON object - */ - IdentifiedPacketFees.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedPacketFees; - })(); - - v1.IncentivizedAcknowledgement = (function() { - - /** - * Properties of an IncentivizedAcknowledgement. - * @memberof ibc.applications.fee.v1 - * @interface IIncentivizedAcknowledgement - * @property {Uint8Array|null} [app_acknowledgement] IncentivizedAcknowledgement app_acknowledgement - * @property {string|null} [forward_relayer_address] IncentivizedAcknowledgement forward_relayer_address - * @property {boolean|null} [underlying_app_success] IncentivizedAcknowledgement underlying_app_success - */ - - /** - * Constructs a new IncentivizedAcknowledgement. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents an IncentivizedAcknowledgement. - * @implements IIncentivizedAcknowledgement - * @constructor - * @param {ibc.applications.fee.v1.IIncentivizedAcknowledgement=} [properties] Properties to set - */ - function IncentivizedAcknowledgement(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IncentivizedAcknowledgement app_acknowledgement. - * @member {Uint8Array} app_acknowledgement - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @instance - */ - IncentivizedAcknowledgement.prototype.app_acknowledgement = $util.newBuffer([]); - - /** - * IncentivizedAcknowledgement forward_relayer_address. - * @member {string} forward_relayer_address - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @instance - */ - IncentivizedAcknowledgement.prototype.forward_relayer_address = ""; - - /** - * IncentivizedAcknowledgement underlying_app_success. - * @member {boolean} underlying_app_success - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @instance - */ - IncentivizedAcknowledgement.prototype.underlying_app_success = false; - - /** - * Encodes the specified IncentivizedAcknowledgement message. Does not implicitly {@link ibc.applications.fee.v1.IncentivizedAcknowledgement.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {ibc.applications.fee.v1.IIncentivizedAcknowledgement} message IncentivizedAcknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncentivizedAcknowledgement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app_acknowledgement != null && Object.hasOwnProperty.call(message, "app_acknowledgement")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.app_acknowledgement); - if (message.forward_relayer_address != null && Object.hasOwnProperty.call(message, "forward_relayer_address")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.forward_relayer_address); - if (message.underlying_app_success != null && Object.hasOwnProperty.call(message, "underlying_app_success")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.underlying_app_success); - return writer; - }; - - /** - * Encodes the specified IncentivizedAcknowledgement message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.IncentivizedAcknowledgement.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {ibc.applications.fee.v1.IIncentivizedAcknowledgement} message IncentivizedAcknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncentivizedAcknowledgement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IncentivizedAcknowledgement message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.IncentivizedAcknowledgement} IncentivizedAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncentivizedAcknowledgement.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.IncentivizedAcknowledgement(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.app_acknowledgement = reader.bytes(); - break; - case 2: - message.forward_relayer_address = reader.string(); - break; - case 3: - message.underlying_app_success = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IncentivizedAcknowledgement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.IncentivizedAcknowledgement} IncentivizedAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncentivizedAcknowledgement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IncentivizedAcknowledgement message. - * @function verify - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IncentivizedAcknowledgement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app_acknowledgement != null && message.hasOwnProperty("app_acknowledgement")) - if (!(message.app_acknowledgement && typeof message.app_acknowledgement.length === "number" || $util.isString(message.app_acknowledgement))) - return "app_acknowledgement: buffer expected"; - if (message.forward_relayer_address != null && message.hasOwnProperty("forward_relayer_address")) - if (!$util.isString(message.forward_relayer_address)) - return "forward_relayer_address: string expected"; - if (message.underlying_app_success != null && message.hasOwnProperty("underlying_app_success")) - if (typeof message.underlying_app_success !== "boolean") - return "underlying_app_success: boolean expected"; - return null; - }; - - /** - * Creates an IncentivizedAcknowledgement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.IncentivizedAcknowledgement} IncentivizedAcknowledgement - */ - IncentivizedAcknowledgement.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.IncentivizedAcknowledgement) - return object; - var message = new $root.ibc.applications.fee.v1.IncentivizedAcknowledgement(); - if (object.app_acknowledgement != null) - if (typeof object.app_acknowledgement === "string") - $util.base64.decode(object.app_acknowledgement, message.app_acknowledgement = $util.newBuffer($util.base64.length(object.app_acknowledgement)), 0); - else if (object.app_acknowledgement.length) - message.app_acknowledgement = object.app_acknowledgement; - if (object.forward_relayer_address != null) - message.forward_relayer_address = String(object.forward_relayer_address); - if (object.underlying_app_success != null) - message.underlying_app_success = Boolean(object.underlying_app_success); - return message; - }; - - /** - * Creates a plain object from an IncentivizedAcknowledgement message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {ibc.applications.fee.v1.IncentivizedAcknowledgement} message IncentivizedAcknowledgement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IncentivizedAcknowledgement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.app_acknowledgement = ""; - else { - object.app_acknowledgement = []; - if (options.bytes !== Array) - object.app_acknowledgement = $util.newBuffer(object.app_acknowledgement); - } - object.forward_relayer_address = ""; - object.underlying_app_success = false; - } - if (message.app_acknowledgement != null && message.hasOwnProperty("app_acknowledgement")) - object.app_acknowledgement = options.bytes === String ? $util.base64.encode(message.app_acknowledgement, 0, message.app_acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.app_acknowledgement) : message.app_acknowledgement; - if (message.forward_relayer_address != null && message.hasOwnProperty("forward_relayer_address")) - object.forward_relayer_address = message.forward_relayer_address; - if (message.underlying_app_success != null && message.hasOwnProperty("underlying_app_success")) - object.underlying_app_success = message.underlying_app_success; - return object; - }; - - /** - * Converts this IncentivizedAcknowledgement to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @instance - * @returns {Object.} JSON object - */ - IncentivizedAcknowledgement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IncentivizedAcknowledgement; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#incentivizedPackets}. - * @memberof ibc.applications.fee.v1.Query - * @typedef IncentivizedPacketsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} [response] QueryIncentivizedPacketsResponse - */ - - /** - * Calls IncentivizedPackets. - * @function incentivizedPackets - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest} request QueryIncentivizedPacketsRequest message or plain object - * @param {ibc.applications.fee.v1.Query.IncentivizedPacketsCallback} callback Node-style callback called with the error, if any, and QueryIncentivizedPacketsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.incentivizedPackets = function incentivizedPackets(request, callback) { - return this.rpcCall(incentivizedPackets, $root.ibc.applications.fee.v1.QueryIncentivizedPacketsRequest, $root.ibc.applications.fee.v1.QueryIncentivizedPacketsResponse, request, callback); - }, "name", { value: "IncentivizedPackets" }); - - /** - * Calls IncentivizedPackets. - * @function incentivizedPackets - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest} request QueryIncentivizedPacketsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#incentivizedPacket}. - * @memberof ibc.applications.fee.v1.Query - * @typedef IncentivizedPacketCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} [response] QueryIncentivizedPacketResponse - */ - - /** - * Calls IncentivizedPacket. - * @function incentivizedPacket - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest} request QueryIncentivizedPacketRequest message or plain object - * @param {ibc.applications.fee.v1.Query.IncentivizedPacketCallback} callback Node-style callback called with the error, if any, and QueryIncentivizedPacketResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.incentivizedPacket = function incentivizedPacket(request, callback) { - return this.rpcCall(incentivizedPacket, $root.ibc.applications.fee.v1.QueryIncentivizedPacketRequest, $root.ibc.applications.fee.v1.QueryIncentivizedPacketResponse, request, callback); - }, "name", { value: "IncentivizedPacket" }); - - /** - * Calls IncentivizedPacket. - * @function incentivizedPacket - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest} request QueryIncentivizedPacketRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#incentivizedPacketsForChannel}. - * @memberof ibc.applications.fee.v1.Query - * @typedef IncentivizedPacketsForChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} [response] QueryIncentivizedPacketsForChannelResponse - */ - - /** - * Calls IncentivizedPacketsForChannel. - * @function incentivizedPacketsForChannel - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest} request QueryIncentivizedPacketsForChannelRequest message or plain object - * @param {ibc.applications.fee.v1.Query.IncentivizedPacketsForChannelCallback} callback Node-style callback called with the error, if any, and QueryIncentivizedPacketsForChannelResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.incentivizedPacketsForChannel = function incentivizedPacketsForChannel(request, callback) { - return this.rpcCall(incentivizedPacketsForChannel, $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest, $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse, request, callback); - }, "name", { value: "IncentivizedPacketsForChannel" }); - - /** - * Calls IncentivizedPacketsForChannel. - * @function incentivizedPacketsForChannel - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest} request QueryIncentivizedPacketsForChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#totalRecvFees}. - * @memberof ibc.applications.fee.v1.Query - * @typedef TotalRecvFeesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} [response] QueryTotalRecvFeesResponse - */ - - /** - * Calls TotalRecvFees. - * @function totalRecvFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest} request QueryTotalRecvFeesRequest message or plain object - * @param {ibc.applications.fee.v1.Query.TotalRecvFeesCallback} callback Node-style callback called with the error, if any, and QueryTotalRecvFeesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.totalRecvFees = function totalRecvFees(request, callback) { - return this.rpcCall(totalRecvFees, $root.ibc.applications.fee.v1.QueryTotalRecvFeesRequest, $root.ibc.applications.fee.v1.QueryTotalRecvFeesResponse, request, callback); - }, "name", { value: "TotalRecvFees" }); - - /** - * Calls TotalRecvFees. - * @function totalRecvFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest} request QueryTotalRecvFeesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#totalAckFees}. - * @memberof ibc.applications.fee.v1.Query - * @typedef TotalAckFeesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryTotalAckFeesResponse} [response] QueryTotalAckFeesResponse - */ - - /** - * Calls TotalAckFees. - * @function totalAckFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest} request QueryTotalAckFeesRequest message or plain object - * @param {ibc.applications.fee.v1.Query.TotalAckFeesCallback} callback Node-style callback called with the error, if any, and QueryTotalAckFeesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.totalAckFees = function totalAckFees(request, callback) { - return this.rpcCall(totalAckFees, $root.ibc.applications.fee.v1.QueryTotalAckFeesRequest, $root.ibc.applications.fee.v1.QueryTotalAckFeesResponse, request, callback); - }, "name", { value: "TotalAckFees" }); - - /** - * Calls TotalAckFees. - * @function totalAckFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest} request QueryTotalAckFeesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#totalTimeoutFees}. - * @memberof ibc.applications.fee.v1.Query - * @typedef TotalTimeoutFeesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} [response] QueryTotalTimeoutFeesResponse - */ - - /** - * Calls TotalTimeoutFees. - * @function totalTimeoutFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest} request QueryTotalTimeoutFeesRequest message or plain object - * @param {ibc.applications.fee.v1.Query.TotalTimeoutFeesCallback} callback Node-style callback called with the error, if any, and QueryTotalTimeoutFeesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.totalTimeoutFees = function totalTimeoutFees(request, callback) { - return this.rpcCall(totalTimeoutFees, $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest, $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse, request, callback); - }, "name", { value: "TotalTimeoutFees" }); - - /** - * Calls TotalTimeoutFees. - * @function totalTimeoutFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest} request QueryTotalTimeoutFeesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#payee}. - * @memberof ibc.applications.fee.v1.Query - * @typedef PayeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryPayeeResponse} [response] QueryPayeeResponse - */ - - /** - * Calls Payee. - * @function payee - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryPayeeRequest} request QueryPayeeRequest message or plain object - * @param {ibc.applications.fee.v1.Query.PayeeCallback} callback Node-style callback called with the error, if any, and QueryPayeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.payee = function payee(request, callback) { - return this.rpcCall(payee, $root.ibc.applications.fee.v1.QueryPayeeRequest, $root.ibc.applications.fee.v1.QueryPayeeResponse, request, callback); - }, "name", { value: "Payee" }); - - /** - * Calls Payee. - * @function payee - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryPayeeRequest} request QueryPayeeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#counterpartyPayee}. - * @memberof ibc.applications.fee.v1.Query - * @typedef CounterpartyPayeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} [response] QueryCounterpartyPayeeResponse - */ - - /** - * Calls CounterpartyPayee. - * @function counterpartyPayee - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest} request QueryCounterpartyPayeeRequest message or plain object - * @param {ibc.applications.fee.v1.Query.CounterpartyPayeeCallback} callback Node-style callback called with the error, if any, and QueryCounterpartyPayeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.counterpartyPayee = function counterpartyPayee(request, callback) { - return this.rpcCall(counterpartyPayee, $root.ibc.applications.fee.v1.QueryCounterpartyPayeeRequest, $root.ibc.applications.fee.v1.QueryCounterpartyPayeeResponse, request, callback); - }, "name", { value: "CounterpartyPayee" }); - - /** - * Calls CounterpartyPayee. - * @function counterpartyPayee - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest} request QueryCounterpartyPayeeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#feeEnabledChannels}. - * @memberof ibc.applications.fee.v1.Query - * @typedef FeeEnabledChannelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} [response] QueryFeeEnabledChannelsResponse - */ - - /** - * Calls FeeEnabledChannels. - * @function feeEnabledChannels - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest} request QueryFeeEnabledChannelsRequest message or plain object - * @param {ibc.applications.fee.v1.Query.FeeEnabledChannelsCallback} callback Node-style callback called with the error, if any, and QueryFeeEnabledChannelsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.feeEnabledChannels = function feeEnabledChannels(request, callback) { - return this.rpcCall(feeEnabledChannels, $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest, $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse, request, callback); - }, "name", { value: "FeeEnabledChannels" }); - - /** - * Calls FeeEnabledChannels. - * @function feeEnabledChannels - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest} request QueryFeeEnabledChannelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#feeEnabledChannel}. - * @memberof ibc.applications.fee.v1.Query - * @typedef FeeEnabledChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} [response] QueryFeeEnabledChannelResponse - */ - - /** - * Calls FeeEnabledChannel. - * @function feeEnabledChannel - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest} request QueryFeeEnabledChannelRequest message or plain object - * @param {ibc.applications.fee.v1.Query.FeeEnabledChannelCallback} callback Node-style callback called with the error, if any, and QueryFeeEnabledChannelResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.feeEnabledChannel = function feeEnabledChannel(request, callback) { - return this.rpcCall(feeEnabledChannel, $root.ibc.applications.fee.v1.QueryFeeEnabledChannelRequest, $root.ibc.applications.fee.v1.QueryFeeEnabledChannelResponse, request, callback); - }, "name", { value: "FeeEnabledChannel" }); - - /** - * Calls FeeEnabledChannel. - * @function feeEnabledChannel - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest} request QueryFeeEnabledChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryIncentivizedPacketsRequest = (function() { - - /** - * Properties of a QueryIncentivizedPacketsRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketsRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryIncentivizedPacketsRequest pagination - * @property {Long|null} [query_height] QueryIncentivizedPacketsRequest query_height - */ - - /** - * Constructs a new QueryIncentivizedPacketsRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketsRequest. - * @implements IQueryIncentivizedPacketsRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest=} [properties] Properties to set - */ - function QueryIncentivizedPacketsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @instance - */ - QueryIncentivizedPacketsRequest.prototype.pagination = null; - - /** - * QueryIncentivizedPacketsRequest query_height. - * @member {Long} query_height - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @instance - */ - QueryIncentivizedPacketsRequest.prototype.query_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryIncentivizedPacketsRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest} message QueryIncentivizedPacketsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query_height != null && Object.hasOwnProperty.call(message, "query_height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.query_height); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketsRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest} message QueryIncentivizedPacketsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsRequest} QueryIncentivizedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - case 2: - message.query_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsRequest} QueryIncentivizedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketsRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (!$util.isInteger(message.query_height) && !(message.query_height && $util.isInteger(message.query_height.low) && $util.isInteger(message.query_height.high))) - return "query_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryIncentivizedPacketsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsRequest} QueryIncentivizedPacketsRequest - */ - QueryIncentivizedPacketsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketsRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - if (object.query_height != null) - if ($util.Long) - (message.query_height = $util.Long.fromValue(object.query_height)).unsigned = true; - else if (typeof object.query_height === "string") - message.query_height = parseInt(object.query_height, 10); - else if (typeof object.query_height === "number") - message.query_height = object.query_height; - else if (typeof object.query_height === "object") - message.query_height = new $util.LongBits(object.query_height.low >>> 0, object.query_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsRequest} message QueryIncentivizedPacketsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pagination = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_height = options.longs === String ? "0" : 0; - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (typeof message.query_height === "number") - object.query_height = options.longs === String ? String(message.query_height) : message.query_height; - else - object.query_height = options.longs === String ? $util.Long.prototype.toString.call(message.query_height) : options.longs === Number ? new $util.LongBits(message.query_height.low >>> 0, message.query_height.high >>> 0).toNumber(true) : message.query_height; - return object; - }; - - /** - * Converts this QueryIncentivizedPacketsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketsRequest; - })(); - - v1.QueryIncentivizedPacketsResponse = (function() { - - /** - * Properties of a QueryIncentivizedPacketsResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketsResponse - * @property {Array.|null} [incentivized_packets] QueryIncentivizedPacketsResponse incentivized_packets - */ - - /** - * Constructs a new QueryIncentivizedPacketsResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketsResponse. - * @implements IQueryIncentivizedPacketsResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsResponse=} [properties] Properties to set - */ - function QueryIncentivizedPacketsResponse(properties) { - this.incentivized_packets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketsResponse incentivized_packets. - * @member {Array.} incentivized_packets - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @instance - */ - QueryIncentivizedPacketsResponse.prototype.incentivized_packets = $util.emptyArray; - - /** - * Encodes the specified QueryIncentivizedPacketsResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsResponse} message QueryIncentivizedPacketsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.incentivized_packets != null && message.incentivized_packets.length) - for (var i = 0; i < message.incentivized_packets.length; ++i) - $root.ibc.applications.fee.v1.IdentifiedPacketFees.encode(message.incentivized_packets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketsResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsResponse} message QueryIncentivizedPacketsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} QueryIncentivizedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.incentivized_packets && message.incentivized_packets.length)) - message.incentivized_packets = []; - message.incentivized_packets.push($root.ibc.applications.fee.v1.IdentifiedPacketFees.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} QueryIncentivizedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketsResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.incentivized_packets != null && message.hasOwnProperty("incentivized_packets")) { - if (!Array.isArray(message.incentivized_packets)) - return "incentivized_packets: array expected"; - for (var i = 0; i < message.incentivized_packets.length; ++i) { - var error = $root.ibc.applications.fee.v1.IdentifiedPacketFees.verify(message.incentivized_packets[i]); - if (error) - return "incentivized_packets." + error; - } - } - return null; - }; - - /** - * Creates a QueryIncentivizedPacketsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} QueryIncentivizedPacketsResponse - */ - QueryIncentivizedPacketsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketsResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsResponse(); - if (object.incentivized_packets) { - if (!Array.isArray(object.incentivized_packets)) - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.incentivized_packets: array expected"); - message.incentivized_packets = []; - for (var i = 0; i < object.incentivized_packets.length; ++i) { - if (typeof object.incentivized_packets[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.incentivized_packets: object expected"); - message.incentivized_packets[i] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.fromObject(object.incentivized_packets[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} message QueryIncentivizedPacketsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.incentivized_packets = []; - if (message.incentivized_packets && message.incentivized_packets.length) { - object.incentivized_packets = []; - for (var j = 0; j < message.incentivized_packets.length; ++j) - object.incentivized_packets[j] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.toObject(message.incentivized_packets[j], options); - } - return object; - }; - - /** - * Converts this QueryIncentivizedPacketsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketsResponse; - })(); - - v1.QueryIncentivizedPacketRequest = (function() { - - /** - * Properties of a QueryIncentivizedPacketRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketRequest - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] QueryIncentivizedPacketRequest packet_id - * @property {Long|null} [query_height] QueryIncentivizedPacketRequest query_height - */ - - /** - * Constructs a new QueryIncentivizedPacketRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketRequest. - * @implements IQueryIncentivizedPacketRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest=} [properties] Properties to set - */ - function QueryIncentivizedPacketRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketRequest packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @instance - */ - QueryIncentivizedPacketRequest.prototype.packet_id = null; - - /** - * QueryIncentivizedPacketRequest query_height. - * @member {Long} query_height - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @instance - */ - QueryIncentivizedPacketRequest.prototype.query_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryIncentivizedPacketRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest} message QueryIncentivizedPacketRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query_height != null && Object.hasOwnProperty.call(message, "query_height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.query_height); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest} message QueryIncentivizedPacketRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketRequest} QueryIncentivizedPacketRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - case 2: - message.query_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketRequest} QueryIncentivizedPacketRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - var error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (!$util.isInteger(message.query_height) && !(message.query_height && $util.isInteger(message.query_height.low) && $util.isInteger(message.query_height.high))) - return "query_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryIncentivizedPacketRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketRequest} QueryIncentivizedPacketRequest - */ - QueryIncentivizedPacketRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketRequest(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketRequest.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - if (object.query_height != null) - if ($util.Long) - (message.query_height = $util.Long.fromValue(object.query_height)).unsigned = true; - else if (typeof object.query_height === "string") - message.query_height = parseInt(object.query_height, 10); - else if (typeof object.query_height === "number") - message.query_height = object.query_height; - else if (typeof object.query_height === "object") - message.query_height = new $util.LongBits(object.query_height.low >>> 0, object.query_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketRequest} message QueryIncentivizedPacketRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.packet_id = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_height = options.longs === String ? "0" : 0; - } - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (typeof message.query_height === "number") - object.query_height = options.longs === String ? String(message.query_height) : message.query_height; - else - object.query_height = options.longs === String ? $util.Long.prototype.toString.call(message.query_height) : options.longs === Number ? new $util.LongBits(message.query_height.low >>> 0, message.query_height.high >>> 0).toNumber(true) : message.query_height; - return object; - }; - - /** - * Converts this QueryIncentivizedPacketRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketRequest; - })(); - - v1.QueryIncentivizedPacketResponse = (function() { - - /** - * Properties of a QueryIncentivizedPacketResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketResponse - * @property {ibc.applications.fee.v1.IIdentifiedPacketFees|null} [incentivized_packet] QueryIncentivizedPacketResponse incentivized_packet - */ - - /** - * Constructs a new QueryIncentivizedPacketResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketResponse. - * @implements IQueryIncentivizedPacketResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketResponse=} [properties] Properties to set - */ - function QueryIncentivizedPacketResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketResponse incentivized_packet. - * @member {ibc.applications.fee.v1.IIdentifiedPacketFees|null|undefined} incentivized_packet - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @instance - */ - QueryIncentivizedPacketResponse.prototype.incentivized_packet = null; - - /** - * Encodes the specified QueryIncentivizedPacketResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketResponse} message QueryIncentivizedPacketResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.incentivized_packet != null && Object.hasOwnProperty.call(message, "incentivized_packet")) - $root.ibc.applications.fee.v1.IdentifiedPacketFees.encode(message.incentivized_packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketResponse} message QueryIncentivizedPacketResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} QueryIncentivizedPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.incentivized_packet = $root.ibc.applications.fee.v1.IdentifiedPacketFees.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} QueryIncentivizedPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.incentivized_packet != null && message.hasOwnProperty("incentivized_packet")) { - var error = $root.ibc.applications.fee.v1.IdentifiedPacketFees.verify(message.incentivized_packet); - if (error) - return "incentivized_packet." + error; - } - return null; - }; - - /** - * Creates a QueryIncentivizedPacketResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} QueryIncentivizedPacketResponse - */ - QueryIncentivizedPacketResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketResponse(); - if (object.incentivized_packet != null) { - if (typeof object.incentivized_packet !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketResponse.incentivized_packet: object expected"); - message.incentivized_packet = $root.ibc.applications.fee.v1.IdentifiedPacketFees.fromObject(object.incentivized_packet); - } - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} message QueryIncentivizedPacketResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.incentivized_packet = null; - if (message.incentivized_packet != null && message.hasOwnProperty("incentivized_packet")) - object.incentivized_packet = $root.ibc.applications.fee.v1.IdentifiedPacketFees.toObject(message.incentivized_packet, options); - return object; - }; - - /** - * Converts this QueryIncentivizedPacketResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketResponse; - })(); - - v1.QueryIncentivizedPacketsForChannelRequest = (function() { - - /** - * Properties of a QueryIncentivizedPacketsForChannelRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketsForChannelRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryIncentivizedPacketsForChannelRequest pagination - * @property {string|null} [port_id] QueryIncentivizedPacketsForChannelRequest port_id - * @property {string|null} [channel_id] QueryIncentivizedPacketsForChannelRequest channel_id - * @property {Long|null} [query_height] QueryIncentivizedPacketsForChannelRequest query_height - */ - - /** - * Constructs a new QueryIncentivizedPacketsForChannelRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketsForChannelRequest. - * @implements IQueryIncentivizedPacketsForChannelRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest=} [properties] Properties to set - */ - function QueryIncentivizedPacketsForChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketsForChannelRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - */ - QueryIncentivizedPacketsForChannelRequest.prototype.pagination = null; - - /** - * QueryIncentivizedPacketsForChannelRequest port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - */ - QueryIncentivizedPacketsForChannelRequest.prototype.port_id = ""; - - /** - * QueryIncentivizedPacketsForChannelRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - */ - QueryIncentivizedPacketsForChannelRequest.prototype.channel_id = ""; - - /** - * QueryIncentivizedPacketsForChannelRequest query_height. - * @member {Long} query_height - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - */ - QueryIncentivizedPacketsForChannelRequest.prototype.query_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest} message QueryIncentivizedPacketsForChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsForChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.channel_id); - if (message.query_height != null && Object.hasOwnProperty.call(message, "query_height")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.query_height); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest} message QueryIncentivizedPacketsForChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsForChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketsForChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest} QueryIncentivizedPacketsForChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsForChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - case 2: - message.port_id = reader.string(); - break; - case 3: - message.channel_id = reader.string(); - break; - case 4: - message.query_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketsForChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest} QueryIncentivizedPacketsForChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsForChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketsForChannelRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketsForChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (!$util.isInteger(message.query_height) && !(message.query_height && $util.isInteger(message.query_height.low) && $util.isInteger(message.query_height.high))) - return "query_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryIncentivizedPacketsForChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest} QueryIncentivizedPacketsForChannelRequest - */ - QueryIncentivizedPacketsForChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.query_height != null) - if ($util.Long) - (message.query_height = $util.Long.fromValue(object.query_height)).unsigned = true; - else if (typeof object.query_height === "string") - message.query_height = parseInt(object.query_height, 10); - else if (typeof object.query_height === "number") - message.query_height = object.query_height; - else if (typeof object.query_height === "object") - message.query_height = new $util.LongBits(object.query_height.low >>> 0, object.query_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketsForChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest} message QueryIncentivizedPacketsForChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketsForChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pagination = null; - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_height = options.longs === String ? "0" : 0; - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (typeof message.query_height === "number") - object.query_height = options.longs === String ? String(message.query_height) : message.query_height; - else - object.query_height = options.longs === String ? $util.Long.prototype.toString.call(message.query_height) : options.longs === Number ? new $util.LongBits(message.query_height.low >>> 0, message.query_height.high >>> 0).toNumber(true) : message.query_height; - return object; - }; - - /** - * Converts this QueryIncentivizedPacketsForChannelRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketsForChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketsForChannelRequest; - })(); - - v1.QueryIncentivizedPacketsForChannelResponse = (function() { - - /** - * Properties of a QueryIncentivizedPacketsForChannelResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketsForChannelResponse - * @property {Array.|null} [incentivized_packets] QueryIncentivizedPacketsForChannelResponse incentivized_packets - */ - - /** - * Constructs a new QueryIncentivizedPacketsForChannelResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketsForChannelResponse. - * @implements IQueryIncentivizedPacketsForChannelResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelResponse=} [properties] Properties to set - */ - function QueryIncentivizedPacketsForChannelResponse(properties) { - this.incentivized_packets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketsForChannelResponse incentivized_packets. - * @member {Array.} incentivized_packets - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @instance - */ - QueryIncentivizedPacketsForChannelResponse.prototype.incentivized_packets = $util.emptyArray; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelResponse} message QueryIncentivizedPacketsForChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsForChannelResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.incentivized_packets != null && message.incentivized_packets.length) - for (var i = 0; i < message.incentivized_packets.length; ++i) - $root.ibc.applications.fee.v1.IdentifiedPacketFees.encode(message.incentivized_packets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelResponse} message QueryIncentivizedPacketsForChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsForChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketsForChannelResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} QueryIncentivizedPacketsForChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsForChannelResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.incentivized_packets && message.incentivized_packets.length)) - message.incentivized_packets = []; - message.incentivized_packets.push($root.ibc.applications.fee.v1.IdentifiedPacketFees.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketsForChannelResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} QueryIncentivizedPacketsForChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsForChannelResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketsForChannelResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketsForChannelResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.incentivized_packets != null && message.hasOwnProperty("incentivized_packets")) { - if (!Array.isArray(message.incentivized_packets)) - return "incentivized_packets: array expected"; - for (var i = 0; i < message.incentivized_packets.length; ++i) { - var error = $root.ibc.applications.fee.v1.IdentifiedPacketFees.verify(message.incentivized_packets[i]); - if (error) - return "incentivized_packets." + error; - } - } - return null; - }; - - /** - * Creates a QueryIncentivizedPacketsForChannelResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} QueryIncentivizedPacketsForChannelResponse - */ - QueryIncentivizedPacketsForChannelResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse(); - if (object.incentivized_packets) { - if (!Array.isArray(object.incentivized_packets)) - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.incentivized_packets: array expected"); - message.incentivized_packets = []; - for (var i = 0; i < object.incentivized_packets.length; ++i) { - if (typeof object.incentivized_packets[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.incentivized_packets: object expected"); - message.incentivized_packets[i] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.fromObject(object.incentivized_packets[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketsForChannelResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} message QueryIncentivizedPacketsForChannelResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketsForChannelResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.incentivized_packets = []; - if (message.incentivized_packets && message.incentivized_packets.length) { - object.incentivized_packets = []; - for (var j = 0; j < message.incentivized_packets.length; ++j) - object.incentivized_packets[j] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.toObject(message.incentivized_packets[j], options); - } - return object; - }; - - /** - * Converts this QueryIncentivizedPacketsForChannelResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketsForChannelResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketsForChannelResponse; - })(); - - v1.QueryTotalRecvFeesRequest = (function() { - - /** - * Properties of a QueryTotalRecvFeesRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalRecvFeesRequest - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] QueryTotalRecvFeesRequest packet_id - */ - - /** - * Constructs a new QueryTotalRecvFeesRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalRecvFeesRequest. - * @implements IQueryTotalRecvFeesRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest=} [properties] Properties to set - */ - function QueryTotalRecvFeesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalRecvFeesRequest packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @instance - */ - QueryTotalRecvFeesRequest.prototype.packet_id = null; - - /** - * Encodes the specified QueryTotalRecvFeesRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest} message QueryTotalRecvFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalRecvFeesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalRecvFeesRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest} message QueryTotalRecvFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalRecvFeesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalRecvFeesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesRequest} QueryTotalRecvFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalRecvFeesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalRecvFeesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalRecvFeesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesRequest} QueryTotalRecvFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalRecvFeesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalRecvFeesRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalRecvFeesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - var error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - return null; - }; - - /** - * Creates a QueryTotalRecvFeesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesRequest} QueryTotalRecvFeesRequest - */ - QueryTotalRecvFeesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalRecvFeesRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryTotalRecvFeesRequest(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalRecvFeesRequest.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalRecvFeesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {ibc.applications.fee.v1.QueryTotalRecvFeesRequest} message QueryTotalRecvFeesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalRecvFeesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.packet_id = null; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - return object; - }; - - /** - * Converts this QueryTotalRecvFeesRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryTotalRecvFeesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalRecvFeesRequest; - })(); - - v1.QueryTotalRecvFeesResponse = (function() { - - /** - * Properties of a QueryTotalRecvFeesResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalRecvFeesResponse - * @property {Array.|null} [recv_fees] QueryTotalRecvFeesResponse recv_fees - */ - - /** - * Constructs a new QueryTotalRecvFeesResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalRecvFeesResponse. - * @implements IQueryTotalRecvFeesResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesResponse=} [properties] Properties to set - */ - function QueryTotalRecvFeesResponse(properties) { - this.recv_fees = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalRecvFeesResponse recv_fees. - * @member {Array.} recv_fees - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @instance - */ - QueryTotalRecvFeesResponse.prototype.recv_fees = $util.emptyArray; - - /** - * Encodes the specified QueryTotalRecvFeesResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesResponse} message QueryTotalRecvFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalRecvFeesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recv_fees != null && message.recv_fees.length) - for (var i = 0; i < message.recv_fees.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.recv_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalRecvFeesResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesResponse} message QueryTotalRecvFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalRecvFeesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalRecvFeesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} QueryTotalRecvFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalRecvFeesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalRecvFeesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.recv_fees && message.recv_fees.length)) - message.recv_fees = []; - message.recv_fees.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalRecvFeesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} QueryTotalRecvFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalRecvFeesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalRecvFeesResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalRecvFeesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recv_fees != null && message.hasOwnProperty("recv_fees")) { - if (!Array.isArray(message.recv_fees)) - return "recv_fees: array expected"; - for (var i = 0; i < message.recv_fees.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.recv_fees[i]); - if (error) - return "recv_fees." + error; - } - } - return null; - }; - - /** - * Creates a QueryTotalRecvFeesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} QueryTotalRecvFeesResponse - */ - QueryTotalRecvFeesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalRecvFeesResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryTotalRecvFeesResponse(); - if (object.recv_fees) { - if (!Array.isArray(object.recv_fees)) - throw TypeError(".ibc.applications.fee.v1.QueryTotalRecvFeesResponse.recv_fees: array expected"); - message.recv_fees = []; - for (var i = 0; i < object.recv_fees.length; ++i) { - if (typeof object.recv_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalRecvFeesResponse.recv_fees: object expected"); - message.recv_fees[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.recv_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalRecvFeesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} message QueryTotalRecvFeesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalRecvFeesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.recv_fees = []; - if (message.recv_fees && message.recv_fees.length) { - object.recv_fees = []; - for (var j = 0; j < message.recv_fees.length; ++j) - object.recv_fees[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.recv_fees[j], options); - } - return object; - }; - - /** - * Converts this QueryTotalRecvFeesResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryTotalRecvFeesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalRecvFeesResponse; - })(); - - v1.QueryTotalAckFeesRequest = (function() { - - /** - * Properties of a QueryTotalAckFeesRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalAckFeesRequest - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] QueryTotalAckFeesRequest packet_id - */ - - /** - * Constructs a new QueryTotalAckFeesRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalAckFeesRequest. - * @implements IQueryTotalAckFeesRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest=} [properties] Properties to set - */ - function QueryTotalAckFeesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalAckFeesRequest packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @instance - */ - QueryTotalAckFeesRequest.prototype.packet_id = null; - - /** - * Encodes the specified QueryTotalAckFeesRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest} message QueryTotalAckFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalAckFeesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalAckFeesRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest} message QueryTotalAckFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalAckFeesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalAckFeesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesRequest} QueryTotalAckFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalAckFeesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalAckFeesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalAckFeesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesRequest} QueryTotalAckFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalAckFeesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalAckFeesRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalAckFeesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - var error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - return null; - }; - - /** - * Creates a QueryTotalAckFeesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesRequest} QueryTotalAckFeesRequest - */ - QueryTotalAckFeesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalAckFeesRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryTotalAckFeesRequest(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalAckFeesRequest.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalAckFeesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {ibc.applications.fee.v1.QueryTotalAckFeesRequest} message QueryTotalAckFeesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalAckFeesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.packet_id = null; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - return object; - }; - - /** - * Converts this QueryTotalAckFeesRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryTotalAckFeesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalAckFeesRequest; - })(); - - v1.QueryTotalAckFeesResponse = (function() { - - /** - * Properties of a QueryTotalAckFeesResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalAckFeesResponse - * @property {Array.|null} [ack_fees] QueryTotalAckFeesResponse ack_fees - */ - - /** - * Constructs a new QueryTotalAckFeesResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalAckFeesResponse. - * @implements IQueryTotalAckFeesResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesResponse=} [properties] Properties to set - */ - function QueryTotalAckFeesResponse(properties) { - this.ack_fees = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalAckFeesResponse ack_fees. - * @member {Array.} ack_fees - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @instance - */ - QueryTotalAckFeesResponse.prototype.ack_fees = $util.emptyArray; - - /** - * Encodes the specified QueryTotalAckFeesResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesResponse} message QueryTotalAckFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalAckFeesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ack_fees != null && message.ack_fees.length) - for (var i = 0; i < message.ack_fees.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.ack_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalAckFeesResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesResponse} message QueryTotalAckFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalAckFeesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalAckFeesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesResponse} QueryTotalAckFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalAckFeesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalAckFeesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ack_fees && message.ack_fees.length)) - message.ack_fees = []; - message.ack_fees.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalAckFeesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesResponse} QueryTotalAckFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalAckFeesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalAckFeesResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalAckFeesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ack_fees != null && message.hasOwnProperty("ack_fees")) { - if (!Array.isArray(message.ack_fees)) - return "ack_fees: array expected"; - for (var i = 0; i < message.ack_fees.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.ack_fees[i]); - if (error) - return "ack_fees." + error; - } - } - return null; - }; - - /** - * Creates a QueryTotalAckFeesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesResponse} QueryTotalAckFeesResponse - */ - QueryTotalAckFeesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalAckFeesResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryTotalAckFeesResponse(); - if (object.ack_fees) { - if (!Array.isArray(object.ack_fees)) - throw TypeError(".ibc.applications.fee.v1.QueryTotalAckFeesResponse.ack_fees: array expected"); - message.ack_fees = []; - for (var i = 0; i < object.ack_fees.length; ++i) { - if (typeof object.ack_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalAckFeesResponse.ack_fees: object expected"); - message.ack_fees[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.ack_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalAckFeesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {ibc.applications.fee.v1.QueryTotalAckFeesResponse} message QueryTotalAckFeesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalAckFeesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ack_fees = []; - if (message.ack_fees && message.ack_fees.length) { - object.ack_fees = []; - for (var j = 0; j < message.ack_fees.length; ++j) - object.ack_fees[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.ack_fees[j], options); - } - return object; - }; - - /** - * Converts this QueryTotalAckFeesResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryTotalAckFeesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalAckFeesResponse; - })(); - - v1.QueryTotalTimeoutFeesRequest = (function() { - - /** - * Properties of a QueryTotalTimeoutFeesRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalTimeoutFeesRequest - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] QueryTotalTimeoutFeesRequest packet_id - */ - - /** - * Constructs a new QueryTotalTimeoutFeesRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalTimeoutFeesRequest. - * @implements IQueryTotalTimeoutFeesRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest=} [properties] Properties to set - */ - function QueryTotalTimeoutFeesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalTimeoutFeesRequest packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @instance - */ - QueryTotalTimeoutFeesRequest.prototype.packet_id = null; - - /** - * Encodes the specified QueryTotalTimeoutFeesRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest} message QueryTotalTimeoutFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalTimeoutFeesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalTimeoutFeesRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest} message QueryTotalTimeoutFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalTimeoutFeesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalTimeoutFeesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest} QueryTotalTimeoutFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalTimeoutFeesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalTimeoutFeesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest} QueryTotalTimeoutFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalTimeoutFeesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalTimeoutFeesRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalTimeoutFeesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - var error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - return null; - }; - - /** - * Creates a QueryTotalTimeoutFeesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest} QueryTotalTimeoutFeesRequest - */ - QueryTotalTimeoutFeesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalTimeoutFeesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest} message QueryTotalTimeoutFeesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalTimeoutFeesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.packet_id = null; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - return object; - }; - - /** - * Converts this QueryTotalTimeoutFeesRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryTotalTimeoutFeesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalTimeoutFeesRequest; - })(); - - v1.QueryTotalTimeoutFeesResponse = (function() { - - /** - * Properties of a QueryTotalTimeoutFeesResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalTimeoutFeesResponse - * @property {Array.|null} [timeout_fees] QueryTotalTimeoutFeesResponse timeout_fees - */ - - /** - * Constructs a new QueryTotalTimeoutFeesResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalTimeoutFeesResponse. - * @implements IQueryTotalTimeoutFeesResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesResponse=} [properties] Properties to set - */ - function QueryTotalTimeoutFeesResponse(properties) { - this.timeout_fees = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalTimeoutFeesResponse timeout_fees. - * @member {Array.} timeout_fees - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @instance - */ - QueryTotalTimeoutFeesResponse.prototype.timeout_fees = $util.emptyArray; - - /** - * Encodes the specified QueryTotalTimeoutFeesResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesResponse} message QueryTotalTimeoutFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalTimeoutFeesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timeout_fees != null && message.timeout_fees.length) - for (var i = 0; i < message.timeout_fees.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.timeout_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalTimeoutFeesResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesResponse} message QueryTotalTimeoutFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalTimeoutFeesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalTimeoutFeesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} QueryTotalTimeoutFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalTimeoutFeesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.timeout_fees && message.timeout_fees.length)) - message.timeout_fees = []; - message.timeout_fees.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalTimeoutFeesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} QueryTotalTimeoutFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalTimeoutFeesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalTimeoutFeesResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalTimeoutFeesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timeout_fees != null && message.hasOwnProperty("timeout_fees")) { - if (!Array.isArray(message.timeout_fees)) - return "timeout_fees: array expected"; - for (var i = 0; i < message.timeout_fees.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.timeout_fees[i]); - if (error) - return "timeout_fees." + error; - } - } - return null; - }; - - /** - * Creates a QueryTotalTimeoutFeesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} QueryTotalTimeoutFeesResponse - */ - QueryTotalTimeoutFeesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse(); - if (object.timeout_fees) { - if (!Array.isArray(object.timeout_fees)) - throw TypeError(".ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.timeout_fees: array expected"); - message.timeout_fees = []; - for (var i = 0; i < object.timeout_fees.length; ++i) { - if (typeof object.timeout_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.timeout_fees: object expected"); - message.timeout_fees[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.timeout_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalTimeoutFeesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} message QueryTotalTimeoutFeesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalTimeoutFeesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.timeout_fees = []; - if (message.timeout_fees && message.timeout_fees.length) { - object.timeout_fees = []; - for (var j = 0; j < message.timeout_fees.length; ++j) - object.timeout_fees[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.timeout_fees[j], options); - } - return object; - }; - - /** - * Converts this QueryTotalTimeoutFeesResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryTotalTimeoutFeesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalTimeoutFeesResponse; - })(); - - v1.QueryPayeeRequest = (function() { - - /** - * Properties of a QueryPayeeRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryPayeeRequest - * @property {string|null} [channel_id] QueryPayeeRequest channel_id - * @property {string|null} [relayer] QueryPayeeRequest relayer - */ - - /** - * Constructs a new QueryPayeeRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryPayeeRequest. - * @implements IQueryPayeeRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryPayeeRequest=} [properties] Properties to set - */ - function QueryPayeeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPayeeRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @instance - */ - QueryPayeeRequest.prototype.channel_id = ""; - - /** - * QueryPayeeRequest relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @instance - */ - QueryPayeeRequest.prototype.relayer = ""; - - /** - * Encodes the specified QueryPayeeRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {ibc.applications.fee.v1.IQueryPayeeRequest} message QueryPayeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPayeeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relayer); - return writer; - }; - - /** - * Encodes the specified QueryPayeeRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {ibc.applications.fee.v1.IQueryPayeeRequest} message QueryPayeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPayeeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPayeeRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryPayeeRequest} QueryPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPayeeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryPayeeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.relayer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPayeeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryPayeeRequest} QueryPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPayeeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPayeeRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPayeeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - return null; - }; - - /** - * Creates a QueryPayeeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryPayeeRequest} QueryPayeeRequest - */ - QueryPayeeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryPayeeRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryPayeeRequest(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - return message; - }; - - /** - * Creates a plain object from a QueryPayeeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {ibc.applications.fee.v1.QueryPayeeRequest} message QueryPayeeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPayeeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.channel_id = ""; - object.relayer = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - return object; - }; - - /** - * Converts this QueryPayeeRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPayeeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPayeeRequest; - })(); - - v1.QueryPayeeResponse = (function() { - - /** - * Properties of a QueryPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryPayeeResponse - * @property {string|null} [payee_address] QueryPayeeResponse payee_address - */ - - /** - * Constructs a new QueryPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryPayeeResponse. - * @implements IQueryPayeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryPayeeResponse=} [properties] Properties to set - */ - function QueryPayeeResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPayeeResponse payee_address. - * @member {string} payee_address - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @instance - */ - QueryPayeeResponse.prototype.payee_address = ""; - - /** - * Encodes the specified QueryPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IQueryPayeeResponse} message QueryPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPayeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.payee_address != null && Object.hasOwnProperty.call(message, "payee_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.payee_address); - return writer; - }; - - /** - * Encodes the specified QueryPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IQueryPayeeResponse} message QueryPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPayeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPayeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryPayeeResponse} QueryPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPayeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryPayeeResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.payee_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPayeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryPayeeResponse} QueryPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPayeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPayeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPayeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.payee_address != null && message.hasOwnProperty("payee_address")) - if (!$util.isString(message.payee_address)) - return "payee_address: string expected"; - return null; - }; - - /** - * Creates a QueryPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryPayeeResponse} QueryPayeeResponse - */ - QueryPayeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryPayeeResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryPayeeResponse(); - if (object.payee_address != null) - message.payee_address = String(object.payee_address); - return message; - }; - - /** - * Creates a plain object from a QueryPayeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {ibc.applications.fee.v1.QueryPayeeResponse} message QueryPayeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPayeeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.payee_address = ""; - if (message.payee_address != null && message.hasOwnProperty("payee_address")) - object.payee_address = message.payee_address; - return object; - }; - - /** - * Converts this QueryPayeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPayeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPayeeResponse; - })(); - - v1.QueryCounterpartyPayeeRequest = (function() { - - /** - * Properties of a QueryCounterpartyPayeeRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryCounterpartyPayeeRequest - * @property {string|null} [channel_id] QueryCounterpartyPayeeRequest channel_id - * @property {string|null} [relayer] QueryCounterpartyPayeeRequest relayer - */ - - /** - * Constructs a new QueryCounterpartyPayeeRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryCounterpartyPayeeRequest. - * @implements IQueryCounterpartyPayeeRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest=} [properties] Properties to set - */ - function QueryCounterpartyPayeeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryCounterpartyPayeeRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @instance - */ - QueryCounterpartyPayeeRequest.prototype.channel_id = ""; - - /** - * QueryCounterpartyPayeeRequest relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @instance - */ - QueryCounterpartyPayeeRequest.prototype.relayer = ""; - - /** - * Encodes the specified QueryCounterpartyPayeeRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest} message QueryCounterpartyPayeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCounterpartyPayeeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relayer); - return writer; - }; - - /** - * Encodes the specified QueryCounterpartyPayeeRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest} message QueryCounterpartyPayeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCounterpartyPayeeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryCounterpartyPayeeRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeRequest} QueryCounterpartyPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCounterpartyPayeeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryCounterpartyPayeeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.relayer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryCounterpartyPayeeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeRequest} QueryCounterpartyPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCounterpartyPayeeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryCounterpartyPayeeRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryCounterpartyPayeeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - return null; - }; - - /** - * Creates a QueryCounterpartyPayeeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeRequest} QueryCounterpartyPayeeRequest - */ - QueryCounterpartyPayeeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryCounterpartyPayeeRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryCounterpartyPayeeRequest(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - return message; - }; - - /** - * Creates a plain object from a QueryCounterpartyPayeeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {ibc.applications.fee.v1.QueryCounterpartyPayeeRequest} message QueryCounterpartyPayeeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryCounterpartyPayeeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.channel_id = ""; - object.relayer = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - return object; - }; - - /** - * Converts this QueryCounterpartyPayeeRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @instance - * @returns {Object.} JSON object - */ - QueryCounterpartyPayeeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryCounterpartyPayeeRequest; - })(); - - v1.QueryCounterpartyPayeeResponse = (function() { - - /** - * Properties of a QueryCounterpartyPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryCounterpartyPayeeResponse - * @property {string|null} [counterparty_payee] QueryCounterpartyPayeeResponse counterparty_payee - */ - - /** - * Constructs a new QueryCounterpartyPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryCounterpartyPayeeResponse. - * @implements IQueryCounterpartyPayeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeResponse=} [properties] Properties to set - */ - function QueryCounterpartyPayeeResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryCounterpartyPayeeResponse counterparty_payee. - * @member {string} counterparty_payee - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @instance - */ - QueryCounterpartyPayeeResponse.prototype.counterparty_payee = ""; - - /** - * Encodes the specified QueryCounterpartyPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeResponse} message QueryCounterpartyPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCounterpartyPayeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.counterparty_payee != null && Object.hasOwnProperty.call(message, "counterparty_payee")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.counterparty_payee); - return writer; - }; - - /** - * Encodes the specified QueryCounterpartyPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeResponse} message QueryCounterpartyPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCounterpartyPayeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryCounterpartyPayeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} QueryCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCounterpartyPayeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryCounterpartyPayeeResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.counterparty_payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryCounterpartyPayeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} QueryCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCounterpartyPayeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryCounterpartyPayeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryCounterpartyPayeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - if (!$util.isString(message.counterparty_payee)) - return "counterparty_payee: string expected"; - return null; - }; - - /** - * Creates a QueryCounterpartyPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} QueryCounterpartyPayeeResponse - */ - QueryCounterpartyPayeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryCounterpartyPayeeResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryCounterpartyPayeeResponse(); - if (object.counterparty_payee != null) - message.counterparty_payee = String(object.counterparty_payee); - return message; - }; - - /** - * Creates a plain object from a QueryCounterpartyPayeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} message QueryCounterpartyPayeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryCounterpartyPayeeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.counterparty_payee = ""; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - object.counterparty_payee = message.counterparty_payee; - return object; - }; - - /** - * Converts this QueryCounterpartyPayeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @instance - * @returns {Object.} JSON object - */ - QueryCounterpartyPayeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryCounterpartyPayeeResponse; - })(); - - v1.QueryFeeEnabledChannelsRequest = (function() { - - /** - * Properties of a QueryFeeEnabledChannelsRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryFeeEnabledChannelsRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryFeeEnabledChannelsRequest pagination - * @property {Long|null} [query_height] QueryFeeEnabledChannelsRequest query_height - */ - - /** - * Constructs a new QueryFeeEnabledChannelsRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryFeeEnabledChannelsRequest. - * @implements IQueryFeeEnabledChannelsRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest=} [properties] Properties to set - */ - function QueryFeeEnabledChannelsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFeeEnabledChannelsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @instance - */ - QueryFeeEnabledChannelsRequest.prototype.pagination = null; - - /** - * QueryFeeEnabledChannelsRequest query_height. - * @member {Long} query_height - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @instance - */ - QueryFeeEnabledChannelsRequest.prototype.query_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryFeeEnabledChannelsRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest} message QueryFeeEnabledChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query_height != null && Object.hasOwnProperty.call(message, "query_height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.query_height); - return writer; - }; - - /** - * Encodes the specified QueryFeeEnabledChannelsRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest} message QueryFeeEnabledChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFeeEnabledChannelsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest} QueryFeeEnabledChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - case 2: - message.query_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFeeEnabledChannelsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest} QueryFeeEnabledChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFeeEnabledChannelsRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFeeEnabledChannelsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (!$util.isInteger(message.query_height) && !(message.query_height && $util.isInteger(message.query_height.low) && $util.isInteger(message.query_height.high))) - return "query_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryFeeEnabledChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest} QueryFeeEnabledChannelsRequest - */ - QueryFeeEnabledChannelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - if (object.query_height != null) - if ($util.Long) - (message.query_height = $util.Long.fromValue(object.query_height)).unsigned = true; - else if (typeof object.query_height === "string") - message.query_height = parseInt(object.query_height, 10); - else if (typeof object.query_height === "number") - message.query_height = object.query_height; - else if (typeof object.query_height === "object") - message.query_height = new $util.LongBits(object.query_height.low >>> 0, object.query_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryFeeEnabledChannelsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest} message QueryFeeEnabledChannelsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFeeEnabledChannelsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pagination = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_height = options.longs === String ? "0" : 0; - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (typeof message.query_height === "number") - object.query_height = options.longs === String ? String(message.query_height) : message.query_height; - else - object.query_height = options.longs === String ? $util.Long.prototype.toString.call(message.query_height) : options.longs === Number ? new $util.LongBits(message.query_height.low >>> 0, message.query_height.high >>> 0).toNumber(true) : message.query_height; - return object; - }; - - /** - * Converts this QueryFeeEnabledChannelsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryFeeEnabledChannelsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFeeEnabledChannelsRequest; - })(); - - v1.QueryFeeEnabledChannelsResponse = (function() { - - /** - * Properties of a QueryFeeEnabledChannelsResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryFeeEnabledChannelsResponse - * @property {Array.|null} [fee_enabled_channels] QueryFeeEnabledChannelsResponse fee_enabled_channels - */ - - /** - * Constructs a new QueryFeeEnabledChannelsResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryFeeEnabledChannelsResponse. - * @implements IQueryFeeEnabledChannelsResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsResponse=} [properties] Properties to set - */ - function QueryFeeEnabledChannelsResponse(properties) { - this.fee_enabled_channels = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFeeEnabledChannelsResponse fee_enabled_channels. - * @member {Array.} fee_enabled_channels - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @instance - */ - QueryFeeEnabledChannelsResponse.prototype.fee_enabled_channels = $util.emptyArray; - - /** - * Encodes the specified QueryFeeEnabledChannelsResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsResponse} message QueryFeeEnabledChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee_enabled_channels != null && message.fee_enabled_channels.length) - for (var i = 0; i < message.fee_enabled_channels.length; ++i) - $root.ibc.applications.fee.v1.FeeEnabledChannel.encode(message.fee_enabled_channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryFeeEnabledChannelsResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsResponse} message QueryFeeEnabledChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFeeEnabledChannelsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} QueryFeeEnabledChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.fee_enabled_channels && message.fee_enabled_channels.length)) - message.fee_enabled_channels = []; - message.fee_enabled_channels.push($root.ibc.applications.fee.v1.FeeEnabledChannel.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFeeEnabledChannelsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} QueryFeeEnabledChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFeeEnabledChannelsResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFeeEnabledChannelsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee_enabled_channels != null && message.hasOwnProperty("fee_enabled_channels")) { - if (!Array.isArray(message.fee_enabled_channels)) - return "fee_enabled_channels: array expected"; - for (var i = 0; i < message.fee_enabled_channels.length; ++i) { - var error = $root.ibc.applications.fee.v1.FeeEnabledChannel.verify(message.fee_enabled_channels[i]); - if (error) - return "fee_enabled_channels." + error; - } - } - return null; - }; - - /** - * Creates a QueryFeeEnabledChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} QueryFeeEnabledChannelsResponse - */ - QueryFeeEnabledChannelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse(); - if (object.fee_enabled_channels) { - if (!Array.isArray(object.fee_enabled_channels)) - throw TypeError(".ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.fee_enabled_channels: array expected"); - message.fee_enabled_channels = []; - for (var i = 0; i < object.fee_enabled_channels.length; ++i) { - if (typeof object.fee_enabled_channels[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.fee_enabled_channels: object expected"); - message.fee_enabled_channels[i] = $root.ibc.applications.fee.v1.FeeEnabledChannel.fromObject(object.fee_enabled_channels[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryFeeEnabledChannelsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} message QueryFeeEnabledChannelsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFeeEnabledChannelsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.fee_enabled_channels = []; - if (message.fee_enabled_channels && message.fee_enabled_channels.length) { - object.fee_enabled_channels = []; - for (var j = 0; j < message.fee_enabled_channels.length; ++j) - object.fee_enabled_channels[j] = $root.ibc.applications.fee.v1.FeeEnabledChannel.toObject(message.fee_enabled_channels[j], options); - } - return object; - }; - - /** - * Converts this QueryFeeEnabledChannelsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryFeeEnabledChannelsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFeeEnabledChannelsResponse; - })(); - - v1.QueryFeeEnabledChannelRequest = (function() { - - /** - * Properties of a QueryFeeEnabledChannelRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryFeeEnabledChannelRequest - * @property {string|null} [port_id] QueryFeeEnabledChannelRequest port_id - * @property {string|null} [channel_id] QueryFeeEnabledChannelRequest channel_id - */ - - /** - * Constructs a new QueryFeeEnabledChannelRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryFeeEnabledChannelRequest. - * @implements IQueryFeeEnabledChannelRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest=} [properties] Properties to set - */ - function QueryFeeEnabledChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFeeEnabledChannelRequest port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @instance - */ - QueryFeeEnabledChannelRequest.prototype.port_id = ""; - - /** - * QueryFeeEnabledChannelRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @instance - */ - QueryFeeEnabledChannelRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryFeeEnabledChannelRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest} message QueryFeeEnabledChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryFeeEnabledChannelRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest} message QueryFeeEnabledChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFeeEnabledChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelRequest} QueryFeeEnabledChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFeeEnabledChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelRequest} QueryFeeEnabledChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFeeEnabledChannelRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFeeEnabledChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryFeeEnabledChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelRequest} QueryFeeEnabledChannelRequest - */ - QueryFeeEnabledChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryFeeEnabledChannelRequest) - return object; - var message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryFeeEnabledChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelRequest} message QueryFeeEnabledChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFeeEnabledChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryFeeEnabledChannelRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @instance - * @returns {Object.} JSON object - */ - QueryFeeEnabledChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFeeEnabledChannelRequest; - })(); - - v1.QueryFeeEnabledChannelResponse = (function() { - - /** - * Properties of a QueryFeeEnabledChannelResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryFeeEnabledChannelResponse - * @property {boolean|null} [fee_enabled] QueryFeeEnabledChannelResponse fee_enabled - */ - - /** - * Constructs a new QueryFeeEnabledChannelResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryFeeEnabledChannelResponse. - * @implements IQueryFeeEnabledChannelResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelResponse=} [properties] Properties to set - */ - function QueryFeeEnabledChannelResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFeeEnabledChannelResponse fee_enabled. - * @member {boolean} fee_enabled - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @instance - */ - QueryFeeEnabledChannelResponse.prototype.fee_enabled = false; - - /** - * Encodes the specified QueryFeeEnabledChannelResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelResponse} message QueryFeeEnabledChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee_enabled != null && Object.hasOwnProperty.call(message, "fee_enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.fee_enabled); - return writer; - }; - - /** - * Encodes the specified QueryFeeEnabledChannelResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelResponse} message QueryFeeEnabledChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFeeEnabledChannelResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} QueryFeeEnabledChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFeeEnabledChannelResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} QueryFeeEnabledChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFeeEnabledChannelResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFeeEnabledChannelResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee_enabled != null && message.hasOwnProperty("fee_enabled")) - if (typeof message.fee_enabled !== "boolean") - return "fee_enabled: boolean expected"; - return null; - }; - - /** - * Creates a QueryFeeEnabledChannelResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} QueryFeeEnabledChannelResponse - */ - QueryFeeEnabledChannelResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryFeeEnabledChannelResponse) - return object; - var message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelResponse(); - if (object.fee_enabled != null) - message.fee_enabled = Boolean(object.fee_enabled); - return message; - }; - - /** - * Creates a plain object from a QueryFeeEnabledChannelResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} message QueryFeeEnabledChannelResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFeeEnabledChannelResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.fee_enabled = false; - if (message.fee_enabled != null && message.hasOwnProperty("fee_enabled")) - object.fee_enabled = message.fee_enabled; - return object; - }; - - /** - * Converts this QueryFeeEnabledChannelResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @instance - * @returns {Object.} JSON object - */ - QueryFeeEnabledChannelResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFeeEnabledChannelResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.applications.fee.v1 - * @interface IGenesisState - * @property {Array.|null} [identified_fees] GenesisState identified_fees - * @property {Array.|null} [fee_enabled_channels] GenesisState fee_enabled_channels - * @property {Array.|null} [registered_payees] GenesisState registered_payees - * @property {Array.|null} [registered_counterparty_payees] GenesisState registered_counterparty_payees - * @property {Array.|null} [forward_relayers] GenesisState forward_relayers - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.applications.fee.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.identified_fees = []; - this.fee_enabled_channels = []; - this.registered_payees = []; - this.registered_counterparty_payees = []; - this.forward_relayers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState identified_fees. - * @member {Array.} identified_fees - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.identified_fees = $util.emptyArray; - - /** - * GenesisState fee_enabled_channels. - * @member {Array.} fee_enabled_channels - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.fee_enabled_channels = $util.emptyArray; - - /** - * GenesisState registered_payees. - * @member {Array.} registered_payees - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.registered_payees = $util.emptyArray; - - /** - * GenesisState registered_counterparty_payees. - * @member {Array.} registered_counterparty_payees - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.registered_counterparty_payees = $util.emptyArray; - - /** - * GenesisState forward_relayers. - * @member {Array.} forward_relayers - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.forward_relayers = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.fee.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {ibc.applications.fee.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identified_fees != null && message.identified_fees.length) - for (var i = 0; i < message.identified_fees.length; ++i) - $root.ibc.applications.fee.v1.IdentifiedPacketFees.encode(message.identified_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fee_enabled_channels != null && message.fee_enabled_channels.length) - for (var i = 0; i < message.fee_enabled_channels.length; ++i) - $root.ibc.applications.fee.v1.FeeEnabledChannel.encode(message.fee_enabled_channels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.registered_payees != null && message.registered_payees.length) - for (var i = 0; i < message.registered_payees.length; ++i) - $root.ibc.applications.fee.v1.RegisteredPayee.encode(message.registered_payees[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.registered_counterparty_payees != null && message.registered_counterparty_payees.length) - for (var i = 0; i < message.registered_counterparty_payees.length; ++i) - $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.encode(message.registered_counterparty_payees[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.forward_relayers != null && message.forward_relayers.length) - for (var i = 0; i < message.forward_relayers.length; ++i) - $root.ibc.applications.fee.v1.ForwardRelayerAddress.encode(message.forward_relayers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {ibc.applications.fee.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.identified_fees && message.identified_fees.length)) - message.identified_fees = []; - message.identified_fees.push($root.ibc.applications.fee.v1.IdentifiedPacketFees.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.fee_enabled_channels && message.fee_enabled_channels.length)) - message.fee_enabled_channels = []; - message.fee_enabled_channels.push($root.ibc.applications.fee.v1.FeeEnabledChannel.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.registered_payees && message.registered_payees.length)) - message.registered_payees = []; - message.registered_payees.push($root.ibc.applications.fee.v1.RegisteredPayee.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.registered_counterparty_payees && message.registered_counterparty_payees.length)) - message.registered_counterparty_payees = []; - message.registered_counterparty_payees.push($root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.forward_relayers && message.forward_relayers.length)) - message.forward_relayers = []; - message.forward_relayers.push($root.ibc.applications.fee.v1.ForwardRelayerAddress.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identified_fees != null && message.hasOwnProperty("identified_fees")) { - if (!Array.isArray(message.identified_fees)) - return "identified_fees: array expected"; - for (var i = 0; i < message.identified_fees.length; ++i) { - var error = $root.ibc.applications.fee.v1.IdentifiedPacketFees.verify(message.identified_fees[i]); - if (error) - return "identified_fees." + error; - } - } - if (message.fee_enabled_channels != null && message.hasOwnProperty("fee_enabled_channels")) { - if (!Array.isArray(message.fee_enabled_channels)) - return "fee_enabled_channels: array expected"; - for (var i = 0; i < message.fee_enabled_channels.length; ++i) { - var error = $root.ibc.applications.fee.v1.FeeEnabledChannel.verify(message.fee_enabled_channels[i]); - if (error) - return "fee_enabled_channels." + error; - } - } - if (message.registered_payees != null && message.hasOwnProperty("registered_payees")) { - if (!Array.isArray(message.registered_payees)) - return "registered_payees: array expected"; - for (var i = 0; i < message.registered_payees.length; ++i) { - var error = $root.ibc.applications.fee.v1.RegisteredPayee.verify(message.registered_payees[i]); - if (error) - return "registered_payees." + error; - } - } - if (message.registered_counterparty_payees != null && message.hasOwnProperty("registered_counterparty_payees")) { - if (!Array.isArray(message.registered_counterparty_payees)) - return "registered_counterparty_payees: array expected"; - for (var i = 0; i < message.registered_counterparty_payees.length; ++i) { - var error = $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.verify(message.registered_counterparty_payees[i]); - if (error) - return "registered_counterparty_payees." + error; - } - } - if (message.forward_relayers != null && message.hasOwnProperty("forward_relayers")) { - if (!Array.isArray(message.forward_relayers)) - return "forward_relayers: array expected"; - for (var i = 0; i < message.forward_relayers.length; ++i) { - var error = $root.ibc.applications.fee.v1.ForwardRelayerAddress.verify(message.forward_relayers[i]); - if (error) - return "forward_relayers." + error; - } - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.GenesisState) - return object; - var message = new $root.ibc.applications.fee.v1.GenesisState(); - if (object.identified_fees) { - if (!Array.isArray(object.identified_fees)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.identified_fees: array expected"); - message.identified_fees = []; - for (var i = 0; i < object.identified_fees.length; ++i) { - if (typeof object.identified_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.identified_fees: object expected"); - message.identified_fees[i] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.fromObject(object.identified_fees[i]); - } - } - if (object.fee_enabled_channels) { - if (!Array.isArray(object.fee_enabled_channels)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.fee_enabled_channels: array expected"); - message.fee_enabled_channels = []; - for (var i = 0; i < object.fee_enabled_channels.length; ++i) { - if (typeof object.fee_enabled_channels[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.fee_enabled_channels: object expected"); - message.fee_enabled_channels[i] = $root.ibc.applications.fee.v1.FeeEnabledChannel.fromObject(object.fee_enabled_channels[i]); - } - } - if (object.registered_payees) { - if (!Array.isArray(object.registered_payees)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.registered_payees: array expected"); - message.registered_payees = []; - for (var i = 0; i < object.registered_payees.length; ++i) { - if (typeof object.registered_payees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.registered_payees: object expected"); - message.registered_payees[i] = $root.ibc.applications.fee.v1.RegisteredPayee.fromObject(object.registered_payees[i]); - } - } - if (object.registered_counterparty_payees) { - if (!Array.isArray(object.registered_counterparty_payees)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.registered_counterparty_payees: array expected"); - message.registered_counterparty_payees = []; - for (var i = 0; i < object.registered_counterparty_payees.length; ++i) { - if (typeof object.registered_counterparty_payees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.registered_counterparty_payees: object expected"); - message.registered_counterparty_payees[i] = $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.fromObject(object.registered_counterparty_payees[i]); - } - } - if (object.forward_relayers) { - if (!Array.isArray(object.forward_relayers)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.forward_relayers: array expected"); - message.forward_relayers = []; - for (var i = 0; i < object.forward_relayers.length; ++i) { - if (typeof object.forward_relayers[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.forward_relayers: object expected"); - message.forward_relayers[i] = $root.ibc.applications.fee.v1.ForwardRelayerAddress.fromObject(object.forward_relayers[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {ibc.applications.fee.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.identified_fees = []; - object.fee_enabled_channels = []; - object.registered_payees = []; - object.registered_counterparty_payees = []; - object.forward_relayers = []; - } - if (message.identified_fees && message.identified_fees.length) { - object.identified_fees = []; - for (var j = 0; j < message.identified_fees.length; ++j) - object.identified_fees[j] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.toObject(message.identified_fees[j], options); - } - if (message.fee_enabled_channels && message.fee_enabled_channels.length) { - object.fee_enabled_channels = []; - for (var j = 0; j < message.fee_enabled_channels.length; ++j) - object.fee_enabled_channels[j] = $root.ibc.applications.fee.v1.FeeEnabledChannel.toObject(message.fee_enabled_channels[j], options); - } - if (message.registered_payees && message.registered_payees.length) { - object.registered_payees = []; - for (var j = 0; j < message.registered_payees.length; ++j) - object.registered_payees[j] = $root.ibc.applications.fee.v1.RegisteredPayee.toObject(message.registered_payees[j], options); - } - if (message.registered_counterparty_payees && message.registered_counterparty_payees.length) { - object.registered_counterparty_payees = []; - for (var j = 0; j < message.registered_counterparty_payees.length; ++j) - object.registered_counterparty_payees[j] = $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.toObject(message.registered_counterparty_payees[j], options); - } - if (message.forward_relayers && message.forward_relayers.length) { - object.forward_relayers = []; - for (var j = 0; j < message.forward_relayers.length; ++j) - object.forward_relayers[j] = $root.ibc.applications.fee.v1.ForwardRelayerAddress.toObject(message.forward_relayers[j], options); - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - v1.FeeEnabledChannel = (function() { - - /** - * Properties of a FeeEnabledChannel. - * @memberof ibc.applications.fee.v1 - * @interface IFeeEnabledChannel - * @property {string|null} [port_id] FeeEnabledChannel port_id - * @property {string|null} [channel_id] FeeEnabledChannel channel_id - */ - - /** - * Constructs a new FeeEnabledChannel. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a FeeEnabledChannel. - * @implements IFeeEnabledChannel - * @constructor - * @param {ibc.applications.fee.v1.IFeeEnabledChannel=} [properties] Properties to set - */ - function FeeEnabledChannel(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeeEnabledChannel port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @instance - */ - FeeEnabledChannel.prototype.port_id = ""; - - /** - * FeeEnabledChannel channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @instance - */ - FeeEnabledChannel.prototype.channel_id = ""; - - /** - * Encodes the specified FeeEnabledChannel message. Does not implicitly {@link ibc.applications.fee.v1.FeeEnabledChannel.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {ibc.applications.fee.v1.IFeeEnabledChannel} message FeeEnabledChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeEnabledChannel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified FeeEnabledChannel message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.FeeEnabledChannel.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {ibc.applications.fee.v1.IFeeEnabledChannel} message FeeEnabledChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeEnabledChannel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeeEnabledChannel message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.FeeEnabledChannel} FeeEnabledChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeEnabledChannel.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.FeeEnabledChannel(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeeEnabledChannel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.FeeEnabledChannel} FeeEnabledChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeEnabledChannel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeeEnabledChannel message. - * @function verify - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeeEnabledChannel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a FeeEnabledChannel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.FeeEnabledChannel} FeeEnabledChannel - */ - FeeEnabledChannel.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.FeeEnabledChannel) - return object; - var message = new $root.ibc.applications.fee.v1.FeeEnabledChannel(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a FeeEnabledChannel message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {ibc.applications.fee.v1.FeeEnabledChannel} message FeeEnabledChannel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeeEnabledChannel.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this FeeEnabledChannel to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @instance - * @returns {Object.} JSON object - */ - FeeEnabledChannel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FeeEnabledChannel; - })(); - - v1.RegisteredPayee = (function() { - - /** - * Properties of a RegisteredPayee. - * @memberof ibc.applications.fee.v1 - * @interface IRegisteredPayee - * @property {string|null} [channel_id] RegisteredPayee channel_id - * @property {string|null} [relayer] RegisteredPayee relayer - * @property {string|null} [payee] RegisteredPayee payee - */ - - /** - * Constructs a new RegisteredPayee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a RegisteredPayee. - * @implements IRegisteredPayee - * @constructor - * @param {ibc.applications.fee.v1.IRegisteredPayee=} [properties] Properties to set - */ - function RegisteredPayee(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RegisteredPayee channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @instance - */ - RegisteredPayee.prototype.channel_id = ""; - - /** - * RegisteredPayee relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @instance - */ - RegisteredPayee.prototype.relayer = ""; - - /** - * RegisteredPayee payee. - * @member {string} payee - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @instance - */ - RegisteredPayee.prototype.payee = ""; - - /** - * Encodes the specified RegisteredPayee message. Does not implicitly {@link ibc.applications.fee.v1.RegisteredPayee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {ibc.applications.fee.v1.IRegisteredPayee} message RegisteredPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredPayee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relayer); - if (message.payee != null && Object.hasOwnProperty.call(message, "payee")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.payee); - return writer; - }; - - /** - * Encodes the specified RegisteredPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.RegisteredPayee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {ibc.applications.fee.v1.IRegisteredPayee} message RegisteredPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredPayee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RegisteredPayee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.RegisteredPayee} RegisteredPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredPayee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.RegisteredPayee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.relayer = reader.string(); - break; - case 3: - message.payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RegisteredPayee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.RegisteredPayee} RegisteredPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredPayee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RegisteredPayee message. - * @function verify - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RegisteredPayee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - if (message.payee != null && message.hasOwnProperty("payee")) - if (!$util.isString(message.payee)) - return "payee: string expected"; - return null; - }; - - /** - * Creates a RegisteredPayee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.RegisteredPayee} RegisteredPayee - */ - RegisteredPayee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.RegisteredPayee) - return object; - var message = new $root.ibc.applications.fee.v1.RegisteredPayee(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - if (object.payee != null) - message.payee = String(object.payee); - return message; - }; - - /** - * Creates a plain object from a RegisteredPayee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {ibc.applications.fee.v1.RegisteredPayee} message RegisteredPayee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegisteredPayee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.channel_id = ""; - object.relayer = ""; - object.payee = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - if (message.payee != null && message.hasOwnProperty("payee")) - object.payee = message.payee; - return object; - }; - - /** - * Converts this RegisteredPayee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @instance - * @returns {Object.} JSON object - */ - RegisteredPayee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RegisteredPayee; - })(); - - v1.RegisteredCounterpartyPayee = (function() { - - /** - * Properties of a RegisteredCounterpartyPayee. - * @memberof ibc.applications.fee.v1 - * @interface IRegisteredCounterpartyPayee - * @property {string|null} [channel_id] RegisteredCounterpartyPayee channel_id - * @property {string|null} [relayer] RegisteredCounterpartyPayee relayer - * @property {string|null} [counterparty_payee] RegisteredCounterpartyPayee counterparty_payee - */ - - /** - * Constructs a new RegisteredCounterpartyPayee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a RegisteredCounterpartyPayee. - * @implements IRegisteredCounterpartyPayee - * @constructor - * @param {ibc.applications.fee.v1.IRegisteredCounterpartyPayee=} [properties] Properties to set - */ - function RegisteredCounterpartyPayee(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RegisteredCounterpartyPayee channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @instance - */ - RegisteredCounterpartyPayee.prototype.channel_id = ""; - - /** - * RegisteredCounterpartyPayee relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @instance - */ - RegisteredCounterpartyPayee.prototype.relayer = ""; - - /** - * RegisteredCounterpartyPayee counterparty_payee. - * @member {string} counterparty_payee - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @instance - */ - RegisteredCounterpartyPayee.prototype.counterparty_payee = ""; - - /** - * Encodes the specified RegisteredCounterpartyPayee message. Does not implicitly {@link ibc.applications.fee.v1.RegisteredCounterpartyPayee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.IRegisteredCounterpartyPayee} message RegisteredCounterpartyPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredCounterpartyPayee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relayer); - if (message.counterparty_payee != null && Object.hasOwnProperty.call(message, "counterparty_payee")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.counterparty_payee); - return writer; - }; - - /** - * Encodes the specified RegisteredCounterpartyPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.RegisteredCounterpartyPayee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.IRegisteredCounterpartyPayee} message RegisteredCounterpartyPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredCounterpartyPayee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RegisteredCounterpartyPayee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.RegisteredCounterpartyPayee} RegisteredCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredCounterpartyPayee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.relayer = reader.string(); - break; - case 3: - message.counterparty_payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RegisteredCounterpartyPayee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.RegisteredCounterpartyPayee} RegisteredCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredCounterpartyPayee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RegisteredCounterpartyPayee message. - * @function verify - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RegisteredCounterpartyPayee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - if (!$util.isString(message.counterparty_payee)) - return "counterparty_payee: string expected"; - return null; - }; - - /** - * Creates a RegisteredCounterpartyPayee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.RegisteredCounterpartyPayee} RegisteredCounterpartyPayee - */ - RegisteredCounterpartyPayee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee) - return object; - var message = new $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - if (object.counterparty_payee != null) - message.counterparty_payee = String(object.counterparty_payee); - return message; - }; - - /** - * Creates a plain object from a RegisteredCounterpartyPayee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.RegisteredCounterpartyPayee} message RegisteredCounterpartyPayee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegisteredCounterpartyPayee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.channel_id = ""; - object.relayer = ""; - object.counterparty_payee = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - object.counterparty_payee = message.counterparty_payee; - return object; - }; - - /** - * Converts this RegisteredCounterpartyPayee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @instance - * @returns {Object.} JSON object - */ - RegisteredCounterpartyPayee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RegisteredCounterpartyPayee; - })(); - - v1.ForwardRelayerAddress = (function() { - - /** - * Properties of a ForwardRelayerAddress. - * @memberof ibc.applications.fee.v1 - * @interface IForwardRelayerAddress - * @property {string|null} [address] ForwardRelayerAddress address - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] ForwardRelayerAddress packet_id - */ - - /** - * Constructs a new ForwardRelayerAddress. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a ForwardRelayerAddress. - * @implements IForwardRelayerAddress - * @constructor - * @param {ibc.applications.fee.v1.IForwardRelayerAddress=} [properties] Properties to set - */ - function ForwardRelayerAddress(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ForwardRelayerAddress address. - * @member {string} address - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @instance - */ - ForwardRelayerAddress.prototype.address = ""; - - /** - * ForwardRelayerAddress packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @instance - */ - ForwardRelayerAddress.prototype.packet_id = null; - - /** - * Encodes the specified ForwardRelayerAddress message. Does not implicitly {@link ibc.applications.fee.v1.ForwardRelayerAddress.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {ibc.applications.fee.v1.IForwardRelayerAddress} message ForwardRelayerAddress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ForwardRelayerAddress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ForwardRelayerAddress message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.ForwardRelayerAddress.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {ibc.applications.fee.v1.IForwardRelayerAddress} message ForwardRelayerAddress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ForwardRelayerAddress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ForwardRelayerAddress message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.ForwardRelayerAddress} ForwardRelayerAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ForwardRelayerAddress.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.ForwardRelayerAddress(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ForwardRelayerAddress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.ForwardRelayerAddress} ForwardRelayerAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ForwardRelayerAddress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ForwardRelayerAddress message. - * @function verify - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ForwardRelayerAddress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - var error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - return null; - }; - - /** - * Creates a ForwardRelayerAddress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.ForwardRelayerAddress} ForwardRelayerAddress - */ - ForwardRelayerAddress.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.ForwardRelayerAddress) - return object; - var message = new $root.ibc.applications.fee.v1.ForwardRelayerAddress(); - if (object.address != null) - message.address = String(object.address); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.ForwardRelayerAddress.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - return message; - }; - - /** - * Creates a plain object from a ForwardRelayerAddress message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {ibc.applications.fee.v1.ForwardRelayerAddress} message ForwardRelayerAddress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ForwardRelayerAddress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.address = ""; - object.packet_id = null; - } - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - return object; - }; - - /** - * Converts this ForwardRelayerAddress to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @instance - * @returns {Object.} JSON object - */ - ForwardRelayerAddress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ForwardRelayerAddress; - })(); - - v1.Metadata = (function() { - - /** - * Properties of a Metadata. - * @memberof ibc.applications.fee.v1 - * @interface IMetadata - * @property {string|null} [fee_version] Metadata fee_version - * @property {string|null} [app_version] Metadata app_version - */ - - /** - * Constructs a new Metadata. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a Metadata. - * @implements IMetadata - * @constructor - * @param {ibc.applications.fee.v1.IMetadata=} [properties] Properties to set - */ - function Metadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metadata fee_version. - * @member {string} fee_version - * @memberof ibc.applications.fee.v1.Metadata - * @instance - */ - Metadata.prototype.fee_version = ""; - - /** - * Metadata app_version. - * @member {string} app_version - * @memberof ibc.applications.fee.v1.Metadata - * @instance - */ - Metadata.prototype.app_version = ""; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link ibc.applications.fee.v1.Metadata.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {ibc.applications.fee.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee_version != null && Object.hasOwnProperty.call(message, "fee_version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fee_version); - if (message.app_version != null && Object.hasOwnProperty.call(message, "app_version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.app_version); - return writer; - }; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.Metadata.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {ibc.applications.fee.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.Metadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee_version = reader.string(); - break; - case 2: - message.app_version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metadata message. - * @function verify - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee_version != null && message.hasOwnProperty("fee_version")) - if (!$util.isString(message.fee_version)) - return "fee_version: string expected"; - if (message.app_version != null && message.hasOwnProperty("app_version")) - if (!$util.isString(message.app_version)) - return "app_version: string expected"; - return null; - }; - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.Metadata} Metadata - */ - Metadata.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.Metadata) - return object; - var message = new $root.ibc.applications.fee.v1.Metadata(); - if (object.fee_version != null) - message.fee_version = String(object.fee_version); - if (object.app_version != null) - message.app_version = String(object.app_version); - return message; - }; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {ibc.applications.fee.v1.Metadata} message Metadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fee_version = ""; - object.app_version = ""; - } - if (message.fee_version != null && message.hasOwnProperty("fee_version")) - object.fee_version = message.fee_version; - if (message.app_version != null && message.hasOwnProperty("app_version")) - object.app_version = message.app_version; - return object; - }; - - /** - * Converts this Metadata to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.Metadata - * @instance - * @returns {Object.} JSON object - */ - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Metadata; - })(); - - return v1; - })(); - - return fee; - })(); - - applications.interchain_accounts = (function() { - - /** - * Namespace interchain_accounts. - * @memberof ibc.applications - * @namespace - */ - var interchain_accounts = {}; - - interchain_accounts.controller = (function() { - - /** - * Namespace controller. - * @memberof ibc.applications.interchain_accounts - * @namespace - */ - var controller = {}; - - controller.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.interchain_accounts.controller - * @namespace - */ - var v1 = {}; - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.applications.interchain_accounts.controller.v1.Query#interchainAccount}. - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @typedef InterchainAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} [response] QueryInterchainAccountResponse - */ - - /** - * Calls InterchainAccount. - * @function interchainAccount - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest} request QueryInterchainAccountRequest message or plain object - * @param {ibc.applications.interchain_accounts.controller.v1.Query.InterchainAccountCallback} callback Node-style callback called with the error, if any, and QueryInterchainAccountResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.interchainAccount = function interchainAccount(request, callback) { - return this.rpcCall(interchainAccount, $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest, $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse, request, callback); - }, "name", { value: "InterchainAccount" }); - - /** - * Calls InterchainAccount. - * @function interchainAccount - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest} request QueryInterchainAccountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.interchain_accounts.controller.v1.Query#params}. - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {ibc.applications.interchain_accounts.controller.v1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest, $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryInterchainAccountRequest = (function() { - - /** - * Properties of a QueryInterchainAccountRequest. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IQueryInterchainAccountRequest - * @property {string|null} [owner] QueryInterchainAccountRequest owner - * @property {string|null} [connection_id] QueryInterchainAccountRequest connection_id - */ - - /** - * Constructs a new QueryInterchainAccountRequest. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a QueryInterchainAccountRequest. - * @implements IQueryInterchainAccountRequest - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest=} [properties] Properties to set - */ - function QueryInterchainAccountRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryInterchainAccountRequest owner. - * @member {string} owner - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @instance - */ - QueryInterchainAccountRequest.prototype.owner = ""; - - /** - * QueryInterchainAccountRequest connection_id. - * @member {string} connection_id - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @instance - */ - QueryInterchainAccountRequest.prototype.connection_id = ""; - - /** - * Encodes the specified QueryInterchainAccountRequest message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest} message QueryInterchainAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.owner); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.connection_id); - return writer; - }; - - /** - * Encodes the specified QueryInterchainAccountRequest message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest} message QueryInterchainAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryInterchainAccountRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest} QueryInterchainAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.owner = reader.string(); - break; - case 2: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryInterchainAccountRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest} QueryInterchainAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryInterchainAccountRequest message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInterchainAccountRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.owner != null && message.hasOwnProperty("owner")) - if (!$util.isString(message.owner)) - return "owner: string expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - return null; - }; - - /** - * Creates a QueryInterchainAccountRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest} QueryInterchainAccountRequest - */ - QueryInterchainAccountRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest) - return object; - var message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest(); - if (object.owner != null) - message.owner = String(object.owner); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - return message; - }; - - /** - * Creates a plain object from a QueryInterchainAccountRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest} message QueryInterchainAccountRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInterchainAccountRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.owner = ""; - object.connection_id = ""; - } - if (message.owner != null && message.hasOwnProperty("owner")) - object.owner = message.owner; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - return object; - }; - - /** - * Converts this QueryInterchainAccountRequest to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @instance - * @returns {Object.} JSON object - */ - QueryInterchainAccountRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryInterchainAccountRequest; - })(); - - v1.QueryInterchainAccountResponse = (function() { - - /** - * Properties of a QueryInterchainAccountResponse. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IQueryInterchainAccountResponse - * @property {string|null} [address] QueryInterchainAccountResponse address - */ - - /** - * Constructs a new QueryInterchainAccountResponse. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a QueryInterchainAccountResponse. - * @implements IQueryInterchainAccountResponse - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountResponse=} [properties] Properties to set - */ - function QueryInterchainAccountResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryInterchainAccountResponse address. - * @member {string} address - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @instance - */ - QueryInterchainAccountResponse.prototype.address = ""; - - /** - * Encodes the specified QueryInterchainAccountResponse message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountResponse} message QueryInterchainAccountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); - return writer; - }; - - /** - * Encodes the specified QueryInterchainAccountResponse message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountResponse} message QueryInterchainAccountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryInterchainAccountResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} QueryInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryInterchainAccountResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} QueryInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryInterchainAccountResponse message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInterchainAccountResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - return null; - }; - - /** - * Creates a QueryInterchainAccountResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} QueryInterchainAccountResponse - */ - QueryInterchainAccountResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse) - return object; - var message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse(); - if (object.address != null) - message.address = String(object.address); - return message; - }; - - /** - * Creates a plain object from a QueryInterchainAccountResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} message QueryInterchainAccountResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInterchainAccountResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.address = ""; - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - return object; - }; - - /** - * Converts this QueryInterchainAccountResponse to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @instance - * @returns {Object.} JSON object - */ - QueryInterchainAccountResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryInterchainAccountResponse; - })(); - - v1.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest) - return object; - return new $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - v1.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IQueryParamsResponse - * @property {ibc.applications.interchain_accounts.controller.v1.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {ibc.applications.interchain_accounts.controller.v1.IParams|null|undefined} params - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.interchain_accounts.controller.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.applications.interchain_accounts.controller.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse) - return object; - var message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse.params: object expected"); - message.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IParams - * @property {boolean|null} [controller_enabled] Params controller_enabled - */ - - /** - * Constructs a new Params. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params controller_enabled. - * @member {boolean} controller_enabled - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @instance - */ - Params.prototype.controller_enabled = false; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.controller_enabled != null && Object.hasOwnProperty.call(message, "controller_enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.controller_enabled); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.controller_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.controller_enabled != null && message.hasOwnProperty("controller_enabled")) - if (typeof message.controller_enabled !== "boolean") - return "controller_enabled: boolean expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.Params) - return object; - var message = new $root.ibc.applications.interchain_accounts.controller.v1.Params(); - if (object.controller_enabled != null) - message.controller_enabled = Boolean(object.controller_enabled); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.controller_enabled = false; - if (message.controller_enabled != null && message.hasOwnProperty("controller_enabled")) - object.controller_enabled = message.controller_enabled; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - return v1; - })(); - - return controller; - })(); - - interchain_accounts.host = (function() { - - /** - * Namespace host. - * @memberof ibc.applications.interchain_accounts - * @namespace - */ - var host = {}; - - host.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.interchain_accounts.host - * @namespace - */ - var v1 = {}; - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @interface IParams - * @property {boolean|null} [host_enabled] Params host_enabled - * @property {Array.|null} [allow_messages] Params allow_messages - */ - - /** - * Constructs a new Params. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.applications.interchain_accounts.host.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - this.allow_messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params host_enabled. - * @member {boolean} host_enabled - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @instance - */ - Params.prototype.host_enabled = false; - - /** - * Params allow_messages. - * @member {Array.} allow_messages - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @instance - */ - Params.prototype.allow_messages = $util.emptyArray; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.host_enabled != null && Object.hasOwnProperty.call(message, "host_enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.host_enabled); - if (message.allow_messages != null && message.allow_messages.length) - for (var i = 0; i < message.allow_messages.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allow_messages[i]); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.host.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.host.v1.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.host_enabled = reader.bool(); - break; - case 2: - if (!(message.allow_messages && message.allow_messages.length)) - message.allow_messages = []; - message.allow_messages.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.host.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.host_enabled != null && message.hasOwnProperty("host_enabled")) - if (typeof message.host_enabled !== "boolean") - return "host_enabled: boolean expected"; - if (message.allow_messages != null && message.hasOwnProperty("allow_messages")) { - if (!Array.isArray(message.allow_messages)) - return "allow_messages: array expected"; - for (var i = 0; i < message.allow_messages.length; ++i) - if (!$util.isString(message.allow_messages[i])) - return "allow_messages: string[] expected"; - } - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.host.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.host.v1.Params) - return object; - var message = new $root.ibc.applications.interchain_accounts.host.v1.Params(); - if (object.host_enabled != null) - message.host_enabled = Boolean(object.host_enabled); - if (object.allow_messages) { - if (!Array.isArray(object.allow_messages)) - throw TypeError(".ibc.applications.interchain_accounts.host.v1.Params.allow_messages: array expected"); - message.allow_messages = []; - for (var i = 0; i < object.allow_messages.length; ++i) - message.allow_messages[i] = String(object.allow_messages[i]); - } - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.host.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allow_messages = []; - if (options.defaults) - object.host_enabled = false; - if (message.host_enabled != null && message.hasOwnProperty("host_enabled")) - object.host_enabled = message.host_enabled; - if (message.allow_messages && message.allow_messages.length) { - object.allow_messages = []; - for (var j = 0; j < message.allow_messages.length; ++j) - object.allow_messages[j] = message.allow_messages[j]; - } - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.applications.interchain_accounts.host.v1.Query#params}. - * @memberof ibc.applications.interchain_accounts.host.v1.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.interchain_accounts.host.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {ibc.applications.interchain_accounts.host.v1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.ibc.applications.interchain_accounts.host.v1.QueryParamsRequest, $root.ibc.applications.interchain_accounts.host.v1.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.interchain_accounts.host.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.host.v1.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.host.v1.QueryParamsRequest) - return object; - return new $root.ibc.applications.interchain_accounts.host.v1.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.host.v1.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - v1.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @interface IQueryParamsResponse - * @property {ibc.applications.interchain_accounts.host.v1.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {ibc.applications.interchain_accounts.host.v1.IParams|null|undefined} params - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.interchain_accounts.host.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.host.v1.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.ibc.applications.interchain_accounts.host.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.applications.interchain_accounts.host.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.host.v1.QueryParamsResponse) - return object; - var message = new $root.ibc.applications.interchain_accounts.host.v1.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.interchain_accounts.host.v1.QueryParamsResponse.params: object expected"); - message.params = $root.ibc.applications.interchain_accounts.host.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.interchain_accounts.host.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - return v1; - })(); - - return host; - })(); - - interchain_accounts.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.interchain_accounts - * @namespace - */ - var v1 = {}; - - v1.InterchainAccount = (function() { - - /** - * Properties of an InterchainAccount. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IInterchainAccount - * @property {cosmos.auth.v1beta1.IBaseAccount|null} [base_account] InterchainAccount base_account - * @property {string|null} [account_owner] InterchainAccount account_owner - */ - - /** - * Constructs a new InterchainAccount. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents an InterchainAccount. - * @implements IInterchainAccount - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccount=} [properties] Properties to set - */ - function InterchainAccount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InterchainAccount base_account. - * @member {cosmos.auth.v1beta1.IBaseAccount|null|undefined} base_account - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @instance - */ - InterchainAccount.prototype.base_account = null; - - /** - * InterchainAccount account_owner. - * @member {string} account_owner - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @instance - */ - InterchainAccount.prototype.account_owner = ""; - - /** - * Encodes the specified InterchainAccount message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccount.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccount} message InterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterchainAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.base_account != null && Object.hasOwnProperty.call(message, "base_account")) - $root.cosmos.auth.v1beta1.BaseAccount.encode(message.base_account, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.account_owner != null && Object.hasOwnProperty.call(message, "account_owner")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.account_owner); - return writer; - }; - - /** - * Encodes the specified InterchainAccount message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccount} message InterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterchainAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InterchainAccount message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccount} InterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterchainAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.InterchainAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_account = $root.cosmos.auth.v1beta1.BaseAccount.decode(reader, reader.uint32()); - break; - case 2: - message.account_owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InterchainAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccount} InterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterchainAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InterchainAccount message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InterchainAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.base_account != null && message.hasOwnProperty("base_account")) { - var error = $root.cosmos.auth.v1beta1.BaseAccount.verify(message.base_account); - if (error) - return "base_account." + error; - } - if (message.account_owner != null && message.hasOwnProperty("account_owner")) - if (!$util.isString(message.account_owner)) - return "account_owner: string expected"; - return null; - }; - - /** - * Creates an InterchainAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccount} InterchainAccount - */ - InterchainAccount.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.InterchainAccount) - return object; - var message = new $root.ibc.applications.interchain_accounts.v1.InterchainAccount(); - if (object.base_account != null) { - if (typeof object.base_account !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.InterchainAccount.base_account: object expected"); - message.base_account = $root.cosmos.auth.v1beta1.BaseAccount.fromObject(object.base_account); - } - if (object.account_owner != null) - message.account_owner = String(object.account_owner); - return message; - }; - - /** - * Creates a plain object from an InterchainAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.InterchainAccount} message InterchainAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InterchainAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.base_account = null; - object.account_owner = ""; - } - if (message.base_account != null && message.hasOwnProperty("base_account")) - object.base_account = $root.cosmos.auth.v1beta1.BaseAccount.toObject(message.base_account, options); - if (message.account_owner != null && message.hasOwnProperty("account_owner")) - object.account_owner = message.account_owner; - return object; - }; - - /** - * Converts this InterchainAccount to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @instance - * @returns {Object.} JSON object - */ - InterchainAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InterchainAccount; - })(); - - /** - * Type enum. - * @name ibc.applications.interchain_accounts.v1.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} TYPE_EXECUTE_TX=1 TYPE_EXECUTE_TX value - */ - v1.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TYPE_EXECUTE_TX"] = 1; - return values; - })(); - - v1.InterchainAccountPacketData = (function() { - - /** - * Properties of an InterchainAccountPacketData. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IInterchainAccountPacketData - * @property {ibc.applications.interchain_accounts.v1.Type|null} [type] InterchainAccountPacketData type - * @property {Uint8Array|null} [data] InterchainAccountPacketData data - * @property {string|null} [memo] InterchainAccountPacketData memo - */ - - /** - * Constructs a new InterchainAccountPacketData. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents an InterchainAccountPacketData. - * @implements IInterchainAccountPacketData - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccountPacketData=} [properties] Properties to set - */ - function InterchainAccountPacketData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InterchainAccountPacketData type. - * @member {ibc.applications.interchain_accounts.v1.Type} type - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @instance - */ - InterchainAccountPacketData.prototype.type = 0; - - /** - * InterchainAccountPacketData data. - * @member {Uint8Array} data - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @instance - */ - InterchainAccountPacketData.prototype.data = $util.newBuffer([]); - - /** - * InterchainAccountPacketData memo. - * @member {string} memo - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @instance - */ - InterchainAccountPacketData.prototype.memo = ""; - - /** - * Encodes the specified InterchainAccountPacketData message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccountPacketData.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccountPacketData} message InterchainAccountPacketData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterchainAccountPacketData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.memo); - return writer; - }; - - /** - * Encodes the specified InterchainAccountPacketData message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccountPacketData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccountPacketData} message InterchainAccountPacketData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterchainAccountPacketData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InterchainAccountPacketData message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccountPacketData} InterchainAccountPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterchainAccountPacketData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.InterchainAccountPacketData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.memo = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InterchainAccountPacketData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccountPacketData} InterchainAccountPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterchainAccountPacketData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InterchainAccountPacketData message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InterchainAccountPacketData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - return null; - }; - - /** - * Creates an InterchainAccountPacketData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccountPacketData} InterchainAccountPacketData - */ - InterchainAccountPacketData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.InterchainAccountPacketData) - return object; - var message = new $root.ibc.applications.interchain_accounts.v1.InterchainAccountPacketData(); - switch (object.type) { - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "TYPE_EXECUTE_TX": - case 1: - message.type = 1; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.memo != null) - message.memo = String(object.memo); - return message; - }; - - /** - * Creates a plain object from an InterchainAccountPacketData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {ibc.applications.interchain_accounts.v1.InterchainAccountPacketData} message InterchainAccountPacketData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InterchainAccountPacketData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.memo = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.ibc.applications.interchain_accounts.v1.Type[message.type] : message.type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - return object; - }; - - /** - * Converts this InterchainAccountPacketData to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @instance - * @returns {Object.} JSON object - */ - InterchainAccountPacketData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InterchainAccountPacketData; - })(); - - v1.CosmosTx = (function() { - - /** - * Properties of a CosmosTx. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface ICosmosTx - * @property {Array.|null} [messages] CosmosTx messages - */ - - /** - * Constructs a new CosmosTx. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a CosmosTx. - * @implements ICosmosTx - * @constructor - * @param {ibc.applications.interchain_accounts.v1.ICosmosTx=} [properties] Properties to set - */ - function CosmosTx(properties) { - this.messages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CosmosTx messages. - * @member {Array.} messages - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @instance - */ - CosmosTx.prototype.messages = $util.emptyArray; - - /** - * Encodes the specified CosmosTx message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.CosmosTx.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {ibc.applications.interchain_accounts.v1.ICosmosTx} message CosmosTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CosmosTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.protobuf.Any.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CosmosTx message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.CosmosTx.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {ibc.applications.interchain_accounts.v1.ICosmosTx} message CosmosTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CosmosTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CosmosTx message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.CosmosTx} CosmosTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CosmosTx.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.CosmosTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CosmosTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.CosmosTx} CosmosTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CosmosTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CosmosTx message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CosmosTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - return null; - }; - - /** - * Creates a CosmosTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.CosmosTx} CosmosTx - */ - CosmosTx.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.CosmosTx) - return object; - var message = new $root.ibc.applications.interchain_accounts.v1.CosmosTx(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".ibc.applications.interchain_accounts.v1.CosmosTx.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.CosmosTx.messages: object expected"); - message.messages[i] = $root.google.protobuf.Any.fromObject(object.messages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CosmosTx message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {ibc.applications.interchain_accounts.v1.CosmosTx} message CosmosTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CosmosTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.protobuf.Any.toObject(message.messages[j], options); - } - return object; - }; - - /** - * Converts this CosmosTx to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @instance - * @returns {Object.} JSON object - */ - CosmosTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CosmosTx; - })(); - - v1.Metadata = (function() { - - /** - * Properties of a Metadata. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IMetadata - * @property {string|null} [version] Metadata version - * @property {string|null} [controller_connection_id] Metadata controller_connection_id - * @property {string|null} [host_connection_id] Metadata host_connection_id - * @property {string|null} [address] Metadata address - * @property {string|null} [encoding] Metadata encoding - * @property {string|null} [tx_type] Metadata tx_type - */ - - /** - * Constructs a new Metadata. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a Metadata. - * @implements IMetadata - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IMetadata=} [properties] Properties to set - */ - function Metadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metadata version. - * @member {string} version - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.version = ""; - - /** - * Metadata controller_connection_id. - * @member {string} controller_connection_id - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.controller_connection_id = ""; - - /** - * Metadata host_connection_id. - * @member {string} host_connection_id - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.host_connection_id = ""; - - /** - * Metadata address. - * @member {string} address - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.address = ""; - - /** - * Metadata encoding. - * @member {string} encoding - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.encoding = ""; - - /** - * Metadata tx_type. - * @member {string} tx_type - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.tx_type = ""; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.Metadata.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {ibc.applications.interchain_accounts.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.controller_connection_id != null && Object.hasOwnProperty.call(message, "controller_connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.controller_connection_id); - if (message.host_connection_id != null && Object.hasOwnProperty.call(message, "host_connection_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.host_connection_id); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.address); - if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.encoding); - if (message.tx_type != null && Object.hasOwnProperty.call(message, "tx_type")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.tx_type); - return writer; - }; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.Metadata.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {ibc.applications.interchain_accounts.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.Metadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.controller_connection_id = reader.string(); - break; - case 3: - message.host_connection_id = reader.string(); - break; - case 4: - message.address = reader.string(); - break; - case 5: - message.encoding = reader.string(); - break; - case 6: - message.tx_type = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metadata message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.controller_connection_id != null && message.hasOwnProperty("controller_connection_id")) - if (!$util.isString(message.controller_connection_id)) - return "controller_connection_id: string expected"; - if (message.host_connection_id != null && message.hasOwnProperty("host_connection_id")) - if (!$util.isString(message.host_connection_id)) - return "host_connection_id: string expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.encoding != null && message.hasOwnProperty("encoding")) - if (!$util.isString(message.encoding)) - return "encoding: string expected"; - if (message.tx_type != null && message.hasOwnProperty("tx_type")) - if (!$util.isString(message.tx_type)) - return "tx_type: string expected"; - return null; - }; - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.Metadata} Metadata - */ - Metadata.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.Metadata) - return object; - var message = new $root.ibc.applications.interchain_accounts.v1.Metadata(); - if (object.version != null) - message.version = String(object.version); - if (object.controller_connection_id != null) - message.controller_connection_id = String(object.controller_connection_id); - if (object.host_connection_id != null) - message.host_connection_id = String(object.host_connection_id); - if (object.address != null) - message.address = String(object.address); - if (object.encoding != null) - message.encoding = String(object.encoding); - if (object.tx_type != null) - message.tx_type = String(object.tx_type); - return message; - }; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {ibc.applications.interchain_accounts.v1.Metadata} message Metadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.controller_connection_id = ""; - object.host_connection_id = ""; - object.address = ""; - object.encoding = ""; - object.tx_type = ""; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.controller_connection_id != null && message.hasOwnProperty("controller_connection_id")) - object.controller_connection_id = message.controller_connection_id; - if (message.host_connection_id != null && message.hasOwnProperty("host_connection_id")) - object.host_connection_id = message.host_connection_id; - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.encoding != null && message.hasOwnProperty("encoding")) - object.encoding = message.encoding; - if (message.tx_type != null && message.hasOwnProperty("tx_type")) - object.tx_type = message.tx_type; - return object; - }; - - /** - * Converts this Metadata to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - * @returns {Object.} JSON object - */ - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Metadata; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IGenesisState - * @property {ibc.applications.interchain_accounts.v1.IControllerGenesisState|null} [controller_genesis_state] GenesisState controller_genesis_state - * @property {ibc.applications.interchain_accounts.v1.IHostGenesisState|null} [host_genesis_state] GenesisState host_genesis_state - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState controller_genesis_state. - * @member {ibc.applications.interchain_accounts.v1.IControllerGenesisState|null|undefined} controller_genesis_state - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @instance - */ - GenesisState.prototype.controller_genesis_state = null; - - /** - * GenesisState host_genesis_state. - * @member {ibc.applications.interchain_accounts.v1.IHostGenesisState|null|undefined} host_genesis_state - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @instance - */ - GenesisState.prototype.host_genesis_state = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.controller_genesis_state != null && Object.hasOwnProperty.call(message, "controller_genesis_state")) - $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.encode(message.controller_genesis_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.host_genesis_state != null && Object.hasOwnProperty.call(message, "host_genesis_state")) - $root.ibc.applications.interchain_accounts.v1.HostGenesisState.encode(message.host_genesis_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.controller_genesis_state = $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.decode(reader, reader.uint32()); - break; - case 2: - message.host_genesis_state = $root.ibc.applications.interchain_accounts.v1.HostGenesisState.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.controller_genesis_state != null && message.hasOwnProperty("controller_genesis_state")) { - var error = $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.verify(message.controller_genesis_state); - if (error) - return "controller_genesis_state." + error; - } - if (message.host_genesis_state != null && message.hasOwnProperty("host_genesis_state")) { - var error = $root.ibc.applications.interchain_accounts.v1.HostGenesisState.verify(message.host_genesis_state); - if (error) - return "host_genesis_state." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.GenesisState) - return object; - var message = new $root.ibc.applications.interchain_accounts.v1.GenesisState(); - if (object.controller_genesis_state != null) { - if (typeof object.controller_genesis_state !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.GenesisState.controller_genesis_state: object expected"); - message.controller_genesis_state = $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.fromObject(object.controller_genesis_state); - } - if (object.host_genesis_state != null) { - if (typeof object.host_genesis_state !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.GenesisState.host_genesis_state: object expected"); - message.host_genesis_state = $root.ibc.applications.interchain_accounts.v1.HostGenesisState.fromObject(object.host_genesis_state); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.controller_genesis_state = null; - object.host_genesis_state = null; - } - if (message.controller_genesis_state != null && message.hasOwnProperty("controller_genesis_state")) - object.controller_genesis_state = $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.toObject(message.controller_genesis_state, options); - if (message.host_genesis_state != null && message.hasOwnProperty("host_genesis_state")) - object.host_genesis_state = $root.ibc.applications.interchain_accounts.v1.HostGenesisState.toObject(message.host_genesis_state, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - v1.ControllerGenesisState = (function() { - - /** - * Properties of a ControllerGenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IControllerGenesisState - * @property {Array.|null} [active_channels] ControllerGenesisState active_channels - * @property {Array.|null} [interchain_accounts] ControllerGenesisState interchain_accounts - * @property {Array.|null} [ports] ControllerGenesisState ports - * @property {ibc.applications.interchain_accounts.controller.v1.IParams|null} [params] ControllerGenesisState params - */ - - /** - * Constructs a new ControllerGenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a ControllerGenesisState. - * @implements IControllerGenesisState - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IControllerGenesisState=} [properties] Properties to set - */ - function ControllerGenesisState(properties) { - this.active_channels = []; - this.interchain_accounts = []; - this.ports = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ControllerGenesisState active_channels. - * @member {Array.} active_channels - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - */ - ControllerGenesisState.prototype.active_channels = $util.emptyArray; - - /** - * ControllerGenesisState interchain_accounts. - * @member {Array.} interchain_accounts - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - */ - ControllerGenesisState.prototype.interchain_accounts = $util.emptyArray; - - /** - * ControllerGenesisState ports. - * @member {Array.} ports - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - */ - ControllerGenesisState.prototype.ports = $util.emptyArray; - - /** - * ControllerGenesisState params. - * @member {ibc.applications.interchain_accounts.controller.v1.IParams|null|undefined} params - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - */ - ControllerGenesisState.prototype.params = null; - - /** - * Encodes the specified ControllerGenesisState message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ControllerGenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IControllerGenesisState} message ControllerGenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ControllerGenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.active_channels != null && message.active_channels.length) - for (var i = 0; i < message.active_channels.length; ++i) - $root.ibc.applications.interchain_accounts.v1.ActiveChannel.encode(message.active_channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.interchain_accounts != null && message.interchain_accounts.length) - for (var i = 0; i < message.interchain_accounts.length; ++i) - $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.encode(message.interchain_accounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ports != null && message.ports.length) - for (var i = 0; i < message.ports.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ports[i]); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.interchain_accounts.controller.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ControllerGenesisState message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ControllerGenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IControllerGenesisState} message ControllerGenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ControllerGenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ControllerGenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.ControllerGenesisState} ControllerGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ControllerGenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.active_channels && message.active_channels.length)) - message.active_channels = []; - message.active_channels.push($root.ibc.applications.interchain_accounts.v1.ActiveChannel.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.interchain_accounts && message.interchain_accounts.length)) - message.interchain_accounts = []; - message.interchain_accounts.push($root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.ports && message.ports.length)) - message.ports = []; - message.ports.push(reader.string()); - break; - case 4: - message.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ControllerGenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.ControllerGenesisState} ControllerGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ControllerGenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ControllerGenesisState message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ControllerGenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.active_channels != null && message.hasOwnProperty("active_channels")) { - if (!Array.isArray(message.active_channels)) - return "active_channels: array expected"; - for (var i = 0; i < message.active_channels.length; ++i) { - var error = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.verify(message.active_channels[i]); - if (error) - return "active_channels." + error; - } - } - if (message.interchain_accounts != null && message.hasOwnProperty("interchain_accounts")) { - if (!Array.isArray(message.interchain_accounts)) - return "interchain_accounts: array expected"; - for (var i = 0; i < message.interchain_accounts.length; ++i) { - var error = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify(message.interchain_accounts[i]); - if (error) - return "interchain_accounts." + error; - } - } - if (message.ports != null && message.hasOwnProperty("ports")) { - if (!Array.isArray(message.ports)) - return "ports: array expected"; - for (var i = 0; i < message.ports.length; ++i) - if (!$util.isString(message.ports[i])) - return "ports: string[] expected"; - } - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.applications.interchain_accounts.controller.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a ControllerGenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.ControllerGenesisState} ControllerGenesisState - */ - ControllerGenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState) - return object; - var message = new $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState(); - if (object.active_channels) { - if (!Array.isArray(object.active_channels)) - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.active_channels: array expected"); - message.active_channels = []; - for (var i = 0; i < object.active_channels.length; ++i) { - if (typeof object.active_channels[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.active_channels: object expected"); - message.active_channels[i] = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.fromObject(object.active_channels[i]); - } - } - if (object.interchain_accounts) { - if (!Array.isArray(object.interchain_accounts)) - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.interchain_accounts: array expected"); - message.interchain_accounts = []; - for (var i = 0; i < object.interchain_accounts.length; ++i) { - if (typeof object.interchain_accounts[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.interchain_accounts: object expected"); - message.interchain_accounts[i] = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.fromObject(object.interchain_accounts[i]); - } - } - if (object.ports) { - if (!Array.isArray(object.ports)) - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.ports: array expected"); - message.ports = []; - for (var i = 0; i < object.ports.length; ++i) - message.ports[i] = String(object.ports[i]); - } - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.params: object expected"); - message.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a ControllerGenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.ControllerGenesisState} message ControllerGenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ControllerGenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.active_channels = []; - object.interchain_accounts = []; - object.ports = []; - } - if (options.defaults) - object.params = null; - if (message.active_channels && message.active_channels.length) { - object.active_channels = []; - for (var j = 0; j < message.active_channels.length; ++j) - object.active_channels[j] = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.toObject(message.active_channels[j], options); - } - if (message.interchain_accounts && message.interchain_accounts.length) { - object.interchain_accounts = []; - for (var j = 0; j < message.interchain_accounts.length; ++j) - object.interchain_accounts[j] = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.toObject(message.interchain_accounts[j], options); - } - if (message.ports && message.ports.length) { - object.ports = []; - for (var j = 0; j < message.ports.length; ++j) - object.ports[j] = message.ports[j]; - } - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this ControllerGenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - * @returns {Object.} JSON object - */ - ControllerGenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ControllerGenesisState; - })(); - - v1.HostGenesisState = (function() { - - /** - * Properties of a HostGenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IHostGenesisState - * @property {Array.|null} [active_channels] HostGenesisState active_channels - * @property {Array.|null} [interchain_accounts] HostGenesisState interchain_accounts - * @property {string|null} [port] HostGenesisState port - * @property {ibc.applications.interchain_accounts.host.v1.IParams|null} [params] HostGenesisState params - */ - - /** - * Constructs a new HostGenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a HostGenesisState. - * @implements IHostGenesisState - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IHostGenesisState=} [properties] Properties to set - */ - function HostGenesisState(properties) { - this.active_channels = []; - this.interchain_accounts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HostGenesisState active_channels. - * @member {Array.} active_channels - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - */ - HostGenesisState.prototype.active_channels = $util.emptyArray; - - /** - * HostGenesisState interchain_accounts. - * @member {Array.} interchain_accounts - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - */ - HostGenesisState.prototype.interchain_accounts = $util.emptyArray; - - /** - * HostGenesisState port. - * @member {string} port - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - */ - HostGenesisState.prototype.port = ""; - - /** - * HostGenesisState params. - * @member {ibc.applications.interchain_accounts.host.v1.IParams|null|undefined} params - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - */ - HostGenesisState.prototype.params = null; - - /** - * Encodes the specified HostGenesisState message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.HostGenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IHostGenesisState} message HostGenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HostGenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.active_channels != null && message.active_channels.length) - for (var i = 0; i < message.active_channels.length; ++i) - $root.ibc.applications.interchain_accounts.v1.ActiveChannel.encode(message.active_channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.interchain_accounts != null && message.interchain_accounts.length) - for (var i = 0; i < message.interchain_accounts.length; ++i) - $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.encode(message.interchain_accounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.port); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.interchain_accounts.host.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified HostGenesisState message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.HostGenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IHostGenesisState} message HostGenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HostGenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HostGenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.HostGenesisState} HostGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HostGenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.HostGenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.active_channels && message.active_channels.length)) - message.active_channels = []; - message.active_channels.push($root.ibc.applications.interchain_accounts.v1.ActiveChannel.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.interchain_accounts && message.interchain_accounts.length)) - message.interchain_accounts = []; - message.interchain_accounts.push($root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.decode(reader, reader.uint32())); - break; - case 3: - message.port = reader.string(); - break; - case 4: - message.params = $root.ibc.applications.interchain_accounts.host.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HostGenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.HostGenesisState} HostGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HostGenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HostGenesisState message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HostGenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.active_channels != null && message.hasOwnProperty("active_channels")) { - if (!Array.isArray(message.active_channels)) - return "active_channels: array expected"; - for (var i = 0; i < message.active_channels.length; ++i) { - var error = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.verify(message.active_channels[i]); - if (error) - return "active_channels." + error; - } - } - if (message.interchain_accounts != null && message.hasOwnProperty("interchain_accounts")) { - if (!Array.isArray(message.interchain_accounts)) - return "interchain_accounts: array expected"; - for (var i = 0; i < message.interchain_accounts.length; ++i) { - var error = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify(message.interchain_accounts[i]); - if (error) - return "interchain_accounts." + error; - } - } - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isString(message.port)) - return "port: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.applications.interchain_accounts.host.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a HostGenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.HostGenesisState} HostGenesisState - */ - HostGenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.HostGenesisState) - return object; - var message = new $root.ibc.applications.interchain_accounts.v1.HostGenesisState(); - if (object.active_channels) { - if (!Array.isArray(object.active_channels)) - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.active_channels: array expected"); - message.active_channels = []; - for (var i = 0; i < object.active_channels.length; ++i) { - if (typeof object.active_channels[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.active_channels: object expected"); - message.active_channels[i] = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.fromObject(object.active_channels[i]); - } - } - if (object.interchain_accounts) { - if (!Array.isArray(object.interchain_accounts)) - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.interchain_accounts: array expected"); - message.interchain_accounts = []; - for (var i = 0; i < object.interchain_accounts.length; ++i) { - if (typeof object.interchain_accounts[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.interchain_accounts: object expected"); - message.interchain_accounts[i] = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.fromObject(object.interchain_accounts[i]); - } - } - if (object.port != null) - message.port = String(object.port); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.params: object expected"); - message.params = $root.ibc.applications.interchain_accounts.host.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a HostGenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.HostGenesisState} message HostGenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HostGenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.active_channels = []; - object.interchain_accounts = []; - } - if (options.defaults) { - object.port = ""; - object.params = null; - } - if (message.active_channels && message.active_channels.length) { - object.active_channels = []; - for (var j = 0; j < message.active_channels.length; ++j) - object.active_channels[j] = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.toObject(message.active_channels[j], options); - } - if (message.interchain_accounts && message.interchain_accounts.length) { - object.interchain_accounts = []; - for (var j = 0; j < message.interchain_accounts.length; ++j) - object.interchain_accounts[j] = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.toObject(message.interchain_accounts[j], options); - } - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.interchain_accounts.host.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this HostGenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - * @returns {Object.} JSON object - */ - HostGenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HostGenesisState; - })(); - - v1.ActiveChannel = (function() { - - /** - * Properties of an ActiveChannel. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IActiveChannel - * @property {string|null} [connection_id] ActiveChannel connection_id - * @property {string|null} [port_id] ActiveChannel port_id - * @property {string|null} [channel_id] ActiveChannel channel_id - */ - - /** - * Constructs a new ActiveChannel. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents an ActiveChannel. - * @implements IActiveChannel - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IActiveChannel=} [properties] Properties to set - */ - function ActiveChannel(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ActiveChannel connection_id. - * @member {string} connection_id - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @instance - */ - ActiveChannel.prototype.connection_id = ""; - - /** - * ActiveChannel port_id. - * @member {string} port_id - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @instance - */ - ActiveChannel.prototype.port_id = ""; - - /** - * ActiveChannel channel_id. - * @member {string} channel_id - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @instance - */ - ActiveChannel.prototype.channel_id = ""; - - /** - * Encodes the specified ActiveChannel message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ActiveChannel.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {ibc.applications.interchain_accounts.v1.IActiveChannel} message ActiveChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActiveChannel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified ActiveChannel message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ActiveChannel.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {ibc.applications.interchain_accounts.v1.IActiveChannel} message ActiveChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActiveChannel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActiveChannel message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.ActiveChannel} ActiveChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActiveChannel.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.ActiveChannel(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.port_id = reader.string(); - break; - case 3: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActiveChannel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.ActiveChannel} ActiveChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActiveChannel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActiveChannel message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActiveChannel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates an ActiveChannel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.ActiveChannel} ActiveChannel - */ - ActiveChannel.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.ActiveChannel) - return object; - var message = new $root.ibc.applications.interchain_accounts.v1.ActiveChannel(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from an ActiveChannel message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {ibc.applications.interchain_accounts.v1.ActiveChannel} message ActiveChannel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActiveChannel.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connection_id = ""; - object.port_id = ""; - object.channel_id = ""; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this ActiveChannel to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @instance - * @returns {Object.} JSON object - */ - ActiveChannel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ActiveChannel; - })(); - - v1.RegisteredInterchainAccount = (function() { - - /** - * Properties of a RegisteredInterchainAccount. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IRegisteredInterchainAccount - * @property {string|null} [connection_id] RegisteredInterchainAccount connection_id - * @property {string|null} [port_id] RegisteredInterchainAccount port_id - * @property {string|null} [account_address] RegisteredInterchainAccount account_address - */ - - /** - * Constructs a new RegisteredInterchainAccount. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a RegisteredInterchainAccount. - * @implements IRegisteredInterchainAccount - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount=} [properties] Properties to set - */ - function RegisteredInterchainAccount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RegisteredInterchainAccount connection_id. - * @member {string} connection_id - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @instance - */ - RegisteredInterchainAccount.prototype.connection_id = ""; - - /** - * RegisteredInterchainAccount port_id. - * @member {string} port_id - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @instance - */ - RegisteredInterchainAccount.prototype.port_id = ""; - - /** - * RegisteredInterchainAccount account_address. - * @member {string} account_address - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @instance - */ - RegisteredInterchainAccount.prototype.account_address = ""; - - /** - * Encodes the specified RegisteredInterchainAccount message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount} message RegisteredInterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredInterchainAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.port_id); - if (message.account_address != null && Object.hasOwnProperty.call(message, "account_address")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.account_address); - return writer; - }; - - /** - * Encodes the specified RegisteredInterchainAccount message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount} message RegisteredInterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredInterchainAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RegisteredInterchainAccount message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount} RegisteredInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredInterchainAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.port_id = reader.string(); - break; - case 3: - message.account_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RegisteredInterchainAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount} RegisteredInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredInterchainAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RegisteredInterchainAccount message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RegisteredInterchainAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.account_address != null && message.hasOwnProperty("account_address")) - if (!$util.isString(message.account_address)) - return "account_address: string expected"; - return null; - }; - - /** - * Creates a RegisteredInterchainAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount} RegisteredInterchainAccount - */ - RegisteredInterchainAccount.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) - return object; - var message = new $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.account_address != null) - message.account_address = String(object.account_address); - return message; - }; - - /** - * Creates a plain object from a RegisteredInterchainAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount} message RegisteredInterchainAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegisteredInterchainAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connection_id = ""; - object.port_id = ""; - object.account_address = ""; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.account_address != null && message.hasOwnProperty("account_address")) - object.account_address = message.account_address; - return object; - }; - - /** - * Converts this RegisteredInterchainAccount to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @instance - * @returns {Object.} JSON object - */ - RegisteredInterchainAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RegisteredInterchainAccount; - })(); - - return v1; - })(); - - return interchain_accounts; - })(); - - applications.transfer = (function() { - - /** - * Namespace transfer. - * @memberof ibc.applications - * @namespace - */ - var transfer = {}; - - transfer.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.transfer - * @namespace - */ - var v1 = {}; - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Msg#transfer}. - * @memberof ibc.applications.transfer.v1.Msg - * @typedef TransferCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.MsgTransferResponse} [response] MsgTransferResponse - */ - - /** - * Calls Transfer. - * @function transfer - * @memberof ibc.applications.transfer.v1.Msg - * @instance - * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object - * @param {ibc.applications.transfer.v1.Msg.TransferCallback} callback Node-style callback called with the error, if any, and MsgTransferResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.transfer = function transfer(request, callback) { - return this.rpcCall(transfer, $root.ibc.applications.transfer.v1.MsgTransfer, $root.ibc.applications.transfer.v1.MsgTransferResponse, request, callback); - }, "name", { value: "Transfer" }); - - /** - * Calls Transfer. - * @function transfer - * @memberof ibc.applications.transfer.v1.Msg - * @instance - * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1.MsgTransfer = (function() { - - /** - * Properties of a MsgTransfer. - * @memberof ibc.applications.transfer.v1 - * @interface IMsgTransfer - * @property {string|null} [source_port] MsgTransfer source_port - * @property {string|null} [source_channel] MsgTransfer source_channel - * @property {cosmos.base.v1beta1.ICoin|null} [token] MsgTransfer token - * @property {string|null} [sender] MsgTransfer sender - * @property {string|null} [receiver] MsgTransfer receiver - * @property {ibc.core.client.v1.IHeight|null} [timeout_height] MsgTransfer timeout_height - * @property {Long|null} [timeout_timestamp] MsgTransfer timeout_timestamp - * @property {string|null} [memo] MsgTransfer memo - */ - - /** - * Constructs a new MsgTransfer. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a MsgTransfer. - * @implements IMsgTransfer - * @constructor - * @param {ibc.applications.transfer.v1.IMsgTransfer=} [properties] Properties to set - */ - function MsgTransfer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTransfer source_port. - * @member {string} source_port - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.source_port = ""; - - /** - * MsgTransfer source_channel. - * @member {string} source_channel - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.source_channel = ""; - - /** - * MsgTransfer token. - * @member {cosmos.base.v1beta1.ICoin|null|undefined} token - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.token = null; - - /** - * MsgTransfer sender. - * @member {string} sender - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.sender = ""; - - /** - * MsgTransfer receiver. - * @member {string} receiver - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.receiver = ""; - - /** - * MsgTransfer timeout_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} timeout_height - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.timeout_height = null; - - /** - * MsgTransfer timeout_timestamp. - * @member {Long} timeout_timestamp - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.timeout_timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgTransfer memo. - * @member {string} memo - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.memo = ""; - - /** - * Encodes the specified MsgTransfer message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransfer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.source_port != null && Object.hasOwnProperty.call(message, "source_port")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.source_port); - if (message.source_channel != null && Object.hasOwnProperty.call(message, "source_channel")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_channel); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - $root.cosmos.base.v1beta1.Coin.encode(message.token, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sender); - if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.receiver); - if (message.timeout_height != null && Object.hasOwnProperty.call(message, "timeout_height")) - $root.ibc.core.client.v1.Height.encode(message.timeout_height, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.timeout_timestamp != null && Object.hasOwnProperty.call(message, "timeout_timestamp")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.timeout_timestamp); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.memo); - return writer; - }; - - /** - * Encodes the specified MsgTransfer message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransfer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransfer.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransfer(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.source_port = reader.string(); - break; - case 2: - message.source_channel = reader.string(); - break; - case 3: - message.token = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); - break; - case 4: - message.sender = reader.string(); - break; - case 5: - message.receiver = reader.string(); - break; - case 6: - message.timeout_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 7: - message.timeout_timestamp = reader.uint64(); - break; - case 8: - message.memo = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransfer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTransfer message. - * @function verify - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTransfer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.source_port != null && message.hasOwnProperty("source_port")) - if (!$util.isString(message.source_port)) - return "source_port: string expected"; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - if (!$util.isString(message.source_channel)) - return "source_channel: string expected"; - if (message.token != null && message.hasOwnProperty("token")) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.token); - if (error) - return "token." + error; - } - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.receiver != null && message.hasOwnProperty("receiver")) - if (!$util.isString(message.receiver)) - return "receiver: string expected"; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.timeout_height); - if (error) - return "timeout_height." + error; - } - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (!$util.isInteger(message.timeout_timestamp) && !(message.timeout_timestamp && $util.isInteger(message.timeout_timestamp.low) && $util.isInteger(message.timeout_timestamp.high))) - return "timeout_timestamp: integer|Long expected"; - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - return null; - }; - - /** - * Creates a MsgTransfer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer - */ - MsgTransfer.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.MsgTransfer) - return object; - var message = new $root.ibc.applications.transfer.v1.MsgTransfer(); - if (object.source_port != null) - message.source_port = String(object.source_port); - if (object.source_channel != null) - message.source_channel = String(object.source_channel); - if (object.token != null) { - if (typeof object.token !== "object") - throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.token: object expected"); - message.token = $root.cosmos.base.v1beta1.Coin.fromObject(object.token); - } - if (object.sender != null) - message.sender = String(object.sender); - if (object.receiver != null) - message.receiver = String(object.receiver); - if (object.timeout_height != null) { - if (typeof object.timeout_height !== "object") - throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.timeout_height: object expected"); - message.timeout_height = $root.ibc.core.client.v1.Height.fromObject(object.timeout_height); - } - if (object.timeout_timestamp != null) - if ($util.Long) - (message.timeout_timestamp = $util.Long.fromValue(object.timeout_timestamp)).unsigned = true; - else if (typeof object.timeout_timestamp === "string") - message.timeout_timestamp = parseInt(object.timeout_timestamp, 10); - else if (typeof object.timeout_timestamp === "number") - message.timeout_timestamp = object.timeout_timestamp; - else if (typeof object.timeout_timestamp === "object") - message.timeout_timestamp = new $util.LongBits(object.timeout_timestamp.low >>> 0, object.timeout_timestamp.high >>> 0).toNumber(true); - if (object.memo != null) - message.memo = String(object.memo); - return message; - }; - - /** - * Creates a plain object from a MsgTransfer message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {ibc.applications.transfer.v1.MsgTransfer} message MsgTransfer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTransfer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.source_port = ""; - object.source_channel = ""; - object.token = null; - object.sender = ""; - object.receiver = ""; - object.timeout_height = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timeout_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timeout_timestamp = options.longs === String ? "0" : 0; - object.memo = ""; - } - if (message.source_port != null && message.hasOwnProperty("source_port")) - object.source_port = message.source_port; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - object.source_channel = message.source_channel; - if (message.token != null && message.hasOwnProperty("token")) - object.token = $root.cosmos.base.v1beta1.Coin.toObject(message.token, options); - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.receiver != null && message.hasOwnProperty("receiver")) - object.receiver = message.receiver; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) - object.timeout_height = $root.ibc.core.client.v1.Height.toObject(message.timeout_height, options); - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (typeof message.timeout_timestamp === "number") - object.timeout_timestamp = options.longs === String ? String(message.timeout_timestamp) : message.timeout_timestamp; - else - object.timeout_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeout_timestamp) : options.longs === Number ? new $util.LongBits(message.timeout_timestamp.low >>> 0, message.timeout_timestamp.high >>> 0).toNumber(true) : message.timeout_timestamp; - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - return object; - }; - - /** - * Converts this MsgTransfer to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - * @returns {Object.} JSON object - */ - MsgTransfer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTransfer; - })(); - - v1.MsgTransferResponse = (function() { - - /** - * Properties of a MsgTransferResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IMsgTransferResponse - * @property {Long|null} [sequence] MsgTransferResponse sequence - */ - - /** - * Constructs a new MsgTransferResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a MsgTransferResponse. - * @implements IMsgTransferResponse - * @constructor - * @param {ibc.applications.transfer.v1.IMsgTransferResponse=} [properties] Properties to set - */ - function MsgTransferResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTransferResponse sequence. - * @member {Long} sequence - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @instance - */ - MsgTransferResponse.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified MsgTransferResponse message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransferResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified MsgTransferResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransferResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransferResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransferResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransferResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTransferResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTransferResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a MsgTransferResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse - */ - MsgTransferResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.MsgTransferResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.MsgTransferResponse(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a MsgTransferResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {ibc.applications.transfer.v1.MsgTransferResponse} message MsgTransferResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTransferResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this MsgTransferResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @instance - * @returns {Object.} JSON object - */ - MsgTransferResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTransferResponse; - })(); - - v1.DenomTrace = (function() { - - /** - * Properties of a DenomTrace. - * @memberof ibc.applications.transfer.v1 - * @interface IDenomTrace - * @property {string|null} [path] DenomTrace path - * @property {string|null} [base_denom] DenomTrace base_denom - */ - - /** - * Constructs a new DenomTrace. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a DenomTrace. - * @implements IDenomTrace - * @constructor - * @param {ibc.applications.transfer.v1.IDenomTrace=} [properties] Properties to set - */ - function DenomTrace(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DenomTrace path. - * @member {string} path - * @memberof ibc.applications.transfer.v1.DenomTrace - * @instance - */ - DenomTrace.prototype.path = ""; - - /** - * DenomTrace base_denom. - * @member {string} base_denom - * @memberof ibc.applications.transfer.v1.DenomTrace - * @instance - */ - DenomTrace.prototype.base_denom = ""; - - /** - * Encodes the specified DenomTrace message. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {ibc.applications.transfer.v1.IDenomTrace} message DenomTrace message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenomTrace.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.base_denom != null && Object.hasOwnProperty.call(message, "base_denom")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.base_denom); - return writer; - }; - - /** - * Encodes the specified DenomTrace message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {ibc.applications.transfer.v1.IDenomTrace} message DenomTrace message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenomTrace.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DenomTrace message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenomTrace.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.DenomTrace(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.string(); - break; - case 2: - message.base_denom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DenomTrace message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenomTrace.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DenomTrace message. - * @function verify - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DenomTrace.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.base_denom != null && message.hasOwnProperty("base_denom")) - if (!$util.isString(message.base_denom)) - return "base_denom: string expected"; - return null; - }; - - /** - * Creates a DenomTrace message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace - */ - DenomTrace.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.DenomTrace) - return object; - var message = new $root.ibc.applications.transfer.v1.DenomTrace(); - if (object.path != null) - message.path = String(object.path); - if (object.base_denom != null) - message.base_denom = String(object.base_denom); - return message; - }; - - /** - * Creates a plain object from a DenomTrace message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {ibc.applications.transfer.v1.DenomTrace} message DenomTrace - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DenomTrace.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.path = ""; - object.base_denom = ""; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.base_denom != null && message.hasOwnProperty("base_denom")) - object.base_denom = message.base_denom; - return object; - }; - - /** - * Converts this DenomTrace to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.DenomTrace - * @instance - * @returns {Object.} JSON object - */ - DenomTrace.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DenomTrace; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.applications.transfer.v1 - * @interface IParams - * @property {boolean|null} [send_enabled] Params send_enabled - * @property {boolean|null} [receive_enabled] Params receive_enabled - */ - - /** - * Constructs a new Params. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.applications.transfer.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params send_enabled. - * @member {boolean} send_enabled - * @memberof ibc.applications.transfer.v1.Params - * @instance - */ - Params.prototype.send_enabled = false; - - /** - * Params receive_enabled. - * @member {boolean} receive_enabled - * @memberof ibc.applications.transfer.v1.Params - * @instance - */ - Params.prototype.receive_enabled = false; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {ibc.applications.transfer.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.send_enabled != null && Object.hasOwnProperty.call(message, "send_enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.send_enabled); - if (message.receive_enabled != null && Object.hasOwnProperty.call(message, "receive_enabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.receive_enabled); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {ibc.applications.transfer.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.send_enabled = reader.bool(); - break; - case 2: - message.receive_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.send_enabled != null && message.hasOwnProperty("send_enabled")) - if (typeof message.send_enabled !== "boolean") - return "send_enabled: boolean expected"; - if (message.receive_enabled != null && message.hasOwnProperty("receive_enabled")) - if (typeof message.receive_enabled !== "boolean") - return "receive_enabled: boolean expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.Params) - return object; - var message = new $root.ibc.applications.transfer.v1.Params(); - if (object.send_enabled != null) - message.send_enabled = Boolean(object.send_enabled); - if (object.receive_enabled != null) - message.receive_enabled = Boolean(object.receive_enabled); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {ibc.applications.transfer.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.send_enabled = false; - object.receive_enabled = false; - } - if (message.send_enabled != null && message.hasOwnProperty("send_enabled")) - object.send_enabled = message.send_enabled; - if (message.receive_enabled != null && message.hasOwnProperty("receive_enabled")) - object.receive_enabled = message.receive_enabled; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTrace}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef DenomTraceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomTraceResponse} [response] QueryDenomTraceResponse - */ - - /** - * Calls DenomTrace. - * @function denomTrace - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.DenomTraceCallback} callback Node-style callback called with the error, if any, and QueryDenomTraceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomTrace = function denomTrace(request, callback) { - return this.rpcCall(denomTrace, $root.ibc.applications.transfer.v1.QueryDenomTraceRequest, $root.ibc.applications.transfer.v1.QueryDenomTraceResponse, request, callback); - }, "name", { value: "DenomTrace" }); - - /** - * Calls DenomTrace. - * @function denomTrace - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTraces}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef DenomTracesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomTracesResponse} [response] QueryDenomTracesResponse - */ - - /** - * Calls DenomTraces. - * @function denomTraces - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.DenomTracesCallback} callback Node-style callback called with the error, if any, and QueryDenomTracesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomTraces = function denomTraces(request, callback) { - return this.rpcCall(denomTraces, $root.ibc.applications.transfer.v1.QueryDenomTracesRequest, $root.ibc.applications.transfer.v1.QueryDenomTracesResponse, request, callback); - }, "name", { value: "DenomTraces" }); - - /** - * Calls DenomTraces. - * @function denomTraces - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#params}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.ibc.applications.transfer.v1.QueryParamsRequest, $root.ibc.applications.transfer.v1.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomHash}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef DenomHashCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomHashResponse} [response] QueryDenomHashResponse - */ - - /** - * Calls DenomHash. - * @function denomHash - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} request QueryDenomHashRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.DenomHashCallback} callback Node-style callback called with the error, if any, and QueryDenomHashResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomHash = function denomHash(request, callback) { - return this.rpcCall(denomHash, $root.ibc.applications.transfer.v1.QueryDenomHashRequest, $root.ibc.applications.transfer.v1.QueryDenomHashResponse, request, callback); - }, "name", { value: "DenomHash" }); - - /** - * Calls DenomHash. - * @function denomHash - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} request QueryDenomHashRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#escrowAddress}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef EscrowAddressCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryEscrowAddressResponse} [response] QueryEscrowAddressResponse - */ - - /** - * Calls EscrowAddress. - * @function escrowAddress - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} request QueryEscrowAddressRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.EscrowAddressCallback} callback Node-style callback called with the error, if any, and QueryEscrowAddressResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.escrowAddress = function escrowAddress(request, callback) { - return this.rpcCall(escrowAddress, $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest, $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse, request, callback); - }, "name", { value: "EscrowAddress" }); - - /** - * Calls EscrowAddress. - * @function escrowAddress - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} request QueryEscrowAddressRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryDenomTraceRequest = (function() { - - /** - * Properties of a QueryDenomTraceRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTraceRequest - * @property {string|null} [hash] QueryDenomTraceRequest hash - */ - - /** - * Constructs a new QueryDenomTraceRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTraceRequest. - * @implements IQueryDenomTraceRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest=} [properties] Properties to set - */ - function QueryDenomTraceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTraceRequest hash. - * @member {string} hash - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @instance - */ - QueryDenomTraceRequest.prototype.hash = ""; - - /** - * Encodes the specified QueryDenomTraceRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} message QueryDenomTraceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); - return writer; - }; - - /** - * Encodes the specified QueryDenomTraceRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} message QueryDenomTraceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTraceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTraceRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTraceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; - return null; - }; - - /** - * Creates a QueryDenomTraceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest - */ - QueryDenomTraceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTraceRequest) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomTraceRequest(); - if (object.hash != null) - message.hash = String(object.hash); - return message; - }; - - /** - * Creates a plain object from a QueryDenomTraceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTraceRequest} message QueryDenomTraceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTraceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.hash = ""; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; - return object; - }; - - /** - * Converts this QueryDenomTraceRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTraceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTraceRequest; - })(); - - v1.QueryDenomTraceResponse = (function() { - - /** - * Properties of a QueryDenomTraceResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTraceResponse - * @property {ibc.applications.transfer.v1.IDenomTrace|null} [denom_trace] QueryDenomTraceResponse denom_trace - */ - - /** - * Constructs a new QueryDenomTraceResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTraceResponse. - * @implements IQueryDenomTraceResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse=} [properties] Properties to set - */ - function QueryDenomTraceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTraceResponse denom_trace. - * @member {ibc.applications.transfer.v1.IDenomTrace|null|undefined} denom_trace - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @instance - */ - QueryDenomTraceResponse.prototype.denom_trace = null; - - /** - * Encodes the specified QueryDenomTraceResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse} message QueryDenomTraceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom_trace != null && Object.hasOwnProperty.call(message, "denom_trace")) - $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denom_trace, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomTraceResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse} message QueryDenomTraceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTraceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom_trace = $root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTraceResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTraceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom_trace != null && message.hasOwnProperty("denom_trace")) { - var error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denom_trace); - if (error) - return "denom_trace." + error; - } - return null; - }; - - /** - * Creates a QueryDenomTraceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse - */ - QueryDenomTraceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTraceResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomTraceResponse(); - if (object.denom_trace != null) { - if (typeof object.denom_trace !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTraceResponse.denom_trace: object expected"); - message.denom_trace = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denom_trace); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomTraceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTraceResponse} message QueryDenomTraceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTraceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.denom_trace = null; - if (message.denom_trace != null && message.hasOwnProperty("denom_trace")) - object.denom_trace = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denom_trace, options); - return object; - }; - - /** - * Converts this QueryDenomTraceResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTraceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTraceResponse; - })(); - - v1.QueryDenomTracesRequest = (function() { - - /** - * Properties of a QueryDenomTracesRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTracesRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryDenomTracesRequest pagination - */ - - /** - * Constructs a new QueryDenomTracesRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTracesRequest. - * @implements IQueryDenomTracesRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest=} [properties] Properties to set - */ - function QueryDenomTracesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTracesRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @instance - */ - QueryDenomTracesRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryDenomTracesRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} message QueryDenomTracesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomTracesRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} message QueryDenomTracesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTracesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTracesRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTracesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryDenomTracesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest - */ - QueryDenomTracesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTracesRequest) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomTracesRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomTracesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTracesRequest} message QueryDenomTracesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTracesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryDenomTracesRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTracesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTracesRequest; - })(); - - v1.QueryDenomTracesResponse = (function() { - - /** - * Properties of a QueryDenomTracesResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTracesResponse - * @property {Array.|null} [denom_traces] QueryDenomTracesResponse denom_traces - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryDenomTracesResponse pagination - */ - - /** - * Constructs a new QueryDenomTracesResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTracesResponse. - * @implements IQueryDenomTracesResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse=} [properties] Properties to set - */ - function QueryDenomTracesResponse(properties) { - this.denom_traces = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTracesResponse denom_traces. - * @member {Array.} denom_traces - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @instance - */ - QueryDenomTracesResponse.prototype.denom_traces = $util.emptyArray; - - /** - * QueryDenomTracesResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @instance - */ - QueryDenomTracesResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryDenomTracesResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse} message QueryDenomTracesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom_traces != null && message.denom_traces.length) - for (var i = 0; i < message.denom_traces.length; ++i) - $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denom_traces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomTracesResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse} message QueryDenomTracesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTracesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.denom_traces && message.denom_traces.length)) - message.denom_traces = []; - message.denom_traces.push($root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTracesResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTracesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom_traces != null && message.hasOwnProperty("denom_traces")) { - if (!Array.isArray(message.denom_traces)) - return "denom_traces: array expected"; - for (var i = 0; i < message.denom_traces.length; ++i) { - var error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denom_traces[i]); - if (error) - return "denom_traces." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryDenomTracesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse - */ - QueryDenomTracesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTracesResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomTracesResponse(); - if (object.denom_traces) { - if (!Array.isArray(object.denom_traces)) - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.denom_traces: array expected"); - message.denom_traces = []; - for (var i = 0; i < object.denom_traces.length; ++i) { - if (typeof object.denom_traces[i] !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.denom_traces: object expected"); - message.denom_traces[i] = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denom_traces[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomTracesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTracesResponse} message QueryDenomTracesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTracesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.denom_traces = []; - if (options.defaults) - object.pagination = null; - if (message.denom_traces && message.denom_traces.length) { - object.denom_traces = []; - for (var j = 0; j < message.denom_traces.length; ++j) - object.denom_traces[j] = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denom_traces[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryDenomTracesResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTracesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTracesResponse; - })(); - - v1.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryParamsRequest) - return object; - return new $root.ibc.applications.transfer.v1.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {ibc.applications.transfer.v1.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - v1.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryParamsResponse - * @property {ibc.applications.transfer.v1.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {ibc.applications.transfer.v1.IParams|null|undefined} params - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.transfer.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.ibc.applications.transfer.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.applications.transfer.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryParamsResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryParamsResponse.params: object expected"); - message.params = $root.ibc.applications.transfer.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {ibc.applications.transfer.v1.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.transfer.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - v1.QueryDenomHashRequest = (function() { - - /** - * Properties of a QueryDenomHashRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomHashRequest - * @property {string|null} [trace] QueryDenomHashRequest trace - */ - - /** - * Constructs a new QueryDenomHashRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomHashRequest. - * @implements IQueryDenomHashRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest=} [properties] Properties to set - */ - function QueryDenomHashRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomHashRequest trace. - * @member {string} trace - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @instance - */ - QueryDenomHashRequest.prototype.trace = ""; - - /** - * Encodes the specified QueryDenomHashRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} message QueryDenomHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trace != null && Object.hasOwnProperty.call(message, "trace")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.trace); - return writer; - }; - - /** - * Encodes the specified QueryDenomHashRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} message QueryDenomHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomHashRequest} QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomHashRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.trace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomHashRequest} QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomHashRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomHashRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trace != null && message.hasOwnProperty("trace")) - if (!$util.isString(message.trace)) - return "trace: string expected"; - return null; - }; - - /** - * Creates a QueryDenomHashRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomHashRequest} QueryDenomHashRequest - */ - QueryDenomHashRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomHashRequest) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomHashRequest(); - if (object.trace != null) - message.trace = String(object.trace); - return message; - }; - - /** - * Creates a plain object from a QueryDenomHashRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {ibc.applications.transfer.v1.QueryDenomHashRequest} message QueryDenomHashRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomHashRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.trace = ""; - if (message.trace != null && message.hasOwnProperty("trace")) - object.trace = message.trace; - return object; - }; - - /** - * Converts this QueryDenomHashRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomHashRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomHashRequest; - })(); - - v1.QueryDenomHashResponse = (function() { - - /** - * Properties of a QueryDenomHashResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomHashResponse - * @property {string|null} [hash] QueryDenomHashResponse hash - */ - - /** - * Constructs a new QueryDenomHashResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomHashResponse. - * @implements IQueryDenomHashResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomHashResponse=} [properties] Properties to set - */ - function QueryDenomHashResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomHashResponse hash. - * @member {string} hash - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @instance - */ - QueryDenomHashResponse.prototype.hash = ""; - - /** - * Encodes the specified QueryDenomHashResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashResponse} message QueryDenomHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); - return writer; - }; - - /** - * Encodes the specified QueryDenomHashResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashResponse} message QueryDenomHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomHashResponse} QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomHashResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomHashResponse} QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomHashResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomHashResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; - return null; - }; - - /** - * Creates a QueryDenomHashResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomHashResponse} QueryDenomHashResponse - */ - QueryDenomHashResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomHashResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomHashResponse(); - if (object.hash != null) - message.hash = String(object.hash); - return message; - }; - - /** - * Creates a plain object from a QueryDenomHashResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {ibc.applications.transfer.v1.QueryDenomHashResponse} message QueryDenomHashResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomHashResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.hash = ""; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; - return object; - }; - - /** - * Converts this QueryDenomHashResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomHashResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomHashResponse; - })(); - - v1.QueryEscrowAddressRequest = (function() { - - /** - * Properties of a QueryEscrowAddressRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryEscrowAddressRequest - * @property {string|null} [port_id] QueryEscrowAddressRequest port_id - * @property {string|null} [channel_id] QueryEscrowAddressRequest channel_id - */ - - /** - * Constructs a new QueryEscrowAddressRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryEscrowAddressRequest. - * @implements IQueryEscrowAddressRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest=} [properties] Properties to set - */ - function QueryEscrowAddressRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryEscrowAddressRequest port_id. - * @member {string} port_id - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @instance - */ - QueryEscrowAddressRequest.prototype.port_id = ""; - - /** - * QueryEscrowAddressRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @instance - */ - QueryEscrowAddressRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryEscrowAddressRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} message QueryEscrowAddressRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryEscrowAddressRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} message QueryEscrowAddressRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressRequest} QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressRequest} QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryEscrowAddressRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryEscrowAddressRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryEscrowAddressRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressRequest} QueryEscrowAddressRequest - */ - QueryEscrowAddressRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryEscrowAddressRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {ibc.applications.transfer.v1.QueryEscrowAddressRequest} message QueryEscrowAddressRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryEscrowAddressRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryEscrowAddressRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @instance - * @returns {Object.} JSON object - */ - QueryEscrowAddressRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryEscrowAddressRequest; - })(); - - v1.QueryEscrowAddressResponse = (function() { - - /** - * Properties of a QueryEscrowAddressResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryEscrowAddressResponse - * @property {string|null} [escrow_address] QueryEscrowAddressResponse escrow_address - */ - - /** - * Constructs a new QueryEscrowAddressResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryEscrowAddressResponse. - * @implements IQueryEscrowAddressResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressResponse=} [properties] Properties to set - */ - function QueryEscrowAddressResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryEscrowAddressResponse escrow_address. - * @member {string} escrow_address - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @instance - */ - QueryEscrowAddressResponse.prototype.escrow_address = ""; - - /** - * Encodes the specified QueryEscrowAddressResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressResponse} message QueryEscrowAddressResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.escrow_address != null && Object.hasOwnProperty.call(message, "escrow_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.escrow_address); - return writer; - }; - - /** - * Encodes the specified QueryEscrowAddressResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressResponse} message QueryEscrowAddressResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressResponse} QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.escrow_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressResponse} QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryEscrowAddressResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryEscrowAddressResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.escrow_address != null && message.hasOwnProperty("escrow_address")) - if (!$util.isString(message.escrow_address)) - return "escrow_address: string expected"; - return null; - }; - - /** - * Creates a QueryEscrowAddressResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressResponse} QueryEscrowAddressResponse - */ - QueryEscrowAddressResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse(); - if (object.escrow_address != null) - message.escrow_address = String(object.escrow_address); - return message; - }; - - /** - * Creates a plain object from a QueryEscrowAddressResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {ibc.applications.transfer.v1.QueryEscrowAddressResponse} message QueryEscrowAddressResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryEscrowAddressResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.escrow_address = ""; - if (message.escrow_address != null && message.hasOwnProperty("escrow_address")) - object.escrow_address = message.escrow_address; - return object; - }; - - /** - * Converts this QueryEscrowAddressResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @instance - * @returns {Object.} JSON object - */ - QueryEscrowAddressResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryEscrowAddressResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.applications.transfer.v1 - * @interface IGenesisState - * @property {string|null} [port_id] GenesisState port_id - * @property {Array.|null} [denom_traces] GenesisState denom_traces - * @property {ibc.applications.transfer.v1.IParams|null} [params] GenesisState params - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.applications.transfer.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.denom_traces = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState port_id. - * @member {string} port_id - * @memberof ibc.applications.transfer.v1.GenesisState - * @instance - */ - GenesisState.prototype.port_id = ""; - - /** - * GenesisState denom_traces. - * @member {Array.} denom_traces - * @memberof ibc.applications.transfer.v1.GenesisState - * @instance - */ - GenesisState.prototype.denom_traces = $util.emptyArray; - - /** - * GenesisState params. - * @member {ibc.applications.transfer.v1.IParams|null|undefined} params - * @memberof ibc.applications.transfer.v1.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.transfer.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {ibc.applications.transfer.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.denom_traces != null && message.denom_traces.length) - for (var i = 0; i < message.denom_traces.length; ++i) - $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denom_traces[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.transfer.v1.Params.encode(message.params, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {ibc.applications.transfer.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - if (!(message.denom_traces && message.denom_traces.length)) - message.denom_traces = []; - message.denom_traces.push($root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32())); - break; - case 3: - message.params = $root.ibc.applications.transfer.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.denom_traces != null && message.hasOwnProperty("denom_traces")) { - if (!Array.isArray(message.denom_traces)) - return "denom_traces: array expected"; - for (var i = 0; i < message.denom_traces.length; ++i) { - var error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denom_traces[i]); - if (error) - return "denom_traces." + error; - } - } - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.applications.transfer.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.GenesisState) - return object; - var message = new $root.ibc.applications.transfer.v1.GenesisState(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.denom_traces) { - if (!Array.isArray(object.denom_traces)) - throw TypeError(".ibc.applications.transfer.v1.GenesisState.denom_traces: array expected"); - message.denom_traces = []; - for (var i = 0; i < object.denom_traces.length; ++i) { - if (typeof object.denom_traces[i] !== "object") - throw TypeError(".ibc.applications.transfer.v1.GenesisState.denom_traces: object expected"); - message.denom_traces[i] = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denom_traces[i]); - } - } - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.transfer.v1.GenesisState.params: object expected"); - message.params = $root.ibc.applications.transfer.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {ibc.applications.transfer.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.denom_traces = []; - if (options.defaults) { - object.port_id = ""; - object.params = null; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.denom_traces && message.denom_traces.length) { - object.denom_traces = []; - for (var j = 0; j < message.denom_traces.length; ++j) - object.denom_traces[j] = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denom_traces[j], options); - } - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.transfer.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return v1; - })(); - - transfer.v2 = (function() { - - /** - * Namespace v2. - * @memberof ibc.applications.transfer - * @namespace - */ - var v2 = {}; - - v2.FungibleTokenPacketData = (function() { - - /** - * Properties of a FungibleTokenPacketData. - * @memberof ibc.applications.transfer.v2 - * @interface IFungibleTokenPacketData - * @property {string|null} [denom] FungibleTokenPacketData denom - * @property {string|null} [amount] FungibleTokenPacketData amount - * @property {string|null} [sender] FungibleTokenPacketData sender - * @property {string|null} [receiver] FungibleTokenPacketData receiver - * @property {string|null} [memo] FungibleTokenPacketData memo - */ - - /** - * Constructs a new FungibleTokenPacketData. - * @memberof ibc.applications.transfer.v2 - * @classdesc Represents a FungibleTokenPacketData. - * @implements IFungibleTokenPacketData - * @constructor - * @param {ibc.applications.transfer.v2.IFungibleTokenPacketData=} [properties] Properties to set - */ - function FungibleTokenPacketData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FungibleTokenPacketData denom. - * @member {string} denom - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.denom = ""; - - /** - * FungibleTokenPacketData amount. - * @member {string} amount - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.amount = ""; - - /** - * FungibleTokenPacketData sender. - * @member {string} sender - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.sender = ""; - - /** - * FungibleTokenPacketData receiver. - * @member {string} receiver - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.receiver = ""; - - /** - * FungibleTokenPacketData memo. - * @member {string} memo - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.memo = ""; - - /** - * Encodes the specified FungibleTokenPacketData message. Does not implicitly {@link ibc.applications.transfer.v2.FungibleTokenPacketData.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {ibc.applications.transfer.v2.IFungibleTokenPacketData} message FungibleTokenPacketData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FungibleTokenPacketData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sender); - if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.receiver); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.memo); - return writer; - }; - - /** - * Encodes the specified FungibleTokenPacketData message, length delimited. Does not implicitly {@link ibc.applications.transfer.v2.FungibleTokenPacketData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {ibc.applications.transfer.v2.IFungibleTokenPacketData} message FungibleTokenPacketData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FungibleTokenPacketData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FungibleTokenPacketData message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v2.FungibleTokenPacketData} FungibleTokenPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FungibleTokenPacketData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v2.FungibleTokenPacketData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - case 3: - message.sender = reader.string(); - break; - case 4: - message.receiver = reader.string(); - break; - case 5: - message.memo = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FungibleTokenPacketData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v2.FungibleTokenPacketData} FungibleTokenPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FungibleTokenPacketData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FungibleTokenPacketData message. - * @function verify - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FungibleTokenPacketData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.receiver != null && message.hasOwnProperty("receiver")) - if (!$util.isString(message.receiver)) - return "receiver: string expected"; - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - return null; - }; - - /** - * Creates a FungibleTokenPacketData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v2.FungibleTokenPacketData} FungibleTokenPacketData - */ - FungibleTokenPacketData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v2.FungibleTokenPacketData) - return object; - var message = new $root.ibc.applications.transfer.v2.FungibleTokenPacketData(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - if (object.sender != null) - message.sender = String(object.sender); - if (object.receiver != null) - message.receiver = String(object.receiver); - if (object.memo != null) - message.memo = String(object.memo); - return message; - }; - - /** - * Creates a plain object from a FungibleTokenPacketData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {ibc.applications.transfer.v2.FungibleTokenPacketData} message FungibleTokenPacketData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FungibleTokenPacketData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - object.sender = ""; - object.receiver = ""; - object.memo = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.receiver != null && message.hasOwnProperty("receiver")) - object.receiver = message.receiver; - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - return object; - }; - - /** - * Converts this FungibleTokenPacketData to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - * @returns {Object.} JSON object - */ - FungibleTokenPacketData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FungibleTokenPacketData; - })(); - - return v2; - })(); - - return transfer; - })(); - - return applications; - })(); - - ibc.core = (function() { - - /** - * Namespace core. - * @memberof ibc - * @namespace - */ - var core = {}; - - core.channel = (function() { - - /** - * Namespace channel. - * @memberof ibc.core - * @namespace - */ - var channel = {}; - - channel.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.channel - * @namespace - */ - var v1 = {}; - - v1.Channel = (function() { - - /** - * Properties of a Channel. - * @memberof ibc.core.channel.v1 - * @interface IChannel - * @property {ibc.core.channel.v1.State|null} [state] Channel state - * @property {ibc.core.channel.v1.Order|null} [ordering] Channel ordering - * @property {ibc.core.channel.v1.ICounterparty|null} [counterparty] Channel counterparty - * @property {Array.|null} [connection_hops] Channel connection_hops - * @property {string|null} [version] Channel version - */ - - /** - * Constructs a new Channel. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Channel. - * @implements IChannel - * @constructor - * @param {ibc.core.channel.v1.IChannel=} [properties] Properties to set - */ - function Channel(properties) { - this.connection_hops = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Channel state. - * @member {ibc.core.channel.v1.State} state - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.state = 0; - - /** - * Channel ordering. - * @member {ibc.core.channel.v1.Order} ordering - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.ordering = 0; - - /** - * Channel counterparty. - * @member {ibc.core.channel.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.counterparty = null; - - /** - * Channel connection_hops. - * @member {Array.} connection_hops - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.connection_hops = $util.emptyArray; - - /** - * Channel version. - * @member {string} version - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.version = ""; - - /** - * Encodes the specified Channel message. Does not implicitly {@link ibc.core.channel.v1.Channel.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {ibc.core.channel.v1.IChannel} message Channel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Channel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.ordering != null && Object.hasOwnProperty.call(message, "ordering")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ordering); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.channel.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.connection_hops != null && message.connection_hops.length) - for (var i = 0; i < message.connection_hops.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.connection_hops[i]); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); - return writer; - }; - - /** - * Encodes the specified Channel message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Channel.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {ibc.core.channel.v1.IChannel} message Channel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Channel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Channel message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.Channel} Channel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Channel.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Channel(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.ordering = reader.int32(); - break; - case 3: - message.counterparty = $root.ibc.core.channel.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.connection_hops && message.connection_hops.length)) - message.connection_hops = []; - message.connection_hops.push(reader.string()); - break; - case 5: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Channel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.Channel} Channel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Channel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Channel message. - * @function verify - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Channel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.ordering != null && message.hasOwnProperty("ordering")) - switch (message.ordering) { - default: - return "ordering: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - var error = $root.ibc.core.channel.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.connection_hops != null && message.hasOwnProperty("connection_hops")) { - if (!Array.isArray(message.connection_hops)) - return "connection_hops: array expected"; - for (var i = 0; i < message.connection_hops.length; ++i) - if (!$util.isString(message.connection_hops[i])) - return "connection_hops: string[] expected"; - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a Channel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.Channel} Channel - */ - Channel.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.Channel) - return object; - var message = new $root.ibc.core.channel.v1.Channel(); - switch (object.state) { - case "STATE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STATE_INIT": - case 1: - message.state = 1; - break; - case "STATE_TRYOPEN": - case 2: - message.state = 2; - break; - case "STATE_OPEN": - case 3: - message.state = 3; - break; - case "STATE_CLOSED": - case 4: - message.state = 4; - break; - } - switch (object.ordering) { - case "ORDER_NONE_UNSPECIFIED": - case 0: - message.ordering = 0; - break; - case "ORDER_UNORDERED": - case 1: - message.ordering = 1; - break; - case "ORDER_ORDERED": - case 2: - message.ordering = 2; - break; - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.channel.v1.Channel.counterparty: object expected"); - message.counterparty = $root.ibc.core.channel.v1.Counterparty.fromObject(object.counterparty); - } - if (object.connection_hops) { - if (!Array.isArray(object.connection_hops)) - throw TypeError(".ibc.core.channel.v1.Channel.connection_hops: array expected"); - message.connection_hops = []; - for (var i = 0; i < object.connection_hops.length; ++i) - message.connection_hops[i] = String(object.connection_hops[i]); - } - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a Channel message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {ibc.core.channel.v1.Channel} message Channel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Channel.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.connection_hops = []; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; - object.ordering = options.enums === String ? "ORDER_NONE_UNSPECIFIED" : 0; - object.counterparty = null; - object.version = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.ibc.core.channel.v1.State[message.state] : message.state; - if (message.ordering != null && message.hasOwnProperty("ordering")) - object.ordering = options.enums === String ? $root.ibc.core.channel.v1.Order[message.ordering] : message.ordering; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.channel.v1.Counterparty.toObject(message.counterparty, options); - if (message.connection_hops && message.connection_hops.length) { - object.connection_hops = []; - for (var j = 0; j < message.connection_hops.length; ++j) - object.connection_hops[j] = message.connection_hops[j]; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this Channel to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.Channel - * @instance - * @returns {Object.} JSON object - */ - Channel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Channel; - })(); - - v1.IdentifiedChannel = (function() { - - /** - * Properties of an IdentifiedChannel. - * @memberof ibc.core.channel.v1 - * @interface IIdentifiedChannel - * @property {ibc.core.channel.v1.State|null} [state] IdentifiedChannel state - * @property {ibc.core.channel.v1.Order|null} [ordering] IdentifiedChannel ordering - * @property {ibc.core.channel.v1.ICounterparty|null} [counterparty] IdentifiedChannel counterparty - * @property {Array.|null} [connection_hops] IdentifiedChannel connection_hops - * @property {string|null} [version] IdentifiedChannel version - * @property {string|null} [port_id] IdentifiedChannel port_id - * @property {string|null} [channel_id] IdentifiedChannel channel_id - */ - - /** - * Constructs a new IdentifiedChannel. - * @memberof ibc.core.channel.v1 - * @classdesc Represents an IdentifiedChannel. - * @implements IIdentifiedChannel - * @constructor - * @param {ibc.core.channel.v1.IIdentifiedChannel=} [properties] Properties to set - */ - function IdentifiedChannel(properties) { - this.connection_hops = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedChannel state. - * @member {ibc.core.channel.v1.State} state - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.state = 0; - - /** - * IdentifiedChannel ordering. - * @member {ibc.core.channel.v1.Order} ordering - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.ordering = 0; - - /** - * IdentifiedChannel counterparty. - * @member {ibc.core.channel.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.counterparty = null; - - /** - * IdentifiedChannel connection_hops. - * @member {Array.} connection_hops - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.connection_hops = $util.emptyArray; - - /** - * IdentifiedChannel version. - * @member {string} version - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.version = ""; - - /** - * IdentifiedChannel port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.port_id = ""; - - /** - * IdentifiedChannel channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.channel_id = ""; - - /** - * Encodes the specified IdentifiedChannel message. Does not implicitly {@link ibc.core.channel.v1.IdentifiedChannel.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {ibc.core.channel.v1.IIdentifiedChannel} message IdentifiedChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedChannel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.ordering != null && Object.hasOwnProperty.call(message, "ordering")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ordering); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.channel.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.connection_hops != null && message.connection_hops.length) - for (var i = 0; i < message.connection_hops.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.connection_hops[i]); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified IdentifiedChannel message, length delimited. Does not implicitly {@link ibc.core.channel.v1.IdentifiedChannel.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {ibc.core.channel.v1.IIdentifiedChannel} message IdentifiedChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedChannel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedChannel message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedChannel.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.IdentifiedChannel(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.ordering = reader.int32(); - break; - case 3: - message.counterparty = $root.ibc.core.channel.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.connection_hops && message.connection_hops.length)) - message.connection_hops = []; - message.connection_hops.push(reader.string()); - break; - case 5: - message.version = reader.string(); - break; - case 6: - message.port_id = reader.string(); - break; - case 7: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedChannel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedChannel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedChannel message. - * @function verify - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedChannel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.ordering != null && message.hasOwnProperty("ordering")) - switch (message.ordering) { - default: - return "ordering: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - var error = $root.ibc.core.channel.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.connection_hops != null && message.hasOwnProperty("connection_hops")) { - if (!Array.isArray(message.connection_hops)) - return "connection_hops: array expected"; - for (var i = 0; i < message.connection_hops.length; ++i) - if (!$util.isString(message.connection_hops[i])) - return "connection_hops: string[] expected"; - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates an IdentifiedChannel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel - */ - IdentifiedChannel.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.IdentifiedChannel) - return object; - var message = new $root.ibc.core.channel.v1.IdentifiedChannel(); - switch (object.state) { - case "STATE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STATE_INIT": - case 1: - message.state = 1; - break; - case "STATE_TRYOPEN": - case 2: - message.state = 2; - break; - case "STATE_OPEN": - case 3: - message.state = 3; - break; - case "STATE_CLOSED": - case 4: - message.state = 4; - break; - } - switch (object.ordering) { - case "ORDER_NONE_UNSPECIFIED": - case 0: - message.ordering = 0; - break; - case "ORDER_UNORDERED": - case 1: - message.ordering = 1; - break; - case "ORDER_ORDERED": - case 2: - message.ordering = 2; - break; - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.channel.v1.IdentifiedChannel.counterparty: object expected"); - message.counterparty = $root.ibc.core.channel.v1.Counterparty.fromObject(object.counterparty); - } - if (object.connection_hops) { - if (!Array.isArray(object.connection_hops)) - throw TypeError(".ibc.core.channel.v1.IdentifiedChannel.connection_hops: array expected"); - message.connection_hops = []; - for (var i = 0; i < object.connection_hops.length; ++i) - message.connection_hops[i] = String(object.connection_hops[i]); - } - if (object.version != null) - message.version = String(object.version); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from an IdentifiedChannel message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {ibc.core.channel.v1.IdentifiedChannel} message IdentifiedChannel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedChannel.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.connection_hops = []; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; - object.ordering = options.enums === String ? "ORDER_NONE_UNSPECIFIED" : 0; - object.counterparty = null; - object.version = ""; - object.port_id = ""; - object.channel_id = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.ibc.core.channel.v1.State[message.state] : message.state; - if (message.ordering != null && message.hasOwnProperty("ordering")) - object.ordering = options.enums === String ? $root.ibc.core.channel.v1.Order[message.ordering] : message.ordering; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.channel.v1.Counterparty.toObject(message.counterparty, options); - if (message.connection_hops && message.connection_hops.length) { - object.connection_hops = []; - for (var j = 0; j < message.connection_hops.length; ++j) - object.connection_hops[j] = message.connection_hops[j]; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this IdentifiedChannel to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - * @returns {Object.} JSON object - */ - IdentifiedChannel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedChannel; - })(); - - /** - * State enum. - * @name ibc.core.channel.v1.State - * @enum {number} - * @property {number} STATE_UNINITIALIZED_UNSPECIFIED=0 STATE_UNINITIALIZED_UNSPECIFIED value - * @property {number} STATE_INIT=1 STATE_INIT value - * @property {number} STATE_TRYOPEN=2 STATE_TRYOPEN value - * @property {number} STATE_OPEN=3 STATE_OPEN value - * @property {number} STATE_CLOSED=4 STATE_CLOSED value - */ - v1.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNINITIALIZED_UNSPECIFIED"] = 0; - values[valuesById[1] = "STATE_INIT"] = 1; - values[valuesById[2] = "STATE_TRYOPEN"] = 2; - values[valuesById[3] = "STATE_OPEN"] = 3; - values[valuesById[4] = "STATE_CLOSED"] = 4; - return values; - })(); - - /** - * Order enum. - * @name ibc.core.channel.v1.Order - * @enum {number} - * @property {number} ORDER_NONE_UNSPECIFIED=0 ORDER_NONE_UNSPECIFIED value - * @property {number} ORDER_UNORDERED=1 ORDER_UNORDERED value - * @property {number} ORDER_ORDERED=2 ORDER_ORDERED value - */ - v1.Order = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ORDER_NONE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORDER_UNORDERED"] = 1; - values[valuesById[2] = "ORDER_ORDERED"] = 2; - return values; - })(); - - v1.Counterparty = (function() { - - /** - * Properties of a Counterparty. - * @memberof ibc.core.channel.v1 - * @interface ICounterparty - * @property {string|null} [port_id] Counterparty port_id - * @property {string|null} [channel_id] Counterparty channel_id - */ - - /** - * Constructs a new Counterparty. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Counterparty. - * @implements ICounterparty - * @constructor - * @param {ibc.core.channel.v1.ICounterparty=} [properties] Properties to set - */ - function Counterparty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Counterparty port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.Counterparty - * @instance - */ - Counterparty.prototype.port_id = ""; - - /** - * Counterparty channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.Counterparty - * @instance - */ - Counterparty.prototype.channel_id = ""; - - /** - * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.channel.v1.Counterparty.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {ibc.core.channel.v1.ICounterparty} message Counterparty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counterparty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified Counterparty message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Counterparty.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {ibc.core.channel.v1.ICounterparty} message Counterparty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counterparty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Counterparty message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.Counterparty} Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counterparty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Counterparty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Counterparty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.Counterparty} Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counterparty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Counterparty message. - * @function verify - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Counterparty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a Counterparty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.Counterparty} Counterparty - */ - Counterparty.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.Counterparty) - return object; - var message = new $root.ibc.core.channel.v1.Counterparty(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a Counterparty message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {ibc.core.channel.v1.Counterparty} message Counterparty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Counterparty.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this Counterparty to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.Counterparty - * @instance - * @returns {Object.} JSON object - */ - Counterparty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Counterparty; - })(); - - v1.Packet = (function() { - - /** - * Properties of a Packet. - * @memberof ibc.core.channel.v1 - * @interface IPacket - * @property {Long|null} [sequence] Packet sequence - * @property {string|null} [source_port] Packet source_port - * @property {string|null} [source_channel] Packet source_channel - * @property {string|null} [destination_port] Packet destination_port - * @property {string|null} [destination_channel] Packet destination_channel - * @property {Uint8Array|null} [data] Packet data - * @property {ibc.core.client.v1.IHeight|null} [timeout_height] Packet timeout_height - * @property {Long|null} [timeout_timestamp] Packet timeout_timestamp - */ - - /** - * Constructs a new Packet. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Packet. - * @implements IPacket - * @constructor - * @param {ibc.core.channel.v1.IPacket=} [properties] Properties to set - */ - function Packet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Packet sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Packet source_port. - * @member {string} source_port - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.source_port = ""; - - /** - * Packet source_channel. - * @member {string} source_channel - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.source_channel = ""; - - /** - * Packet destination_port. - * @member {string} destination_port - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.destination_port = ""; - - /** - * Packet destination_channel. - * @member {string} destination_channel - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.destination_channel = ""; - - /** - * Packet data. - * @member {Uint8Array} data - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.data = $util.newBuffer([]); - - /** - * Packet timeout_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} timeout_height - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.timeout_height = null; - - /** - * Packet timeout_timestamp. - * @member {Long} timeout_timestamp - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.timeout_timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Packet message. Does not implicitly {@link ibc.core.channel.v1.Packet.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {ibc.core.channel.v1.IPacket} message Packet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Packet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.source_port != null && Object.hasOwnProperty.call(message, "source_port")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_port); - if (message.source_channel != null && Object.hasOwnProperty.call(message, "source_channel")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.source_channel); - if (message.destination_port != null && Object.hasOwnProperty.call(message, "destination_port")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.destination_port); - if (message.destination_channel != null && Object.hasOwnProperty.call(message, "destination_channel")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.destination_channel); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.data); - if (message.timeout_height != null && Object.hasOwnProperty.call(message, "timeout_height")) - $root.ibc.core.client.v1.Height.encode(message.timeout_height, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.timeout_timestamp != null && Object.hasOwnProperty.call(message, "timeout_timestamp")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.timeout_timestamp); - return writer; - }; - - /** - * Encodes the specified Packet message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Packet.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {ibc.core.channel.v1.IPacket} message Packet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Packet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Packet message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.Packet} Packet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Packet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Packet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.source_port = reader.string(); - break; - case 3: - message.source_channel = reader.string(); - break; - case 4: - message.destination_port = reader.string(); - break; - case 5: - message.destination_channel = reader.string(); - break; - case 6: - message.data = reader.bytes(); - break; - case 7: - message.timeout_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 8: - message.timeout_timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Packet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.Packet} Packet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Packet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Packet message. - * @function verify - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Packet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.source_port != null && message.hasOwnProperty("source_port")) - if (!$util.isString(message.source_port)) - return "source_port: string expected"; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - if (!$util.isString(message.source_channel)) - return "source_channel: string expected"; - if (message.destination_port != null && message.hasOwnProperty("destination_port")) - if (!$util.isString(message.destination_port)) - return "destination_port: string expected"; - if (message.destination_channel != null && message.hasOwnProperty("destination_channel")) - if (!$util.isString(message.destination_channel)) - return "destination_channel: string expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.timeout_height); - if (error) - return "timeout_height." + error; - } - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (!$util.isInteger(message.timeout_timestamp) && !(message.timeout_timestamp && $util.isInteger(message.timeout_timestamp.low) && $util.isInteger(message.timeout_timestamp.high))) - return "timeout_timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a Packet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.Packet} Packet - */ - Packet.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.Packet) - return object; - var message = new $root.ibc.core.channel.v1.Packet(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.source_port != null) - message.source_port = String(object.source_port); - if (object.source_channel != null) - message.source_channel = String(object.source_channel); - if (object.destination_port != null) - message.destination_port = String(object.destination_port); - if (object.destination_channel != null) - message.destination_channel = String(object.destination_channel); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.timeout_height != null) { - if (typeof object.timeout_height !== "object") - throw TypeError(".ibc.core.channel.v1.Packet.timeout_height: object expected"); - message.timeout_height = $root.ibc.core.client.v1.Height.fromObject(object.timeout_height); - } - if (object.timeout_timestamp != null) - if ($util.Long) - (message.timeout_timestamp = $util.Long.fromValue(object.timeout_timestamp)).unsigned = true; - else if (typeof object.timeout_timestamp === "string") - message.timeout_timestamp = parseInt(object.timeout_timestamp, 10); - else if (typeof object.timeout_timestamp === "number") - message.timeout_timestamp = object.timeout_timestamp; - else if (typeof object.timeout_timestamp === "object") - message.timeout_timestamp = new $util.LongBits(object.timeout_timestamp.low >>> 0, object.timeout_timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Packet message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {ibc.core.channel.v1.Packet} message Packet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Packet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - object.source_port = ""; - object.source_channel = ""; - object.destination_port = ""; - object.destination_channel = ""; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.timeout_height = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timeout_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timeout_timestamp = options.longs === String ? "0" : 0; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.source_port != null && message.hasOwnProperty("source_port")) - object.source_port = message.source_port; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - object.source_channel = message.source_channel; - if (message.destination_port != null && message.hasOwnProperty("destination_port")) - object.destination_port = message.destination_port; - if (message.destination_channel != null && message.hasOwnProperty("destination_channel")) - object.destination_channel = message.destination_channel; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) - object.timeout_height = $root.ibc.core.client.v1.Height.toObject(message.timeout_height, options); - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (typeof message.timeout_timestamp === "number") - object.timeout_timestamp = options.longs === String ? String(message.timeout_timestamp) : message.timeout_timestamp; - else - object.timeout_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeout_timestamp) : options.longs === Number ? new $util.LongBits(message.timeout_timestamp.low >>> 0, message.timeout_timestamp.high >>> 0).toNumber(true) : message.timeout_timestamp; - return object; - }; - - /** - * Converts this Packet to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.Packet - * @instance - * @returns {Object.} JSON object - */ - Packet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Packet; - })(); - - v1.PacketState = (function() { - - /** - * Properties of a PacketState. - * @memberof ibc.core.channel.v1 - * @interface IPacketState - * @property {string|null} [port_id] PacketState port_id - * @property {string|null} [channel_id] PacketState channel_id - * @property {Long|null} [sequence] PacketState sequence - * @property {Uint8Array|null} [data] PacketState data - */ - - /** - * Constructs a new PacketState. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a PacketState. - * @implements IPacketState - * @constructor - * @param {ibc.core.channel.v1.IPacketState=} [properties] Properties to set - */ - function PacketState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketState port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.PacketState - * @instance - */ - PacketState.prototype.port_id = ""; - - /** - * PacketState channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.PacketState - * @instance - */ - PacketState.prototype.channel_id = ""; - - /** - * PacketState sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.PacketState - * @instance - */ - PacketState.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PacketState data. - * @member {Uint8Array} data - * @memberof ibc.core.channel.v1.PacketState - * @instance - */ - PacketState.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified PacketState message. Does not implicitly {@link ibc.core.channel.v1.PacketState.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {ibc.core.channel.v1.IPacketState} message PacketState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified PacketState message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {ibc.core.channel.v1.IPacketState} message PacketState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.PacketState} PacketState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.PacketState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - case 4: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.PacketState} PacketState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketState message. - * @function verify - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a PacketState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.PacketState} PacketState - */ - PacketState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.PacketState) - return object; - var message = new $root.ibc.core.channel.v1.PacketState(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a PacketState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {ibc.core.channel.v1.PacketState} message PacketState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this PacketState to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.PacketState - * @instance - * @returns {Object.} JSON object - */ - PacketState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketState; - })(); - - v1.PacketId = (function() { - - /** - * Properties of a PacketId. - * @memberof ibc.core.channel.v1 - * @interface IPacketId - * @property {string|null} [port_id] PacketId port_id - * @property {string|null} [channel_id] PacketId channel_id - * @property {Long|null} [sequence] PacketId sequence - */ - - /** - * Constructs a new PacketId. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a PacketId. - * @implements IPacketId - * @constructor - * @param {ibc.core.channel.v1.IPacketId=} [properties] Properties to set - */ - function PacketId(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketId port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.PacketId - * @instance - */ - PacketId.prototype.port_id = ""; - - /** - * PacketId channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.PacketId - * @instance - */ - PacketId.prototype.channel_id = ""; - - /** - * PacketId sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.PacketId - * @instance - */ - PacketId.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified PacketId message. Does not implicitly {@link ibc.core.channel.v1.PacketId.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {ibc.core.channel.v1.IPacketId} message PacketId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified PacketId message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketId.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {ibc.core.channel.v1.IPacketId} message PacketId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketId message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.PacketId} PacketId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketId.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.PacketId(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.PacketId} PacketId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketId message. - * @function verify - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a PacketId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.PacketId} PacketId - */ - PacketId.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.PacketId) - return object; - var message = new $root.ibc.core.channel.v1.PacketId(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PacketId message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {ibc.core.channel.v1.PacketId} message PacketId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this PacketId to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.PacketId - * @instance - * @returns {Object.} JSON object - */ - PacketId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketId; - })(); - - v1.Acknowledgement = (function() { - - /** - * Properties of an Acknowledgement. - * @memberof ibc.core.channel.v1 - * @interface IAcknowledgement - * @property {Uint8Array|null} [result] Acknowledgement result - * @property {string|null} [error] Acknowledgement error - */ - - /** - * Constructs a new Acknowledgement. - * @memberof ibc.core.channel.v1 - * @classdesc Represents an Acknowledgement. - * @implements IAcknowledgement - * @constructor - * @param {ibc.core.channel.v1.IAcknowledgement=} [properties] Properties to set - */ - function Acknowledgement(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Acknowledgement result. - * @member {Uint8Array|null|undefined} result - * @memberof ibc.core.channel.v1.Acknowledgement - * @instance - */ - Acknowledgement.prototype.result = null; - - /** - * Acknowledgement error. - * @member {string|null|undefined} error - * @memberof ibc.core.channel.v1.Acknowledgement - * @instance - */ - Acknowledgement.prototype.error = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Acknowledgement response. - * @member {"result"|"error"|undefined} response - * @memberof ibc.core.channel.v1.Acknowledgement - * @instance - */ - Object.defineProperty(Acknowledgement.prototype, "response", { - get: $util.oneOfGetter($oneOfFields = ["result", "error"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified Acknowledgement message. Does not implicitly {@link ibc.core.channel.v1.Acknowledgement.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {ibc.core.channel.v1.IAcknowledgement} message Acknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Acknowledgement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.result); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.error); - return writer; - }; - - /** - * Encodes the specified Acknowledgement message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Acknowledgement.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {ibc.core.channel.v1.IAcknowledgement} message Acknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Acknowledgement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Acknowledgement message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Acknowledgement.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Acknowledgement(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 21: - message.result = reader.bytes(); - break; - case 22: - message.error = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Acknowledgement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Acknowledgement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Acknowledgement message. - * @function verify - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Acknowledgement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.result != null && message.hasOwnProperty("result")) { - properties.response = 1; - if (!(message.result && typeof message.result.length === "number" || $util.isString(message.result))) - return "result: buffer expected"; - } - if (message.error != null && message.hasOwnProperty("error")) { - if (properties.response === 1) - return "response: multiple values"; - properties.response = 1; - if (!$util.isString(message.error)) - return "error: string expected"; - } - return null; - }; - - /** - * Creates an Acknowledgement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement - */ - Acknowledgement.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.Acknowledgement) - return object; - var message = new $root.ibc.core.channel.v1.Acknowledgement(); - if (object.result != null) - if (typeof object.result === "string") - $util.base64.decode(object.result, message.result = $util.newBuffer($util.base64.length(object.result)), 0); - else if (object.result.length) - message.result = object.result; - if (object.error != null) - message.error = String(object.error); - return message; - }; - - /** - * Creates a plain object from an Acknowledgement message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {ibc.core.channel.v1.Acknowledgement} message Acknowledgement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Acknowledgement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.result != null && message.hasOwnProperty("result")) { - object.result = options.bytes === String ? $util.base64.encode(message.result, 0, message.result.length) : options.bytes === Array ? Array.prototype.slice.call(message.result) : message.result; - if (options.oneofs) - object.response = "result"; - } - if (message.error != null && message.hasOwnProperty("error")) { - object.error = message.error; - if (options.oneofs) - object.response = "error"; - } - return object; - }; - - /** - * Converts this Acknowledgement to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.Acknowledgement - * @instance - * @returns {Object.} JSON object - */ - Acknowledgement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Acknowledgement; - })(); - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenInit}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelOpenInitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelOpenInitResponse} [response] MsgChannelOpenInitResponse - */ - - /** - * Calls ChannelOpenInit. - * @function channelOpenInit - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenInit} request MsgChannelOpenInit message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelOpenInitCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenInitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelOpenInit = function channelOpenInit(request, callback) { - return this.rpcCall(channelOpenInit, $root.ibc.core.channel.v1.MsgChannelOpenInit, $root.ibc.core.channel.v1.MsgChannelOpenInitResponse, request, callback); - }, "name", { value: "ChannelOpenInit" }); - - /** - * Calls ChannelOpenInit. - * @function channelOpenInit - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenInit} request MsgChannelOpenInit message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenTry}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelOpenTryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelOpenTryResponse} [response] MsgChannelOpenTryResponse - */ - - /** - * Calls ChannelOpenTry. - * @function channelOpenTry - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenTry} request MsgChannelOpenTry message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelOpenTryCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenTryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelOpenTry = function channelOpenTry(request, callback) { - return this.rpcCall(channelOpenTry, $root.ibc.core.channel.v1.MsgChannelOpenTry, $root.ibc.core.channel.v1.MsgChannelOpenTryResponse, request, callback); - }, "name", { value: "ChannelOpenTry" }); - - /** - * Calls ChannelOpenTry. - * @function channelOpenTry - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenTry} request MsgChannelOpenTry message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenAck}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelOpenAckCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelOpenAckResponse} [response] MsgChannelOpenAckResponse - */ - - /** - * Calls ChannelOpenAck. - * @function channelOpenAck - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenAck} request MsgChannelOpenAck message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelOpenAckCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenAckResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelOpenAck = function channelOpenAck(request, callback) { - return this.rpcCall(channelOpenAck, $root.ibc.core.channel.v1.MsgChannelOpenAck, $root.ibc.core.channel.v1.MsgChannelOpenAckResponse, request, callback); - }, "name", { value: "ChannelOpenAck" }); - - /** - * Calls ChannelOpenAck. - * @function channelOpenAck - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenAck} request MsgChannelOpenAck message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenConfirm}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelOpenConfirmCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} [response] MsgChannelOpenConfirmResponse - */ - - /** - * Calls ChannelOpenConfirm. - * @function channelOpenConfirm - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} request MsgChannelOpenConfirm message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelOpenConfirmCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenConfirmResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelOpenConfirm = function channelOpenConfirm(request, callback) { - return this.rpcCall(channelOpenConfirm, $root.ibc.core.channel.v1.MsgChannelOpenConfirm, $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse, request, callback); - }, "name", { value: "ChannelOpenConfirm" }); - - /** - * Calls ChannelOpenConfirm. - * @function channelOpenConfirm - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} request MsgChannelOpenConfirm message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelCloseInit}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelCloseInitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelCloseInitResponse} [response] MsgChannelCloseInitResponse - */ - - /** - * Calls ChannelCloseInit. - * @function channelCloseInit - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelCloseInit} request MsgChannelCloseInit message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelCloseInitCallback} callback Node-style callback called with the error, if any, and MsgChannelCloseInitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelCloseInit = function channelCloseInit(request, callback) { - return this.rpcCall(channelCloseInit, $root.ibc.core.channel.v1.MsgChannelCloseInit, $root.ibc.core.channel.v1.MsgChannelCloseInitResponse, request, callback); - }, "name", { value: "ChannelCloseInit" }); - - /** - * Calls ChannelCloseInit. - * @function channelCloseInit - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelCloseInit} request MsgChannelCloseInit message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelCloseConfirm}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelCloseConfirmCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} [response] MsgChannelCloseConfirmResponse - */ - - /** - * Calls ChannelCloseConfirm. - * @function channelCloseConfirm - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} request MsgChannelCloseConfirm message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelCloseConfirmCallback} callback Node-style callback called with the error, if any, and MsgChannelCloseConfirmResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelCloseConfirm = function channelCloseConfirm(request, callback) { - return this.rpcCall(channelCloseConfirm, $root.ibc.core.channel.v1.MsgChannelCloseConfirm, $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse, request, callback); - }, "name", { value: "ChannelCloseConfirm" }); - - /** - * Calls ChannelCloseConfirm. - * @function channelCloseConfirm - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} request MsgChannelCloseConfirm message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#recvPacket}. - * @memberof ibc.core.channel.v1.Msg - * @typedef RecvPacketCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgRecvPacketResponse} [response] MsgRecvPacketResponse - */ - - /** - * Calls RecvPacket. - * @function recvPacket - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgRecvPacket} request MsgRecvPacket message or plain object - * @param {ibc.core.channel.v1.Msg.RecvPacketCallback} callback Node-style callback called with the error, if any, and MsgRecvPacketResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.recvPacket = function recvPacket(request, callback) { - return this.rpcCall(recvPacket, $root.ibc.core.channel.v1.MsgRecvPacket, $root.ibc.core.channel.v1.MsgRecvPacketResponse, request, callback); - }, "name", { value: "RecvPacket" }); - - /** - * Calls RecvPacket. - * @function recvPacket - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgRecvPacket} request MsgRecvPacket message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#timeout}. - * @memberof ibc.core.channel.v1.Msg - * @typedef TimeoutCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgTimeoutResponse} [response] MsgTimeoutResponse - */ - - /** - * Calls Timeout. - * @function timeout - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgTimeout} request MsgTimeout message or plain object - * @param {ibc.core.channel.v1.Msg.TimeoutCallback} callback Node-style callback called with the error, if any, and MsgTimeoutResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.timeout = function timeout(request, callback) { - return this.rpcCall(timeout, $root.ibc.core.channel.v1.MsgTimeout, $root.ibc.core.channel.v1.MsgTimeoutResponse, request, callback); - }, "name", { value: "Timeout" }); - - /** - * Calls Timeout. - * @function timeout - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgTimeout} request MsgTimeout message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#timeoutOnClose}. - * @memberof ibc.core.channel.v1.Msg - * @typedef TimeoutOnCloseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} [response] MsgTimeoutOnCloseResponse - */ - - /** - * Calls TimeoutOnClose. - * @function timeoutOnClose - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} request MsgTimeoutOnClose message or plain object - * @param {ibc.core.channel.v1.Msg.TimeoutOnCloseCallback} callback Node-style callback called with the error, if any, and MsgTimeoutOnCloseResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.timeoutOnClose = function timeoutOnClose(request, callback) { - return this.rpcCall(timeoutOnClose, $root.ibc.core.channel.v1.MsgTimeoutOnClose, $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse, request, callback); - }, "name", { value: "TimeoutOnClose" }); - - /** - * Calls TimeoutOnClose. - * @function timeoutOnClose - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} request MsgTimeoutOnClose message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#acknowledgement}. - * @memberof ibc.core.channel.v1.Msg - * @typedef AcknowledgementCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgAcknowledgementResponse} [response] MsgAcknowledgementResponse - */ - - /** - * Calls Acknowledgement. - * @function acknowledgement - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgAcknowledgement} request MsgAcknowledgement message or plain object - * @param {ibc.core.channel.v1.Msg.AcknowledgementCallback} callback Node-style callback called with the error, if any, and MsgAcknowledgementResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.acknowledgement = function acknowledgement(request, callback) { - return this.rpcCall(acknowledgement, $root.ibc.core.channel.v1.MsgAcknowledgement, $root.ibc.core.channel.v1.MsgAcknowledgementResponse, request, callback); - }, "name", { value: "Acknowledgement" }); - - /** - * Calls Acknowledgement. - * @function acknowledgement - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgAcknowledgement} request MsgAcknowledgement message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - /** - * ResponseResultType enum. - * @name ibc.core.channel.v1.ResponseResultType - * @enum {number} - * @property {number} RESPONSE_RESULT_TYPE_UNSPECIFIED=0 RESPONSE_RESULT_TYPE_UNSPECIFIED value - * @property {number} RESPONSE_RESULT_TYPE_NOOP=1 RESPONSE_RESULT_TYPE_NOOP value - * @property {number} RESPONSE_RESULT_TYPE_SUCCESS=2 RESPONSE_RESULT_TYPE_SUCCESS value - */ - v1.ResponseResultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESPONSE_RESULT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESPONSE_RESULT_TYPE_NOOP"] = 1; - values[valuesById[2] = "RESPONSE_RESULT_TYPE_SUCCESS"] = 2; - return values; - })(); - - v1.MsgChannelOpenInit = (function() { - - /** - * Properties of a MsgChannelOpenInit. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenInit - * @property {string|null} [port_id] MsgChannelOpenInit port_id - * @property {ibc.core.channel.v1.IChannel|null} [channel] MsgChannelOpenInit channel - * @property {string|null} [signer] MsgChannelOpenInit signer - */ - - /** - * Constructs a new MsgChannelOpenInit. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenInit. - * @implements IMsgChannelOpenInit - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenInit=} [properties] Properties to set - */ - function MsgChannelOpenInit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenInit port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @instance - */ - MsgChannelOpenInit.prototype.port_id = ""; - - /** - * MsgChannelOpenInit channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @instance - */ - MsgChannelOpenInit.prototype.channel = null; - - /** - * MsgChannelOpenInit signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @instance - */ - MsgChannelOpenInit.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelOpenInit message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInit.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenInit} message MsgChannelOpenInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenInit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenInit message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInit.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenInit} message MsgChannelOpenInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenInit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenInit message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenInit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenInit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenInit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenInit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenInit message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenInit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - var error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenInit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit - */ - MsgChannelOpenInit.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenInit) - return object; - var message = new $root.ibc.core.channel.v1.MsgChannelOpenInit(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenInit.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenInit message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenInit} message MsgChannelOpenInit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenInit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelOpenInit to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenInit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenInit; - })(); - - v1.MsgChannelOpenInitResponse = (function() { - - /** - * Properties of a MsgChannelOpenInitResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenInitResponse - * @property {string|null} [channel_id] MsgChannelOpenInitResponse channel_id - * @property {string|null} [version] MsgChannelOpenInitResponse version - */ - - /** - * Constructs a new MsgChannelOpenInitResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenInitResponse. - * @implements IMsgChannelOpenInitResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse=} [properties] Properties to set - */ - function MsgChannelOpenInitResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenInitResponse channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @instance - */ - MsgChannelOpenInitResponse.prototype.channel_id = ""; - - /** - * MsgChannelOpenInitResponse version. - * @member {string} version - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @instance - */ - MsgChannelOpenInitResponse.prototype.version = ""; - - /** - * Encodes the specified MsgChannelOpenInitResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInitResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse} message MsgChannelOpenInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenInitResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenInitResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse} message MsgChannelOpenInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenInitResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenInitResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenInitResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenInitResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenInitResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenInitResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenInitResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenInitResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenInitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse - */ - MsgChannelOpenInitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenInitResponse) - return object; - var message = new $root.ibc.core.channel.v1.MsgChannelOpenInitResponse(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenInitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenInitResponse} message MsgChannelOpenInitResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenInitResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.channel_id = ""; - object.version = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this MsgChannelOpenInitResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenInitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenInitResponse; - })(); - - v1.MsgChannelOpenTry = (function() { - - /** - * Properties of a MsgChannelOpenTry. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenTry - * @property {string|null} [port_id] MsgChannelOpenTry port_id - * @property {string|null} [previous_channel_id] MsgChannelOpenTry previous_channel_id - * @property {ibc.core.channel.v1.IChannel|null} [channel] MsgChannelOpenTry channel - * @property {string|null} [counterparty_version] MsgChannelOpenTry counterparty_version - * @property {Uint8Array|null} [proof_init] MsgChannelOpenTry proof_init - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgChannelOpenTry proof_height - * @property {string|null} [signer] MsgChannelOpenTry signer - */ - - /** - * Constructs a new MsgChannelOpenTry. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenTry. - * @implements IMsgChannelOpenTry - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenTry=} [properties] Properties to set - */ - function MsgChannelOpenTry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenTry port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.port_id = ""; - - /** - * MsgChannelOpenTry previous_channel_id. - * @member {string} previous_channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.previous_channel_id = ""; - - /** - * MsgChannelOpenTry channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.channel = null; - - /** - * MsgChannelOpenTry counterparty_version. - * @member {string} counterparty_version - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.counterparty_version = ""; - - /** - * MsgChannelOpenTry proof_init. - * @member {Uint8Array} proof_init - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.proof_init = $util.newBuffer([]); - - /** - * MsgChannelOpenTry proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.proof_height = null; - - /** - * MsgChannelOpenTry signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelOpenTry message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTry.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenTry} message MsgChannelOpenTry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenTry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.previous_channel_id != null && Object.hasOwnProperty.call(message, "previous_channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.previous_channel_id); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.counterparty_version != null && Object.hasOwnProperty.call(message, "counterparty_version")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.counterparty_version); - if (message.proof_init != null && Object.hasOwnProperty.call(message, "proof_init")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proof_init); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenTry message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTry.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenTry} message MsgChannelOpenTry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenTry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenTry message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenTry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenTry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.previous_channel_id = reader.string(); - break; - case 3: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - case 4: - message.counterparty_version = reader.string(); - break; - case 5: - message.proof_init = reader.bytes(); - break; - case 6: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 7: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenTry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenTry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenTry message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenTry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.previous_channel_id != null && message.hasOwnProperty("previous_channel_id")) - if (!$util.isString(message.previous_channel_id)) - return "previous_channel_id: string expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - var error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - if (message.counterparty_version != null && message.hasOwnProperty("counterparty_version")) - if (!$util.isString(message.counterparty_version)) - return "counterparty_version: string expected"; - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - if (!(message.proof_init && typeof message.proof_init.length === "number" || $util.isString(message.proof_init))) - return "proof_init: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenTry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry - */ - MsgChannelOpenTry.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenTry) - return object; - var message = new $root.ibc.core.channel.v1.MsgChannelOpenTry(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.previous_channel_id != null) - message.previous_channel_id = String(object.previous_channel_id); - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenTry.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - if (object.counterparty_version != null) - message.counterparty_version = String(object.counterparty_version); - if (object.proof_init != null) - if (typeof object.proof_init === "string") - $util.base64.decode(object.proof_init, message.proof_init = $util.newBuffer($util.base64.length(object.proof_init)), 0); - else if (object.proof_init.length) - message.proof_init = object.proof_init; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenTry.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenTry message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenTry} message MsgChannelOpenTry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenTry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.previous_channel_id = ""; - object.channel = null; - object.counterparty_version = ""; - if (options.bytes === String) - object.proof_init = ""; - else { - object.proof_init = []; - if (options.bytes !== Array) - object.proof_init = $util.newBuffer(object.proof_init); - } - object.proof_height = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.previous_channel_id != null && message.hasOwnProperty("previous_channel_id")) - object.previous_channel_id = message.previous_channel_id; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - if (message.counterparty_version != null && message.hasOwnProperty("counterparty_version")) - object.counterparty_version = message.counterparty_version; - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - object.proof_init = options.bytes === String ? $util.base64.encode(message.proof_init, 0, message.proof_init.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_init) : message.proof_init; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelOpenTry to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenTry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenTry; - })(); - - v1.MsgChannelOpenTryResponse = (function() { - - /** - * Properties of a MsgChannelOpenTryResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenTryResponse - * @property {string|null} [version] MsgChannelOpenTryResponse version - */ - - /** - * Constructs a new MsgChannelOpenTryResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenTryResponse. - * @implements IMsgChannelOpenTryResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse=} [properties] Properties to set - */ - function MsgChannelOpenTryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenTryResponse version. - * @member {string} version - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @instance - */ - MsgChannelOpenTryResponse.prototype.version = ""; - - /** - * Encodes the specified MsgChannelOpenTryResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTryResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse} message MsgChannelOpenTryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenTryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenTryResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse} message MsgChannelOpenTryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenTryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenTryResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenTryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenTryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenTryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenTryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenTryResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenTryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenTryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse - */ - MsgChannelOpenTryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenTryResponse) - return object; - var message = new $root.ibc.core.channel.v1.MsgChannelOpenTryResponse(); - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenTryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenTryResponse} message MsgChannelOpenTryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenTryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.version = ""; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this MsgChannelOpenTryResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenTryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenTryResponse; - })(); - - v1.MsgChannelOpenAck = (function() { - - /** - * Properties of a MsgChannelOpenAck. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenAck - * @property {string|null} [port_id] MsgChannelOpenAck port_id - * @property {string|null} [channel_id] MsgChannelOpenAck channel_id - * @property {string|null} [counterparty_channel_id] MsgChannelOpenAck counterparty_channel_id - * @property {string|null} [counterparty_version] MsgChannelOpenAck counterparty_version - * @property {Uint8Array|null} [proof_try] MsgChannelOpenAck proof_try - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgChannelOpenAck proof_height - * @property {string|null} [signer] MsgChannelOpenAck signer - */ - - /** - * Constructs a new MsgChannelOpenAck. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenAck. - * @implements IMsgChannelOpenAck - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenAck=} [properties] Properties to set - */ - function MsgChannelOpenAck(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenAck port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.port_id = ""; - - /** - * MsgChannelOpenAck channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.channel_id = ""; - - /** - * MsgChannelOpenAck counterparty_channel_id. - * @member {string} counterparty_channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.counterparty_channel_id = ""; - - /** - * MsgChannelOpenAck counterparty_version. - * @member {string} counterparty_version - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.counterparty_version = ""; - - /** - * MsgChannelOpenAck proof_try. - * @member {Uint8Array} proof_try - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.proof_try = $util.newBuffer([]); - - /** - * MsgChannelOpenAck proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.proof_height = null; - - /** - * MsgChannelOpenAck signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelOpenAck message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAck.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenAck} message MsgChannelOpenAck message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenAck.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.counterparty_channel_id != null && Object.hasOwnProperty.call(message, "counterparty_channel_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.counterparty_channel_id); - if (message.counterparty_version != null && Object.hasOwnProperty.call(message, "counterparty_version")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.counterparty_version); - if (message.proof_try != null && Object.hasOwnProperty.call(message, "proof_try")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proof_try); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenAck message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAck.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenAck} message MsgChannelOpenAck message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenAck.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenAck message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenAck.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenAck(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.counterparty_channel_id = reader.string(); - break; - case 4: - message.counterparty_version = reader.string(); - break; - case 5: - message.proof_try = reader.bytes(); - break; - case 6: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 7: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenAck message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenAck.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenAck message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenAck.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.counterparty_channel_id != null && message.hasOwnProperty("counterparty_channel_id")) - if (!$util.isString(message.counterparty_channel_id)) - return "counterparty_channel_id: string expected"; - if (message.counterparty_version != null && message.hasOwnProperty("counterparty_version")) - if (!$util.isString(message.counterparty_version)) - return "counterparty_version: string expected"; - if (message.proof_try != null && message.hasOwnProperty("proof_try")) - if (!(message.proof_try && typeof message.proof_try.length === "number" || $util.isString(message.proof_try))) - return "proof_try: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenAck message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck - */ - MsgChannelOpenAck.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenAck) - return object; - var message = new $root.ibc.core.channel.v1.MsgChannelOpenAck(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.counterparty_channel_id != null) - message.counterparty_channel_id = String(object.counterparty_channel_id); - if (object.counterparty_version != null) - message.counterparty_version = String(object.counterparty_version); - if (object.proof_try != null) - if (typeof object.proof_try === "string") - $util.base64.decode(object.proof_try, message.proof_try = $util.newBuffer($util.base64.length(object.proof_try)), 0); - else if (object.proof_try.length) - message.proof_try = object.proof_try; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenAck.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenAck message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenAck} message MsgChannelOpenAck - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenAck.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.counterparty_channel_id = ""; - object.counterparty_version = ""; - if (options.bytes === String) - object.proof_try = ""; - else { - object.proof_try = []; - if (options.bytes !== Array) - object.proof_try = $util.newBuffer(object.proof_try); - } - object.proof_height = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.counterparty_channel_id != null && message.hasOwnProperty("counterparty_channel_id")) - object.counterparty_channel_id = message.counterparty_channel_id; - if (message.counterparty_version != null && message.hasOwnProperty("counterparty_version")) - object.counterparty_version = message.counterparty_version; - if (message.proof_try != null && message.hasOwnProperty("proof_try")) - object.proof_try = options.bytes === String ? $util.base64.encode(message.proof_try, 0, message.proof_try.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_try) : message.proof_try; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelOpenAck to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenAck.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenAck; - })(); - - v1.MsgChannelOpenAckResponse = (function() { - - /** - * Properties of a MsgChannelOpenAckResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenAckResponse - */ - - /** - * Constructs a new MsgChannelOpenAckResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenAckResponse. - * @implements IMsgChannelOpenAckResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse=} [properties] Properties to set - */ - function MsgChannelOpenAckResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgChannelOpenAckResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAckResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse} message MsgChannelOpenAckResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenAckResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenAckResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAckResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse} message MsgChannelOpenAckResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenAckResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenAckResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenAckResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenAckResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenAckResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenAckResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenAckResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenAckResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenAckResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse - */ - MsgChannelOpenAckResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenAckResponse) - return object; - return new $root.ibc.core.channel.v1.MsgChannelOpenAckResponse(); - }; - - /** - * Creates a plain object from a MsgChannelOpenAckResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenAckResponse} message MsgChannelOpenAckResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenAckResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgChannelOpenAckResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenAckResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenAckResponse; - })(); - - v1.MsgChannelOpenConfirm = (function() { - - /** - * Properties of a MsgChannelOpenConfirm. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenConfirm - * @property {string|null} [port_id] MsgChannelOpenConfirm port_id - * @property {string|null} [channel_id] MsgChannelOpenConfirm channel_id - * @property {Uint8Array|null} [proof_ack] MsgChannelOpenConfirm proof_ack - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgChannelOpenConfirm proof_height - * @property {string|null} [signer] MsgChannelOpenConfirm signer - */ - - /** - * Constructs a new MsgChannelOpenConfirm. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenConfirm. - * @implements IMsgChannelOpenConfirm - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm=} [properties] Properties to set - */ - function MsgChannelOpenConfirm(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenConfirm port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.port_id = ""; - - /** - * MsgChannelOpenConfirm channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.channel_id = ""; - - /** - * MsgChannelOpenConfirm proof_ack. - * @member {Uint8Array} proof_ack - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.proof_ack = $util.newBuffer([]); - - /** - * MsgChannelOpenConfirm proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.proof_height = null; - - /** - * MsgChannelOpenConfirm signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelOpenConfirm message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirm.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} message MsgChannelOpenConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenConfirm.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.proof_ack != null && Object.hasOwnProperty.call(message, "proof_ack")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof_ack); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenConfirm message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirm.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} message MsgChannelOpenConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenConfirm.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenConfirm message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenConfirm.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenConfirm(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.proof_ack = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenConfirm message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenConfirm.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenConfirm message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenConfirm.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.proof_ack != null && message.hasOwnProperty("proof_ack")) - if (!(message.proof_ack && typeof message.proof_ack.length === "number" || $util.isString(message.proof_ack))) - return "proof_ack: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenConfirm message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm - */ - MsgChannelOpenConfirm.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenConfirm) - return object; - var message = new $root.ibc.core.channel.v1.MsgChannelOpenConfirm(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.proof_ack != null) - if (typeof object.proof_ack === "string") - $util.base64.decode(object.proof_ack, message.proof_ack = $util.newBuffer($util.base64.length(object.proof_ack)), 0); - else if (object.proof_ack.length) - message.proof_ack = object.proof_ack; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenConfirm.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenConfirm message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenConfirm} message MsgChannelOpenConfirm - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenConfirm.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if (options.bytes === String) - object.proof_ack = ""; - else { - object.proof_ack = []; - if (options.bytes !== Array) - object.proof_ack = $util.newBuffer(object.proof_ack); - } - object.proof_height = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.proof_ack != null && message.hasOwnProperty("proof_ack")) - object.proof_ack = options.bytes === String ? $util.base64.encode(message.proof_ack, 0, message.proof_ack.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_ack) : message.proof_ack; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelOpenConfirm to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenConfirm.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenConfirm; - })(); - - v1.MsgChannelOpenConfirmResponse = (function() { - - /** - * Properties of a MsgChannelOpenConfirmResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenConfirmResponse - */ - - /** - * Constructs a new MsgChannelOpenConfirmResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenConfirmResponse. - * @implements IMsgChannelOpenConfirmResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse=} [properties] Properties to set - */ - function MsgChannelOpenConfirmResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgChannelOpenConfirmResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirmResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse} message MsgChannelOpenConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenConfirmResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirmResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse} message MsgChannelOpenConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenConfirmResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenConfirmResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenConfirmResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenConfirmResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenConfirmResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenConfirmResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenConfirmResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenConfirmResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse - */ - MsgChannelOpenConfirmResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse) - return object; - return new $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse(); - }; - - /** - * Creates a plain object from a MsgChannelOpenConfirmResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} message MsgChannelOpenConfirmResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenConfirmResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgChannelOpenConfirmResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenConfirmResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenConfirmResponse; - })(); - - v1.MsgChannelCloseInit = (function() { - - /** - * Properties of a MsgChannelCloseInit. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelCloseInit - * @property {string|null} [port_id] MsgChannelCloseInit port_id - * @property {string|null} [channel_id] MsgChannelCloseInit channel_id - * @property {string|null} [signer] MsgChannelCloseInit signer - */ - - /** - * Constructs a new MsgChannelCloseInit. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelCloseInit. - * @implements IMsgChannelCloseInit - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelCloseInit=} [properties] Properties to set - */ - function MsgChannelCloseInit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelCloseInit port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @instance - */ - MsgChannelCloseInit.prototype.port_id = ""; - - /** - * MsgChannelCloseInit channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @instance - */ - MsgChannelCloseInit.prototype.channel_id = ""; - - /** - * MsgChannelCloseInit signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @instance - */ - MsgChannelCloseInit.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelCloseInit message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInit.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseInit} message MsgChannelCloseInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseInit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelCloseInit message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInit.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseInit} message MsgChannelCloseInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseInit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelCloseInit message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseInit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseInit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelCloseInit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseInit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelCloseInit message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelCloseInit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelCloseInit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit - */ - MsgChannelCloseInit.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseInit) - return object; - var message = new $root.ibc.core.channel.v1.MsgChannelCloseInit(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelCloseInit message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {ibc.core.channel.v1.MsgChannelCloseInit} message MsgChannelCloseInit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelCloseInit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelCloseInit to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @instance - * @returns {Object.} JSON object - */ - MsgChannelCloseInit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelCloseInit; - })(); - - v1.MsgChannelCloseInitResponse = (function() { - - /** - * Properties of a MsgChannelCloseInitResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelCloseInitResponse - */ - - /** - * Constructs a new MsgChannelCloseInitResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelCloseInitResponse. - * @implements IMsgChannelCloseInitResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse=} [properties] Properties to set - */ - function MsgChannelCloseInitResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgChannelCloseInitResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInitResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse} message MsgChannelCloseInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseInitResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgChannelCloseInitResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse} message MsgChannelCloseInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseInitResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelCloseInitResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseInitResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseInitResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelCloseInitResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseInitResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelCloseInitResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelCloseInitResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgChannelCloseInitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse - */ - MsgChannelCloseInitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseInitResponse) - return object; - return new $root.ibc.core.channel.v1.MsgChannelCloseInitResponse(); - }; - - /** - * Creates a plain object from a MsgChannelCloseInitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelCloseInitResponse} message MsgChannelCloseInitResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelCloseInitResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgChannelCloseInitResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelCloseInitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelCloseInitResponse; - })(); - - v1.MsgChannelCloseConfirm = (function() { - - /** - * Properties of a MsgChannelCloseConfirm. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelCloseConfirm - * @property {string|null} [port_id] MsgChannelCloseConfirm port_id - * @property {string|null} [channel_id] MsgChannelCloseConfirm channel_id - * @property {Uint8Array|null} [proof_init] MsgChannelCloseConfirm proof_init - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgChannelCloseConfirm proof_height - * @property {string|null} [signer] MsgChannelCloseConfirm signer - */ - - /** - * Constructs a new MsgChannelCloseConfirm. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelCloseConfirm. - * @implements IMsgChannelCloseConfirm - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm=} [properties] Properties to set - */ - function MsgChannelCloseConfirm(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelCloseConfirm port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.port_id = ""; - - /** - * MsgChannelCloseConfirm channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.channel_id = ""; - - /** - * MsgChannelCloseConfirm proof_init. - * @member {Uint8Array} proof_init - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.proof_init = $util.newBuffer([]); - - /** - * MsgChannelCloseConfirm proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.proof_height = null; - - /** - * MsgChannelCloseConfirm signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelCloseConfirm message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirm.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} message MsgChannelCloseConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseConfirm.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.proof_init != null && Object.hasOwnProperty.call(message, "proof_init")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof_init); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelCloseConfirm message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirm.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} message MsgChannelCloseConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseConfirm.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelCloseConfirm message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseConfirm.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseConfirm(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.proof_init = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelCloseConfirm message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseConfirm.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelCloseConfirm message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelCloseConfirm.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - if (!(message.proof_init && typeof message.proof_init.length === "number" || $util.isString(message.proof_init))) - return "proof_init: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelCloseConfirm message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm - */ - MsgChannelCloseConfirm.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseConfirm) - return object; - var message = new $root.ibc.core.channel.v1.MsgChannelCloseConfirm(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.proof_init != null) - if (typeof object.proof_init === "string") - $util.base64.decode(object.proof_init, message.proof_init = $util.newBuffer($util.base64.length(object.proof_init)), 0); - else if (object.proof_init.length) - message.proof_init = object.proof_init; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelCloseConfirm.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelCloseConfirm message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {ibc.core.channel.v1.MsgChannelCloseConfirm} message MsgChannelCloseConfirm - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelCloseConfirm.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if (options.bytes === String) - object.proof_init = ""; - else { - object.proof_init = []; - if (options.bytes !== Array) - object.proof_init = $util.newBuffer(object.proof_init); - } - object.proof_height = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - object.proof_init = options.bytes === String ? $util.base64.encode(message.proof_init, 0, message.proof_init.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_init) : message.proof_init; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelCloseConfirm to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - * @returns {Object.} JSON object - */ - MsgChannelCloseConfirm.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelCloseConfirm; - })(); - - v1.MsgChannelCloseConfirmResponse = (function() { - - /** - * Properties of a MsgChannelCloseConfirmResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelCloseConfirmResponse - */ - - /** - * Constructs a new MsgChannelCloseConfirmResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelCloseConfirmResponse. - * @implements IMsgChannelCloseConfirmResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse=} [properties] Properties to set - */ - function MsgChannelCloseConfirmResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgChannelCloseConfirmResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirmResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse} message MsgChannelCloseConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseConfirmResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgChannelCloseConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirmResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse} message MsgChannelCloseConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseConfirmResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelCloseConfirmResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseConfirmResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelCloseConfirmResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseConfirmResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelCloseConfirmResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelCloseConfirmResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgChannelCloseConfirmResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse - */ - MsgChannelCloseConfirmResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse) - return object; - return new $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse(); - }; - - /** - * Creates a plain object from a MsgChannelCloseConfirmResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} message MsgChannelCloseConfirmResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelCloseConfirmResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgChannelCloseConfirmResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelCloseConfirmResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelCloseConfirmResponse; - })(); - - v1.MsgRecvPacket = (function() { - - /** - * Properties of a MsgRecvPacket. - * @memberof ibc.core.channel.v1 - * @interface IMsgRecvPacket - * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgRecvPacket packet - * @property {Uint8Array|null} [proof_commitment] MsgRecvPacket proof_commitment - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgRecvPacket proof_height - * @property {string|null} [signer] MsgRecvPacket signer - */ - - /** - * Constructs a new MsgRecvPacket. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgRecvPacket. - * @implements IMsgRecvPacket - * @constructor - * @param {ibc.core.channel.v1.IMsgRecvPacket=} [properties] Properties to set - */ - function MsgRecvPacket(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRecvPacket packet. - * @member {ibc.core.channel.v1.IPacket|null|undefined} packet - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - */ - MsgRecvPacket.prototype.packet = null; - - /** - * MsgRecvPacket proof_commitment. - * @member {Uint8Array} proof_commitment - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - */ - MsgRecvPacket.prototype.proof_commitment = $util.newBuffer([]); - - /** - * MsgRecvPacket proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - */ - MsgRecvPacket.prototype.proof_height = null; - - /** - * MsgRecvPacket signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - */ - MsgRecvPacket.prototype.signer = ""; - - /** - * Encodes the specified MsgRecvPacket message. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacket.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {ibc.core.channel.v1.IMsgRecvPacket} message MsgRecvPacket message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRecvPacket.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) - $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof_commitment != null && Object.hasOwnProperty.call(message, "proof_commitment")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof_commitment); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgRecvPacket message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacket.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {ibc.core.channel.v1.IMsgRecvPacket} message MsgRecvPacket message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRecvPacket.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRecvPacket message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRecvPacket.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgRecvPacket(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); - break; - case 2: - message.proof_commitment = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 4: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRecvPacket message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRecvPacket.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRecvPacket message. - * @function verify - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRecvPacket.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet != null && message.hasOwnProperty("packet")) { - var error = $root.ibc.core.channel.v1.Packet.verify(message.packet); - if (error) - return "packet." + error; - } - if (message.proof_commitment != null && message.hasOwnProperty("proof_commitment")) - if (!(message.proof_commitment && typeof message.proof_commitment.length === "number" || $util.isString(message.proof_commitment))) - return "proof_commitment: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgRecvPacket message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket - */ - MsgRecvPacket.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgRecvPacket) - return object; - var message = new $root.ibc.core.channel.v1.MsgRecvPacket(); - if (object.packet != null) { - if (typeof object.packet !== "object") - throw TypeError(".ibc.core.channel.v1.MsgRecvPacket.packet: object expected"); - message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); - } - if (object.proof_commitment != null) - if (typeof object.proof_commitment === "string") - $util.base64.decode(object.proof_commitment, message.proof_commitment = $util.newBuffer($util.base64.length(object.proof_commitment)), 0); - else if (object.proof_commitment.length) - message.proof_commitment = object.proof_commitment; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgRecvPacket.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgRecvPacket message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {ibc.core.channel.v1.MsgRecvPacket} message MsgRecvPacket - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRecvPacket.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.packet = null; - if (options.bytes === String) - object.proof_commitment = ""; - else { - object.proof_commitment = []; - if (options.bytes !== Array) - object.proof_commitment = $util.newBuffer(object.proof_commitment); - } - object.proof_height = null; - object.signer = ""; - } - if (message.packet != null && message.hasOwnProperty("packet")) - object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); - if (message.proof_commitment != null && message.hasOwnProperty("proof_commitment")) - object.proof_commitment = options.bytes === String ? $util.base64.encode(message.proof_commitment, 0, message.proof_commitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_commitment) : message.proof_commitment; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgRecvPacket to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - * @returns {Object.} JSON object - */ - MsgRecvPacket.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRecvPacket; - })(); - - v1.MsgRecvPacketResponse = (function() { - - /** - * Properties of a MsgRecvPacketResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgRecvPacketResponse - * @property {ibc.core.channel.v1.ResponseResultType|null} [result] MsgRecvPacketResponse result - */ - - /** - * Constructs a new MsgRecvPacketResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgRecvPacketResponse. - * @implements IMsgRecvPacketResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgRecvPacketResponse=} [properties] Properties to set - */ - function MsgRecvPacketResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRecvPacketResponse result. - * @member {ibc.core.channel.v1.ResponseResultType} result - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @instance - */ - MsgRecvPacketResponse.prototype.result = 0; - - /** - * Encodes the specified MsgRecvPacketResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacketResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {ibc.core.channel.v1.IMsgRecvPacketResponse} message MsgRecvPacketResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRecvPacketResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - return writer; - }; - - /** - * Encodes the specified MsgRecvPacketResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacketResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {ibc.core.channel.v1.IMsgRecvPacketResponse} message MsgRecvPacketResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRecvPacketResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRecvPacketResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRecvPacketResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgRecvPacketResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRecvPacketResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRecvPacketResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRecvPacketResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRecvPacketResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a MsgRecvPacketResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse - */ - MsgRecvPacketResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgRecvPacketResponse) - return object; - var message = new $root.ibc.core.channel.v1.MsgRecvPacketResponse(); - switch (object.result) { - case "RESPONSE_RESULT_TYPE_UNSPECIFIED": - case 0: - message.result = 0; - break; - case "RESPONSE_RESULT_TYPE_NOOP": - case 1: - message.result = 1; - break; - case "RESPONSE_RESULT_TYPE_SUCCESS": - case 2: - message.result = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a MsgRecvPacketResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {ibc.core.channel.v1.MsgRecvPacketResponse} message MsgRecvPacketResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRecvPacketResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.result = options.enums === String ? "RESPONSE_RESULT_TYPE_UNSPECIFIED" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.ibc.core.channel.v1.ResponseResultType[message.result] : message.result; - return object; - }; - - /** - * Converts this MsgRecvPacketResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @instance - * @returns {Object.} JSON object - */ - MsgRecvPacketResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRecvPacketResponse; - })(); - - v1.MsgTimeout = (function() { - - /** - * Properties of a MsgTimeout. - * @memberof ibc.core.channel.v1 - * @interface IMsgTimeout - * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgTimeout packet - * @property {Uint8Array|null} [proof_unreceived] MsgTimeout proof_unreceived - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgTimeout proof_height - * @property {Long|null} [next_sequence_recv] MsgTimeout next_sequence_recv - * @property {string|null} [signer] MsgTimeout signer - */ - - /** - * Constructs a new MsgTimeout. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgTimeout. - * @implements IMsgTimeout - * @constructor - * @param {ibc.core.channel.v1.IMsgTimeout=} [properties] Properties to set - */ - function MsgTimeout(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTimeout packet. - * @member {ibc.core.channel.v1.IPacket|null|undefined} packet - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.packet = null; - - /** - * MsgTimeout proof_unreceived. - * @member {Uint8Array} proof_unreceived - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.proof_unreceived = $util.newBuffer([]); - - /** - * MsgTimeout proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.proof_height = null; - - /** - * MsgTimeout next_sequence_recv. - * @member {Long} next_sequence_recv - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.next_sequence_recv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgTimeout signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.signer = ""; - - /** - * Encodes the specified MsgTimeout message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeout.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {ibc.core.channel.v1.IMsgTimeout} message MsgTimeout message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeout.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) - $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof_unreceived != null && Object.hasOwnProperty.call(message, "proof_unreceived")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof_unreceived); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.next_sequence_recv != null && Object.hasOwnProperty.call(message, "next_sequence_recv")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.next_sequence_recv); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgTimeout message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeout.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {ibc.core.channel.v1.IMsgTimeout} message MsgTimeout message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeout.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTimeout message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeout.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeout(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); - break; - case 2: - message.proof_unreceived = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 4: - message.next_sequence_recv = reader.uint64(); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTimeout message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeout.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTimeout message. - * @function verify - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTimeout.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet != null && message.hasOwnProperty("packet")) { - var error = $root.ibc.core.channel.v1.Packet.verify(message.packet); - if (error) - return "packet." + error; - } - if (message.proof_unreceived != null && message.hasOwnProperty("proof_unreceived")) - if (!(message.proof_unreceived && typeof message.proof_unreceived.length === "number" || $util.isString(message.proof_unreceived))) - return "proof_unreceived: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.next_sequence_recv != null && message.hasOwnProperty("next_sequence_recv")) - if (!$util.isInteger(message.next_sequence_recv) && !(message.next_sequence_recv && $util.isInteger(message.next_sequence_recv.low) && $util.isInteger(message.next_sequence_recv.high))) - return "next_sequence_recv: integer|Long expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgTimeout message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout - */ - MsgTimeout.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgTimeout) - return object; - var message = new $root.ibc.core.channel.v1.MsgTimeout(); - if (object.packet != null) { - if (typeof object.packet !== "object") - throw TypeError(".ibc.core.channel.v1.MsgTimeout.packet: object expected"); - message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); - } - if (object.proof_unreceived != null) - if (typeof object.proof_unreceived === "string") - $util.base64.decode(object.proof_unreceived, message.proof_unreceived = $util.newBuffer($util.base64.length(object.proof_unreceived)), 0); - else if (object.proof_unreceived.length) - message.proof_unreceived = object.proof_unreceived; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgTimeout.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.next_sequence_recv != null) - if ($util.Long) - (message.next_sequence_recv = $util.Long.fromValue(object.next_sequence_recv)).unsigned = true; - else if (typeof object.next_sequence_recv === "string") - message.next_sequence_recv = parseInt(object.next_sequence_recv, 10); - else if (typeof object.next_sequence_recv === "number") - message.next_sequence_recv = object.next_sequence_recv; - else if (typeof object.next_sequence_recv === "object") - message.next_sequence_recv = new $util.LongBits(object.next_sequence_recv.low >>> 0, object.next_sequence_recv.high >>> 0).toNumber(true); - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgTimeout message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {ibc.core.channel.v1.MsgTimeout} message MsgTimeout - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTimeout.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.packet = null; - if (options.bytes === String) - object.proof_unreceived = ""; - else { - object.proof_unreceived = []; - if (options.bytes !== Array) - object.proof_unreceived = $util.newBuffer(object.proof_unreceived); - } - object.proof_height = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.next_sequence_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_sequence_recv = options.longs === String ? "0" : 0; - object.signer = ""; - } - if (message.packet != null && message.hasOwnProperty("packet")) - object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); - if (message.proof_unreceived != null && message.hasOwnProperty("proof_unreceived")) - object.proof_unreceived = options.bytes === String ? $util.base64.encode(message.proof_unreceived, 0, message.proof_unreceived.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_unreceived) : message.proof_unreceived; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.next_sequence_recv != null && message.hasOwnProperty("next_sequence_recv")) - if (typeof message.next_sequence_recv === "number") - object.next_sequence_recv = options.longs === String ? String(message.next_sequence_recv) : message.next_sequence_recv; - else - object.next_sequence_recv = options.longs === String ? $util.Long.prototype.toString.call(message.next_sequence_recv) : options.longs === Number ? new $util.LongBits(message.next_sequence_recv.low >>> 0, message.next_sequence_recv.high >>> 0).toNumber(true) : message.next_sequence_recv; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgTimeout to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - * @returns {Object.} JSON object - */ - MsgTimeout.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTimeout; - })(); - - v1.MsgTimeoutResponse = (function() { - - /** - * Properties of a MsgTimeoutResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgTimeoutResponse - * @property {ibc.core.channel.v1.ResponseResultType|null} [result] MsgTimeoutResponse result - */ - - /** - * Constructs a new MsgTimeoutResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgTimeoutResponse. - * @implements IMsgTimeoutResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgTimeoutResponse=} [properties] Properties to set - */ - function MsgTimeoutResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTimeoutResponse result. - * @member {ibc.core.channel.v1.ResponseResultType} result - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @instance - */ - MsgTimeoutResponse.prototype.result = 0; - - /** - * Encodes the specified MsgTimeoutResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutResponse} message MsgTimeoutResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - return writer; - }; - - /** - * Encodes the specified MsgTimeoutResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutResponse} message MsgTimeoutResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTimeoutResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeoutResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTimeoutResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTimeoutResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTimeoutResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a MsgTimeoutResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse - */ - MsgTimeoutResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgTimeoutResponse) - return object; - var message = new $root.ibc.core.channel.v1.MsgTimeoutResponse(); - switch (object.result) { - case "RESPONSE_RESULT_TYPE_UNSPECIFIED": - case 0: - message.result = 0; - break; - case "RESPONSE_RESULT_TYPE_NOOP": - case 1: - message.result = 1; - break; - case "RESPONSE_RESULT_TYPE_SUCCESS": - case 2: - message.result = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a MsgTimeoutResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {ibc.core.channel.v1.MsgTimeoutResponse} message MsgTimeoutResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTimeoutResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.result = options.enums === String ? "RESPONSE_RESULT_TYPE_UNSPECIFIED" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.ibc.core.channel.v1.ResponseResultType[message.result] : message.result; - return object; - }; - - /** - * Converts this MsgTimeoutResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @instance - * @returns {Object.} JSON object - */ - MsgTimeoutResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTimeoutResponse; - })(); - - v1.MsgTimeoutOnClose = (function() { - - /** - * Properties of a MsgTimeoutOnClose. - * @memberof ibc.core.channel.v1 - * @interface IMsgTimeoutOnClose - * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgTimeoutOnClose packet - * @property {Uint8Array|null} [proof_unreceived] MsgTimeoutOnClose proof_unreceived - * @property {Uint8Array|null} [proof_close] MsgTimeoutOnClose proof_close - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgTimeoutOnClose proof_height - * @property {Long|null} [next_sequence_recv] MsgTimeoutOnClose next_sequence_recv - * @property {string|null} [signer] MsgTimeoutOnClose signer - */ - - /** - * Constructs a new MsgTimeoutOnClose. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgTimeoutOnClose. - * @implements IMsgTimeoutOnClose - * @constructor - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose=} [properties] Properties to set - */ - function MsgTimeoutOnClose(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTimeoutOnClose packet. - * @member {ibc.core.channel.v1.IPacket|null|undefined} packet - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.packet = null; - - /** - * MsgTimeoutOnClose proof_unreceived. - * @member {Uint8Array} proof_unreceived - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.proof_unreceived = $util.newBuffer([]); - - /** - * MsgTimeoutOnClose proof_close. - * @member {Uint8Array} proof_close - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.proof_close = $util.newBuffer([]); - - /** - * MsgTimeoutOnClose proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.proof_height = null; - - /** - * MsgTimeoutOnClose next_sequence_recv. - * @member {Long} next_sequence_recv - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.next_sequence_recv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgTimeoutOnClose signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.signer = ""; - - /** - * Encodes the specified MsgTimeoutOnClose message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnClose.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} message MsgTimeoutOnClose message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutOnClose.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) - $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof_unreceived != null && Object.hasOwnProperty.call(message, "proof_unreceived")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof_unreceived); - if (message.proof_close != null && Object.hasOwnProperty.call(message, "proof_close")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof_close); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.next_sequence_recv != null && Object.hasOwnProperty.call(message, "next_sequence_recv")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.next_sequence_recv); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgTimeoutOnClose message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnClose.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} message MsgTimeoutOnClose message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutOnClose.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTimeoutOnClose message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutOnClose.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeoutOnClose(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); - break; - case 2: - message.proof_unreceived = reader.bytes(); - break; - case 3: - message.proof_close = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 5: - message.next_sequence_recv = reader.uint64(); - break; - case 6: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTimeoutOnClose message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutOnClose.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTimeoutOnClose message. - * @function verify - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTimeoutOnClose.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet != null && message.hasOwnProperty("packet")) { - var error = $root.ibc.core.channel.v1.Packet.verify(message.packet); - if (error) - return "packet." + error; - } - if (message.proof_unreceived != null && message.hasOwnProperty("proof_unreceived")) - if (!(message.proof_unreceived && typeof message.proof_unreceived.length === "number" || $util.isString(message.proof_unreceived))) - return "proof_unreceived: buffer expected"; - if (message.proof_close != null && message.hasOwnProperty("proof_close")) - if (!(message.proof_close && typeof message.proof_close.length === "number" || $util.isString(message.proof_close))) - return "proof_close: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.next_sequence_recv != null && message.hasOwnProperty("next_sequence_recv")) - if (!$util.isInteger(message.next_sequence_recv) && !(message.next_sequence_recv && $util.isInteger(message.next_sequence_recv.low) && $util.isInteger(message.next_sequence_recv.high))) - return "next_sequence_recv: integer|Long expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgTimeoutOnClose message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose - */ - MsgTimeoutOnClose.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgTimeoutOnClose) - return object; - var message = new $root.ibc.core.channel.v1.MsgTimeoutOnClose(); - if (object.packet != null) { - if (typeof object.packet !== "object") - throw TypeError(".ibc.core.channel.v1.MsgTimeoutOnClose.packet: object expected"); - message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); - } - if (object.proof_unreceived != null) - if (typeof object.proof_unreceived === "string") - $util.base64.decode(object.proof_unreceived, message.proof_unreceived = $util.newBuffer($util.base64.length(object.proof_unreceived)), 0); - else if (object.proof_unreceived.length) - message.proof_unreceived = object.proof_unreceived; - if (object.proof_close != null) - if (typeof object.proof_close === "string") - $util.base64.decode(object.proof_close, message.proof_close = $util.newBuffer($util.base64.length(object.proof_close)), 0); - else if (object.proof_close.length) - message.proof_close = object.proof_close; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgTimeoutOnClose.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.next_sequence_recv != null) - if ($util.Long) - (message.next_sequence_recv = $util.Long.fromValue(object.next_sequence_recv)).unsigned = true; - else if (typeof object.next_sequence_recv === "string") - message.next_sequence_recv = parseInt(object.next_sequence_recv, 10); - else if (typeof object.next_sequence_recv === "number") - message.next_sequence_recv = object.next_sequence_recv; - else if (typeof object.next_sequence_recv === "object") - message.next_sequence_recv = new $util.LongBits(object.next_sequence_recv.low >>> 0, object.next_sequence_recv.high >>> 0).toNumber(true); - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgTimeoutOnClose message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {ibc.core.channel.v1.MsgTimeoutOnClose} message MsgTimeoutOnClose - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTimeoutOnClose.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.packet = null; - if (options.bytes === String) - object.proof_unreceived = ""; - else { - object.proof_unreceived = []; - if (options.bytes !== Array) - object.proof_unreceived = $util.newBuffer(object.proof_unreceived); - } - if (options.bytes === String) - object.proof_close = ""; - else { - object.proof_close = []; - if (options.bytes !== Array) - object.proof_close = $util.newBuffer(object.proof_close); - } - object.proof_height = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.next_sequence_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_sequence_recv = options.longs === String ? "0" : 0; - object.signer = ""; - } - if (message.packet != null && message.hasOwnProperty("packet")) - object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); - if (message.proof_unreceived != null && message.hasOwnProperty("proof_unreceived")) - object.proof_unreceived = options.bytes === String ? $util.base64.encode(message.proof_unreceived, 0, message.proof_unreceived.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_unreceived) : message.proof_unreceived; - if (message.proof_close != null && message.hasOwnProperty("proof_close")) - object.proof_close = options.bytes === String ? $util.base64.encode(message.proof_close, 0, message.proof_close.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_close) : message.proof_close; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.next_sequence_recv != null && message.hasOwnProperty("next_sequence_recv")) - if (typeof message.next_sequence_recv === "number") - object.next_sequence_recv = options.longs === String ? String(message.next_sequence_recv) : message.next_sequence_recv; - else - object.next_sequence_recv = options.longs === String ? $util.Long.prototype.toString.call(message.next_sequence_recv) : options.longs === Number ? new $util.LongBits(message.next_sequence_recv.low >>> 0, message.next_sequence_recv.high >>> 0).toNumber(true) : message.next_sequence_recv; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgTimeoutOnClose to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - * @returns {Object.} JSON object - */ - MsgTimeoutOnClose.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTimeoutOnClose; - })(); - - v1.MsgTimeoutOnCloseResponse = (function() { - - /** - * Properties of a MsgTimeoutOnCloseResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgTimeoutOnCloseResponse - * @property {ibc.core.channel.v1.ResponseResultType|null} [result] MsgTimeoutOnCloseResponse result - */ - - /** - * Constructs a new MsgTimeoutOnCloseResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgTimeoutOnCloseResponse. - * @implements IMsgTimeoutOnCloseResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse=} [properties] Properties to set - */ - function MsgTimeoutOnCloseResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTimeoutOnCloseResponse result. - * @member {ibc.core.channel.v1.ResponseResultType} result - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @instance - */ - MsgTimeoutOnCloseResponse.prototype.result = 0; - - /** - * Encodes the specified MsgTimeoutOnCloseResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnCloseResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse} message MsgTimeoutOnCloseResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutOnCloseResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - return writer; - }; - - /** - * Encodes the specified MsgTimeoutOnCloseResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnCloseResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse} message MsgTimeoutOnCloseResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutOnCloseResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTimeoutOnCloseResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutOnCloseResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTimeoutOnCloseResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutOnCloseResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTimeoutOnCloseResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTimeoutOnCloseResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a MsgTimeoutOnCloseResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse - */ - MsgTimeoutOnCloseResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse) - return object; - var message = new $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse(); - switch (object.result) { - case "RESPONSE_RESULT_TYPE_UNSPECIFIED": - case 0: - message.result = 0; - break; - case "RESPONSE_RESULT_TYPE_NOOP": - case 1: - message.result = 1; - break; - case "RESPONSE_RESULT_TYPE_SUCCESS": - case 2: - message.result = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a MsgTimeoutOnCloseResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} message MsgTimeoutOnCloseResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTimeoutOnCloseResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.result = options.enums === String ? "RESPONSE_RESULT_TYPE_UNSPECIFIED" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.ibc.core.channel.v1.ResponseResultType[message.result] : message.result; - return object; - }; - - /** - * Converts this MsgTimeoutOnCloseResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @instance - * @returns {Object.} JSON object - */ - MsgTimeoutOnCloseResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTimeoutOnCloseResponse; - })(); - - v1.MsgAcknowledgement = (function() { - - /** - * Properties of a MsgAcknowledgement. - * @memberof ibc.core.channel.v1 - * @interface IMsgAcknowledgement - * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgAcknowledgement packet - * @property {Uint8Array|null} [acknowledgement] MsgAcknowledgement acknowledgement - * @property {Uint8Array|null} [proof_acked] MsgAcknowledgement proof_acked - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgAcknowledgement proof_height - * @property {string|null} [signer] MsgAcknowledgement signer - */ - - /** - * Constructs a new MsgAcknowledgement. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgAcknowledgement. - * @implements IMsgAcknowledgement - * @constructor - * @param {ibc.core.channel.v1.IMsgAcknowledgement=} [properties] Properties to set - */ - function MsgAcknowledgement(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgAcknowledgement packet. - * @member {ibc.core.channel.v1.IPacket|null|undefined} packet - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.packet = null; - - /** - * MsgAcknowledgement acknowledgement. - * @member {Uint8Array} acknowledgement - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.acknowledgement = $util.newBuffer([]); - - /** - * MsgAcknowledgement proof_acked. - * @member {Uint8Array} proof_acked - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.proof_acked = $util.newBuffer([]); - - /** - * MsgAcknowledgement proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.proof_height = null; - - /** - * MsgAcknowledgement signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.signer = ""; - - /** - * Encodes the specified MsgAcknowledgement message. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgement.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {ibc.core.channel.v1.IMsgAcknowledgement} message MsgAcknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAcknowledgement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) - $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.acknowledgement); - if (message.proof_acked != null && Object.hasOwnProperty.call(message, "proof_acked")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof_acked); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgAcknowledgement message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgement.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {ibc.core.channel.v1.IMsgAcknowledgement} message MsgAcknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAcknowledgement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAcknowledgement message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAcknowledgement.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgAcknowledgement(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); - break; - case 2: - message.acknowledgement = reader.bytes(); - break; - case 3: - message.proof_acked = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAcknowledgement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAcknowledgement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAcknowledgement message. - * @function verify - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAcknowledgement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet != null && message.hasOwnProperty("packet")) { - var error = $root.ibc.core.channel.v1.Packet.verify(message.packet); - if (error) - return "packet." + error; - } - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) - return "acknowledgement: buffer expected"; - if (message.proof_acked != null && message.hasOwnProperty("proof_acked")) - if (!(message.proof_acked && typeof message.proof_acked.length === "number" || $util.isString(message.proof_acked))) - return "proof_acked: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgAcknowledgement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement - */ - MsgAcknowledgement.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgAcknowledgement) - return object; - var message = new $root.ibc.core.channel.v1.MsgAcknowledgement(); - if (object.packet != null) { - if (typeof object.packet !== "object") - throw TypeError(".ibc.core.channel.v1.MsgAcknowledgement.packet: object expected"); - message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); - } - if (object.acknowledgement != null) - if (typeof object.acknowledgement === "string") - $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); - else if (object.acknowledgement.length) - message.acknowledgement = object.acknowledgement; - if (object.proof_acked != null) - if (typeof object.proof_acked === "string") - $util.base64.decode(object.proof_acked, message.proof_acked = $util.newBuffer($util.base64.length(object.proof_acked)), 0); - else if (object.proof_acked.length) - message.proof_acked = object.proof_acked; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgAcknowledgement.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgAcknowledgement message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {ibc.core.channel.v1.MsgAcknowledgement} message MsgAcknowledgement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAcknowledgement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.packet = null; - if (options.bytes === String) - object.acknowledgement = ""; - else { - object.acknowledgement = []; - if (options.bytes !== Array) - object.acknowledgement = $util.newBuffer(object.acknowledgement); - } - if (options.bytes === String) - object.proof_acked = ""; - else { - object.proof_acked = []; - if (options.bytes !== Array) - object.proof_acked = $util.newBuffer(object.proof_acked); - } - object.proof_height = null; - object.signer = ""; - } - if (message.packet != null && message.hasOwnProperty("packet")) - object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; - if (message.proof_acked != null && message.hasOwnProperty("proof_acked")) - object.proof_acked = options.bytes === String ? $util.base64.encode(message.proof_acked, 0, message.proof_acked.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_acked) : message.proof_acked; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgAcknowledgement to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - * @returns {Object.} JSON object - */ - MsgAcknowledgement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAcknowledgement; - })(); - - v1.MsgAcknowledgementResponse = (function() { - - /** - * Properties of a MsgAcknowledgementResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgAcknowledgementResponse - * @property {ibc.core.channel.v1.ResponseResultType|null} [result] MsgAcknowledgementResponse result - */ - - /** - * Constructs a new MsgAcknowledgementResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgAcknowledgementResponse. - * @implements IMsgAcknowledgementResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse=} [properties] Properties to set - */ - function MsgAcknowledgementResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgAcknowledgementResponse result. - * @member {ibc.core.channel.v1.ResponseResultType} result - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @instance - */ - MsgAcknowledgementResponse.prototype.result = 0; - - /** - * Encodes the specified MsgAcknowledgementResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgementResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse} message MsgAcknowledgementResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAcknowledgementResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - return writer; - }; - - /** - * Encodes the specified MsgAcknowledgementResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgementResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse} message MsgAcknowledgementResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAcknowledgementResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAcknowledgementResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAcknowledgementResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgAcknowledgementResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAcknowledgementResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAcknowledgementResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAcknowledgementResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAcknowledgementResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a MsgAcknowledgementResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse - */ - MsgAcknowledgementResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgAcknowledgementResponse) - return object; - var message = new $root.ibc.core.channel.v1.MsgAcknowledgementResponse(); - switch (object.result) { - case "RESPONSE_RESULT_TYPE_UNSPECIFIED": - case 0: - message.result = 0; - break; - case "RESPONSE_RESULT_TYPE_NOOP": - case 1: - message.result = 1; - break; - case "RESPONSE_RESULT_TYPE_SUCCESS": - case 2: - message.result = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a MsgAcknowledgementResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.MsgAcknowledgementResponse} message MsgAcknowledgementResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAcknowledgementResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.result = options.enums === String ? "RESPONSE_RESULT_TYPE_UNSPECIFIED" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.ibc.core.channel.v1.ResponseResultType[message.result] : message.result; - return object; - }; - - /** - * Converts this MsgAcknowledgementResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @instance - * @returns {Object.} JSON object - */ - MsgAcknowledgementResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAcknowledgementResponse; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channel}. - * @memberof ibc.core.channel.v1.Query - * @typedef ChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryChannelResponse} [response] QueryChannelResponse - */ - - /** - * Calls Channel. - * @function channel - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelRequest} request QueryChannelRequest message or plain object - * @param {ibc.core.channel.v1.Query.ChannelCallback} callback Node-style callback called with the error, if any, and QueryChannelResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.channel = function channel(request, callback) { - return this.rpcCall(channel, $root.ibc.core.channel.v1.QueryChannelRequest, $root.ibc.core.channel.v1.QueryChannelResponse, request, callback); - }, "name", { value: "Channel" }); - - /** - * Calls Channel. - * @function channel - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelRequest} request QueryChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channels}. - * @memberof ibc.core.channel.v1.Query - * @typedef ChannelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryChannelsResponse} [response] QueryChannelsResponse - */ - - /** - * Calls Channels. - * @function channels - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelsRequest} request QueryChannelsRequest message or plain object - * @param {ibc.core.channel.v1.Query.ChannelsCallback} callback Node-style callback called with the error, if any, and QueryChannelsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.channels = function channels(request, callback) { - return this.rpcCall(channels, $root.ibc.core.channel.v1.QueryChannelsRequest, $root.ibc.core.channel.v1.QueryChannelsResponse, request, callback); - }, "name", { value: "Channels" }); - - /** - * Calls Channels. - * @function channels - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelsRequest} request QueryChannelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#connectionChannels}. - * @memberof ibc.core.channel.v1.Query - * @typedef ConnectionChannelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryConnectionChannelsResponse} [response] QueryConnectionChannelsResponse - */ - - /** - * Calls ConnectionChannels. - * @function connectionChannels - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} request QueryConnectionChannelsRequest message or plain object - * @param {ibc.core.channel.v1.Query.ConnectionChannelsCallback} callback Node-style callback called with the error, if any, and QueryConnectionChannelsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connectionChannels = function connectionChannels(request, callback) { - return this.rpcCall(connectionChannels, $root.ibc.core.channel.v1.QueryConnectionChannelsRequest, $root.ibc.core.channel.v1.QueryConnectionChannelsResponse, request, callback); - }, "name", { value: "ConnectionChannels" }); - - /** - * Calls ConnectionChannels. - * @function connectionChannels - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} request QueryConnectionChannelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channelClientState}. - * @memberof ibc.core.channel.v1.Query - * @typedef ChannelClientStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryChannelClientStateResponse} [response] QueryChannelClientStateResponse - */ - - /** - * Calls ChannelClientState. - * @function channelClientState - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} request QueryChannelClientStateRequest message or plain object - * @param {ibc.core.channel.v1.Query.ChannelClientStateCallback} callback Node-style callback called with the error, if any, and QueryChannelClientStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.channelClientState = function channelClientState(request, callback) { - return this.rpcCall(channelClientState, $root.ibc.core.channel.v1.QueryChannelClientStateRequest, $root.ibc.core.channel.v1.QueryChannelClientStateResponse, request, callback); - }, "name", { value: "ChannelClientState" }); - - /** - * Calls ChannelClientState. - * @function channelClientState - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} request QueryChannelClientStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channelConsensusState}. - * @memberof ibc.core.channel.v1.Query - * @typedef ChannelConsensusStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryChannelConsensusStateResponse} [response] QueryChannelConsensusStateResponse - */ - - /** - * Calls ChannelConsensusState. - * @function channelConsensusState - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} request QueryChannelConsensusStateRequest message or plain object - * @param {ibc.core.channel.v1.Query.ChannelConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryChannelConsensusStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.channelConsensusState = function channelConsensusState(request, callback) { - return this.rpcCall(channelConsensusState, $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest, $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse, request, callback); - }, "name", { value: "ChannelConsensusState" }); - - /** - * Calls ChannelConsensusState. - * @function channelConsensusState - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} request QueryChannelConsensusStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitment}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketCommitmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketCommitmentResponse} [response] QueryPacketCommitmentResponse - */ - - /** - * Calls PacketCommitment. - * @function packetCommitment - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} request QueryPacketCommitmentRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketCommitmentCallback} callback Node-style callback called with the error, if any, and QueryPacketCommitmentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetCommitment = function packetCommitment(request, callback) { - return this.rpcCall(packetCommitment, $root.ibc.core.channel.v1.QueryPacketCommitmentRequest, $root.ibc.core.channel.v1.QueryPacketCommitmentResponse, request, callback); - }, "name", { value: "PacketCommitment" }); - - /** - * Calls PacketCommitment. - * @function packetCommitment - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} request QueryPacketCommitmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitments}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketCommitmentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketCommitmentsResponse} [response] QueryPacketCommitmentsResponse - */ - - /** - * Calls PacketCommitments. - * @function packetCommitments - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} request QueryPacketCommitmentsRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketCommitmentsCallback} callback Node-style callback called with the error, if any, and QueryPacketCommitmentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetCommitments = function packetCommitments(request, callback) { - return this.rpcCall(packetCommitments, $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest, $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse, request, callback); - }, "name", { value: "PacketCommitments" }); - - /** - * Calls PacketCommitments. - * @function packetCommitments - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} request QueryPacketCommitmentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetReceipt}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketReceiptCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketReceiptResponse} [response] QueryPacketReceiptResponse - */ - - /** - * Calls PacketReceipt. - * @function packetReceipt - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} request QueryPacketReceiptRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketReceiptCallback} callback Node-style callback called with the error, if any, and QueryPacketReceiptResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetReceipt = function packetReceipt(request, callback) { - return this.rpcCall(packetReceipt, $root.ibc.core.channel.v1.QueryPacketReceiptRequest, $root.ibc.core.channel.v1.QueryPacketReceiptResponse, request, callback); - }, "name", { value: "PacketReceipt" }); - - /** - * Calls PacketReceipt. - * @function packetReceipt - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} request QueryPacketReceiptRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgement}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketAcknowledgementCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} [response] QueryPacketAcknowledgementResponse - */ - - /** - * Calls PacketAcknowledgement. - * @function packetAcknowledgement - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} request QueryPacketAcknowledgementRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketAcknowledgementCallback} callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetAcknowledgement = function packetAcknowledgement(request, callback) { - return this.rpcCall(packetAcknowledgement, $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest, $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse, request, callback); - }, "name", { value: "PacketAcknowledgement" }); - - /** - * Calls PacketAcknowledgement. - * @function packetAcknowledgement - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} request QueryPacketAcknowledgementRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgements}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketAcknowledgementsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} [response] QueryPacketAcknowledgementsResponse - */ - - /** - * Calls PacketAcknowledgements. - * @function packetAcknowledgements - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} request QueryPacketAcknowledgementsRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketAcknowledgementsCallback} callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetAcknowledgements = function packetAcknowledgements(request, callback) { - return this.rpcCall(packetAcknowledgements, $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest, $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse, request, callback); - }, "name", { value: "PacketAcknowledgements" }); - - /** - * Calls PacketAcknowledgements. - * @function packetAcknowledgements - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} request QueryPacketAcknowledgementsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedPackets}. - * @memberof ibc.core.channel.v1.Query - * @typedef UnreceivedPacketsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} [response] QueryUnreceivedPacketsResponse - */ - - /** - * Calls UnreceivedPackets. - * @function unreceivedPackets - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} request QueryUnreceivedPacketsRequest message or plain object - * @param {ibc.core.channel.v1.Query.UnreceivedPacketsCallback} callback Node-style callback called with the error, if any, and QueryUnreceivedPacketsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.unreceivedPackets = function unreceivedPackets(request, callback) { - return this.rpcCall(unreceivedPackets, $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest, $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse, request, callback); - }, "name", { value: "UnreceivedPackets" }); - - /** - * Calls UnreceivedPackets. - * @function unreceivedPackets - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} request QueryUnreceivedPacketsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedAcks}. - * @memberof ibc.core.channel.v1.Query - * @typedef UnreceivedAcksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryUnreceivedAcksResponse} [response] QueryUnreceivedAcksResponse - */ - - /** - * Calls UnreceivedAcks. - * @function unreceivedAcks - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} request QueryUnreceivedAcksRequest message or plain object - * @param {ibc.core.channel.v1.Query.UnreceivedAcksCallback} callback Node-style callback called with the error, if any, and QueryUnreceivedAcksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.unreceivedAcks = function unreceivedAcks(request, callback) { - return this.rpcCall(unreceivedAcks, $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest, $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse, request, callback); - }, "name", { value: "UnreceivedAcks" }); - - /** - * Calls UnreceivedAcks. - * @function unreceivedAcks - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} request QueryUnreceivedAcksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#nextSequenceReceive}. - * @memberof ibc.core.channel.v1.Query - * @typedef NextSequenceReceiveCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} [response] QueryNextSequenceReceiveResponse - */ - - /** - * Calls NextSequenceReceive. - * @function nextSequenceReceive - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} request QueryNextSequenceReceiveRequest message or plain object - * @param {ibc.core.channel.v1.Query.NextSequenceReceiveCallback} callback Node-style callback called with the error, if any, and QueryNextSequenceReceiveResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.nextSequenceReceive = function nextSequenceReceive(request, callback) { - return this.rpcCall(nextSequenceReceive, $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest, $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse, request, callback); - }, "name", { value: "NextSequenceReceive" }); - - /** - * Calls NextSequenceReceive. - * @function nextSequenceReceive - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} request QueryNextSequenceReceiveRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryChannelRequest = (function() { - - /** - * Properties of a QueryChannelRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelRequest - * @property {string|null} [port_id] QueryChannelRequest port_id - * @property {string|null} [channel_id] QueryChannelRequest channel_id - */ - - /** - * Constructs a new QueryChannelRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelRequest. - * @implements IQueryChannelRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelRequest=} [properties] Properties to set - */ - function QueryChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @instance - */ - QueryChannelRequest.prototype.port_id = ""; - - /** - * QueryChannelRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @instance - */ - QueryChannelRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryChannelRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelRequest} message QueryChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryChannelRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelRequest} message QueryChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest - */ - QueryChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryChannelRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {ibc.core.channel.v1.QueryChannelRequest} message QueryChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryChannelRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @instance - * @returns {Object.} JSON object - */ - QueryChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelRequest; - })(); - - v1.QueryChannelResponse = (function() { - - /** - * Properties of a QueryChannelResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelResponse - * @property {ibc.core.channel.v1.IChannel|null} [channel] QueryChannelResponse channel - * @property {Uint8Array|null} [proof] QueryChannelResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryChannelResponse proof_height - */ - - /** - * Constructs a new QueryChannelResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelResponse. - * @implements IQueryChannelResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelResponse=} [properties] Properties to set - */ - function QueryChannelResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelResponse channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @instance - */ - QueryChannelResponse.prototype.channel = null; - - /** - * QueryChannelResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @instance - */ - QueryChannelResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryChannelResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @instance - */ - QueryChannelResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryChannelResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelResponse} message QueryChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelResponse} message QueryChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - var error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryChannelResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse - */ - QueryChannelResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryChannelResponse(); - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelResponse.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {ibc.core.channel.v1.QueryChannelResponse} message QueryChannelResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.channel = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryChannelResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @instance - * @returns {Object.} JSON object - */ - QueryChannelResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelResponse; - })(); - - v1.QueryChannelsRequest = (function() { - - /** - * Properties of a QueryChannelsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelsRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryChannelsRequest pagination - */ - - /** - * Constructs a new QueryChannelsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelsRequest. - * @implements IQueryChannelsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelsRequest=} [properties] Properties to set - */ - function QueryChannelsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @instance - */ - QueryChannelsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelsRequest} message QueryChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelsRequest} message QueryChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest - */ - QueryChannelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelsRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryChannelsRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {ibc.core.channel.v1.QueryChannelsRequest} message QueryChannelsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryChannelsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryChannelsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelsRequest; - })(); - - v1.QueryChannelsResponse = (function() { - - /** - * Properties of a QueryChannelsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelsResponse - * @property {Array.|null} [channels] QueryChannelsResponse channels - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryChannelsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryChannelsResponse height - */ - - /** - * Constructs a new QueryChannelsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelsResponse. - * @implements IQueryChannelsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelsResponse=} [properties] Properties to set - */ - function QueryChannelsResponse(properties) { - this.channels = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelsResponse channels. - * @member {Array.} channels - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @instance - */ - QueryChannelsResponse.prototype.channels = $util.emptyArray; - - /** - * QueryChannelsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @instance - */ - QueryChannelsResponse.prototype.pagination = null; - - /** - * QueryChannelsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @instance - */ - QueryChannelsResponse.prototype.height = null; - - /** - * Encodes the specified QueryChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelsResponse} message QueryChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channels != null && message.channels.length) - for (var i = 0; i < message.channels.length; ++i) - $root.ibc.core.channel.v1.IdentifiedChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelsResponse} message QueryChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.channels && message.channels.length)) - message.channels = []; - message.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channels != null && message.hasOwnProperty("channels")) { - if (!Array.isArray(message.channels)) - return "channels: array expected"; - for (var i = 0; i < message.channels.length; ++i) { - var error = $root.ibc.core.channel.v1.IdentifiedChannel.verify(message.channels[i]); - if (error) - return "channels." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse - */ - QueryChannelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelsResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryChannelsResponse(); - if (object.channels) { - if (!Array.isArray(object.channels)) - throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.channels: array expected"); - message.channels = []; - for (var i = 0; i < object.channels.length; ++i) { - if (typeof object.channels[i] !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.channels: object expected"); - message.channels[i] = $root.ibc.core.channel.v1.IdentifiedChannel.fromObject(object.channels[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {ibc.core.channel.v1.QueryChannelsResponse} message QueryChannelsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.channels = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.channels && message.channels.length) { - object.channels = []; - for (var j = 0; j < message.channels.length; ++j) - object.channels[j] = $root.ibc.core.channel.v1.IdentifiedChannel.toObject(message.channels[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryChannelsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryChannelsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelsResponse; - })(); - - v1.QueryConnectionChannelsRequest = (function() { - - /** - * Properties of a QueryConnectionChannelsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryConnectionChannelsRequest - * @property {string|null} [connection] QueryConnectionChannelsRequest connection - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConnectionChannelsRequest pagination - */ - - /** - * Constructs a new QueryConnectionChannelsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryConnectionChannelsRequest. - * @implements IQueryConnectionChannelsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest=} [properties] Properties to set - */ - function QueryConnectionChannelsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionChannelsRequest connection. - * @member {string} connection - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @instance - */ - QueryConnectionChannelsRequest.prototype.connection = ""; - - /** - * QueryConnectionChannelsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @instance - */ - QueryConnectionChannelsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryConnectionChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} message QueryConnectionChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionChannelsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionChannelsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} message QueryConnectionChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionChannelsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionChannelsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryConnectionChannelsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection = reader.string(); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionChannelsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionChannelsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionChannelsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionChannelsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection != null && message.hasOwnProperty("connection")) - if (!$util.isString(message.connection)) - return "connection: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest - */ - QueryConnectionChannelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryConnectionChannelsRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryConnectionChannelsRequest(); - if (object.connection != null) - message.connection = String(object.connection); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionChannelsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {ibc.core.channel.v1.QueryConnectionChannelsRequest} message QueryConnectionChannelsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionChannelsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connection = ""; - object.pagination = null; - } - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = message.connection; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConnectionChannelsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionChannelsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionChannelsRequest; - })(); - - v1.QueryConnectionChannelsResponse = (function() { - - /** - * Properties of a QueryConnectionChannelsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryConnectionChannelsResponse - * @property {Array.|null} [channels] QueryConnectionChannelsResponse channels - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConnectionChannelsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryConnectionChannelsResponse height - */ - - /** - * Constructs a new QueryConnectionChannelsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryConnectionChannelsResponse. - * @implements IQueryConnectionChannelsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse=} [properties] Properties to set - */ - function QueryConnectionChannelsResponse(properties) { - this.channels = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionChannelsResponse channels. - * @member {Array.} channels - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @instance - */ - QueryConnectionChannelsResponse.prototype.channels = $util.emptyArray; - - /** - * QueryConnectionChannelsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @instance - */ - QueryConnectionChannelsResponse.prototype.pagination = null; - - /** - * QueryConnectionChannelsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @instance - */ - QueryConnectionChannelsResponse.prototype.height = null; - - /** - * Encodes the specified QueryConnectionChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse} message QueryConnectionChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionChannelsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channels != null && message.channels.length) - for (var i = 0; i < message.channels.length; ++i) - $root.ibc.core.channel.v1.IdentifiedChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionChannelsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse} message QueryConnectionChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionChannelsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionChannelsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryConnectionChannelsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.channels && message.channels.length)) - message.channels = []; - message.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionChannelsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionChannelsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionChannelsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionChannelsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channels != null && message.hasOwnProperty("channels")) { - if (!Array.isArray(message.channels)) - return "channels: array expected"; - for (var i = 0; i < message.channels.length; ++i) { - var error = $root.ibc.core.channel.v1.IdentifiedChannel.verify(message.channels[i]); - if (error) - return "channels." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse - */ - QueryConnectionChannelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryConnectionChannelsResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryConnectionChannelsResponse(); - if (object.channels) { - if (!Array.isArray(object.channels)) - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.channels: array expected"); - message.channels = []; - for (var i = 0; i < object.channels.length; ++i) { - if (typeof object.channels[i] !== "object") - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.channels: object expected"); - message.channels[i] = $root.ibc.core.channel.v1.IdentifiedChannel.fromObject(object.channels[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionChannelsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {ibc.core.channel.v1.QueryConnectionChannelsResponse} message QueryConnectionChannelsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionChannelsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.channels = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.channels && message.channels.length) { - object.channels = []; - for (var j = 0; j < message.channels.length; ++j) - object.channels[j] = $root.ibc.core.channel.v1.IdentifiedChannel.toObject(message.channels[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryConnectionChannelsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionChannelsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionChannelsResponse; - })(); - - v1.QueryChannelClientStateRequest = (function() { - - /** - * Properties of a QueryChannelClientStateRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelClientStateRequest - * @property {string|null} [port_id] QueryChannelClientStateRequest port_id - * @property {string|null} [channel_id] QueryChannelClientStateRequest channel_id - */ - - /** - * Constructs a new QueryChannelClientStateRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelClientStateRequest. - * @implements IQueryChannelClientStateRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest=} [properties] Properties to set - */ - function QueryChannelClientStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelClientStateRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @instance - */ - QueryChannelClientStateRequest.prototype.port_id = ""; - - /** - * QueryChannelClientStateRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @instance - */ - QueryChannelClientStateRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryChannelClientStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} message QueryChannelClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelClientStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryChannelClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} message QueryChannelClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelClientStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelClientStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelClientStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelClientStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelClientStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelClientStateRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelClientStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryChannelClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest - */ - QueryChannelClientStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelClientStateRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryChannelClientStateRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryChannelClientStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {ibc.core.channel.v1.QueryChannelClientStateRequest} message QueryChannelClientStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelClientStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryChannelClientStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryChannelClientStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelClientStateRequest; - })(); - - v1.QueryChannelClientStateResponse = (function() { - - /** - * Properties of a QueryChannelClientStateResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelClientStateResponse - * @property {ibc.core.client.v1.IIdentifiedClientState|null} [identified_client_state] QueryChannelClientStateResponse identified_client_state - * @property {Uint8Array|null} [proof] QueryChannelClientStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryChannelClientStateResponse proof_height - */ - - /** - * Constructs a new QueryChannelClientStateResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelClientStateResponse. - * @implements IQueryChannelClientStateResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse=} [properties] Properties to set - */ - function QueryChannelClientStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelClientStateResponse identified_client_state. - * @member {ibc.core.client.v1.IIdentifiedClientState|null|undefined} identified_client_state - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @instance - */ - QueryChannelClientStateResponse.prototype.identified_client_state = null; - - /** - * QueryChannelClientStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @instance - */ - QueryChannelClientStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryChannelClientStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @instance - */ - QueryChannelClientStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryChannelClientStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse} message QueryChannelClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelClientStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identified_client_state != null && Object.hasOwnProperty.call(message, "identified_client_state")) - $root.ibc.core.client.v1.IdentifiedClientState.encode(message.identified_client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse} message QueryChannelClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelClientStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelClientStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelClientStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelClientStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelClientStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelClientStateResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelClientStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identified_client_state != null && message.hasOwnProperty("identified_client_state")) { - var error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.identified_client_state); - if (error) - return "identified_client_state." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryChannelClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse - */ - QueryChannelClientStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelClientStateResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryChannelClientStateResponse(); - if (object.identified_client_state != null) { - if (typeof object.identified_client_state !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelClientStateResponse.identified_client_state: object expected"); - message.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.identified_client_state); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelClientStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelClientStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {ibc.core.channel.v1.QueryChannelClientStateResponse} message QueryChannelClientStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelClientStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.identified_client_state = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.identified_client_state != null && message.hasOwnProperty("identified_client_state")) - object.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.identified_client_state, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryChannelClientStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryChannelClientStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelClientStateResponse; - })(); - - v1.QueryChannelConsensusStateRequest = (function() { - - /** - * Properties of a QueryChannelConsensusStateRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelConsensusStateRequest - * @property {string|null} [port_id] QueryChannelConsensusStateRequest port_id - * @property {string|null} [channel_id] QueryChannelConsensusStateRequest channel_id - * @property {Long|null} [revision_number] QueryChannelConsensusStateRequest revision_number - * @property {Long|null} [revision_height] QueryChannelConsensusStateRequest revision_height - */ - - /** - * Constructs a new QueryChannelConsensusStateRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelConsensusStateRequest. - * @implements IQueryChannelConsensusStateRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest=} [properties] Properties to set - */ - function QueryChannelConsensusStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelConsensusStateRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - */ - QueryChannelConsensusStateRequest.prototype.port_id = ""; - - /** - * QueryChannelConsensusStateRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - */ - QueryChannelConsensusStateRequest.prototype.channel_id = ""; - - /** - * QueryChannelConsensusStateRequest revision_number. - * @member {Long} revision_number - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - */ - QueryChannelConsensusStateRequest.prototype.revision_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryChannelConsensusStateRequest revision_height. - * @member {Long} revision_height - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - */ - QueryChannelConsensusStateRequest.prototype.revision_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryChannelConsensusStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} message QueryChannelConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelConsensusStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.revision_number != null && Object.hasOwnProperty.call(message, "revision_number")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revision_number); - if (message.revision_height != null && Object.hasOwnProperty.call(message, "revision_height")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.revision_height); - return writer; - }; - - /** - * Encodes the specified QueryChannelConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} message QueryChannelConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelConsensusStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelConsensusStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.revision_number = reader.uint64(); - break; - case 4: - message.revision_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelConsensusStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelConsensusStateRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelConsensusStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (!$util.isInteger(message.revision_number) && !(message.revision_number && $util.isInteger(message.revision_number.low) && $util.isInteger(message.revision_number.high))) - return "revision_number: integer|Long expected"; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (!$util.isInteger(message.revision_height) && !(message.revision_height && $util.isInteger(message.revision_height.low) && $util.isInteger(message.revision_height.high))) - return "revision_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryChannelConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest - */ - QueryChannelConsensusStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.revision_number != null) - if ($util.Long) - (message.revision_number = $util.Long.fromValue(object.revision_number)).unsigned = true; - else if (typeof object.revision_number === "string") - message.revision_number = parseInt(object.revision_number, 10); - else if (typeof object.revision_number === "number") - message.revision_number = object.revision_number; - else if (typeof object.revision_number === "object") - message.revision_number = new $util.LongBits(object.revision_number.low >>> 0, object.revision_number.high >>> 0).toNumber(true); - if (object.revision_height != null) - if ($util.Long) - (message.revision_height = $util.Long.fromValue(object.revision_height)).unsigned = true; - else if (typeof object.revision_height === "string") - message.revision_height = parseInt(object.revision_height, 10); - else if (typeof object.revision_height === "number") - message.revision_height = object.revision_height; - else if (typeof object.revision_height === "object") - message.revision_height = new $util.LongBits(object.revision_height.low >>> 0, object.revision_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryChannelConsensusStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {ibc.core.channel.v1.QueryChannelConsensusStateRequest} message QueryChannelConsensusStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelConsensusStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_number = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_height = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (typeof message.revision_number === "number") - object.revision_number = options.longs === String ? String(message.revision_number) : message.revision_number; - else - object.revision_number = options.longs === String ? $util.Long.prototype.toString.call(message.revision_number) : options.longs === Number ? new $util.LongBits(message.revision_number.low >>> 0, message.revision_number.high >>> 0).toNumber(true) : message.revision_number; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (typeof message.revision_height === "number") - object.revision_height = options.longs === String ? String(message.revision_height) : message.revision_height; - else - object.revision_height = options.longs === String ? $util.Long.prototype.toString.call(message.revision_height) : options.longs === Number ? new $util.LongBits(message.revision_height.low >>> 0, message.revision_height.high >>> 0).toNumber(true) : message.revision_height; - return object; - }; - - /** - * Converts this QueryChannelConsensusStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryChannelConsensusStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelConsensusStateRequest; - })(); - - v1.QueryChannelConsensusStateResponse = (function() { - - /** - * Properties of a QueryChannelConsensusStateResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelConsensusStateResponse - * @property {google.protobuf.IAny|null} [consensus_state] QueryChannelConsensusStateResponse consensus_state - * @property {string|null} [client_id] QueryChannelConsensusStateResponse client_id - * @property {Uint8Array|null} [proof] QueryChannelConsensusStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryChannelConsensusStateResponse proof_height - */ - - /** - * Constructs a new QueryChannelConsensusStateResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelConsensusStateResponse. - * @implements IQueryChannelConsensusStateResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse=} [properties] Properties to set - */ - function QueryChannelConsensusStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelConsensusStateResponse consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - */ - QueryChannelConsensusStateResponse.prototype.consensus_state = null; - - /** - * QueryChannelConsensusStateResponse client_id. - * @member {string} client_id - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - */ - QueryChannelConsensusStateResponse.prototype.client_id = ""; - - /** - * QueryChannelConsensusStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - */ - QueryChannelConsensusStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryChannelConsensusStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - */ - QueryChannelConsensusStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryChannelConsensusStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse} message QueryChannelConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelConsensusStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.client_id); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse} message QueryChannelConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelConsensusStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelConsensusStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.client_id = reader.string(); - break; - case 3: - message.proof = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelConsensusStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelConsensusStateResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelConsensusStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryChannelConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse - */ - QueryChannelConsensusStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse(); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelConsensusStateResponse.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelConsensusStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelConsensusStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {ibc.core.channel.v1.QueryChannelConsensusStateResponse} message QueryChannelConsensusStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelConsensusStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.consensus_state = null; - object.client_id = ""; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryChannelConsensusStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryChannelConsensusStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelConsensusStateResponse; - })(); - - v1.QueryPacketCommitmentRequest = (function() { - - /** - * Properties of a QueryPacketCommitmentRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketCommitmentRequest - * @property {string|null} [port_id] QueryPacketCommitmentRequest port_id - * @property {string|null} [channel_id] QueryPacketCommitmentRequest channel_id - * @property {Long|null} [sequence] QueryPacketCommitmentRequest sequence - */ - - /** - * Constructs a new QueryPacketCommitmentRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketCommitmentRequest. - * @implements IQueryPacketCommitmentRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest=} [properties] Properties to set - */ - function QueryPacketCommitmentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketCommitmentRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @instance - */ - QueryPacketCommitmentRequest.prototype.port_id = ""; - - /** - * QueryPacketCommitmentRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @instance - */ - QueryPacketCommitmentRequest.prototype.channel_id = ""; - - /** - * QueryPacketCommitmentRequest sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @instance - */ - QueryPacketCommitmentRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryPacketCommitmentRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} message QueryPacketCommitmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified QueryPacketCommitmentRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} message QueryPacketCommitmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketCommitmentRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketCommitmentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketCommitmentRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketCommitmentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryPacketCommitmentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest - */ - QueryPacketCommitmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketCommitmentRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryPacketCommitmentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketCommitmentRequest} message QueryPacketCommitmentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketCommitmentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this QueryPacketCommitmentRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketCommitmentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketCommitmentRequest; - })(); - - v1.QueryPacketCommitmentResponse = (function() { - - /** - * Properties of a QueryPacketCommitmentResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketCommitmentResponse - * @property {Uint8Array|null} [commitment] QueryPacketCommitmentResponse commitment - * @property {Uint8Array|null} [proof] QueryPacketCommitmentResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryPacketCommitmentResponse proof_height - */ - - /** - * Constructs a new QueryPacketCommitmentResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketCommitmentResponse. - * @implements IQueryPacketCommitmentResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse=} [properties] Properties to set - */ - function QueryPacketCommitmentResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketCommitmentResponse commitment. - * @member {Uint8Array} commitment - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @instance - */ - QueryPacketCommitmentResponse.prototype.commitment = $util.newBuffer([]); - - /** - * QueryPacketCommitmentResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @instance - */ - QueryPacketCommitmentResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryPacketCommitmentResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @instance - */ - QueryPacketCommitmentResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryPacketCommitmentResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse} message QueryPacketCommitmentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.commitment); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketCommitmentResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse} message QueryPacketCommitmentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketCommitmentResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.commitment = reader.bytes(); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketCommitmentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketCommitmentResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketCommitmentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commitment != null && message.hasOwnProperty("commitment")) - if (!(message.commitment && typeof message.commitment.length === "number" || $util.isString(message.commitment))) - return "commitment: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketCommitmentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse - */ - QueryPacketCommitmentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketCommitmentResponse(); - if (object.commitment != null) - if (typeof object.commitment === "string") - $util.base64.decode(object.commitment, message.commitment = $util.newBuffer($util.base64.length(object.commitment)), 0); - else if (object.commitment.length) - message.commitment = object.commitment; - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketCommitmentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketCommitmentResponse} message QueryPacketCommitmentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketCommitmentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.commitment = ""; - else { - object.commitment = []; - if (options.bytes !== Array) - object.commitment = $util.newBuffer(object.commitment); - } - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.commitment != null && message.hasOwnProperty("commitment")) - object.commitment = options.bytes === String ? $util.base64.encode(message.commitment, 0, message.commitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.commitment) : message.commitment; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryPacketCommitmentResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketCommitmentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketCommitmentResponse; - })(); - - v1.QueryPacketCommitmentsRequest = (function() { - - /** - * Properties of a QueryPacketCommitmentsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketCommitmentsRequest - * @property {string|null} [port_id] QueryPacketCommitmentsRequest port_id - * @property {string|null} [channel_id] QueryPacketCommitmentsRequest channel_id - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryPacketCommitmentsRequest pagination - */ - - /** - * Constructs a new QueryPacketCommitmentsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketCommitmentsRequest. - * @implements IQueryPacketCommitmentsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest=} [properties] Properties to set - */ - function QueryPacketCommitmentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketCommitmentsRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @instance - */ - QueryPacketCommitmentsRequest.prototype.port_id = ""; - - /** - * QueryPacketCommitmentsRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @instance - */ - QueryPacketCommitmentsRequest.prototype.channel_id = ""; - - /** - * QueryPacketCommitmentsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @instance - */ - QueryPacketCommitmentsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryPacketCommitmentsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} message QueryPacketCommitmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketCommitmentsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} message QueryPacketCommitmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketCommitmentsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketCommitmentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketCommitmentsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketCommitmentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryPacketCommitmentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest - */ - QueryPacketCommitmentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketCommitmentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketCommitmentsRequest} message QueryPacketCommitmentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketCommitmentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.pagination = null; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryPacketCommitmentsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketCommitmentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketCommitmentsRequest; - })(); - - v1.QueryPacketCommitmentsResponse = (function() { - - /** - * Properties of a QueryPacketCommitmentsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketCommitmentsResponse - * @property {Array.|null} [commitments] QueryPacketCommitmentsResponse commitments - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryPacketCommitmentsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryPacketCommitmentsResponse height - */ - - /** - * Constructs a new QueryPacketCommitmentsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketCommitmentsResponse. - * @implements IQueryPacketCommitmentsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse=} [properties] Properties to set - */ - function QueryPacketCommitmentsResponse(properties) { - this.commitments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketCommitmentsResponse commitments. - * @member {Array.} commitments - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @instance - */ - QueryPacketCommitmentsResponse.prototype.commitments = $util.emptyArray; - - /** - * QueryPacketCommitmentsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @instance - */ - QueryPacketCommitmentsResponse.prototype.pagination = null; - - /** - * QueryPacketCommitmentsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @instance - */ - QueryPacketCommitmentsResponse.prototype.height = null; - - /** - * Encodes the specified QueryPacketCommitmentsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse} message QueryPacketCommitmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commitments != null && message.commitments.length) - for (var i = 0; i < message.commitments.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.commitments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketCommitmentsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse} message QueryPacketCommitmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketCommitmentsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.commitments && message.commitments.length)) - message.commitments = []; - message.commitments.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketCommitmentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketCommitmentsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketCommitmentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commitments != null && message.hasOwnProperty("commitments")) { - if (!Array.isArray(message.commitments)) - return "commitments: array expected"; - for (var i = 0; i < message.commitments.length; ++i) { - var error = $root.ibc.core.channel.v1.PacketState.verify(message.commitments[i]); - if (error) - return "commitments." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketCommitmentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse - */ - QueryPacketCommitmentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse(); - if (object.commitments) { - if (!Array.isArray(object.commitments)) - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.commitments: array expected"); - message.commitments = []; - for (var i = 0; i < object.commitments.length; ++i) { - if (typeof object.commitments[i] !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.commitments: object expected"); - message.commitments[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.commitments[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketCommitmentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketCommitmentsResponse} message QueryPacketCommitmentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketCommitmentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.commitments = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.commitments && message.commitments.length) { - object.commitments = []; - for (var j = 0; j < message.commitments.length; ++j) - object.commitments[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.commitments[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryPacketCommitmentsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketCommitmentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketCommitmentsResponse; - })(); - - v1.QueryPacketReceiptRequest = (function() { - - /** - * Properties of a QueryPacketReceiptRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketReceiptRequest - * @property {string|null} [port_id] QueryPacketReceiptRequest port_id - * @property {string|null} [channel_id] QueryPacketReceiptRequest channel_id - * @property {Long|null} [sequence] QueryPacketReceiptRequest sequence - */ - - /** - * Constructs a new QueryPacketReceiptRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketReceiptRequest. - * @implements IQueryPacketReceiptRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest=} [properties] Properties to set - */ - function QueryPacketReceiptRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketReceiptRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @instance - */ - QueryPacketReceiptRequest.prototype.port_id = ""; - - /** - * QueryPacketReceiptRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @instance - */ - QueryPacketReceiptRequest.prototype.channel_id = ""; - - /** - * QueryPacketReceiptRequest sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @instance - */ - QueryPacketReceiptRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryPacketReceiptRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} message QueryPacketReceiptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketReceiptRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified QueryPacketReceiptRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} message QueryPacketReceiptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketReceiptRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketReceiptRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketReceiptRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketReceiptRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketReceiptRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketReceiptRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketReceiptRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketReceiptRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryPacketReceiptRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest - */ - QueryPacketReceiptRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketReceiptRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketReceiptRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryPacketReceiptRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketReceiptRequest} message QueryPacketReceiptRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketReceiptRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this QueryPacketReceiptRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketReceiptRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketReceiptRequest; - })(); - - v1.QueryPacketReceiptResponse = (function() { - - /** - * Properties of a QueryPacketReceiptResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketReceiptResponse - * @property {boolean|null} [received] QueryPacketReceiptResponse received - * @property {Uint8Array|null} [proof] QueryPacketReceiptResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryPacketReceiptResponse proof_height - */ - - /** - * Constructs a new QueryPacketReceiptResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketReceiptResponse. - * @implements IQueryPacketReceiptResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse=} [properties] Properties to set - */ - function QueryPacketReceiptResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketReceiptResponse received. - * @member {boolean} received - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @instance - */ - QueryPacketReceiptResponse.prototype.received = false; - - /** - * QueryPacketReceiptResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @instance - */ - QueryPacketReceiptResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryPacketReceiptResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @instance - */ - QueryPacketReceiptResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryPacketReceiptResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse} message QueryPacketReceiptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketReceiptResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.received != null && Object.hasOwnProperty.call(message, "received")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.received); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketReceiptResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse} message QueryPacketReceiptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketReceiptResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketReceiptResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketReceiptResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketReceiptResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.received = reader.bool(); - break; - case 3: - message.proof = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketReceiptResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketReceiptResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketReceiptResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketReceiptResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.received != null && message.hasOwnProperty("received")) - if (typeof message.received !== "boolean") - return "received: boolean expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketReceiptResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse - */ - QueryPacketReceiptResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketReceiptResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketReceiptResponse(); - if (object.received != null) - message.received = Boolean(object.received); - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketReceiptResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketReceiptResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketReceiptResponse} message QueryPacketReceiptResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketReceiptResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.received = false; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.received != null && message.hasOwnProperty("received")) - object.received = message.received; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryPacketReceiptResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketReceiptResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketReceiptResponse; - })(); - - v1.QueryPacketAcknowledgementRequest = (function() { - - /** - * Properties of a QueryPacketAcknowledgementRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketAcknowledgementRequest - * @property {string|null} [port_id] QueryPacketAcknowledgementRequest port_id - * @property {string|null} [channel_id] QueryPacketAcknowledgementRequest channel_id - * @property {Long|null} [sequence] QueryPacketAcknowledgementRequest sequence - */ - - /** - * Constructs a new QueryPacketAcknowledgementRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketAcknowledgementRequest. - * @implements IQueryPacketAcknowledgementRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest=} [properties] Properties to set - */ - function QueryPacketAcknowledgementRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketAcknowledgementRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @instance - */ - QueryPacketAcknowledgementRequest.prototype.port_id = ""; - - /** - * QueryPacketAcknowledgementRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @instance - */ - QueryPacketAcknowledgementRequest.prototype.channel_id = ""; - - /** - * QueryPacketAcknowledgementRequest sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @instance - */ - QueryPacketAcknowledgementRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryPacketAcknowledgementRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} message QueryPacketAcknowledgementRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified QueryPacketAcknowledgementRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} message QueryPacketAcknowledgementRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketAcknowledgementRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketAcknowledgementRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketAcknowledgementRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketAcknowledgementRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryPacketAcknowledgementRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest - */ - QueryPacketAcknowledgementRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryPacketAcknowledgementRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} message QueryPacketAcknowledgementRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketAcknowledgementRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this QueryPacketAcknowledgementRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketAcknowledgementRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketAcknowledgementRequest; - })(); - - v1.QueryPacketAcknowledgementResponse = (function() { - - /** - * Properties of a QueryPacketAcknowledgementResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketAcknowledgementResponse - * @property {Uint8Array|null} [acknowledgement] QueryPacketAcknowledgementResponse acknowledgement - * @property {Uint8Array|null} [proof] QueryPacketAcknowledgementResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryPacketAcknowledgementResponse proof_height - */ - - /** - * Constructs a new QueryPacketAcknowledgementResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketAcknowledgementResponse. - * @implements IQueryPacketAcknowledgementResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse=} [properties] Properties to set - */ - function QueryPacketAcknowledgementResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketAcknowledgementResponse acknowledgement. - * @member {Uint8Array} acknowledgement - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @instance - */ - QueryPacketAcknowledgementResponse.prototype.acknowledgement = $util.newBuffer([]); - - /** - * QueryPacketAcknowledgementResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @instance - */ - QueryPacketAcknowledgementResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryPacketAcknowledgementResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @instance - */ - QueryPacketAcknowledgementResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryPacketAcknowledgementResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse} message QueryPacketAcknowledgementResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.acknowledgement); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketAcknowledgementResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse} message QueryPacketAcknowledgementResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketAcknowledgementResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.acknowledgement = reader.bytes(); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketAcknowledgementResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketAcknowledgementResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketAcknowledgementResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) - return "acknowledgement: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketAcknowledgementResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse - */ - QueryPacketAcknowledgementResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse(); - if (object.acknowledgement != null) - if (typeof object.acknowledgement === "string") - $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); - else if (object.acknowledgement.length) - message.acknowledgement = object.acknowledgement; - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketAcknowledgementResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} message QueryPacketAcknowledgementResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketAcknowledgementResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.acknowledgement = ""; - else { - object.acknowledgement = []; - if (options.bytes !== Array) - object.acknowledgement = $util.newBuffer(object.acknowledgement); - } - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryPacketAcknowledgementResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketAcknowledgementResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketAcknowledgementResponse; - })(); - - v1.QueryPacketAcknowledgementsRequest = (function() { - - /** - * Properties of a QueryPacketAcknowledgementsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketAcknowledgementsRequest - * @property {string|null} [port_id] QueryPacketAcknowledgementsRequest port_id - * @property {string|null} [channel_id] QueryPacketAcknowledgementsRequest channel_id - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryPacketAcknowledgementsRequest pagination - * @property {Array.|null} [packet_commitment_sequences] QueryPacketAcknowledgementsRequest packet_commitment_sequences - */ - - /** - * Constructs a new QueryPacketAcknowledgementsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketAcknowledgementsRequest. - * @implements IQueryPacketAcknowledgementsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest=} [properties] Properties to set - */ - function QueryPacketAcknowledgementsRequest(properties) { - this.packet_commitment_sequences = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketAcknowledgementsRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - */ - QueryPacketAcknowledgementsRequest.prototype.port_id = ""; - - /** - * QueryPacketAcknowledgementsRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - */ - QueryPacketAcknowledgementsRequest.prototype.channel_id = ""; - - /** - * QueryPacketAcknowledgementsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - */ - QueryPacketAcknowledgementsRequest.prototype.pagination = null; - - /** - * QueryPacketAcknowledgementsRequest packet_commitment_sequences. - * @member {Array.} packet_commitment_sequences - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - */ - QueryPacketAcknowledgementsRequest.prototype.packet_commitment_sequences = $util.emptyArray; - - /** - * Encodes the specified QueryPacketAcknowledgementsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} message QueryPacketAcknowledgementsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.packet_commitment_sequences != null && message.packet_commitment_sequences.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.packet_commitment_sequences.length; ++i) - writer.uint64(message.packet_commitment_sequences[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified QueryPacketAcknowledgementsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} message QueryPacketAcknowledgementsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketAcknowledgementsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.packet_commitment_sequences && message.packet_commitment_sequences.length)) - message.packet_commitment_sequences = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.packet_commitment_sequences.push(reader.uint64()); - } else - message.packet_commitment_sequences.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketAcknowledgementsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketAcknowledgementsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketAcknowledgementsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.packet_commitment_sequences != null && message.hasOwnProperty("packet_commitment_sequences")) { - if (!Array.isArray(message.packet_commitment_sequences)) - return "packet_commitment_sequences: array expected"; - for (var i = 0; i < message.packet_commitment_sequences.length; ++i) - if (!$util.isInteger(message.packet_commitment_sequences[i]) && !(message.packet_commitment_sequences[i] && $util.isInteger(message.packet_commitment_sequences[i].low) && $util.isInteger(message.packet_commitment_sequences[i].high))) - return "packet_commitment_sequences: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a QueryPacketAcknowledgementsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest - */ - QueryPacketAcknowledgementsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - if (object.packet_commitment_sequences) { - if (!Array.isArray(object.packet_commitment_sequences)) - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.packet_commitment_sequences: array expected"); - message.packet_commitment_sequences = []; - for (var i = 0; i < object.packet_commitment_sequences.length; ++i) - if ($util.Long) - (message.packet_commitment_sequences[i] = $util.Long.fromValue(object.packet_commitment_sequences[i])).unsigned = true; - else if (typeof object.packet_commitment_sequences[i] === "string") - message.packet_commitment_sequences[i] = parseInt(object.packet_commitment_sequences[i], 10); - else if (typeof object.packet_commitment_sequences[i] === "number") - message.packet_commitment_sequences[i] = object.packet_commitment_sequences[i]; - else if (typeof object.packet_commitment_sequences[i] === "object") - message.packet_commitment_sequences[i] = new $util.LongBits(object.packet_commitment_sequences[i].low >>> 0, object.packet_commitment_sequences[i].high >>> 0).toNumber(true); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketAcknowledgementsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} message QueryPacketAcknowledgementsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketAcknowledgementsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.packet_commitment_sequences = []; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.pagination = null; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - if (message.packet_commitment_sequences && message.packet_commitment_sequences.length) { - object.packet_commitment_sequences = []; - for (var j = 0; j < message.packet_commitment_sequences.length; ++j) - if (typeof message.packet_commitment_sequences[j] === "number") - object.packet_commitment_sequences[j] = options.longs === String ? String(message.packet_commitment_sequences[j]) : message.packet_commitment_sequences[j]; - else - object.packet_commitment_sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.packet_commitment_sequences[j]) : options.longs === Number ? new $util.LongBits(message.packet_commitment_sequences[j].low >>> 0, message.packet_commitment_sequences[j].high >>> 0).toNumber(true) : message.packet_commitment_sequences[j]; - } - return object; - }; - - /** - * Converts this QueryPacketAcknowledgementsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketAcknowledgementsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketAcknowledgementsRequest; - })(); - - v1.QueryPacketAcknowledgementsResponse = (function() { - - /** - * Properties of a QueryPacketAcknowledgementsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketAcknowledgementsResponse - * @property {Array.|null} [acknowledgements] QueryPacketAcknowledgementsResponse acknowledgements - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryPacketAcknowledgementsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryPacketAcknowledgementsResponse height - */ - - /** - * Constructs a new QueryPacketAcknowledgementsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketAcknowledgementsResponse. - * @implements IQueryPacketAcknowledgementsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse=} [properties] Properties to set - */ - function QueryPacketAcknowledgementsResponse(properties) { - this.acknowledgements = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketAcknowledgementsResponse acknowledgements. - * @member {Array.} acknowledgements - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @instance - */ - QueryPacketAcknowledgementsResponse.prototype.acknowledgements = $util.emptyArray; - - /** - * QueryPacketAcknowledgementsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @instance - */ - QueryPacketAcknowledgementsResponse.prototype.pagination = null; - - /** - * QueryPacketAcknowledgementsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @instance - */ - QueryPacketAcknowledgementsResponse.prototype.height = null; - - /** - * Encodes the specified QueryPacketAcknowledgementsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse} message QueryPacketAcknowledgementsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.acknowledgements != null && message.acknowledgements.length) - for (var i = 0; i < message.acknowledgements.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.acknowledgements[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketAcknowledgementsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse} message QueryPacketAcknowledgementsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketAcknowledgementsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.acknowledgements && message.acknowledgements.length)) - message.acknowledgements = []; - message.acknowledgements.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketAcknowledgementsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketAcknowledgementsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketAcknowledgementsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.acknowledgements != null && message.hasOwnProperty("acknowledgements")) { - if (!Array.isArray(message.acknowledgements)) - return "acknowledgements: array expected"; - for (var i = 0; i < message.acknowledgements.length; ++i) { - var error = $root.ibc.core.channel.v1.PacketState.verify(message.acknowledgements[i]); - if (error) - return "acknowledgements." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketAcknowledgementsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse - */ - QueryPacketAcknowledgementsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse(); - if (object.acknowledgements) { - if (!Array.isArray(object.acknowledgements)) - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.acknowledgements: array expected"); - message.acknowledgements = []; - for (var i = 0; i < object.acknowledgements.length; ++i) { - if (typeof object.acknowledgements[i] !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.acknowledgements: object expected"); - message.acknowledgements[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.acknowledgements[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketAcknowledgementsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} message QueryPacketAcknowledgementsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketAcknowledgementsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.acknowledgements = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.acknowledgements && message.acknowledgements.length) { - object.acknowledgements = []; - for (var j = 0; j < message.acknowledgements.length; ++j) - object.acknowledgements[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.acknowledgements[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryPacketAcknowledgementsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketAcknowledgementsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketAcknowledgementsResponse; - })(); - - v1.QueryUnreceivedPacketsRequest = (function() { - - /** - * Properties of a QueryUnreceivedPacketsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryUnreceivedPacketsRequest - * @property {string|null} [port_id] QueryUnreceivedPacketsRequest port_id - * @property {string|null} [channel_id] QueryUnreceivedPacketsRequest channel_id - * @property {Array.|null} [packet_commitment_sequences] QueryUnreceivedPacketsRequest packet_commitment_sequences - */ - - /** - * Constructs a new QueryUnreceivedPacketsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryUnreceivedPacketsRequest. - * @implements IQueryUnreceivedPacketsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest=} [properties] Properties to set - */ - function QueryUnreceivedPacketsRequest(properties) { - this.packet_commitment_sequences = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUnreceivedPacketsRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @instance - */ - QueryUnreceivedPacketsRequest.prototype.port_id = ""; - - /** - * QueryUnreceivedPacketsRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @instance - */ - QueryUnreceivedPacketsRequest.prototype.channel_id = ""; - - /** - * QueryUnreceivedPacketsRequest packet_commitment_sequences. - * @member {Array.} packet_commitment_sequences - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @instance - */ - QueryUnreceivedPacketsRequest.prototype.packet_commitment_sequences = $util.emptyArray; - - /** - * Encodes the specified QueryUnreceivedPacketsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} message QueryUnreceivedPacketsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedPacketsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.packet_commitment_sequences != null && message.packet_commitment_sequences.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.packet_commitment_sequences.length; ++i) - writer.uint64(message.packet_commitment_sequences[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified QueryUnreceivedPacketsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} message QueryUnreceivedPacketsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedPacketsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUnreceivedPacketsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedPacketsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - if (!(message.packet_commitment_sequences && message.packet_commitment_sequences.length)) - message.packet_commitment_sequences = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.packet_commitment_sequences.push(reader.uint64()); - } else - message.packet_commitment_sequences.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUnreceivedPacketsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedPacketsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUnreceivedPacketsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUnreceivedPacketsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.packet_commitment_sequences != null && message.hasOwnProperty("packet_commitment_sequences")) { - if (!Array.isArray(message.packet_commitment_sequences)) - return "packet_commitment_sequences: array expected"; - for (var i = 0; i < message.packet_commitment_sequences.length; ++i) - if (!$util.isInteger(message.packet_commitment_sequences[i]) && !(message.packet_commitment_sequences[i] && $util.isInteger(message.packet_commitment_sequences[i].low) && $util.isInteger(message.packet_commitment_sequences[i].high))) - return "packet_commitment_sequences: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a QueryUnreceivedPacketsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest - */ - QueryUnreceivedPacketsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.packet_commitment_sequences) { - if (!Array.isArray(object.packet_commitment_sequences)) - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedPacketsRequest.packet_commitment_sequences: array expected"); - message.packet_commitment_sequences = []; - for (var i = 0; i < object.packet_commitment_sequences.length; ++i) - if ($util.Long) - (message.packet_commitment_sequences[i] = $util.Long.fromValue(object.packet_commitment_sequences[i])).unsigned = true; - else if (typeof object.packet_commitment_sequences[i] === "string") - message.packet_commitment_sequences[i] = parseInt(object.packet_commitment_sequences[i], 10); - else if (typeof object.packet_commitment_sequences[i] === "number") - message.packet_commitment_sequences[i] = object.packet_commitment_sequences[i]; - else if (typeof object.packet_commitment_sequences[i] === "object") - message.packet_commitment_sequences[i] = new $util.LongBits(object.packet_commitment_sequences[i].low >>> 0, object.packet_commitment_sequences[i].high >>> 0).toNumber(true); - } - return message; - }; - - /** - * Creates a plain object from a QueryUnreceivedPacketsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} message QueryUnreceivedPacketsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUnreceivedPacketsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.packet_commitment_sequences = []; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.packet_commitment_sequences && message.packet_commitment_sequences.length) { - object.packet_commitment_sequences = []; - for (var j = 0; j < message.packet_commitment_sequences.length; ++j) - if (typeof message.packet_commitment_sequences[j] === "number") - object.packet_commitment_sequences[j] = options.longs === String ? String(message.packet_commitment_sequences[j]) : message.packet_commitment_sequences[j]; - else - object.packet_commitment_sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.packet_commitment_sequences[j]) : options.longs === Number ? new $util.LongBits(message.packet_commitment_sequences[j].low >>> 0, message.packet_commitment_sequences[j].high >>> 0).toNumber(true) : message.packet_commitment_sequences[j]; - } - return object; - }; - - /** - * Converts this QueryUnreceivedPacketsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryUnreceivedPacketsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUnreceivedPacketsRequest; - })(); - - v1.QueryUnreceivedPacketsResponse = (function() { - - /** - * Properties of a QueryUnreceivedPacketsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryUnreceivedPacketsResponse - * @property {Array.|null} [sequences] QueryUnreceivedPacketsResponse sequences - * @property {ibc.core.client.v1.IHeight|null} [height] QueryUnreceivedPacketsResponse height - */ - - /** - * Constructs a new QueryUnreceivedPacketsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryUnreceivedPacketsResponse. - * @implements IQueryUnreceivedPacketsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse=} [properties] Properties to set - */ - function QueryUnreceivedPacketsResponse(properties) { - this.sequences = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUnreceivedPacketsResponse sequences. - * @member {Array.} sequences - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @instance - */ - QueryUnreceivedPacketsResponse.prototype.sequences = $util.emptyArray; - - /** - * QueryUnreceivedPacketsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @instance - */ - QueryUnreceivedPacketsResponse.prototype.height = null; - - /** - * Encodes the specified QueryUnreceivedPacketsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse} message QueryUnreceivedPacketsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedPacketsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequences != null && message.sequences.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.sequences.length; ++i) - writer.uint64(message.sequences[i]); - writer.ldelim(); - } - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryUnreceivedPacketsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse} message QueryUnreceivedPacketsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedPacketsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUnreceivedPacketsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedPacketsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.sequences && message.sequences.length)) - message.sequences = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.sequences.push(reader.uint64()); - } else - message.sequences.push(reader.uint64()); - break; - case 2: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUnreceivedPacketsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedPacketsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUnreceivedPacketsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUnreceivedPacketsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequences != null && message.hasOwnProperty("sequences")) { - if (!Array.isArray(message.sequences)) - return "sequences: array expected"; - for (var i = 0; i < message.sequences.length; ++i) - if (!$util.isInteger(message.sequences[i]) && !(message.sequences[i] && $util.isInteger(message.sequences[i].low) && $util.isInteger(message.sequences[i].high))) - return "sequences: integer|Long[] expected"; - } - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryUnreceivedPacketsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse - */ - QueryUnreceivedPacketsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse(); - if (object.sequences) { - if (!Array.isArray(object.sequences)) - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedPacketsResponse.sequences: array expected"); - message.sequences = []; - for (var i = 0; i < object.sequences.length; ++i) - if ($util.Long) - (message.sequences[i] = $util.Long.fromValue(object.sequences[i])).unsigned = true; - else if (typeof object.sequences[i] === "string") - message.sequences[i] = parseInt(object.sequences[i], 10); - else if (typeof object.sequences[i] === "number") - message.sequences[i] = object.sequences[i]; - else if (typeof object.sequences[i] === "object") - message.sequences[i] = new $util.LongBits(object.sequences[i].low >>> 0, object.sequences[i].high >>> 0).toNumber(true); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedPacketsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryUnreceivedPacketsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} message QueryUnreceivedPacketsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUnreceivedPacketsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sequences = []; - if (options.defaults) - object.height = null; - if (message.sequences && message.sequences.length) { - object.sequences = []; - for (var j = 0; j < message.sequences.length; ++j) - if (typeof message.sequences[j] === "number") - object.sequences[j] = options.longs === String ? String(message.sequences[j]) : message.sequences[j]; - else - object.sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.sequences[j]) : options.longs === Number ? new $util.LongBits(message.sequences[j].low >>> 0, message.sequences[j].high >>> 0).toNumber(true) : message.sequences[j]; - } - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryUnreceivedPacketsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryUnreceivedPacketsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUnreceivedPacketsResponse; - })(); - - v1.QueryUnreceivedAcksRequest = (function() { - - /** - * Properties of a QueryUnreceivedAcksRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryUnreceivedAcksRequest - * @property {string|null} [port_id] QueryUnreceivedAcksRequest port_id - * @property {string|null} [channel_id] QueryUnreceivedAcksRequest channel_id - * @property {Array.|null} [packet_ack_sequences] QueryUnreceivedAcksRequest packet_ack_sequences - */ - - /** - * Constructs a new QueryUnreceivedAcksRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryUnreceivedAcksRequest. - * @implements IQueryUnreceivedAcksRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest=} [properties] Properties to set - */ - function QueryUnreceivedAcksRequest(properties) { - this.packet_ack_sequences = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUnreceivedAcksRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @instance - */ - QueryUnreceivedAcksRequest.prototype.port_id = ""; - - /** - * QueryUnreceivedAcksRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @instance - */ - QueryUnreceivedAcksRequest.prototype.channel_id = ""; - - /** - * QueryUnreceivedAcksRequest packet_ack_sequences. - * @member {Array.} packet_ack_sequences - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @instance - */ - QueryUnreceivedAcksRequest.prototype.packet_ack_sequences = $util.emptyArray; - - /** - * Encodes the specified QueryUnreceivedAcksRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} message QueryUnreceivedAcksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedAcksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.packet_ack_sequences != null && message.packet_ack_sequences.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.packet_ack_sequences.length; ++i) - writer.uint64(message.packet_ack_sequences[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified QueryUnreceivedAcksRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} message QueryUnreceivedAcksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedAcksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUnreceivedAcksRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedAcksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - if (!(message.packet_ack_sequences && message.packet_ack_sequences.length)) - message.packet_ack_sequences = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.packet_ack_sequences.push(reader.uint64()); - } else - message.packet_ack_sequences.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUnreceivedAcksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedAcksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUnreceivedAcksRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUnreceivedAcksRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.packet_ack_sequences != null && message.hasOwnProperty("packet_ack_sequences")) { - if (!Array.isArray(message.packet_ack_sequences)) - return "packet_ack_sequences: array expected"; - for (var i = 0; i < message.packet_ack_sequences.length; ++i) - if (!$util.isInteger(message.packet_ack_sequences[i]) && !(message.packet_ack_sequences[i] && $util.isInteger(message.packet_ack_sequences[i].low) && $util.isInteger(message.packet_ack_sequences[i].high))) - return "packet_ack_sequences: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a QueryUnreceivedAcksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest - */ - QueryUnreceivedAcksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.packet_ack_sequences) { - if (!Array.isArray(object.packet_ack_sequences)) - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedAcksRequest.packet_ack_sequences: array expected"); - message.packet_ack_sequences = []; - for (var i = 0; i < object.packet_ack_sequences.length; ++i) - if ($util.Long) - (message.packet_ack_sequences[i] = $util.Long.fromValue(object.packet_ack_sequences[i])).unsigned = true; - else if (typeof object.packet_ack_sequences[i] === "string") - message.packet_ack_sequences[i] = parseInt(object.packet_ack_sequences[i], 10); - else if (typeof object.packet_ack_sequences[i] === "number") - message.packet_ack_sequences[i] = object.packet_ack_sequences[i]; - else if (typeof object.packet_ack_sequences[i] === "object") - message.packet_ack_sequences[i] = new $util.LongBits(object.packet_ack_sequences[i].low >>> 0, object.packet_ack_sequences[i].high >>> 0).toNumber(true); - } - return message; - }; - - /** - * Creates a plain object from a QueryUnreceivedAcksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {ibc.core.channel.v1.QueryUnreceivedAcksRequest} message QueryUnreceivedAcksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUnreceivedAcksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.packet_ack_sequences = []; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.packet_ack_sequences && message.packet_ack_sequences.length) { - object.packet_ack_sequences = []; - for (var j = 0; j < message.packet_ack_sequences.length; ++j) - if (typeof message.packet_ack_sequences[j] === "number") - object.packet_ack_sequences[j] = options.longs === String ? String(message.packet_ack_sequences[j]) : message.packet_ack_sequences[j]; - else - object.packet_ack_sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.packet_ack_sequences[j]) : options.longs === Number ? new $util.LongBits(message.packet_ack_sequences[j].low >>> 0, message.packet_ack_sequences[j].high >>> 0).toNumber(true) : message.packet_ack_sequences[j]; - } - return object; - }; - - /** - * Converts this QueryUnreceivedAcksRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @instance - * @returns {Object.} JSON object - */ - QueryUnreceivedAcksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUnreceivedAcksRequest; - })(); - - v1.QueryUnreceivedAcksResponse = (function() { - - /** - * Properties of a QueryUnreceivedAcksResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryUnreceivedAcksResponse - * @property {Array.|null} [sequences] QueryUnreceivedAcksResponse sequences - * @property {ibc.core.client.v1.IHeight|null} [height] QueryUnreceivedAcksResponse height - */ - - /** - * Constructs a new QueryUnreceivedAcksResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryUnreceivedAcksResponse. - * @implements IQueryUnreceivedAcksResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse=} [properties] Properties to set - */ - function QueryUnreceivedAcksResponse(properties) { - this.sequences = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUnreceivedAcksResponse sequences. - * @member {Array.} sequences - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @instance - */ - QueryUnreceivedAcksResponse.prototype.sequences = $util.emptyArray; - - /** - * QueryUnreceivedAcksResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @instance - */ - QueryUnreceivedAcksResponse.prototype.height = null; - - /** - * Encodes the specified QueryUnreceivedAcksResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse} message QueryUnreceivedAcksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedAcksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequences != null && message.sequences.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.sequences.length; ++i) - writer.uint64(message.sequences[i]); - writer.ldelim(); - } - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryUnreceivedAcksResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse} message QueryUnreceivedAcksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedAcksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUnreceivedAcksResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedAcksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.sequences && message.sequences.length)) - message.sequences = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.sequences.push(reader.uint64()); - } else - message.sequences.push(reader.uint64()); - break; - case 2: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUnreceivedAcksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedAcksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUnreceivedAcksResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUnreceivedAcksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequences != null && message.hasOwnProperty("sequences")) { - if (!Array.isArray(message.sequences)) - return "sequences: array expected"; - for (var i = 0; i < message.sequences.length; ++i) - if (!$util.isInteger(message.sequences[i]) && !(message.sequences[i] && $util.isInteger(message.sequences[i].low) && $util.isInteger(message.sequences[i].high))) - return "sequences: integer|Long[] expected"; - } - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryUnreceivedAcksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse - */ - QueryUnreceivedAcksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse(); - if (object.sequences) { - if (!Array.isArray(object.sequences)) - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedAcksResponse.sequences: array expected"); - message.sequences = []; - for (var i = 0; i < object.sequences.length; ++i) - if ($util.Long) - (message.sequences[i] = $util.Long.fromValue(object.sequences[i])).unsigned = true; - else if (typeof object.sequences[i] === "string") - message.sequences[i] = parseInt(object.sequences[i], 10); - else if (typeof object.sequences[i] === "number") - message.sequences[i] = object.sequences[i]; - else if (typeof object.sequences[i] === "object") - message.sequences[i] = new $util.LongBits(object.sequences[i].low >>> 0, object.sequences[i].high >>> 0).toNumber(true); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedAcksResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryUnreceivedAcksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {ibc.core.channel.v1.QueryUnreceivedAcksResponse} message QueryUnreceivedAcksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUnreceivedAcksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sequences = []; - if (options.defaults) - object.height = null; - if (message.sequences && message.sequences.length) { - object.sequences = []; - for (var j = 0; j < message.sequences.length; ++j) - if (typeof message.sequences[j] === "number") - object.sequences[j] = options.longs === String ? String(message.sequences[j]) : message.sequences[j]; - else - object.sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.sequences[j]) : options.longs === Number ? new $util.LongBits(message.sequences[j].low >>> 0, message.sequences[j].high >>> 0).toNumber(true) : message.sequences[j]; - } - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryUnreceivedAcksResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @instance - * @returns {Object.} JSON object - */ - QueryUnreceivedAcksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUnreceivedAcksResponse; - })(); - - v1.QueryNextSequenceReceiveRequest = (function() { - - /** - * Properties of a QueryNextSequenceReceiveRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryNextSequenceReceiveRequest - * @property {string|null} [port_id] QueryNextSequenceReceiveRequest port_id - * @property {string|null} [channel_id] QueryNextSequenceReceiveRequest channel_id - */ - - /** - * Constructs a new QueryNextSequenceReceiveRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryNextSequenceReceiveRequest. - * @implements IQueryNextSequenceReceiveRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest=} [properties] Properties to set - */ - function QueryNextSequenceReceiveRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryNextSequenceReceiveRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @instance - */ - QueryNextSequenceReceiveRequest.prototype.port_id = ""; - - /** - * QueryNextSequenceReceiveRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @instance - */ - QueryNextSequenceReceiveRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryNextSequenceReceiveRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} message QueryNextSequenceReceiveRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryNextSequenceReceiveRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryNextSequenceReceiveRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} message QueryNextSequenceReceiveRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryNextSequenceReceiveRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryNextSequenceReceiveRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryNextSequenceReceiveRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryNextSequenceReceiveRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryNextSequenceReceiveRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryNextSequenceReceiveRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryNextSequenceReceiveRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryNextSequenceReceiveRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest - */ - QueryNextSequenceReceiveRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest) - return object; - var message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryNextSequenceReceiveRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} message QueryNextSequenceReceiveRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryNextSequenceReceiveRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryNextSequenceReceiveRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @instance - * @returns {Object.} JSON object - */ - QueryNextSequenceReceiveRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryNextSequenceReceiveRequest; - })(); - - v1.QueryNextSequenceReceiveResponse = (function() { - - /** - * Properties of a QueryNextSequenceReceiveResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryNextSequenceReceiveResponse - * @property {Long|null} [next_sequence_receive] QueryNextSequenceReceiveResponse next_sequence_receive - * @property {Uint8Array|null} [proof] QueryNextSequenceReceiveResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryNextSequenceReceiveResponse proof_height - */ - - /** - * Constructs a new QueryNextSequenceReceiveResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryNextSequenceReceiveResponse. - * @implements IQueryNextSequenceReceiveResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse=} [properties] Properties to set - */ - function QueryNextSequenceReceiveResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryNextSequenceReceiveResponse next_sequence_receive. - * @member {Long} next_sequence_receive - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @instance - */ - QueryNextSequenceReceiveResponse.prototype.next_sequence_receive = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryNextSequenceReceiveResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @instance - */ - QueryNextSequenceReceiveResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryNextSequenceReceiveResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @instance - */ - QueryNextSequenceReceiveResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryNextSequenceReceiveResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse} message QueryNextSequenceReceiveResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryNextSequenceReceiveResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.next_sequence_receive != null && Object.hasOwnProperty.call(message, "next_sequence_receive")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.next_sequence_receive); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryNextSequenceReceiveResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse} message QueryNextSequenceReceiveResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryNextSequenceReceiveResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryNextSequenceReceiveResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryNextSequenceReceiveResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_sequence_receive = reader.uint64(); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryNextSequenceReceiveResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryNextSequenceReceiveResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryNextSequenceReceiveResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryNextSequenceReceiveResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.next_sequence_receive != null && message.hasOwnProperty("next_sequence_receive")) - if (!$util.isInteger(message.next_sequence_receive) && !(message.next_sequence_receive && $util.isInteger(message.next_sequence_receive.low) && $util.isInteger(message.next_sequence_receive.high))) - return "next_sequence_receive: integer|Long expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryNextSequenceReceiveResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse - */ - QueryNextSequenceReceiveResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse) - return object; - var message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse(); - if (object.next_sequence_receive != null) - if ($util.Long) - (message.next_sequence_receive = $util.Long.fromValue(object.next_sequence_receive)).unsigned = true; - else if (typeof object.next_sequence_receive === "string") - message.next_sequence_receive = parseInt(object.next_sequence_receive, 10); - else if (typeof object.next_sequence_receive === "number") - message.next_sequence_receive = object.next_sequence_receive; - else if (typeof object.next_sequence_receive === "object") - message.next_sequence_receive = new $util.LongBits(object.next_sequence_receive.low >>> 0, object.next_sequence_receive.high >>> 0).toNumber(true); - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryNextSequenceReceiveResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryNextSequenceReceiveResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} message QueryNextSequenceReceiveResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryNextSequenceReceiveResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.next_sequence_receive = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_sequence_receive = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.next_sequence_receive != null && message.hasOwnProperty("next_sequence_receive")) - if (typeof message.next_sequence_receive === "number") - object.next_sequence_receive = options.longs === String ? String(message.next_sequence_receive) : message.next_sequence_receive; - else - object.next_sequence_receive = options.longs === String ? $util.Long.prototype.toString.call(message.next_sequence_receive) : options.longs === Number ? new $util.LongBits(message.next_sequence_receive.low >>> 0, message.next_sequence_receive.high >>> 0).toNumber(true) : message.next_sequence_receive; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryNextSequenceReceiveResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @instance - * @returns {Object.} JSON object - */ - QueryNextSequenceReceiveResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryNextSequenceReceiveResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.core.channel.v1 - * @interface IGenesisState - * @property {Array.|null} [channels] GenesisState channels - * @property {Array.|null} [acknowledgements] GenesisState acknowledgements - * @property {Array.|null} [commitments] GenesisState commitments - * @property {Array.|null} [receipts] GenesisState receipts - * @property {Array.|null} [send_sequences] GenesisState send_sequences - * @property {Array.|null} [recv_sequences] GenesisState recv_sequences - * @property {Array.|null} [ack_sequences] GenesisState ack_sequences - * @property {Long|null} [next_channel_sequence] GenesisState next_channel_sequence - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.core.channel.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.channels = []; - this.acknowledgements = []; - this.commitments = []; - this.receipts = []; - this.send_sequences = []; - this.recv_sequences = []; - this.ack_sequences = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState channels. - * @member {Array.} channels - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.channels = $util.emptyArray; - - /** - * GenesisState acknowledgements. - * @member {Array.} acknowledgements - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.acknowledgements = $util.emptyArray; - - /** - * GenesisState commitments. - * @member {Array.} commitments - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.commitments = $util.emptyArray; - - /** - * GenesisState receipts. - * @member {Array.} receipts - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.receipts = $util.emptyArray; - - /** - * GenesisState send_sequences. - * @member {Array.} send_sequences - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.send_sequences = $util.emptyArray; - - /** - * GenesisState recv_sequences. - * @member {Array.} recv_sequences - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.recv_sequences = $util.emptyArray; - - /** - * GenesisState ack_sequences. - * @member {Array.} ack_sequences - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.ack_sequences = $util.emptyArray; - - /** - * GenesisState next_channel_sequence. - * @member {Long} next_channel_sequence - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.next_channel_sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.channel.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {ibc.core.channel.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channels != null && message.channels.length) - for (var i = 0; i < message.channels.length; ++i) - $root.ibc.core.channel.v1.IdentifiedChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.acknowledgements != null && message.acknowledgements.length) - for (var i = 0; i < message.acknowledgements.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.acknowledgements[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.commitments != null && message.commitments.length) - for (var i = 0; i < message.commitments.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.commitments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.receipts != null && message.receipts.length) - for (var i = 0; i < message.receipts.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.receipts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.send_sequences != null && message.send_sequences.length) - for (var i = 0; i < message.send_sequences.length; ++i) - $root.ibc.core.channel.v1.PacketSequence.encode(message.send_sequences[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.recv_sequences != null && message.recv_sequences.length) - for (var i = 0; i < message.recv_sequences.length; ++i) - $root.ibc.core.channel.v1.PacketSequence.encode(message.recv_sequences[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ack_sequences != null && message.ack_sequences.length) - for (var i = 0; i < message.ack_sequences.length; ++i) - $root.ibc.core.channel.v1.PacketSequence.encode(message.ack_sequences[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.next_channel_sequence != null && Object.hasOwnProperty.call(message, "next_channel_sequence")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.next_channel_sequence); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.channel.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {ibc.core.channel.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.channels && message.channels.length)) - message.channels = []; - message.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.acknowledgements && message.acknowledgements.length)) - message.acknowledgements = []; - message.acknowledgements.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.commitments && message.commitments.length)) - message.commitments = []; - message.commitments.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.receipts && message.receipts.length)) - message.receipts = []; - message.receipts.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.send_sequences && message.send_sequences.length)) - message.send_sequences = []; - message.send_sequences.push($root.ibc.core.channel.v1.PacketSequence.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.recv_sequences && message.recv_sequences.length)) - message.recv_sequences = []; - message.recv_sequences.push($root.ibc.core.channel.v1.PacketSequence.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.ack_sequences && message.ack_sequences.length)) - message.ack_sequences = []; - message.ack_sequences.push($root.ibc.core.channel.v1.PacketSequence.decode(reader, reader.uint32())); - break; - case 8: - message.next_channel_sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channels != null && message.hasOwnProperty("channels")) { - if (!Array.isArray(message.channels)) - return "channels: array expected"; - for (var i = 0; i < message.channels.length; ++i) { - var error = $root.ibc.core.channel.v1.IdentifiedChannel.verify(message.channels[i]); - if (error) - return "channels." + error; - } - } - if (message.acknowledgements != null && message.hasOwnProperty("acknowledgements")) { - if (!Array.isArray(message.acknowledgements)) - return "acknowledgements: array expected"; - for (var i = 0; i < message.acknowledgements.length; ++i) { - var error = $root.ibc.core.channel.v1.PacketState.verify(message.acknowledgements[i]); - if (error) - return "acknowledgements." + error; - } - } - if (message.commitments != null && message.hasOwnProperty("commitments")) { - if (!Array.isArray(message.commitments)) - return "commitments: array expected"; - for (var i = 0; i < message.commitments.length; ++i) { - var error = $root.ibc.core.channel.v1.PacketState.verify(message.commitments[i]); - if (error) - return "commitments." + error; - } - } - if (message.receipts != null && message.hasOwnProperty("receipts")) { - if (!Array.isArray(message.receipts)) - return "receipts: array expected"; - for (var i = 0; i < message.receipts.length; ++i) { - var error = $root.ibc.core.channel.v1.PacketState.verify(message.receipts[i]); - if (error) - return "receipts." + error; - } - } - if (message.send_sequences != null && message.hasOwnProperty("send_sequences")) { - if (!Array.isArray(message.send_sequences)) - return "send_sequences: array expected"; - for (var i = 0; i < message.send_sequences.length; ++i) { - var error = $root.ibc.core.channel.v1.PacketSequence.verify(message.send_sequences[i]); - if (error) - return "send_sequences." + error; - } - } - if (message.recv_sequences != null && message.hasOwnProperty("recv_sequences")) { - if (!Array.isArray(message.recv_sequences)) - return "recv_sequences: array expected"; - for (var i = 0; i < message.recv_sequences.length; ++i) { - var error = $root.ibc.core.channel.v1.PacketSequence.verify(message.recv_sequences[i]); - if (error) - return "recv_sequences." + error; - } - } - if (message.ack_sequences != null && message.hasOwnProperty("ack_sequences")) { - if (!Array.isArray(message.ack_sequences)) - return "ack_sequences: array expected"; - for (var i = 0; i < message.ack_sequences.length; ++i) { - var error = $root.ibc.core.channel.v1.PacketSequence.verify(message.ack_sequences[i]); - if (error) - return "ack_sequences." + error; - } - } - if (message.next_channel_sequence != null && message.hasOwnProperty("next_channel_sequence")) - if (!$util.isInteger(message.next_channel_sequence) && !(message.next_channel_sequence && $util.isInteger(message.next_channel_sequence.low) && $util.isInteger(message.next_channel_sequence.high))) - return "next_channel_sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.GenesisState) - return object; - var message = new $root.ibc.core.channel.v1.GenesisState(); - if (object.channels) { - if (!Array.isArray(object.channels)) - throw TypeError(".ibc.core.channel.v1.GenesisState.channels: array expected"); - message.channels = []; - for (var i = 0; i < object.channels.length; ++i) { - if (typeof object.channels[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.channels: object expected"); - message.channels[i] = $root.ibc.core.channel.v1.IdentifiedChannel.fromObject(object.channels[i]); - } - } - if (object.acknowledgements) { - if (!Array.isArray(object.acknowledgements)) - throw TypeError(".ibc.core.channel.v1.GenesisState.acknowledgements: array expected"); - message.acknowledgements = []; - for (var i = 0; i < object.acknowledgements.length; ++i) { - if (typeof object.acknowledgements[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.acknowledgements: object expected"); - message.acknowledgements[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.acknowledgements[i]); - } - } - if (object.commitments) { - if (!Array.isArray(object.commitments)) - throw TypeError(".ibc.core.channel.v1.GenesisState.commitments: array expected"); - message.commitments = []; - for (var i = 0; i < object.commitments.length; ++i) { - if (typeof object.commitments[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.commitments: object expected"); - message.commitments[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.commitments[i]); - } - } - if (object.receipts) { - if (!Array.isArray(object.receipts)) - throw TypeError(".ibc.core.channel.v1.GenesisState.receipts: array expected"); - message.receipts = []; - for (var i = 0; i < object.receipts.length; ++i) { - if (typeof object.receipts[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.receipts: object expected"); - message.receipts[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.receipts[i]); - } - } - if (object.send_sequences) { - if (!Array.isArray(object.send_sequences)) - throw TypeError(".ibc.core.channel.v1.GenesisState.send_sequences: array expected"); - message.send_sequences = []; - for (var i = 0; i < object.send_sequences.length; ++i) { - if (typeof object.send_sequences[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.send_sequences: object expected"); - message.send_sequences[i] = $root.ibc.core.channel.v1.PacketSequence.fromObject(object.send_sequences[i]); - } - } - if (object.recv_sequences) { - if (!Array.isArray(object.recv_sequences)) - throw TypeError(".ibc.core.channel.v1.GenesisState.recv_sequences: array expected"); - message.recv_sequences = []; - for (var i = 0; i < object.recv_sequences.length; ++i) { - if (typeof object.recv_sequences[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.recv_sequences: object expected"); - message.recv_sequences[i] = $root.ibc.core.channel.v1.PacketSequence.fromObject(object.recv_sequences[i]); - } - } - if (object.ack_sequences) { - if (!Array.isArray(object.ack_sequences)) - throw TypeError(".ibc.core.channel.v1.GenesisState.ack_sequences: array expected"); - message.ack_sequences = []; - for (var i = 0; i < object.ack_sequences.length; ++i) { - if (typeof object.ack_sequences[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.ack_sequences: object expected"); - message.ack_sequences[i] = $root.ibc.core.channel.v1.PacketSequence.fromObject(object.ack_sequences[i]); - } - } - if (object.next_channel_sequence != null) - if ($util.Long) - (message.next_channel_sequence = $util.Long.fromValue(object.next_channel_sequence)).unsigned = true; - else if (typeof object.next_channel_sequence === "string") - message.next_channel_sequence = parseInt(object.next_channel_sequence, 10); - else if (typeof object.next_channel_sequence === "number") - message.next_channel_sequence = object.next_channel_sequence; - else if (typeof object.next_channel_sequence === "object") - message.next_channel_sequence = new $util.LongBits(object.next_channel_sequence.low >>> 0, object.next_channel_sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {ibc.core.channel.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.channels = []; - object.acknowledgements = []; - object.commitments = []; - object.receipts = []; - object.send_sequences = []; - object.recv_sequences = []; - object.ack_sequences = []; - } - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.next_channel_sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_channel_sequence = options.longs === String ? "0" : 0; - if (message.channels && message.channels.length) { - object.channels = []; - for (var j = 0; j < message.channels.length; ++j) - object.channels[j] = $root.ibc.core.channel.v1.IdentifiedChannel.toObject(message.channels[j], options); - } - if (message.acknowledgements && message.acknowledgements.length) { - object.acknowledgements = []; - for (var j = 0; j < message.acknowledgements.length; ++j) - object.acknowledgements[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.acknowledgements[j], options); - } - if (message.commitments && message.commitments.length) { - object.commitments = []; - for (var j = 0; j < message.commitments.length; ++j) - object.commitments[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.commitments[j], options); - } - if (message.receipts && message.receipts.length) { - object.receipts = []; - for (var j = 0; j < message.receipts.length; ++j) - object.receipts[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.receipts[j], options); - } - if (message.send_sequences && message.send_sequences.length) { - object.send_sequences = []; - for (var j = 0; j < message.send_sequences.length; ++j) - object.send_sequences[j] = $root.ibc.core.channel.v1.PacketSequence.toObject(message.send_sequences[j], options); - } - if (message.recv_sequences && message.recv_sequences.length) { - object.recv_sequences = []; - for (var j = 0; j < message.recv_sequences.length; ++j) - object.recv_sequences[j] = $root.ibc.core.channel.v1.PacketSequence.toObject(message.recv_sequences[j], options); - } - if (message.ack_sequences && message.ack_sequences.length) { - object.ack_sequences = []; - for (var j = 0; j < message.ack_sequences.length; ++j) - object.ack_sequences[j] = $root.ibc.core.channel.v1.PacketSequence.toObject(message.ack_sequences[j], options); - } - if (message.next_channel_sequence != null && message.hasOwnProperty("next_channel_sequence")) - if (typeof message.next_channel_sequence === "number") - object.next_channel_sequence = options.longs === String ? String(message.next_channel_sequence) : message.next_channel_sequence; - else - object.next_channel_sequence = options.longs === String ? $util.Long.prototype.toString.call(message.next_channel_sequence) : options.longs === Number ? new $util.LongBits(message.next_channel_sequence.low >>> 0, message.next_channel_sequence.high >>> 0).toNumber(true) : message.next_channel_sequence; - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - v1.PacketSequence = (function() { - - /** - * Properties of a PacketSequence. - * @memberof ibc.core.channel.v1 - * @interface IPacketSequence - * @property {string|null} [port_id] PacketSequence port_id - * @property {string|null} [channel_id] PacketSequence channel_id - * @property {Long|null} [sequence] PacketSequence sequence - */ - - /** - * Constructs a new PacketSequence. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a PacketSequence. - * @implements IPacketSequence - * @constructor - * @param {ibc.core.channel.v1.IPacketSequence=} [properties] Properties to set - */ - function PacketSequence(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketSequence port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.PacketSequence - * @instance - */ - PacketSequence.prototype.port_id = ""; - - /** - * PacketSequence channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.PacketSequence - * @instance - */ - PacketSequence.prototype.channel_id = ""; - - /** - * PacketSequence sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.PacketSequence - * @instance - */ - PacketSequence.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified PacketSequence message. Does not implicitly {@link ibc.core.channel.v1.PacketSequence.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {ibc.core.channel.v1.IPacketSequence} message PacketSequence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketSequence.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified PacketSequence message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketSequence.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {ibc.core.channel.v1.IPacketSequence} message PacketSequence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketSequence.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketSequence message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketSequence.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.PacketSequence(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketSequence message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketSequence.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketSequence message. - * @function verify - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketSequence.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a PacketSequence message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence - */ - PacketSequence.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.PacketSequence) - return object; - var message = new $root.ibc.core.channel.v1.PacketSequence(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PacketSequence message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {ibc.core.channel.v1.PacketSequence} message PacketSequence - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketSequence.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this PacketSequence to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.PacketSequence - * @instance - * @returns {Object.} JSON object - */ - PacketSequence.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketSequence; - })(); - - return v1; - })(); - - return channel; - })(); - - core.client = (function() { - - /** - * Namespace client. - * @memberof ibc.core - * @namespace - */ - var client = {}; - - client.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.client - * @namespace - */ - var v1 = {}; - - v1.IdentifiedClientState = (function() { - - /** - * Properties of an IdentifiedClientState. - * @memberof ibc.core.client.v1 - * @interface IIdentifiedClientState - * @property {string|null} [client_id] IdentifiedClientState client_id - * @property {google.protobuf.IAny|null} [client_state] IdentifiedClientState client_state - */ - - /** - * Constructs a new IdentifiedClientState. - * @memberof ibc.core.client.v1 - * @classdesc Represents an IdentifiedClientState. - * @implements IIdentifiedClientState - * @constructor - * @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set - */ - function IdentifiedClientState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedClientState client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.IdentifiedClientState - * @instance - */ - IdentifiedClientState.prototype.client_id = ""; - - /** - * IdentifiedClientState client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.client.v1.IdentifiedClientState - * @instance - */ - IdentifiedClientState.prototype.client_state = null; - - /** - * Encodes the specified IdentifiedClientState message. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentifiedClientState message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedClientState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedClientState message. - * @function verify - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - var error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - return null; - }; - - /** - * Creates an IdentifiedClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState - */ - IdentifiedClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.IdentifiedClientState) - return object; - var message = new $root.ibc.core.client.v1.IdentifiedClientState(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.client.v1.IdentifiedClientState.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - return message; - }; - - /** - * Creates a plain object from an IdentifiedClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {ibc.core.client.v1.IdentifiedClientState} message IdentifiedClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.client_state = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - return object; - }; - - /** - * Converts this IdentifiedClientState to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.IdentifiedClientState - * @instance - * @returns {Object.} JSON object - */ - IdentifiedClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedClientState; - })(); - - v1.ConsensusStateWithHeight = (function() { - - /** - * Properties of a ConsensusStateWithHeight. - * @memberof ibc.core.client.v1 - * @interface IConsensusStateWithHeight - * @property {ibc.core.client.v1.IHeight|null} [height] ConsensusStateWithHeight height - * @property {google.protobuf.IAny|null} [consensus_state] ConsensusStateWithHeight consensus_state - */ - - /** - * Constructs a new ConsensusStateWithHeight. - * @memberof ibc.core.client.v1 - * @classdesc Represents a ConsensusStateWithHeight. - * @implements IConsensusStateWithHeight - * @constructor - * @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set - */ - function ConsensusStateWithHeight(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusStateWithHeight height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @instance - */ - ConsensusStateWithHeight.prototype.height = null; - - /** - * ConsensusStateWithHeight consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @instance - */ - ConsensusStateWithHeight.prototype.consensus_state = null; - - /** - * Encodes the specified ConsensusStateWithHeight message. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateWithHeight.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConsensusStateWithHeight message, length delimited. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateWithHeight.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateWithHeight.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateWithHeight.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusStateWithHeight message. - * @function verify - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusStateWithHeight.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - return null; - }; - - /** - * Creates a ConsensusStateWithHeight message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight - */ - ConsensusStateWithHeight.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.ConsensusStateWithHeight) - return object; - var message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - return message; - }; - - /** - * Creates a plain object from a ConsensusStateWithHeight message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {ibc.core.client.v1.ConsensusStateWithHeight} message ConsensusStateWithHeight - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusStateWithHeight.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.height = null; - object.consensus_state = null; - } - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - return object; - }; - - /** - * Converts this ConsensusStateWithHeight to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @instance - * @returns {Object.} JSON object - */ - ConsensusStateWithHeight.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusStateWithHeight; - })(); - - v1.ClientConsensusStates = (function() { - - /** - * Properties of a ClientConsensusStates. - * @memberof ibc.core.client.v1 - * @interface IClientConsensusStates - * @property {string|null} [client_id] ClientConsensusStates client_id - * @property {Array.|null} [consensus_states] ClientConsensusStates consensus_states - */ - - /** - * Constructs a new ClientConsensusStates. - * @memberof ibc.core.client.v1 - * @classdesc Represents a ClientConsensusStates. - * @implements IClientConsensusStates - * @constructor - * @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set - */ - function ClientConsensusStates(properties) { - this.consensus_states = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientConsensusStates client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.ClientConsensusStates - * @instance - */ - ClientConsensusStates.prototype.client_id = ""; - - /** - * ClientConsensusStates consensus_states. - * @member {Array.} consensus_states - * @memberof ibc.core.client.v1.ClientConsensusStates - * @instance - */ - ClientConsensusStates.prototype.consensus_states = $util.emptyArray; - - /** - * Encodes the specified ClientConsensusStates message. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConsensusStates.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.consensus_states != null && message.consensus_states.length) - for (var i = 0; i < message.consensus_states.length; ++i) - $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensus_states[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientConsensusStates message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConsensusStates.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConsensusStates.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientConsensusStates(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - if (!(message.consensus_states && message.consensus_states.length)) - message.consensus_states = []; - message.consensus_states.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConsensusStates.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientConsensusStates message. - * @function verify - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientConsensusStates.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.consensus_states != null && message.hasOwnProperty("consensus_states")) { - if (!Array.isArray(message.consensus_states)) - return "consensus_states: array expected"; - for (var i = 0; i < message.consensus_states.length; ++i) { - var error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensus_states[i]); - if (error) - return "consensus_states." + error; - } - } - return null; - }; - - /** - * Creates a ClientConsensusStates message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates - */ - ClientConsensusStates.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.ClientConsensusStates) - return object; - var message = new $root.ibc.core.client.v1.ClientConsensusStates(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.consensus_states) { - if (!Array.isArray(object.consensus_states)) - throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensus_states: array expected"); - message.consensus_states = []; - for (var i = 0; i < object.consensus_states.length; ++i) { - if (typeof object.consensus_states[i] !== "object") - throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensus_states: object expected"); - message.consensus_states[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensus_states[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ClientConsensusStates message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {ibc.core.client.v1.ClientConsensusStates} message ClientConsensusStates - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientConsensusStates.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.consensus_states = []; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.consensus_states && message.consensus_states.length) { - object.consensus_states = []; - for (var j = 0; j < message.consensus_states.length; ++j) - object.consensus_states[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensus_states[j], options); - } - return object; - }; - - /** - * Converts this ClientConsensusStates to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.ClientConsensusStates - * @instance - * @returns {Object.} JSON object - */ - ClientConsensusStates.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientConsensusStates; - })(); - - v1.ClientUpdateProposal = (function() { - - /** - * Properties of a ClientUpdateProposal. - * @memberof ibc.core.client.v1 - * @interface IClientUpdateProposal - * @property {string|null} [title] ClientUpdateProposal title - * @property {string|null} [description] ClientUpdateProposal description - * @property {string|null} [subject_client_id] ClientUpdateProposal subject_client_id - * @property {string|null} [substitute_client_id] ClientUpdateProposal substitute_client_id - */ - - /** - * Constructs a new ClientUpdateProposal. - * @memberof ibc.core.client.v1 - * @classdesc Represents a ClientUpdateProposal. - * @implements IClientUpdateProposal - * @constructor - * @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set - */ - function ClientUpdateProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientUpdateProposal title. - * @member {string} title - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.title = ""; - - /** - * ClientUpdateProposal description. - * @member {string} description - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.description = ""; - - /** - * ClientUpdateProposal subject_client_id. - * @member {string} subject_client_id - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.subject_client_id = ""; - - /** - * ClientUpdateProposal substitute_client_id. - * @member {string} substitute_client_id - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.substitute_client_id = ""; - - /** - * Encodes the specified ClientUpdateProposal message. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientUpdateProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.subject_client_id != null && Object.hasOwnProperty.call(message, "subject_client_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.subject_client_id); - if (message.substitute_client_id != null && Object.hasOwnProperty.call(message, "substitute_client_id")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.substitute_client_id); - return writer; - }; - - /** - * Encodes the specified ClientUpdateProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientUpdateProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientUpdateProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientUpdateProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.subject_client_id = reader.string(); - break; - case 4: - message.substitute_client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientUpdateProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientUpdateProposal message. - * @function verify - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientUpdateProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.subject_client_id != null && message.hasOwnProperty("subject_client_id")) - if (!$util.isString(message.subject_client_id)) - return "subject_client_id: string expected"; - if (message.substitute_client_id != null && message.hasOwnProperty("substitute_client_id")) - if (!$util.isString(message.substitute_client_id)) - return "substitute_client_id: string expected"; - return null; - }; - - /** - * Creates a ClientUpdateProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal - */ - ClientUpdateProposal.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.ClientUpdateProposal) - return object; - var message = new $root.ibc.core.client.v1.ClientUpdateProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.subject_client_id != null) - message.subject_client_id = String(object.subject_client_id); - if (object.substitute_client_id != null) - message.substitute_client_id = String(object.substitute_client_id); - return message; - }; - - /** - * Creates a plain object from a ClientUpdateProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {ibc.core.client.v1.ClientUpdateProposal} message ClientUpdateProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientUpdateProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.subject_client_id = ""; - object.substitute_client_id = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.subject_client_id != null && message.hasOwnProperty("subject_client_id")) - object.subject_client_id = message.subject_client_id; - if (message.substitute_client_id != null && message.hasOwnProperty("substitute_client_id")) - object.substitute_client_id = message.substitute_client_id; - return object; - }; - - /** - * Converts this ClientUpdateProposal to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - * @returns {Object.} JSON object - */ - ClientUpdateProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientUpdateProposal; - })(); - - v1.UpgradeProposal = (function() { - - /** - * Properties of an UpgradeProposal. - * @memberof ibc.core.client.v1 - * @interface IUpgradeProposal - * @property {string|null} [title] UpgradeProposal title - * @property {string|null} [description] UpgradeProposal description - * @property {cosmos.upgrade.v1beta1.IPlan|null} [plan] UpgradeProposal plan - * @property {google.protobuf.IAny|null} [upgraded_client_state] UpgradeProposal upgraded_client_state - */ - - /** - * Constructs a new UpgradeProposal. - * @memberof ibc.core.client.v1 - * @classdesc Represents an UpgradeProposal. - * @implements IUpgradeProposal - * @constructor - * @param {ibc.core.client.v1.IUpgradeProposal=} [properties] Properties to set - */ - function UpgradeProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeProposal title. - * @member {string} title - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.title = ""; - - /** - * UpgradeProposal description. - * @member {string} description - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.description = ""; - - /** - * UpgradeProposal plan. - * @member {cosmos.upgrade.v1beta1.IPlan|null|undefined} plan - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.plan = null; - - /** - * UpgradeProposal upgraded_client_state. - * @member {google.protobuf.IAny|null|undefined} upgraded_client_state - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.upgraded_client_state = null; - - /** - * Encodes the specified UpgradeProposal message. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {ibc.core.client.v1.IUpgradeProposal} message UpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) - $root.cosmos.upgrade.v1beta1.Plan.encode(message.plan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.upgraded_client_state != null && Object.hasOwnProperty.call(message, "upgraded_client_state")) - $root.google.protobuf.Any.encode(message.upgraded_client_state, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpgradeProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {ibc.core.client.v1.IUpgradeProposal} message UpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.UpgradeProposal} UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.UpgradeProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = $root.cosmos.upgrade.v1beta1.Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgraded_client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.UpgradeProposal} UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeProposal message. - * @function verify - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.plan != null && message.hasOwnProperty("plan")) { - var error = $root.cosmos.upgrade.v1beta1.Plan.verify(message.plan); - if (error) - return "plan." + error; - } - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) { - var error = $root.google.protobuf.Any.verify(message.upgraded_client_state); - if (error) - return "upgraded_client_state." + error; - } - return null; - }; - - /** - * Creates an UpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.UpgradeProposal} UpgradeProposal - */ - UpgradeProposal.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.UpgradeProposal) - return object; - var message = new $root.ibc.core.client.v1.UpgradeProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.plan != null) { - if (typeof object.plan !== "object") - throw TypeError(".ibc.core.client.v1.UpgradeProposal.plan: object expected"); - message.plan = $root.cosmos.upgrade.v1beta1.Plan.fromObject(object.plan); - } - if (object.upgraded_client_state != null) { - if (typeof object.upgraded_client_state !== "object") - throw TypeError(".ibc.core.client.v1.UpgradeProposal.upgraded_client_state: object expected"); - message.upgraded_client_state = $root.google.protobuf.Any.fromObject(object.upgraded_client_state); - } - return message; - }; - - /** - * Creates a plain object from an UpgradeProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {ibc.core.client.v1.UpgradeProposal} message UpgradeProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.plan = null; - object.upgraded_client_state = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.plan != null && message.hasOwnProperty("plan")) - object.plan = $root.cosmos.upgrade.v1beta1.Plan.toObject(message.plan, options); - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) - object.upgraded_client_state = $root.google.protobuf.Any.toObject(message.upgraded_client_state, options); - return object; - }; - - /** - * Converts this UpgradeProposal to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - * @returns {Object.} JSON object - */ - UpgradeProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpgradeProposal; - })(); - - v1.Height = (function() { - - /** - * Properties of an Height. - * @memberof ibc.core.client.v1 - * @interface IHeight - * @property {Long|null} [revision_number] Height revision_number - * @property {Long|null} [revision_height] Height revision_height - */ - - /** - * Constructs a new Height. - * @memberof ibc.core.client.v1 - * @classdesc Represents an Height. - * @implements IHeight - * @constructor - * @param {ibc.core.client.v1.IHeight=} [properties] Properties to set - */ - function Height(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Height revision_number. - * @member {Long} revision_number - * @memberof ibc.core.client.v1.Height - * @instance - */ - Height.prototype.revision_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Height revision_height. - * @member {Long} revision_height - * @memberof ibc.core.client.v1.Height - * @instance - */ - Height.prototype.revision_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Height message. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.Height - * @static - * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Height.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision_number != null && Object.hasOwnProperty.call(message, "revision_number")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.revision_number); - if (message.revision_height != null && Object.hasOwnProperty.call(message, "revision_height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision_height); - return writer; - }; - - /** - * Encodes the specified Height message, length delimited. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.Height - * @static - * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Height.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Height message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.Height - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.Height} Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Height.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Height(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revision_number = reader.uint64(); - break; - case 2: - message.revision_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Height message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.Height - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.Height} Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Height.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Height message. - * @function verify - * @memberof ibc.core.client.v1.Height - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Height.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (!$util.isInteger(message.revision_number) && !(message.revision_number && $util.isInteger(message.revision_number.low) && $util.isInteger(message.revision_number.high))) - return "revision_number: integer|Long expected"; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (!$util.isInteger(message.revision_height) && !(message.revision_height && $util.isInteger(message.revision_height.low) && $util.isInteger(message.revision_height.high))) - return "revision_height: integer|Long expected"; - return null; - }; - - /** - * Creates an Height message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.Height - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.Height} Height - */ - Height.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.Height) - return object; - var message = new $root.ibc.core.client.v1.Height(); - if (object.revision_number != null) - if ($util.Long) - (message.revision_number = $util.Long.fromValue(object.revision_number)).unsigned = true; - else if (typeof object.revision_number === "string") - message.revision_number = parseInt(object.revision_number, 10); - else if (typeof object.revision_number === "number") - message.revision_number = object.revision_number; - else if (typeof object.revision_number === "object") - message.revision_number = new $util.LongBits(object.revision_number.low >>> 0, object.revision_number.high >>> 0).toNumber(true); - if (object.revision_height != null) - if ($util.Long) - (message.revision_height = $util.Long.fromValue(object.revision_height)).unsigned = true; - else if (typeof object.revision_height === "string") - message.revision_height = parseInt(object.revision_height, 10); - else if (typeof object.revision_height === "number") - message.revision_height = object.revision_height; - else if (typeof object.revision_height === "object") - message.revision_height = new $util.LongBits(object.revision_height.low >>> 0, object.revision_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an Height message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.Height - * @static - * @param {ibc.core.client.v1.Height} message Height - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Height.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_number = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_height = options.longs === String ? "0" : 0; - } - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (typeof message.revision_number === "number") - object.revision_number = options.longs === String ? String(message.revision_number) : message.revision_number; - else - object.revision_number = options.longs === String ? $util.Long.prototype.toString.call(message.revision_number) : options.longs === Number ? new $util.LongBits(message.revision_number.low >>> 0, message.revision_number.high >>> 0).toNumber(true) : message.revision_number; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (typeof message.revision_height === "number") - object.revision_height = options.longs === String ? String(message.revision_height) : message.revision_height; - else - object.revision_height = options.longs === String ? $util.Long.prototype.toString.call(message.revision_height) : options.longs === Number ? new $util.LongBits(message.revision_height.low >>> 0, message.revision_height.high >>> 0).toNumber(true) : message.revision_height; - return object; - }; - - /** - * Converts this Height to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.Height - * @instance - * @returns {Object.} JSON object - */ - Height.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Height; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.core.client.v1 - * @interface IParams - * @property {Array.|null} [allowed_clients] Params allowed_clients - */ - - /** - * Constructs a new Params. - * @memberof ibc.core.client.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.core.client.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - this.allowed_clients = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params allowed_clients. - * @member {Array.} allowed_clients - * @memberof ibc.core.client.v1.Params - * @instance - */ - Params.prototype.allowed_clients = $util.emptyArray; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.Params - * @static - * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowed_clients != null && message.allowed_clients.length) - for (var i = 0; i < message.allowed_clients.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowed_clients[i]); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.Params - * @static - * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.allowed_clients && message.allowed_clients.length)) - message.allowed_clients = []; - message.allowed_clients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.core.client.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowed_clients != null && message.hasOwnProperty("allowed_clients")) { - if (!Array.isArray(message.allowed_clients)) - return "allowed_clients: array expected"; - for (var i = 0; i < message.allowed_clients.length; ++i) - if (!$util.isString(message.allowed_clients[i])) - return "allowed_clients: string[] expected"; - } - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.Params) - return object; - var message = new $root.ibc.core.client.v1.Params(); - if (object.allowed_clients) { - if (!Array.isArray(object.allowed_clients)) - throw TypeError(".ibc.core.client.v1.Params.allowed_clients: array expected"); - message.allowed_clients = []; - for (var i = 0; i < object.allowed_clients.length; ++i) - message.allowed_clients[i] = String(object.allowed_clients[i]); - } - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.Params - * @static - * @param {ibc.core.client.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowed_clients = []; - if (message.allowed_clients && message.allowed_clients.length) { - object.allowed_clients = []; - for (var j = 0; j < message.allowed_clients.length; ++j) - object.allowed_clients[j] = message.allowed_clients[j]; - } - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.core.client.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#createClient}. - * @memberof ibc.core.client.v1.Msg - * @typedef CreateClientCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.MsgCreateClientResponse} [response] MsgCreateClientResponse - */ - - /** - * Calls CreateClient. - * @function createClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object - * @param {ibc.core.client.v1.Msg.CreateClientCallback} callback Node-style callback called with the error, if any, and MsgCreateClientResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.createClient = function createClient(request, callback) { - return this.rpcCall(createClient, $root.ibc.core.client.v1.MsgCreateClient, $root.ibc.core.client.v1.MsgCreateClientResponse, request, callback); - }, "name", { value: "CreateClient" }); - - /** - * Calls CreateClient. - * @function createClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#updateClient}. - * @memberof ibc.core.client.v1.Msg - * @typedef UpdateClientCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.MsgUpdateClientResponse} [response] MsgUpdateClientResponse - */ - - /** - * Calls UpdateClient. - * @function updateClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object - * @param {ibc.core.client.v1.Msg.UpdateClientCallback} callback Node-style callback called with the error, if any, and MsgUpdateClientResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.updateClient = function updateClient(request, callback) { - return this.rpcCall(updateClient, $root.ibc.core.client.v1.MsgUpdateClient, $root.ibc.core.client.v1.MsgUpdateClientResponse, request, callback); - }, "name", { value: "UpdateClient" }); - - /** - * Calls UpdateClient. - * @function updateClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#upgradeClient}. - * @memberof ibc.core.client.v1.Msg - * @typedef UpgradeClientCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.MsgUpgradeClientResponse} [response] MsgUpgradeClientResponse - */ - - /** - * Calls UpgradeClient. - * @function upgradeClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object - * @param {ibc.core.client.v1.Msg.UpgradeClientCallback} callback Node-style callback called with the error, if any, and MsgUpgradeClientResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.upgradeClient = function upgradeClient(request, callback) { - return this.rpcCall(upgradeClient, $root.ibc.core.client.v1.MsgUpgradeClient, $root.ibc.core.client.v1.MsgUpgradeClientResponse, request, callback); - }, "name", { value: "UpgradeClient" }); - - /** - * Calls UpgradeClient. - * @function upgradeClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#submitMisbehaviour}. - * @memberof ibc.core.client.v1.Msg - * @typedef SubmitMisbehaviourCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} [response] MsgSubmitMisbehaviourResponse - */ - - /** - * Calls SubmitMisbehaviour. - * @function submitMisbehaviour - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object - * @param {ibc.core.client.v1.Msg.SubmitMisbehaviourCallback} callback Node-style callback called with the error, if any, and MsgSubmitMisbehaviourResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.submitMisbehaviour = function submitMisbehaviour(request, callback) { - return this.rpcCall(submitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse, request, callback); - }, "name", { value: "SubmitMisbehaviour" }); - - /** - * Calls SubmitMisbehaviour. - * @function submitMisbehaviour - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1.MsgCreateClient = (function() { - - /** - * Properties of a MsgCreateClient. - * @memberof ibc.core.client.v1 - * @interface IMsgCreateClient - * @property {google.protobuf.IAny|null} [client_state] MsgCreateClient client_state - * @property {google.protobuf.IAny|null} [consensus_state] MsgCreateClient consensus_state - * @property {string|null} [signer] MsgCreateClient signer - */ - - /** - * Constructs a new MsgCreateClient. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgCreateClient. - * @implements IMsgCreateClient - * @constructor - * @param {ibc.core.client.v1.IMsgCreateClient=} [properties] Properties to set - */ - function MsgCreateClient(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgCreateClient client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.client.v1.MsgCreateClient - * @instance - */ - MsgCreateClient.prototype.client_state = null; - - /** - * MsgCreateClient consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.client.v1.MsgCreateClient - * @instance - */ - MsgCreateClient.prototype.consensus_state = null; - - /** - * MsgCreateClient signer. - * @member {string} signer - * @memberof ibc.core.client.v1.MsgCreateClient - * @instance - */ - MsgCreateClient.prototype.signer = ""; - - /** - * Encodes the specified MsgCreateClient message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateClient.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgCreateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateClient.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgCreateClient message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateClient.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClient(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgCreateClient message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateClient.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgCreateClient message. - * @function verify - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgCreateClient.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - var error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgCreateClient message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient - */ - MsgCreateClient.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgCreateClient) - return object; - var message = new $root.ibc.core.client.v1.MsgCreateClient(); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.client.v1.MsgCreateClient.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.MsgCreateClient.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgCreateClient message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {ibc.core.client.v1.MsgCreateClient} message MsgCreateClient - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgCreateClient.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_state = null; - object.consensus_state = null; - object.signer = ""; - } - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgCreateClient to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgCreateClient - * @instance - * @returns {Object.} JSON object - */ - MsgCreateClient.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgCreateClient; - })(); - - v1.MsgCreateClientResponse = (function() { - - /** - * Properties of a MsgCreateClientResponse. - * @memberof ibc.core.client.v1 - * @interface IMsgCreateClientResponse - */ - - /** - * Constructs a new MsgCreateClientResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgCreateClientResponse. - * @implements IMsgCreateClientResponse - * @constructor - * @param {ibc.core.client.v1.IMsgCreateClientResponse=} [properties] Properties to set - */ - function MsgCreateClientResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgCreateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateClientResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgCreateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgCreateClientResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateClientResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClientResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgCreateClientResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateClientResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgCreateClientResponse message. - * @function verify - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgCreateClientResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgCreateClientResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse - */ - MsgCreateClientResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgCreateClientResponse) - return object; - return new $root.ibc.core.client.v1.MsgCreateClientResponse(); - }; - - /** - * Creates a plain object from a MsgCreateClientResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {ibc.core.client.v1.MsgCreateClientResponse} message MsgCreateClientResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgCreateClientResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgCreateClientResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @instance - * @returns {Object.} JSON object - */ - MsgCreateClientResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgCreateClientResponse; - })(); - - v1.MsgUpdateClient = (function() { - - /** - * Properties of a MsgUpdateClient. - * @memberof ibc.core.client.v1 - * @interface IMsgUpdateClient - * @property {string|null} [client_id] MsgUpdateClient client_id - * @property {google.protobuf.IAny|null} [header] MsgUpdateClient header - * @property {string|null} [signer] MsgUpdateClient signer - */ - - /** - * Constructs a new MsgUpdateClient. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgUpdateClient. - * @implements IMsgUpdateClient - * @constructor - * @param {ibc.core.client.v1.IMsgUpdateClient=} [properties] Properties to set - */ - function MsgUpdateClient(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgUpdateClient client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.MsgUpdateClient - * @instance - */ - MsgUpdateClient.prototype.client_id = ""; - - /** - * MsgUpdateClient header. - * @member {google.protobuf.IAny|null|undefined} header - * @memberof ibc.core.client.v1.MsgUpdateClient - * @instance - */ - MsgUpdateClient.prototype.header = null; - - /** - * MsgUpdateClient signer. - * @member {string} signer - * @memberof ibc.core.client.v1.MsgUpdateClient - * @instance - */ - MsgUpdateClient.prototype.signer = ""; - - /** - * Encodes the specified MsgUpdateClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateClient.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgUpdateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateClient.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpdateClient message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateClient.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClient(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.header = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpdateClient message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateClient.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpdateClient message. - * @function verify - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpdateClient.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.header != null && message.hasOwnProperty("header")) { - var error = $root.google.protobuf.Any.verify(message.header); - if (error) - return "header." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgUpdateClient message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient - */ - MsgUpdateClient.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgUpdateClient) - return object; - var message = new $root.ibc.core.client.v1.MsgUpdateClient(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".ibc.core.client.v1.MsgUpdateClient.header: object expected"); - message.header = $root.google.protobuf.Any.fromObject(object.header); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgUpdateClient message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {ibc.core.client.v1.MsgUpdateClient} message MsgUpdateClient - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpdateClient.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.header = null; - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.google.protobuf.Any.toObject(message.header, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgUpdateClient to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgUpdateClient - * @instance - * @returns {Object.} JSON object - */ - MsgUpdateClient.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpdateClient; - })(); - - v1.MsgUpdateClientResponse = (function() { - - /** - * Properties of a MsgUpdateClientResponse. - * @memberof ibc.core.client.v1 - * @interface IMsgUpdateClientResponse - */ - - /** - * Constructs a new MsgUpdateClientResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgUpdateClientResponse. - * @implements IMsgUpdateClientResponse - * @constructor - * @param {ibc.core.client.v1.IMsgUpdateClientResponse=} [properties] Properties to set - */ - function MsgUpdateClientResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgUpdateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateClientResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgUpdateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpdateClientResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateClientResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClientResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpdateClientResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateClientResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpdateClientResponse message. - * @function verify - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpdateClientResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgUpdateClientResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse - */ - MsgUpdateClientResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgUpdateClientResponse) - return object; - return new $root.ibc.core.client.v1.MsgUpdateClientResponse(); - }; - - /** - * Creates a plain object from a MsgUpdateClientResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {ibc.core.client.v1.MsgUpdateClientResponse} message MsgUpdateClientResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpdateClientResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgUpdateClientResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @instance - * @returns {Object.} JSON object - */ - MsgUpdateClientResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpdateClientResponse; - })(); - - v1.MsgUpgradeClient = (function() { - - /** - * Properties of a MsgUpgradeClient. - * @memberof ibc.core.client.v1 - * @interface IMsgUpgradeClient - * @property {string|null} [client_id] MsgUpgradeClient client_id - * @property {google.protobuf.IAny|null} [client_state] MsgUpgradeClient client_state - * @property {google.protobuf.IAny|null} [consensus_state] MsgUpgradeClient consensus_state - * @property {Uint8Array|null} [proof_upgrade_client] MsgUpgradeClient proof_upgrade_client - * @property {Uint8Array|null} [proof_upgrade_consensus_state] MsgUpgradeClient proof_upgrade_consensus_state - * @property {string|null} [signer] MsgUpgradeClient signer - */ - - /** - * Constructs a new MsgUpgradeClient. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgUpgradeClient. - * @implements IMsgUpgradeClient - * @constructor - * @param {ibc.core.client.v1.IMsgUpgradeClient=} [properties] Properties to set - */ - function MsgUpgradeClient(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgUpgradeClient client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.client_id = ""; - - /** - * MsgUpgradeClient client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.client_state = null; - - /** - * MsgUpgradeClient consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.consensus_state = null; - - /** - * MsgUpgradeClient proof_upgrade_client. - * @member {Uint8Array} proof_upgrade_client - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.proof_upgrade_client = $util.newBuffer([]); - - /** - * MsgUpgradeClient proof_upgrade_consensus_state. - * @member {Uint8Array} proof_upgrade_consensus_state - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.proof_upgrade_consensus_state = $util.newBuffer([]); - - /** - * MsgUpgradeClient signer. - * @member {string} signer - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.signer = ""; - - /** - * Encodes the specified MsgUpgradeClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpgradeClient.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.proof_upgrade_client != null && Object.hasOwnProperty.call(message, "proof_upgrade_client")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.proof_upgrade_client); - if (message.proof_upgrade_consensus_state != null && Object.hasOwnProperty.call(message, "proof_upgrade_consensus_state")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proof_upgrade_consensus_state); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgUpgradeClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpgradeClient.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpgradeClient message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpgradeClient.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClient(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 4: - message.proof_upgrade_client = reader.bytes(); - break; - case 5: - message.proof_upgrade_consensus_state = reader.bytes(); - break; - case 6: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpgradeClient message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpgradeClient.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpgradeClient message. - * @function verify - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpgradeClient.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - var error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.proof_upgrade_client != null && message.hasOwnProperty("proof_upgrade_client")) - if (!(message.proof_upgrade_client && typeof message.proof_upgrade_client.length === "number" || $util.isString(message.proof_upgrade_client))) - return "proof_upgrade_client: buffer expected"; - if (message.proof_upgrade_consensus_state != null && message.hasOwnProperty("proof_upgrade_consensus_state")) - if (!(message.proof_upgrade_consensus_state && typeof message.proof_upgrade_consensus_state.length === "number" || $util.isString(message.proof_upgrade_consensus_state))) - return "proof_upgrade_consensus_state: buffer expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgUpgradeClient message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient - */ - MsgUpgradeClient.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClient) - return object; - var message = new $root.ibc.core.client.v1.MsgUpgradeClient(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.proof_upgrade_client != null) - if (typeof object.proof_upgrade_client === "string") - $util.base64.decode(object.proof_upgrade_client, message.proof_upgrade_client = $util.newBuffer($util.base64.length(object.proof_upgrade_client)), 0); - else if (object.proof_upgrade_client.length) - message.proof_upgrade_client = object.proof_upgrade_client; - if (object.proof_upgrade_consensus_state != null) - if (typeof object.proof_upgrade_consensus_state === "string") - $util.base64.decode(object.proof_upgrade_consensus_state, message.proof_upgrade_consensus_state = $util.newBuffer($util.base64.length(object.proof_upgrade_consensus_state)), 0); - else if (object.proof_upgrade_consensus_state.length) - message.proof_upgrade_consensus_state = object.proof_upgrade_consensus_state; - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgUpgradeClient message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {ibc.core.client.v1.MsgUpgradeClient} message MsgUpgradeClient - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpgradeClient.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.client_state = null; - object.consensus_state = null; - if (options.bytes === String) - object.proof_upgrade_client = ""; - else { - object.proof_upgrade_client = []; - if (options.bytes !== Array) - object.proof_upgrade_client = $util.newBuffer(object.proof_upgrade_client); - } - if (options.bytes === String) - object.proof_upgrade_consensus_state = ""; - else { - object.proof_upgrade_consensus_state = []; - if (options.bytes !== Array) - object.proof_upgrade_consensus_state = $util.newBuffer(object.proof_upgrade_consensus_state); - } - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.proof_upgrade_client != null && message.hasOwnProperty("proof_upgrade_client")) - object.proof_upgrade_client = options.bytes === String ? $util.base64.encode(message.proof_upgrade_client, 0, message.proof_upgrade_client.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_upgrade_client) : message.proof_upgrade_client; - if (message.proof_upgrade_consensus_state != null && message.hasOwnProperty("proof_upgrade_consensus_state")) - object.proof_upgrade_consensus_state = options.bytes === String ? $util.base64.encode(message.proof_upgrade_consensus_state, 0, message.proof_upgrade_consensus_state.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_upgrade_consensus_state) : message.proof_upgrade_consensus_state; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgUpgradeClient to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - * @returns {Object.} JSON object - */ - MsgUpgradeClient.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpgradeClient; - })(); - - v1.MsgUpgradeClientResponse = (function() { - - /** - * Properties of a MsgUpgradeClientResponse. - * @memberof ibc.core.client.v1 - * @interface IMsgUpgradeClientResponse - */ - - /** - * Constructs a new MsgUpgradeClientResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgUpgradeClientResponse. - * @implements IMsgUpgradeClientResponse - * @constructor - * @param {ibc.core.client.v1.IMsgUpgradeClientResponse=} [properties] Properties to set - */ - function MsgUpgradeClientResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgUpgradeClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpgradeClientResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgUpgradeClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpgradeClientResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpgradeClientResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpgradeClientResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpgradeClientResponse message. - * @function verify - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpgradeClientResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgUpgradeClientResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse - */ - MsgUpgradeClientResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClientResponse) - return object; - return new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); - }; - - /** - * Creates a plain object from a MsgUpgradeClientResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {ibc.core.client.v1.MsgUpgradeClientResponse} message MsgUpgradeClientResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpgradeClientResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgUpgradeClientResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @instance - * @returns {Object.} JSON object - */ - MsgUpgradeClientResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpgradeClientResponse; - })(); - - v1.MsgSubmitMisbehaviour = (function() { - - /** - * Properties of a MsgSubmitMisbehaviour. - * @memberof ibc.core.client.v1 - * @interface IMsgSubmitMisbehaviour - * @property {string|null} [client_id] MsgSubmitMisbehaviour client_id - * @property {google.protobuf.IAny|null} [misbehaviour] MsgSubmitMisbehaviour misbehaviour - * @property {string|null} [signer] MsgSubmitMisbehaviour signer - */ - - /** - * Constructs a new MsgSubmitMisbehaviour. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgSubmitMisbehaviour. - * @implements IMsgSubmitMisbehaviour - * @constructor - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour=} [properties] Properties to set - */ - function MsgSubmitMisbehaviour(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitMisbehaviour client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @instance - */ - MsgSubmitMisbehaviour.prototype.client_id = ""; - - /** - * MsgSubmitMisbehaviour misbehaviour. - * @member {google.protobuf.IAny|null|undefined} misbehaviour - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @instance - */ - MsgSubmitMisbehaviour.prototype.misbehaviour = null; - - /** - * MsgSubmitMisbehaviour signer. - * @member {string} signer - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @instance - */ - MsgSubmitMisbehaviour.prototype.signer = ""; - - /** - * Encodes the specified MsgSubmitMisbehaviour message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitMisbehaviour.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.misbehaviour != null && Object.hasOwnProperty.call(message, "misbehaviour")) - $root.google.protobuf.Any.encode(message.misbehaviour, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgSubmitMisbehaviour message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitMisbehaviour.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitMisbehaviour.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.misbehaviour = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitMisbehaviour.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitMisbehaviour message. - * @function verify - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitMisbehaviour.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) { - var error = $root.google.protobuf.Any.verify(message.misbehaviour); - if (error) - return "misbehaviour." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgSubmitMisbehaviour message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour - */ - MsgSubmitMisbehaviour.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviour) - return object; - var message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.misbehaviour != null) { - if (typeof object.misbehaviour !== "object") - throw TypeError(".ibc.core.client.v1.MsgSubmitMisbehaviour.misbehaviour: object expected"); - message.misbehaviour = $root.google.protobuf.Any.fromObject(object.misbehaviour); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitMisbehaviour message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {ibc.core.client.v1.MsgSubmitMisbehaviour} message MsgSubmitMisbehaviour - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitMisbehaviour.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.misbehaviour = null; - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) - object.misbehaviour = $root.google.protobuf.Any.toObject(message.misbehaviour, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgSubmitMisbehaviour to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitMisbehaviour.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitMisbehaviour; - })(); - - v1.MsgSubmitMisbehaviourResponse = (function() { - - /** - * Properties of a MsgSubmitMisbehaviourResponse. - * @memberof ibc.core.client.v1 - * @interface IMsgSubmitMisbehaviourResponse - */ - - /** - * Constructs a new MsgSubmitMisbehaviourResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgSubmitMisbehaviourResponse. - * @implements IMsgSubmitMisbehaviourResponse - * @constructor - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse=} [properties] Properties to set - */ - function MsgSubmitMisbehaviourResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgSubmitMisbehaviourResponse message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitMisbehaviourResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgSubmitMisbehaviourResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitMisbehaviourResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitMisbehaviourResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitMisbehaviourResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitMisbehaviourResponse message. - * @function verify - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitMisbehaviourResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgSubmitMisbehaviourResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse - */ - MsgSubmitMisbehaviourResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse) - return object; - return new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); - }; - - /** - * Creates a plain object from a MsgSubmitMisbehaviourResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitMisbehaviourResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgSubmitMisbehaviourResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitMisbehaviourResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitMisbehaviourResponse; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.core.client.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientState}. - * @memberof ibc.core.client.v1.Query - * @typedef ClientStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryClientStateResponse} [response] QueryClientStateResponse - */ - - /** - * Calls ClientState. - * @function clientState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object - * @param {ibc.core.client.v1.Query.ClientStateCallback} callback Node-style callback called with the error, if any, and QueryClientStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientState = function clientState(request, callback) { - return this.rpcCall(clientState, $root.ibc.core.client.v1.QueryClientStateRequest, $root.ibc.core.client.v1.QueryClientStateResponse, request, callback); - }, "name", { value: "ClientState" }); - - /** - * Calls ClientState. - * @function clientState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientStates}. - * @memberof ibc.core.client.v1.Query - * @typedef ClientStatesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryClientStatesResponse} [response] QueryClientStatesResponse - */ - - /** - * Calls ClientStates. - * @function clientStates - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object - * @param {ibc.core.client.v1.Query.ClientStatesCallback} callback Node-style callback called with the error, if any, and QueryClientStatesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientStates = function clientStates(request, callback) { - return this.rpcCall(clientStates, $root.ibc.core.client.v1.QueryClientStatesRequest, $root.ibc.core.client.v1.QueryClientStatesResponse, request, callback); - }, "name", { value: "ClientStates" }); - - /** - * Calls ClientStates. - * @function clientStates - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#consensusState}. - * @memberof ibc.core.client.v1.Query - * @typedef ConsensusStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryConsensusStateResponse} [response] QueryConsensusStateResponse - */ - - /** - * Calls ConsensusState. - * @function consensusState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object - * @param {ibc.core.client.v1.Query.ConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryConsensusStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.consensusState = function consensusState(request, callback) { - return this.rpcCall(consensusState, $root.ibc.core.client.v1.QueryConsensusStateRequest, $root.ibc.core.client.v1.QueryConsensusStateResponse, request, callback); - }, "name", { value: "ConsensusState" }); - - /** - * Calls ConsensusState. - * @function consensusState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#consensusStates}. - * @memberof ibc.core.client.v1.Query - * @typedef ConsensusStatesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryConsensusStatesResponse} [response] QueryConsensusStatesResponse - */ - - /** - * Calls ConsensusStates. - * @function consensusStates - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object - * @param {ibc.core.client.v1.Query.ConsensusStatesCallback} callback Node-style callback called with the error, if any, and QueryConsensusStatesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.consensusStates = function consensusStates(request, callback) { - return this.rpcCall(consensusStates, $root.ibc.core.client.v1.QueryConsensusStatesRequest, $root.ibc.core.client.v1.QueryConsensusStatesResponse, request, callback); - }, "name", { value: "ConsensusStates" }); - - /** - * Calls ConsensusStates. - * @function consensusStates - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#consensusStateHeights}. - * @memberof ibc.core.client.v1.Query - * @typedef ConsensusStateHeightsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryConsensusStateHeightsResponse} [response] QueryConsensusStateHeightsResponse - */ - - /** - * Calls ConsensusStateHeights. - * @function consensusStateHeights - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest} request QueryConsensusStateHeightsRequest message or plain object - * @param {ibc.core.client.v1.Query.ConsensusStateHeightsCallback} callback Node-style callback called with the error, if any, and QueryConsensusStateHeightsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.consensusStateHeights = function consensusStateHeights(request, callback) { - return this.rpcCall(consensusStateHeights, $root.ibc.core.client.v1.QueryConsensusStateHeightsRequest, $root.ibc.core.client.v1.QueryConsensusStateHeightsResponse, request, callback); - }, "name", { value: "ConsensusStateHeights" }); - - /** - * Calls ConsensusStateHeights. - * @function consensusStateHeights - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest} request QueryConsensusStateHeightsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientStatus}. - * @memberof ibc.core.client.v1.Query - * @typedef ClientStatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryClientStatusResponse} [response] QueryClientStatusResponse - */ - - /** - * Calls ClientStatus. - * @function clientStatus - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStatusRequest} request QueryClientStatusRequest message or plain object - * @param {ibc.core.client.v1.Query.ClientStatusCallback} callback Node-style callback called with the error, if any, and QueryClientStatusResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientStatus = function clientStatus(request, callback) { - return this.rpcCall(clientStatus, $root.ibc.core.client.v1.QueryClientStatusRequest, $root.ibc.core.client.v1.QueryClientStatusResponse, request, callback); - }, "name", { value: "ClientStatus" }); - - /** - * Calls ClientStatus. - * @function clientStatus - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStatusRequest} request QueryClientStatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientParams}. - * @memberof ibc.core.client.v1.Query - * @typedef ClientParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryClientParamsResponse} [response] QueryClientParamsResponse - */ - - /** - * Calls ClientParams. - * @function clientParams - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object - * @param {ibc.core.client.v1.Query.ClientParamsCallback} callback Node-style callback called with the error, if any, and QueryClientParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientParams = function clientParams(request, callback) { - return this.rpcCall(clientParams, $root.ibc.core.client.v1.QueryClientParamsRequest, $root.ibc.core.client.v1.QueryClientParamsResponse, request, callback); - }, "name", { value: "ClientParams" }); - - /** - * Calls ClientParams. - * @function clientParams - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#upgradedClientState}. - * @memberof ibc.core.client.v1.Query - * @typedef UpgradedClientStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryUpgradedClientStateResponse} [response] QueryUpgradedClientStateResponse - */ - - /** - * Calls UpgradedClientState. - * @function upgradedClientState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest} request QueryUpgradedClientStateRequest message or plain object - * @param {ibc.core.client.v1.Query.UpgradedClientStateCallback} callback Node-style callback called with the error, if any, and QueryUpgradedClientStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.upgradedClientState = function upgradedClientState(request, callback) { - return this.rpcCall(upgradedClientState, $root.ibc.core.client.v1.QueryUpgradedClientStateRequest, $root.ibc.core.client.v1.QueryUpgradedClientStateResponse, request, callback); - }, "name", { value: "UpgradedClientState" }); - - /** - * Calls UpgradedClientState. - * @function upgradedClientState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest} request QueryUpgradedClientStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#upgradedConsensusState}. - * @memberof ibc.core.client.v1.Query - * @typedef UpgradedConsensusStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} [response] QueryUpgradedConsensusStateResponse - */ - - /** - * Calls UpgradedConsensusState. - * @function upgradedConsensusState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest} request QueryUpgradedConsensusStateRequest message or plain object - * @param {ibc.core.client.v1.Query.UpgradedConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryUpgradedConsensusStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.upgradedConsensusState = function upgradedConsensusState(request, callback) { - return this.rpcCall(upgradedConsensusState, $root.ibc.core.client.v1.QueryUpgradedConsensusStateRequest, $root.ibc.core.client.v1.QueryUpgradedConsensusStateResponse, request, callback); - }, "name", { value: "UpgradedConsensusState" }); - - /** - * Calls UpgradedConsensusState. - * @function upgradedConsensusState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest} request QueryUpgradedConsensusStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryClientStateRequest = (function() { - - /** - * Properties of a QueryClientStateRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStateRequest - * @property {string|null} [client_id] QueryClientStateRequest client_id - */ - - /** - * Constructs a new QueryClientStateRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStateRequest. - * @implements IQueryClientStateRequest - * @constructor - * @param {ibc.core.client.v1.IQueryClientStateRequest=} [properties] Properties to set - */ - function QueryClientStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStateRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @instance - */ - QueryClientStateRequest.prototype.client_id = ""; - - /** - * Encodes the specified QueryClientStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - return writer; - }; - - /** - * Encodes the specified QueryClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStateRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - return null; - }; - - /** - * Creates a QueryClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest - */ - QueryClientStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStateRequest) - return object; - var message = new $root.ibc.core.client.v1.QueryClientStateRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - return message; - }; - - /** - * Creates a plain object from a QueryClientStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {ibc.core.client.v1.QueryClientStateRequest} message QueryClientStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - return object; - }; - - /** - * Converts this QueryClientStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStateRequest; - })(); - - v1.QueryClientStateResponse = (function() { - - /** - * Properties of a QueryClientStateResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStateResponse - * @property {google.protobuf.IAny|null} [client_state] QueryClientStateResponse client_state - * @property {Uint8Array|null} [proof] QueryClientStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryClientStateResponse proof_height - */ - - /** - * Constructs a new QueryClientStateResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStateResponse. - * @implements IQueryClientStateResponse - * @constructor - * @param {ibc.core.client.v1.IQueryClientStateResponse=} [properties] Properties to set - */ - function QueryClientStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStateResponse client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @instance - */ - QueryClientStateResponse.prototype.client_state = null; - - /** - * QueryClientStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @instance - */ - QueryClientStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryClientStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @instance - */ - QueryClientStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryClientStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStateResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - var error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse - */ - QueryClientStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStateResponse) - return object; - var message = new $root.ibc.core.client.v1.QueryClientStateResponse(); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {ibc.core.client.v1.QueryClientStateResponse} message QueryClientStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_state = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryClientStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStateResponse; - })(); - - v1.QueryClientStatesRequest = (function() { - - /** - * Properties of a QueryClientStatesRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStatesRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryClientStatesRequest pagination - */ - - /** - * Constructs a new QueryClientStatesRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStatesRequest. - * @implements IQueryClientStatesRequest - * @constructor - * @param {ibc.core.client.v1.IQueryClientStatesRequest=} [properties] Properties to set - */ - function QueryClientStatesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStatesRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @instance - */ - QueryClientStatesRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryClientStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStatesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStatesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStatesRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStatesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryClientStatesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest - */ - QueryClientStatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStatesRequest) - return object; - var message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStatesRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientStatesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {ibc.core.client.v1.QueryClientStatesRequest} message QueryClientStatesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStatesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryClientStatesRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientStatesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStatesRequest; - })(); - - v1.QueryClientStatesResponse = (function() { - - /** - * Properties of a QueryClientStatesResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStatesResponse - * @property {Array.|null} [client_states] QueryClientStatesResponse client_states - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryClientStatesResponse pagination - */ - - /** - * Constructs a new QueryClientStatesResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStatesResponse. - * @implements IQueryClientStatesResponse - * @constructor - * @param {ibc.core.client.v1.IQueryClientStatesResponse=} [properties] Properties to set - */ - function QueryClientStatesResponse(properties) { - this.client_states = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStatesResponse client_states. - * @member {Array.} client_states - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @instance - */ - QueryClientStatesResponse.prototype.client_states = $util.emptyArray; - - /** - * QueryClientStatesResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @instance - */ - QueryClientStatesResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryClientStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_states != null && message.client_states.length) - for (var i = 0; i < message.client_states.length; ++i) - $root.ibc.core.client.v1.IdentifiedClientState.encode(message.client_states[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStatesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.client_states && message.client_states.length)) - message.client_states = []; - message.client_states.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStatesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStatesResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStatesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_states != null && message.hasOwnProperty("client_states")) { - if (!Array.isArray(message.client_states)) - return "client_states: array expected"; - for (var i = 0; i < message.client_states.length; ++i) { - var error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.client_states[i]); - if (error) - return "client_states." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryClientStatesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse - */ - QueryClientStatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStatesResponse) - return object; - var message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); - if (object.client_states) { - if (!Array.isArray(object.client_states)) - throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.client_states: array expected"); - message.client_states = []; - for (var i = 0; i < object.client_states.length; ++i) { - if (typeof object.client_states[i] !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.client_states: object expected"); - message.client_states[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.client_states[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientStatesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {ibc.core.client.v1.QueryClientStatesResponse} message QueryClientStatesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStatesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.client_states = []; - if (options.defaults) - object.pagination = null; - if (message.client_states && message.client_states.length) { - object.client_states = []; - for (var j = 0; j < message.client_states.length; ++j) - object.client_states[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.client_states[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryClientStatesResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientStatesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStatesResponse; - })(); - - v1.QueryConsensusStateRequest = (function() { - - /** - * Properties of a QueryConsensusStateRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStateRequest - * @property {string|null} [client_id] QueryConsensusStateRequest client_id - * @property {Long|null} [revision_number] QueryConsensusStateRequest revision_number - * @property {Long|null} [revision_height] QueryConsensusStateRequest revision_height - * @property {boolean|null} [latest_height] QueryConsensusStateRequest latest_height - */ - - /** - * Constructs a new QueryConsensusStateRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStateRequest. - * @implements IQueryConsensusStateRequest - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStateRequest=} [properties] Properties to set - */ - function QueryConsensusStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStateRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - */ - QueryConsensusStateRequest.prototype.client_id = ""; - - /** - * QueryConsensusStateRequest revision_number. - * @member {Long} revision_number - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - */ - QueryConsensusStateRequest.prototype.revision_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryConsensusStateRequest revision_height. - * @member {Long} revision_height - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - */ - QueryConsensusStateRequest.prototype.revision_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryConsensusStateRequest latest_height. - * @member {boolean} latest_height - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - */ - QueryConsensusStateRequest.prototype.latest_height = false; - - /** - * Encodes the specified QueryConsensusStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.revision_number != null && Object.hasOwnProperty.call(message, "revision_number")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision_number); - if (message.revision_height != null && Object.hasOwnProperty.call(message, "revision_height")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revision_height); - if (message.latest_height != null && Object.hasOwnProperty.call(message, "latest_height")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.latest_height); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.revision_number = reader.uint64(); - break; - case 3: - message.revision_height = reader.uint64(); - break; - case 4: - message.latest_height = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStateRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (!$util.isInteger(message.revision_number) && !(message.revision_number && $util.isInteger(message.revision_number.low) && $util.isInteger(message.revision_number.high))) - return "revision_number: integer|Long expected"; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (!$util.isInteger(message.revision_height) && !(message.revision_height && $util.isInteger(message.revision_height.low) && $util.isInteger(message.revision_height.high))) - return "revision_height: integer|Long expected"; - if (message.latest_height != null && message.hasOwnProperty("latest_height")) - if (typeof message.latest_height !== "boolean") - return "latest_height: boolean expected"; - return null; - }; - - /** - * Creates a QueryConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest - */ - QueryConsensusStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateRequest) - return object; - var message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.revision_number != null) - if ($util.Long) - (message.revision_number = $util.Long.fromValue(object.revision_number)).unsigned = true; - else if (typeof object.revision_number === "string") - message.revision_number = parseInt(object.revision_number, 10); - else if (typeof object.revision_number === "number") - message.revision_number = object.revision_number; - else if (typeof object.revision_number === "object") - message.revision_number = new $util.LongBits(object.revision_number.low >>> 0, object.revision_number.high >>> 0).toNumber(true); - if (object.revision_height != null) - if ($util.Long) - (message.revision_height = $util.Long.fromValue(object.revision_height)).unsigned = true; - else if (typeof object.revision_height === "string") - message.revision_height = parseInt(object.revision_height, 10); - else if (typeof object.revision_height === "number") - message.revision_height = object.revision_height; - else if (typeof object.revision_height === "object") - message.revision_height = new $util.LongBits(object.revision_height.low >>> 0, object.revision_height.high >>> 0).toNumber(true); - if (object.latest_height != null) - message.latest_height = Boolean(object.latest_height); - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {ibc.core.client.v1.QueryConsensusStateRequest} message QueryConsensusStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_number = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_height = options.longs === String ? "0" : 0; - object.latest_height = false; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (typeof message.revision_number === "number") - object.revision_number = options.longs === String ? String(message.revision_number) : message.revision_number; - else - object.revision_number = options.longs === String ? $util.Long.prototype.toString.call(message.revision_number) : options.longs === Number ? new $util.LongBits(message.revision_number.low >>> 0, message.revision_number.high >>> 0).toNumber(true) : message.revision_number; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (typeof message.revision_height === "number") - object.revision_height = options.longs === String ? String(message.revision_height) : message.revision_height; - else - object.revision_height = options.longs === String ? $util.Long.prototype.toString.call(message.revision_height) : options.longs === Number ? new $util.LongBits(message.revision_height.low >>> 0, message.revision_height.high >>> 0).toNumber(true) : message.revision_height; - if (message.latest_height != null && message.hasOwnProperty("latest_height")) - object.latest_height = message.latest_height; - return object; - }; - - /** - * Converts this QueryConsensusStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStateRequest; - })(); - - v1.QueryConsensusStateResponse = (function() { - - /** - * Properties of a QueryConsensusStateResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStateResponse - * @property {google.protobuf.IAny|null} [consensus_state] QueryConsensusStateResponse consensus_state - * @property {Uint8Array|null} [proof] QueryConsensusStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryConsensusStateResponse proof_height - */ - - /** - * Constructs a new QueryConsensusStateResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStateResponse. - * @implements IQueryConsensusStateResponse - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStateResponse=} [properties] Properties to set - */ - function QueryConsensusStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStateResponse consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @instance - */ - QueryConsensusStateResponse.prototype.consensus_state = null; - - /** - * QueryConsensusStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @instance - */ - QueryConsensusStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryConsensusStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @instance - */ - QueryConsensusStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryConsensusStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStateResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse - */ - QueryConsensusStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateResponse) - return object; - var message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {ibc.core.client.v1.QueryConsensusStateResponse} message QueryConsensusStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.consensus_state = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryConsensusStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStateResponse; - })(); - - v1.QueryConsensusStatesRequest = (function() { - - /** - * Properties of a QueryConsensusStatesRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStatesRequest - * @property {string|null} [client_id] QueryConsensusStatesRequest client_id - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConsensusStatesRequest pagination - */ - - /** - * Constructs a new QueryConsensusStatesRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStatesRequest. - * @implements IQueryConsensusStatesRequest - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest=} [properties] Properties to set - */ - function QueryConsensusStatesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStatesRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @instance - */ - QueryConsensusStatesRequest.prototype.client_id = ""; - - /** - * QueryConsensusStatesRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @instance - */ - QueryConsensusStatesRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryConsensusStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStatesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStatesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStatesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStatesRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStatesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStatesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest - */ - QueryConsensusStatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesRequest) - return object; - var message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStatesRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStatesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {ibc.core.client.v1.QueryConsensusStatesRequest} message QueryConsensusStatesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStatesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.pagination = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConsensusStatesRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStatesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStatesRequest; - })(); - - v1.QueryConsensusStatesResponse = (function() { - - /** - * Properties of a QueryConsensusStatesResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStatesResponse - * @property {Array.|null} [consensus_states] QueryConsensusStatesResponse consensus_states - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConsensusStatesResponse pagination - */ - - /** - * Constructs a new QueryConsensusStatesResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStatesResponse. - * @implements IQueryConsensusStatesResponse - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStatesResponse=} [properties] Properties to set - */ - function QueryConsensusStatesResponse(properties) { - this.consensus_states = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStatesResponse consensus_states. - * @member {Array.} consensus_states - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @instance - */ - QueryConsensusStatesResponse.prototype.consensus_states = $util.emptyArray; - - /** - * QueryConsensusStatesResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @instance - */ - QueryConsensusStatesResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryConsensusStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStatesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_states != null && message.consensus_states.length) - for (var i = 0; i < message.consensus_states.length; ++i) - $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensus_states[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStatesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.consensus_states && message.consensus_states.length)) - message.consensus_states = []; - message.consensus_states.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStatesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStatesResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStatesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_states != null && message.hasOwnProperty("consensus_states")) { - if (!Array.isArray(message.consensus_states)) - return "consensus_states: array expected"; - for (var i = 0; i < message.consensus_states.length; ++i) { - var error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensus_states[i]); - if (error) - return "consensus_states." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStatesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse - */ - QueryConsensusStatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesResponse) - return object; - var message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); - if (object.consensus_states) { - if (!Array.isArray(object.consensus_states)) - throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensus_states: array expected"); - message.consensus_states = []; - for (var i = 0; i < object.consensus_states.length; ++i) { - if (typeof object.consensus_states[i] !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensus_states: object expected"); - message.consensus_states[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensus_states[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStatesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {ibc.core.client.v1.QueryConsensusStatesResponse} message QueryConsensusStatesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStatesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.consensus_states = []; - if (options.defaults) - object.pagination = null; - if (message.consensus_states && message.consensus_states.length) { - object.consensus_states = []; - for (var j = 0; j < message.consensus_states.length; ++j) - object.consensus_states[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensus_states[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConsensusStatesResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStatesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStatesResponse; - })(); - - v1.QueryConsensusStateHeightsRequest = (function() { - - /** - * Properties of a QueryConsensusStateHeightsRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStateHeightsRequest - * @property {string|null} [client_id] QueryConsensusStateHeightsRequest client_id - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConsensusStateHeightsRequest pagination - */ - - /** - * Constructs a new QueryConsensusStateHeightsRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStateHeightsRequest. - * @implements IQueryConsensusStateHeightsRequest - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest=} [properties] Properties to set - */ - function QueryConsensusStateHeightsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStateHeightsRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @instance - */ - QueryConsensusStateHeightsRequest.prototype.client_id = ""; - - /** - * QueryConsensusStateHeightsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @instance - */ - QueryConsensusStateHeightsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryConsensusStateHeightsRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest} message QueryConsensusStateHeightsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateHeightsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStateHeightsRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest} message QueryConsensusStateHeightsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateHeightsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStateHeightsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsRequest} QueryConsensusStateHeightsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateHeightsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateHeightsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStateHeightsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsRequest} QueryConsensusStateHeightsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateHeightsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStateHeightsRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStateHeightsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStateHeightsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsRequest} QueryConsensusStateHeightsRequest - */ - QueryConsensusStateHeightsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateHeightsRequest) - return object; - var message = new $root.ibc.core.client.v1.QueryConsensusStateHeightsRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateHeightsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStateHeightsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {ibc.core.client.v1.QueryConsensusStateHeightsRequest} message QueryConsensusStateHeightsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStateHeightsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.pagination = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConsensusStateHeightsRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStateHeightsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStateHeightsRequest; - })(); - - v1.QueryConsensusStateHeightsResponse = (function() { - - /** - * Properties of a QueryConsensusStateHeightsResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStateHeightsResponse - * @property {Array.|null} [consensus_state_heights] QueryConsensusStateHeightsResponse consensus_state_heights - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConsensusStateHeightsResponse pagination - */ - - /** - * Constructs a new QueryConsensusStateHeightsResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStateHeightsResponse. - * @implements IQueryConsensusStateHeightsResponse - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsResponse=} [properties] Properties to set - */ - function QueryConsensusStateHeightsResponse(properties) { - this.consensus_state_heights = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStateHeightsResponse consensus_state_heights. - * @member {Array.} consensus_state_heights - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @instance - */ - QueryConsensusStateHeightsResponse.prototype.consensus_state_heights = $util.emptyArray; - - /** - * QueryConsensusStateHeightsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @instance - */ - QueryConsensusStateHeightsResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryConsensusStateHeightsResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsResponse} message QueryConsensusStateHeightsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateHeightsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_state_heights != null && message.consensus_state_heights.length) - for (var i = 0; i < message.consensus_state_heights.length; ++i) - $root.ibc.core.client.v1.Height.encode(message.consensus_state_heights[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStateHeightsResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsResponse} message QueryConsensusStateHeightsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateHeightsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStateHeightsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsResponse} QueryConsensusStateHeightsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateHeightsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateHeightsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.consensus_state_heights && message.consensus_state_heights.length)) - message.consensus_state_heights = []; - message.consensus_state_heights.push($root.ibc.core.client.v1.Height.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStateHeightsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsResponse} QueryConsensusStateHeightsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateHeightsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStateHeightsResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStateHeightsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_state_heights != null && message.hasOwnProperty("consensus_state_heights")) { - if (!Array.isArray(message.consensus_state_heights)) - return "consensus_state_heights: array expected"; - for (var i = 0; i < message.consensus_state_heights.length; ++i) { - var error = $root.ibc.core.client.v1.Height.verify(message.consensus_state_heights[i]); - if (error) - return "consensus_state_heights." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStateHeightsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsResponse} QueryConsensusStateHeightsResponse - */ - QueryConsensusStateHeightsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateHeightsResponse) - return object; - var message = new $root.ibc.core.client.v1.QueryConsensusStateHeightsResponse(); - if (object.consensus_state_heights) { - if (!Array.isArray(object.consensus_state_heights)) - throw TypeError(".ibc.core.client.v1.QueryConsensusStateHeightsResponse.consensus_state_heights: array expected"); - message.consensus_state_heights = []; - for (var i = 0; i < object.consensus_state_heights.length; ++i) { - if (typeof object.consensus_state_heights[i] !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateHeightsResponse.consensus_state_heights: object expected"); - message.consensus_state_heights[i] = $root.ibc.core.client.v1.Height.fromObject(object.consensus_state_heights[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateHeightsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStateHeightsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {ibc.core.client.v1.QueryConsensusStateHeightsResponse} message QueryConsensusStateHeightsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStateHeightsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.consensus_state_heights = []; - if (options.defaults) - object.pagination = null; - if (message.consensus_state_heights && message.consensus_state_heights.length) { - object.consensus_state_heights = []; - for (var j = 0; j < message.consensus_state_heights.length; ++j) - object.consensus_state_heights[j] = $root.ibc.core.client.v1.Height.toObject(message.consensus_state_heights[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConsensusStateHeightsResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStateHeightsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStateHeightsResponse; - })(); - - v1.QueryClientStatusRequest = (function() { - - /** - * Properties of a QueryClientStatusRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStatusRequest - * @property {string|null} [client_id] QueryClientStatusRequest client_id - */ - - /** - * Constructs a new QueryClientStatusRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStatusRequest. - * @implements IQueryClientStatusRequest - * @constructor - * @param {ibc.core.client.v1.IQueryClientStatusRequest=} [properties] Properties to set - */ - function QueryClientStatusRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStatusRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @instance - */ - QueryClientStatusRequest.prototype.client_id = ""; - - /** - * Encodes the specified QueryClientStatusRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStatusRequest} message QueryClientStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - return writer; - }; - - /** - * Encodes the specified QueryClientStatusRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStatusRequest} message QueryClientStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStatusRequest} QueryClientStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatusRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatusRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStatusRequest} QueryClientStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStatusRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - return null; - }; - - /** - * Creates a QueryClientStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStatusRequest} QueryClientStatusRequest - */ - QueryClientStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStatusRequest) - return object; - var message = new $root.ibc.core.client.v1.QueryClientStatusRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - return message; - }; - - /** - * Creates a plain object from a QueryClientStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {ibc.core.client.v1.QueryClientStatusRequest} message QueryClientStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStatusRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - return object; - }; - - /** - * Converts this QueryClientStatusRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStatusRequest; - })(); - - v1.QueryClientStatusResponse = (function() { - - /** - * Properties of a QueryClientStatusResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStatusResponse - * @property {string|null} [status] QueryClientStatusResponse status - */ - - /** - * Constructs a new QueryClientStatusResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStatusResponse. - * @implements IQueryClientStatusResponse - * @constructor - * @param {ibc.core.client.v1.IQueryClientStatusResponse=} [properties] Properties to set - */ - function QueryClientStatusResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStatusResponse status. - * @member {string} status - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @instance - */ - QueryClientStatusResponse.prototype.status = ""; - - /** - * Encodes the specified QueryClientStatusResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStatusResponse} message QueryClientStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatusResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.status); - return writer; - }; - - /** - * Encodes the specified QueryClientStatusResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStatusResponse} message QueryClientStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStatusResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStatusResponse} QueryClientStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatusResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatusResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.status = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStatusResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStatusResponse} QueryClientStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatusResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStatusResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStatusResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (!$util.isString(message.status)) - return "status: string expected"; - return null; - }; - - /** - * Creates a QueryClientStatusResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStatusResponse} QueryClientStatusResponse - */ - QueryClientStatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStatusResponse) - return object; - var message = new $root.ibc.core.client.v1.QueryClientStatusResponse(); - if (object.status != null) - message.status = String(object.status); - return message; - }; - - /** - * Creates a plain object from a QueryClientStatusResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {ibc.core.client.v1.QueryClientStatusResponse} message QueryClientStatusResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStatusResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.status = ""; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - return object; - }; - - /** - * Converts this QueryClientStatusResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientStatusResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStatusResponse; - })(); - - v1.QueryClientParamsRequest = (function() { - - /** - * Properties of a QueryClientParamsRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryClientParamsRequest - */ - - /** - * Constructs a new QueryClientParamsRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientParamsRequest. - * @implements IQueryClientParamsRequest - * @constructor - * @param {ibc.core.client.v1.IQueryClientParamsRequest=} [properties] Properties to set - */ - function QueryClientParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryClientParamsRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryClientParamsRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientParamsRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryClientParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest - */ - QueryClientParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientParamsRequest) - return object; - return new $root.ibc.core.client.v1.QueryClientParamsRequest(); - }; - - /** - * Creates a plain object from a QueryClientParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {ibc.core.client.v1.QueryClientParamsRequest} message QueryClientParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryClientParamsRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientParamsRequest; - })(); - - v1.QueryClientParamsResponse = (function() { - - /** - * Properties of a QueryClientParamsResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryClientParamsResponse - * @property {ibc.core.client.v1.IParams|null} [params] QueryClientParamsResponse params - */ - - /** - * Constructs a new QueryClientParamsResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientParamsResponse. - * @implements IQueryClientParamsResponse - * @constructor - * @param {ibc.core.client.v1.IQueryClientParamsResponse=} [properties] Properties to set - */ - function QueryClientParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientParamsResponse params. - * @member {ibc.core.client.v1.IParams|null|undefined} params - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @instance - */ - QueryClientParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryClientParamsResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientParamsResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientParamsResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.core.client.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryClientParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse - */ - QueryClientParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientParamsResponse) - return object; - var message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientParamsResponse.params: object expected"); - message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {ibc.core.client.v1.QueryClientParamsResponse} message QueryClientParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryClientParamsResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientParamsResponse; - })(); - - v1.QueryUpgradedClientStateRequest = (function() { - - /** - * Properties of a QueryUpgradedClientStateRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryUpgradedClientStateRequest - */ - - /** - * Constructs a new QueryUpgradedClientStateRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryUpgradedClientStateRequest. - * @implements IQueryUpgradedClientStateRequest - * @constructor - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest=} [properties] Properties to set - */ - function QueryUpgradedClientStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryUpgradedClientStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest} message QueryUpgradedClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedClientStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryUpgradedClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest} message QueryUpgradedClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUpgradedClientStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryUpgradedClientStateRequest} QueryUpgradedClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedClientStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryUpgradedClientStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUpgradedClientStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryUpgradedClientStateRequest} QueryUpgradedClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedClientStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUpgradedClientStateRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUpgradedClientStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryUpgradedClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryUpgradedClientStateRequest} QueryUpgradedClientStateRequest - */ - QueryUpgradedClientStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryUpgradedClientStateRequest) - return object; - return new $root.ibc.core.client.v1.QueryUpgradedClientStateRequest(); - }; - - /** - * Creates a plain object from a QueryUpgradedClientStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {ibc.core.client.v1.QueryUpgradedClientStateRequest} message QueryUpgradedClientStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUpgradedClientStateRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryUpgradedClientStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryUpgradedClientStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUpgradedClientStateRequest; - })(); - - v1.QueryUpgradedClientStateResponse = (function() { - - /** - * Properties of a QueryUpgradedClientStateResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryUpgradedClientStateResponse - * @property {google.protobuf.IAny|null} [upgraded_client_state] QueryUpgradedClientStateResponse upgraded_client_state - */ - - /** - * Constructs a new QueryUpgradedClientStateResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryUpgradedClientStateResponse. - * @implements IQueryUpgradedClientStateResponse - * @constructor - * @param {ibc.core.client.v1.IQueryUpgradedClientStateResponse=} [properties] Properties to set - */ - function QueryUpgradedClientStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUpgradedClientStateResponse upgraded_client_state. - * @member {google.protobuf.IAny|null|undefined} upgraded_client_state - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @instance - */ - QueryUpgradedClientStateResponse.prototype.upgraded_client_state = null; - - /** - * Encodes the specified QueryUpgradedClientStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {ibc.core.client.v1.IQueryUpgradedClientStateResponse} message QueryUpgradedClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedClientStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.upgraded_client_state != null && Object.hasOwnProperty.call(message, "upgraded_client_state")) - $root.google.protobuf.Any.encode(message.upgraded_client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryUpgradedClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {ibc.core.client.v1.IQueryUpgradedClientStateResponse} message QueryUpgradedClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUpgradedClientStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryUpgradedClientStateResponse} QueryUpgradedClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedClientStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryUpgradedClientStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.upgraded_client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUpgradedClientStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryUpgradedClientStateResponse} QueryUpgradedClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedClientStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUpgradedClientStateResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUpgradedClientStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) { - var error = $root.google.protobuf.Any.verify(message.upgraded_client_state); - if (error) - return "upgraded_client_state." + error; - } - return null; - }; - - /** - * Creates a QueryUpgradedClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryUpgradedClientStateResponse} QueryUpgradedClientStateResponse - */ - QueryUpgradedClientStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryUpgradedClientStateResponse) - return object; - var message = new $root.ibc.core.client.v1.QueryUpgradedClientStateResponse(); - if (object.upgraded_client_state != null) { - if (typeof object.upgraded_client_state !== "object") - throw TypeError(".ibc.core.client.v1.QueryUpgradedClientStateResponse.upgraded_client_state: object expected"); - message.upgraded_client_state = $root.google.protobuf.Any.fromObject(object.upgraded_client_state); - } - return message; - }; - - /** - * Creates a plain object from a QueryUpgradedClientStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {ibc.core.client.v1.QueryUpgradedClientStateResponse} message QueryUpgradedClientStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUpgradedClientStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.upgraded_client_state = null; - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) - object.upgraded_client_state = $root.google.protobuf.Any.toObject(message.upgraded_client_state, options); - return object; - }; - - /** - * Converts this QueryUpgradedClientStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryUpgradedClientStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUpgradedClientStateResponse; - })(); - - v1.QueryUpgradedConsensusStateRequest = (function() { - - /** - * Properties of a QueryUpgradedConsensusStateRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryUpgradedConsensusStateRequest - */ - - /** - * Constructs a new QueryUpgradedConsensusStateRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryUpgradedConsensusStateRequest. - * @implements IQueryUpgradedConsensusStateRequest - * @constructor - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest=} [properties] Properties to set - */ - function QueryUpgradedConsensusStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryUpgradedConsensusStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest} message QueryUpgradedConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedConsensusStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryUpgradedConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest} message QueryUpgradedConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUpgradedConsensusStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedConsensusStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryUpgradedConsensusStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUpgradedConsensusStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUpgradedConsensusStateRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUpgradedConsensusStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryUpgradedConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest - */ - QueryUpgradedConsensusStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryUpgradedConsensusStateRequest) - return object; - return new $root.ibc.core.client.v1.QueryUpgradedConsensusStateRequest(); - }; - - /** - * Creates a plain object from a QueryUpgradedConsensusStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {ibc.core.client.v1.QueryUpgradedConsensusStateRequest} message QueryUpgradedConsensusStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUpgradedConsensusStateRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryUpgradedConsensusStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryUpgradedConsensusStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUpgradedConsensusStateRequest; - })(); - - v1.QueryUpgradedConsensusStateResponse = (function() { - - /** - * Properties of a QueryUpgradedConsensusStateResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryUpgradedConsensusStateResponse - * @property {google.protobuf.IAny|null} [upgraded_consensus_state] QueryUpgradedConsensusStateResponse upgraded_consensus_state - */ - - /** - * Constructs a new QueryUpgradedConsensusStateResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryUpgradedConsensusStateResponse. - * @implements IQueryUpgradedConsensusStateResponse - * @constructor - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateResponse=} [properties] Properties to set - */ - function QueryUpgradedConsensusStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUpgradedConsensusStateResponse upgraded_consensus_state. - * @member {google.protobuf.IAny|null|undefined} upgraded_consensus_state - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @instance - */ - QueryUpgradedConsensusStateResponse.prototype.upgraded_consensus_state = null; - - /** - * Encodes the specified QueryUpgradedConsensusStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateResponse} message QueryUpgradedConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedConsensusStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.upgraded_consensus_state != null && Object.hasOwnProperty.call(message, "upgraded_consensus_state")) - $root.google.protobuf.Any.encode(message.upgraded_consensus_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryUpgradedConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateResponse} message QueryUpgradedConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUpgradedConsensusStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedConsensusStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryUpgradedConsensusStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.upgraded_consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUpgradedConsensusStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUpgradedConsensusStateResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUpgradedConsensusStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.upgraded_consensus_state != null && message.hasOwnProperty("upgraded_consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.upgraded_consensus_state); - if (error) - return "upgraded_consensus_state." + error; - } - return null; - }; - - /** - * Creates a QueryUpgradedConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse - */ - QueryUpgradedConsensusStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryUpgradedConsensusStateResponse) - return object; - var message = new $root.ibc.core.client.v1.QueryUpgradedConsensusStateResponse(); - if (object.upgraded_consensus_state != null) { - if (typeof object.upgraded_consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.QueryUpgradedConsensusStateResponse.upgraded_consensus_state: object expected"); - message.upgraded_consensus_state = $root.google.protobuf.Any.fromObject(object.upgraded_consensus_state); - } - return message; - }; - - /** - * Creates a plain object from a QueryUpgradedConsensusStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} message QueryUpgradedConsensusStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUpgradedConsensusStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.upgraded_consensus_state = null; - if (message.upgraded_consensus_state != null && message.hasOwnProperty("upgraded_consensus_state")) - object.upgraded_consensus_state = $root.google.protobuf.Any.toObject(message.upgraded_consensus_state, options); - return object; - }; - - /** - * Converts this QueryUpgradedConsensusStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryUpgradedConsensusStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUpgradedConsensusStateResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.core.client.v1 - * @interface IGenesisState - * @property {Array.|null} [clients] GenesisState clients - * @property {Array.|null} [clients_consensus] GenesisState clients_consensus - * @property {Array.|null} [clients_metadata] GenesisState clients_metadata - * @property {ibc.core.client.v1.IParams|null} [params] GenesisState params - * @property {boolean|null} [create_localhost] GenesisState create_localhost - * @property {Long|null} [next_client_sequence] GenesisState next_client_sequence - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.core.client.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.core.client.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.clients = []; - this.clients_consensus = []; - this.clients_metadata = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState clients. - * @member {Array.} clients - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.clients = $util.emptyArray; - - /** - * GenesisState clients_consensus. - * @member {Array.} clients_consensus - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.clients_consensus = $util.emptyArray; - - /** - * GenesisState clients_metadata. - * @member {Array.} clients_metadata - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.clients_metadata = $util.emptyArray; - - /** - * GenesisState params. - * @member {ibc.core.client.v1.IParams|null|undefined} params - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * GenesisState create_localhost. - * @member {boolean} create_localhost - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.create_localhost = false; - - /** - * GenesisState next_client_sequence. - * @member {Long} next_client_sequence - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.next_client_sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clients != null && message.clients.length) - for (var i = 0; i < message.clients.length; ++i) - $root.ibc.core.client.v1.IdentifiedClientState.encode(message.clients[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.clients_consensus != null && message.clients_consensus.length) - for (var i = 0; i < message.clients_consensus.length; ++i) - $root.ibc.core.client.v1.ClientConsensusStates.encode(message.clients_consensus[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.clients_metadata != null && message.clients_metadata.length) - for (var i = 0; i < message.clients_metadata.length; ++i) - $root.ibc.core.client.v1.IdentifiedGenesisMetadata.encode(message.clients_metadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.create_localhost != null && Object.hasOwnProperty.call(message, "create_localhost")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.create_localhost); - if (message.next_client_sequence != null && Object.hasOwnProperty.call(message, "next_client_sequence")) - writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.next_client_sequence); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.clients && message.clients.length)) - message.clients = []; - message.clients.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.clients_consensus && message.clients_consensus.length)) - message.clients_consensus = []; - message.clients_consensus.push($root.ibc.core.client.v1.ClientConsensusStates.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.clients_metadata && message.clients_metadata.length)) - message.clients_metadata = []; - message.clients_metadata.push($root.ibc.core.client.v1.IdentifiedGenesisMetadata.decode(reader, reader.uint32())); - break; - case 4: - message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); - break; - case 5: - message.create_localhost = reader.bool(); - break; - case 6: - message.next_client_sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clients != null && message.hasOwnProperty("clients")) { - if (!Array.isArray(message.clients)) - return "clients: array expected"; - for (var i = 0; i < message.clients.length; ++i) { - var error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.clients[i]); - if (error) - return "clients." + error; - } - } - if (message.clients_consensus != null && message.hasOwnProperty("clients_consensus")) { - if (!Array.isArray(message.clients_consensus)) - return "clients_consensus: array expected"; - for (var i = 0; i < message.clients_consensus.length; ++i) { - var error = $root.ibc.core.client.v1.ClientConsensusStates.verify(message.clients_consensus[i]); - if (error) - return "clients_consensus." + error; - } - } - if (message.clients_metadata != null && message.hasOwnProperty("clients_metadata")) { - if (!Array.isArray(message.clients_metadata)) - return "clients_metadata: array expected"; - for (var i = 0; i < message.clients_metadata.length; ++i) { - var error = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.verify(message.clients_metadata[i]); - if (error) - return "clients_metadata." + error; - } - } - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.core.client.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - if (message.create_localhost != null && message.hasOwnProperty("create_localhost")) - if (typeof message.create_localhost !== "boolean") - return "create_localhost: boolean expected"; - if (message.next_client_sequence != null && message.hasOwnProperty("next_client_sequence")) - if (!$util.isInteger(message.next_client_sequence) && !(message.next_client_sequence && $util.isInteger(message.next_client_sequence.low) && $util.isInteger(message.next_client_sequence.high))) - return "next_client_sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.GenesisState) - return object; - var message = new $root.ibc.core.client.v1.GenesisState(); - if (object.clients) { - if (!Array.isArray(object.clients)) - throw TypeError(".ibc.core.client.v1.GenesisState.clients: array expected"); - message.clients = []; - for (var i = 0; i < object.clients.length; ++i) { - if (typeof object.clients[i] !== "object") - throw TypeError(".ibc.core.client.v1.GenesisState.clients: object expected"); - message.clients[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.clients[i]); - } - } - if (object.clients_consensus) { - if (!Array.isArray(object.clients_consensus)) - throw TypeError(".ibc.core.client.v1.GenesisState.clients_consensus: array expected"); - message.clients_consensus = []; - for (var i = 0; i < object.clients_consensus.length; ++i) { - if (typeof object.clients_consensus[i] !== "object") - throw TypeError(".ibc.core.client.v1.GenesisState.clients_consensus: object expected"); - message.clients_consensus[i] = $root.ibc.core.client.v1.ClientConsensusStates.fromObject(object.clients_consensus[i]); - } - } - if (object.clients_metadata) { - if (!Array.isArray(object.clients_metadata)) - throw TypeError(".ibc.core.client.v1.GenesisState.clients_metadata: array expected"); - message.clients_metadata = []; - for (var i = 0; i < object.clients_metadata.length; ++i) { - if (typeof object.clients_metadata[i] !== "object") - throw TypeError(".ibc.core.client.v1.GenesisState.clients_metadata: object expected"); - message.clients_metadata[i] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.fromObject(object.clients_metadata[i]); - } - } - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.core.client.v1.GenesisState.params: object expected"); - message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); - } - if (object.create_localhost != null) - message.create_localhost = Boolean(object.create_localhost); - if (object.next_client_sequence != null) - if ($util.Long) - (message.next_client_sequence = $util.Long.fromValue(object.next_client_sequence)).unsigned = true; - else if (typeof object.next_client_sequence === "string") - message.next_client_sequence = parseInt(object.next_client_sequence, 10); - else if (typeof object.next_client_sequence === "number") - message.next_client_sequence = object.next_client_sequence; - else if (typeof object.next_client_sequence === "object") - message.next_client_sequence = new $util.LongBits(object.next_client_sequence.low >>> 0, object.next_client_sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {ibc.core.client.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.clients = []; - object.clients_consensus = []; - object.clients_metadata = []; - } - if (options.defaults) { - object.params = null; - object.create_localhost = false; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.next_client_sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_client_sequence = options.longs === String ? "0" : 0; - } - if (message.clients && message.clients.length) { - object.clients = []; - for (var j = 0; j < message.clients.length; ++j) - object.clients[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.clients[j], options); - } - if (message.clients_consensus && message.clients_consensus.length) { - object.clients_consensus = []; - for (var j = 0; j < message.clients_consensus.length; ++j) - object.clients_consensus[j] = $root.ibc.core.client.v1.ClientConsensusStates.toObject(message.clients_consensus[j], options); - } - if (message.clients_metadata && message.clients_metadata.length) { - object.clients_metadata = []; - for (var j = 0; j < message.clients_metadata.length; ++j) - object.clients_metadata[j] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.toObject(message.clients_metadata[j], options); - } - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); - if (message.create_localhost != null && message.hasOwnProperty("create_localhost")) - object.create_localhost = message.create_localhost; - if (message.next_client_sequence != null && message.hasOwnProperty("next_client_sequence")) - if (typeof message.next_client_sequence === "number") - object.next_client_sequence = options.longs === String ? String(message.next_client_sequence) : message.next_client_sequence; - else - object.next_client_sequence = options.longs === String ? $util.Long.prototype.toString.call(message.next_client_sequence) : options.longs === Number ? new $util.LongBits(message.next_client_sequence.low >>> 0, message.next_client_sequence.high >>> 0).toNumber(true) : message.next_client_sequence; - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - v1.GenesisMetadata = (function() { - - /** - * Properties of a GenesisMetadata. - * @memberof ibc.core.client.v1 - * @interface IGenesisMetadata - * @property {Uint8Array|null} [key] GenesisMetadata key - * @property {Uint8Array|null} [value] GenesisMetadata value - */ - - /** - * Constructs a new GenesisMetadata. - * @memberof ibc.core.client.v1 - * @classdesc Represents a GenesisMetadata. - * @implements IGenesisMetadata - * @constructor - * @param {ibc.core.client.v1.IGenesisMetadata=} [properties] Properties to set - */ - function GenesisMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisMetadata key. - * @member {Uint8Array} key - * @memberof ibc.core.client.v1.GenesisMetadata - * @instance - */ - GenesisMetadata.prototype.key = $util.newBuffer([]); - - /** - * GenesisMetadata value. - * @member {Uint8Array} value - * @memberof ibc.core.client.v1.GenesisMetadata - * @instance - */ - GenesisMetadata.prototype.value = $util.newBuffer([]); - - /** - * Encodes the specified GenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified GenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisMetadata message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisMetadata message. - * @function verify - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a GenesisMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata - */ - GenesisMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.GenesisMetadata) - return object; - var message = new $root.ibc.core.client.v1.GenesisMetadata(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a GenesisMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {ibc.core.client.v1.GenesisMetadata} message GenesisMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this GenesisMetadata to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.GenesisMetadata - * @instance - * @returns {Object.} JSON object - */ - GenesisMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisMetadata; - })(); - - v1.IdentifiedGenesisMetadata = (function() { - - /** - * Properties of an IdentifiedGenesisMetadata. - * @memberof ibc.core.client.v1 - * @interface IIdentifiedGenesisMetadata - * @property {string|null} [client_id] IdentifiedGenesisMetadata client_id - * @property {Array.|null} [client_metadata] IdentifiedGenesisMetadata client_metadata - */ - - /** - * Constructs a new IdentifiedGenesisMetadata. - * @memberof ibc.core.client.v1 - * @classdesc Represents an IdentifiedGenesisMetadata. - * @implements IIdentifiedGenesisMetadata - * @constructor - * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata=} [properties] Properties to set - */ - function IdentifiedGenesisMetadata(properties) { - this.client_metadata = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedGenesisMetadata client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @instance - */ - IdentifiedGenesisMetadata.prototype.client_id = ""; - - /** - * IdentifiedGenesisMetadata client_metadata. - * @member {Array.} client_metadata - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @instance - */ - IdentifiedGenesisMetadata.prototype.client_metadata = $util.emptyArray; - - /** - * Encodes the specified IdentifiedGenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedGenesisMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.client_metadata != null && message.client_metadata.length) - for (var i = 0; i < message.client_metadata.length; ++i) - $root.ibc.core.client.v1.GenesisMetadata.encode(message.client_metadata[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentifiedGenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedGenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedGenesisMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - if (!(message.client_metadata && message.client_metadata.length)) - message.client_metadata = []; - message.client_metadata.push($root.ibc.core.client.v1.GenesisMetadata.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedGenesisMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedGenesisMetadata message. - * @function verify - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedGenesisMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.client_metadata != null && message.hasOwnProperty("client_metadata")) { - if (!Array.isArray(message.client_metadata)) - return "client_metadata: array expected"; - for (var i = 0; i < message.client_metadata.length; ++i) { - var error = $root.ibc.core.client.v1.GenesisMetadata.verify(message.client_metadata[i]); - if (error) - return "client_metadata." + error; - } - } - return null; - }; - - /** - * Creates an IdentifiedGenesisMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata - */ - IdentifiedGenesisMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.IdentifiedGenesisMetadata) - return object; - var message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.client_metadata) { - if (!Array.isArray(object.client_metadata)) - throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.client_metadata: array expected"); - message.client_metadata = []; - for (var i = 0; i < object.client_metadata.length; ++i) { - if (typeof object.client_metadata[i] !== "object") - throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.client_metadata: object expected"); - message.client_metadata[i] = $root.ibc.core.client.v1.GenesisMetadata.fromObject(object.client_metadata[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentifiedGenesisMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {ibc.core.client.v1.IdentifiedGenesisMetadata} message IdentifiedGenesisMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedGenesisMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.client_metadata = []; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.client_metadata && message.client_metadata.length) { - object.client_metadata = []; - for (var j = 0; j < message.client_metadata.length; ++j) - object.client_metadata[j] = $root.ibc.core.client.v1.GenesisMetadata.toObject(message.client_metadata[j], options); - } - return object; - }; - - /** - * Converts this IdentifiedGenesisMetadata to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @instance - * @returns {Object.} JSON object - */ - IdentifiedGenesisMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedGenesisMetadata; - })(); - - return v1; - })(); - - return client; - })(); - - core.commitment = (function() { - - /** - * Namespace commitment. - * @memberof ibc.core - * @namespace - */ - var commitment = {}; - - commitment.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.commitment - * @namespace - */ - var v1 = {}; - - v1.MerkleRoot = (function() { - - /** - * Properties of a MerkleRoot. - * @memberof ibc.core.commitment.v1 - * @interface IMerkleRoot - * @property {Uint8Array|null} [hash] MerkleRoot hash - */ - - /** - * Constructs a new MerkleRoot. - * @memberof ibc.core.commitment.v1 - * @classdesc Represents a MerkleRoot. - * @implements IMerkleRoot - * @constructor - * @param {ibc.core.commitment.v1.IMerkleRoot=} [properties] Properties to set - */ - function MerkleRoot(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MerkleRoot hash. - * @member {Uint8Array} hash - * @memberof ibc.core.commitment.v1.MerkleRoot - * @instance - */ - MerkleRoot.prototype.hash = $util.newBuffer([]); - - /** - * Encodes the specified MerkleRoot message. Does not implicitly {@link ibc.core.commitment.v1.MerkleRoot.verify|verify} messages. - * @function encode - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {ibc.core.commitment.v1.IMerkleRoot} message MerkleRoot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerkleRoot.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); - return writer; - }; - - /** - * Encodes the specified MerkleRoot message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerkleRoot.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {ibc.core.commitment.v1.IMerkleRoot} message MerkleRoot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerkleRoot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MerkleRoot message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerkleRoot.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerkleRoot(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MerkleRoot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerkleRoot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerkleRoot message. - * @function verify - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerkleRoot.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - return null; - }; - - /** - * Creates a MerkleRoot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot - */ - MerkleRoot.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.commitment.v1.MerkleRoot) - return object; - var message = new $root.ibc.core.commitment.v1.MerkleRoot(); - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - return message; - }; - - /** - * Creates a plain object from a MerkleRoot message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {ibc.core.commitment.v1.MerkleRoot} message MerkleRoot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerkleRoot.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - return object; - }; - - /** - * Converts this MerkleRoot to JSON. - * @function toJSON - * @memberof ibc.core.commitment.v1.MerkleRoot - * @instance - * @returns {Object.} JSON object - */ - MerkleRoot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MerkleRoot; - })(); - - v1.MerklePrefix = (function() { - - /** - * Properties of a MerklePrefix. - * @memberof ibc.core.commitment.v1 - * @interface IMerklePrefix - * @property {Uint8Array|null} [key_prefix] MerklePrefix key_prefix - */ - - /** - * Constructs a new MerklePrefix. - * @memberof ibc.core.commitment.v1 - * @classdesc Represents a MerklePrefix. - * @implements IMerklePrefix - * @constructor - * @param {ibc.core.commitment.v1.IMerklePrefix=} [properties] Properties to set - */ - function MerklePrefix(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MerklePrefix key_prefix. - * @member {Uint8Array} key_prefix - * @memberof ibc.core.commitment.v1.MerklePrefix - * @instance - */ - MerklePrefix.prototype.key_prefix = $util.newBuffer([]); - - /** - * Encodes the specified MerklePrefix message. Does not implicitly {@link ibc.core.commitment.v1.MerklePrefix.verify|verify} messages. - * @function encode - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {ibc.core.commitment.v1.IMerklePrefix} message MerklePrefix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerklePrefix.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key_prefix != null && Object.hasOwnProperty.call(message, "key_prefix")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key_prefix); - return writer; - }; - - /** - * Encodes the specified MerklePrefix message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerklePrefix.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {ibc.core.commitment.v1.IMerklePrefix} message MerklePrefix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerklePrefix.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MerklePrefix message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerklePrefix.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerklePrefix(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key_prefix = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MerklePrefix message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerklePrefix.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerklePrefix message. - * @function verify - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerklePrefix.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key_prefix != null && message.hasOwnProperty("key_prefix")) - if (!(message.key_prefix && typeof message.key_prefix.length === "number" || $util.isString(message.key_prefix))) - return "key_prefix: buffer expected"; - return null; - }; - - /** - * Creates a MerklePrefix message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix - */ - MerklePrefix.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.commitment.v1.MerklePrefix) - return object; - var message = new $root.ibc.core.commitment.v1.MerklePrefix(); - if (object.key_prefix != null) - if (typeof object.key_prefix === "string") - $util.base64.decode(object.key_prefix, message.key_prefix = $util.newBuffer($util.base64.length(object.key_prefix)), 0); - else if (object.key_prefix.length) - message.key_prefix = object.key_prefix; - return message; - }; - - /** - * Creates a plain object from a MerklePrefix message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {ibc.core.commitment.v1.MerklePrefix} message MerklePrefix - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerklePrefix.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.key_prefix = ""; - else { - object.key_prefix = []; - if (options.bytes !== Array) - object.key_prefix = $util.newBuffer(object.key_prefix); - } - if (message.key_prefix != null && message.hasOwnProperty("key_prefix")) - object.key_prefix = options.bytes === String ? $util.base64.encode(message.key_prefix, 0, message.key_prefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.key_prefix) : message.key_prefix; - return object; - }; - - /** - * Converts this MerklePrefix to JSON. - * @function toJSON - * @memberof ibc.core.commitment.v1.MerklePrefix - * @instance - * @returns {Object.} JSON object - */ - MerklePrefix.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MerklePrefix; - })(); - - v1.MerklePath = (function() { - - /** - * Properties of a MerklePath. - * @memberof ibc.core.commitment.v1 - * @interface IMerklePath - * @property {Array.|null} [key_path] MerklePath key_path - */ - - /** - * Constructs a new MerklePath. - * @memberof ibc.core.commitment.v1 - * @classdesc Represents a MerklePath. - * @implements IMerklePath - * @constructor - * @param {ibc.core.commitment.v1.IMerklePath=} [properties] Properties to set - */ - function MerklePath(properties) { - this.key_path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MerklePath key_path. - * @member {Array.} key_path - * @memberof ibc.core.commitment.v1.MerklePath - * @instance - */ - MerklePath.prototype.key_path = $util.emptyArray; - - /** - * Encodes the specified MerklePath message. Does not implicitly {@link ibc.core.commitment.v1.MerklePath.verify|verify} messages. - * @function encode - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {ibc.core.commitment.v1.IMerklePath} message MerklePath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerklePath.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key_path != null && message.key_path.length) - for (var i = 0; i < message.key_path.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key_path[i]); - return writer; - }; - - /** - * Encodes the specified MerklePath message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerklePath.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {ibc.core.commitment.v1.IMerklePath} message MerklePath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerklePath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MerklePath message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.commitment.v1.MerklePath} MerklePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerklePath.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerklePath(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.key_path && message.key_path.length)) - message.key_path = []; - message.key_path.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MerklePath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.commitment.v1.MerklePath} MerklePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerklePath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerklePath message. - * @function verify - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerklePath.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key_path != null && message.hasOwnProperty("key_path")) { - if (!Array.isArray(message.key_path)) - return "key_path: array expected"; - for (var i = 0; i < message.key_path.length; ++i) - if (!$util.isString(message.key_path[i])) - return "key_path: string[] expected"; - } - return null; - }; - - /** - * Creates a MerklePath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.commitment.v1.MerklePath} MerklePath - */ - MerklePath.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.commitment.v1.MerklePath) - return object; - var message = new $root.ibc.core.commitment.v1.MerklePath(); - if (object.key_path) { - if (!Array.isArray(object.key_path)) - throw TypeError(".ibc.core.commitment.v1.MerklePath.key_path: array expected"); - message.key_path = []; - for (var i = 0; i < object.key_path.length; ++i) - message.key_path[i] = String(object.key_path[i]); - } - return message; - }; - - /** - * Creates a plain object from a MerklePath message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {ibc.core.commitment.v1.MerklePath} message MerklePath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerklePath.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.key_path = []; - if (message.key_path && message.key_path.length) { - object.key_path = []; - for (var j = 0; j < message.key_path.length; ++j) - object.key_path[j] = message.key_path[j]; - } - return object; - }; - - /** - * Converts this MerklePath to JSON. - * @function toJSON - * @memberof ibc.core.commitment.v1.MerklePath - * @instance - * @returns {Object.} JSON object - */ - MerklePath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MerklePath; - })(); - - v1.MerkleProof = (function() { - - /** - * Properties of a MerkleProof. - * @memberof ibc.core.commitment.v1 - * @interface IMerkleProof - * @property {Array.|null} [proofs] MerkleProof proofs - */ - - /** - * Constructs a new MerkleProof. - * @memberof ibc.core.commitment.v1 - * @classdesc Represents a MerkleProof. - * @implements IMerkleProof - * @constructor - * @param {ibc.core.commitment.v1.IMerkleProof=} [properties] Properties to set - */ - function MerkleProof(properties) { - this.proofs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MerkleProof proofs. - * @member {Array.} proofs - * @memberof ibc.core.commitment.v1.MerkleProof - * @instance - */ - MerkleProof.prototype.proofs = $util.emptyArray; - - /** - * Encodes the specified MerkleProof message. Does not implicitly {@link ibc.core.commitment.v1.MerkleProof.verify|verify} messages. - * @function encode - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {ibc.core.commitment.v1.IMerkleProof} message MerkleProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerkleProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proofs != null && message.proofs.length) - for (var i = 0; i < message.proofs.length; ++i) - $root.ics23.CommitmentProof.encode(message.proofs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MerkleProof message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerkleProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {ibc.core.commitment.v1.IMerkleProof} message MerkleProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerkleProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MerkleProof message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerkleProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerkleProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.proofs && message.proofs.length)) - message.proofs = []; - message.proofs.push($root.ics23.CommitmentProof.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MerkleProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerkleProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerkleProof message. - * @function verify - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerkleProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proofs != null && message.hasOwnProperty("proofs")) { - if (!Array.isArray(message.proofs)) - return "proofs: array expected"; - for (var i = 0; i < message.proofs.length; ++i) { - var error = $root.ics23.CommitmentProof.verify(message.proofs[i]); - if (error) - return "proofs." + error; - } - } - return null; - }; - - /** - * Creates a MerkleProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof - */ - MerkleProof.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.commitment.v1.MerkleProof) - return object; - var message = new $root.ibc.core.commitment.v1.MerkleProof(); - if (object.proofs) { - if (!Array.isArray(object.proofs)) - throw TypeError(".ibc.core.commitment.v1.MerkleProof.proofs: array expected"); - message.proofs = []; - for (var i = 0; i < object.proofs.length; ++i) { - if (typeof object.proofs[i] !== "object") - throw TypeError(".ibc.core.commitment.v1.MerkleProof.proofs: object expected"); - message.proofs[i] = $root.ics23.CommitmentProof.fromObject(object.proofs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MerkleProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {ibc.core.commitment.v1.MerkleProof} message MerkleProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerkleProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.proofs = []; - if (message.proofs && message.proofs.length) { - object.proofs = []; - for (var j = 0; j < message.proofs.length; ++j) - object.proofs[j] = $root.ics23.CommitmentProof.toObject(message.proofs[j], options); - } - return object; - }; - - /** - * Converts this MerkleProof to JSON. - * @function toJSON - * @memberof ibc.core.commitment.v1.MerkleProof - * @instance - * @returns {Object.} JSON object - */ - MerkleProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MerkleProof; - })(); - - return v1; - })(); - - return commitment; - })(); - - core.connection = (function() { - - /** - * Namespace connection. - * @memberof ibc.core - * @namespace - */ - var connection = {}; - - connection.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.connection - * @namespace - */ - var v1 = {}; - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenInit}. - * @memberof ibc.core.connection.v1.Msg - * @typedef ConnectionOpenInitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.MsgConnectionOpenInitResponse} [response] MsgConnectionOpenInitResponse - */ - - /** - * Calls ConnectionOpenInit. - * @function connectionOpenInit - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} request MsgConnectionOpenInit message or plain object - * @param {ibc.core.connection.v1.Msg.ConnectionOpenInitCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenInitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.connectionOpenInit = function connectionOpenInit(request, callback) { - return this.rpcCall(connectionOpenInit, $root.ibc.core.connection.v1.MsgConnectionOpenInit, $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse, request, callback); - }, "name", { value: "ConnectionOpenInit" }); - - /** - * Calls ConnectionOpenInit. - * @function connectionOpenInit - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} request MsgConnectionOpenInit message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenTry}. - * @memberof ibc.core.connection.v1.Msg - * @typedef ConnectionOpenTryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.MsgConnectionOpenTryResponse} [response] MsgConnectionOpenTryResponse - */ - - /** - * Calls ConnectionOpenTry. - * @function connectionOpenTry - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} request MsgConnectionOpenTry message or plain object - * @param {ibc.core.connection.v1.Msg.ConnectionOpenTryCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenTryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.connectionOpenTry = function connectionOpenTry(request, callback) { - return this.rpcCall(connectionOpenTry, $root.ibc.core.connection.v1.MsgConnectionOpenTry, $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse, request, callback); - }, "name", { value: "ConnectionOpenTry" }); - - /** - * Calls ConnectionOpenTry. - * @function connectionOpenTry - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} request MsgConnectionOpenTry message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenAck}. - * @memberof ibc.core.connection.v1.Msg - * @typedef ConnectionOpenAckCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.MsgConnectionOpenAckResponse} [response] MsgConnectionOpenAckResponse - */ - - /** - * Calls ConnectionOpenAck. - * @function connectionOpenAck - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} request MsgConnectionOpenAck message or plain object - * @param {ibc.core.connection.v1.Msg.ConnectionOpenAckCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenAckResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.connectionOpenAck = function connectionOpenAck(request, callback) { - return this.rpcCall(connectionOpenAck, $root.ibc.core.connection.v1.MsgConnectionOpenAck, $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse, request, callback); - }, "name", { value: "ConnectionOpenAck" }); - - /** - * Calls ConnectionOpenAck. - * @function connectionOpenAck - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} request MsgConnectionOpenAck message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenConfirm}. - * @memberof ibc.core.connection.v1.Msg - * @typedef ConnectionOpenConfirmCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} [response] MsgConnectionOpenConfirmResponse - */ - - /** - * Calls ConnectionOpenConfirm. - * @function connectionOpenConfirm - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} request MsgConnectionOpenConfirm message or plain object - * @param {ibc.core.connection.v1.Msg.ConnectionOpenConfirmCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenConfirmResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.connectionOpenConfirm = function connectionOpenConfirm(request, callback) { - return this.rpcCall(connectionOpenConfirm, $root.ibc.core.connection.v1.MsgConnectionOpenConfirm, $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse, request, callback); - }, "name", { value: "ConnectionOpenConfirm" }); - - /** - * Calls ConnectionOpenConfirm. - * @function connectionOpenConfirm - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} request MsgConnectionOpenConfirm message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1.MsgConnectionOpenInit = (function() { - - /** - * Properties of a MsgConnectionOpenInit. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenInit - * @property {string|null} [client_id] MsgConnectionOpenInit client_id - * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] MsgConnectionOpenInit counterparty - * @property {ibc.core.connection.v1.IVersion|null} [version] MsgConnectionOpenInit version - * @property {Long|null} [delay_period] MsgConnectionOpenInit delay_period - * @property {string|null} [signer] MsgConnectionOpenInit signer - */ - - /** - * Constructs a new MsgConnectionOpenInit. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenInit. - * @implements IMsgConnectionOpenInit - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit=} [properties] Properties to set - */ - function MsgConnectionOpenInit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgConnectionOpenInit client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.client_id = ""; - - /** - * MsgConnectionOpenInit counterparty. - * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.counterparty = null; - - /** - * MsgConnectionOpenInit version. - * @member {ibc.core.connection.v1.IVersion|null|undefined} version - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.version = null; - - /** - * MsgConnectionOpenInit delay_period. - * @member {Long} delay_period - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.delay_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgConnectionOpenInit signer. - * @member {string} signer - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.signer = ""; - - /** - * Encodes the specified MsgConnectionOpenInit message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInit.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} message MsgConnectionOpenInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenInit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.ibc.core.connection.v1.Version.encode(message.version, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.delay_period != null && Object.hasOwnProperty.call(message, "delay_period")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.delay_period); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenInit message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInit.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} message MsgConnectionOpenInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenInit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenInit message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenInit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenInit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 3: - message.version = $root.ibc.core.connection.v1.Version.decode(reader, reader.uint32()); - break; - case 4: - message.delay_period = reader.uint64(); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenInit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenInit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenInit message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenInit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - var error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.ibc.core.connection.v1.Version.verify(message.version); - if (error) - return "version." + error; - } - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (!$util.isInteger(message.delay_period) && !(message.delay_period && $util.isInteger(message.delay_period.low) && $util.isInteger(message.delay_period.high))) - return "delay_period: integer|Long expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenInit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit - */ - MsgConnectionOpenInit.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenInit) - return object; - var message = new $root.ibc.core.connection.v1.MsgConnectionOpenInit(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenInit.counterparty: object expected"); - message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); - } - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenInit.version: object expected"); - message.version = $root.ibc.core.connection.v1.Version.fromObject(object.version); - } - if (object.delay_period != null) - if ($util.Long) - (message.delay_period = $util.Long.fromValue(object.delay_period)).unsigned = true; - else if (typeof object.delay_period === "string") - message.delay_period = parseInt(object.delay_period, 10); - else if (typeof object.delay_period === "number") - message.delay_period = object.delay_period; - else if (typeof object.delay_period === "object") - message.delay_period = new $util.LongBits(object.delay_period.low >>> 0, object.delay_period.high >>> 0).toNumber(true); - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgConnectionOpenInit message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenInit} message MsgConnectionOpenInit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenInit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.counterparty = null; - object.version = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.delay_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.delay_period = options.longs === String ? "0" : 0; - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.ibc.core.connection.v1.Version.toObject(message.version, options); - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (typeof message.delay_period === "number") - object.delay_period = options.longs === String ? String(message.delay_period) : message.delay_period; - else - object.delay_period = options.longs === String ? $util.Long.prototype.toString.call(message.delay_period) : options.longs === Number ? new $util.LongBits(message.delay_period.low >>> 0, message.delay_period.high >>> 0).toNumber(true) : message.delay_period; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgConnectionOpenInit to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenInit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenInit; - })(); - - v1.MsgConnectionOpenInitResponse = (function() { - - /** - * Properties of a MsgConnectionOpenInitResponse. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenInitResponse - */ - - /** - * Constructs a new MsgConnectionOpenInitResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenInitResponse. - * @implements IMsgConnectionOpenInitResponse - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse=} [properties] Properties to set - */ - function MsgConnectionOpenInitResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgConnectionOpenInitResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInitResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse} message MsgConnectionOpenInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenInitResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenInitResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse} message MsgConnectionOpenInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenInitResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenInitResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenInitResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenInitResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenInitResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenInitResponse message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenInitResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenInitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse - */ - MsgConnectionOpenInitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse) - return object; - return new $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse(); - }; - - /** - * Creates a plain object from a MsgConnectionOpenInitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenInitResponse} message MsgConnectionOpenInitResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenInitResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgConnectionOpenInitResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenInitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenInitResponse; - })(); - - v1.MsgConnectionOpenTry = (function() { - - /** - * Properties of a MsgConnectionOpenTry. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenTry - * @property {string|null} [client_id] MsgConnectionOpenTry client_id - * @property {string|null} [previous_connection_id] MsgConnectionOpenTry previous_connection_id - * @property {google.protobuf.IAny|null} [client_state] MsgConnectionOpenTry client_state - * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] MsgConnectionOpenTry counterparty - * @property {Long|null} [delay_period] MsgConnectionOpenTry delay_period - * @property {Array.|null} [counterparty_versions] MsgConnectionOpenTry counterparty_versions - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgConnectionOpenTry proof_height - * @property {Uint8Array|null} [proof_init] MsgConnectionOpenTry proof_init - * @property {Uint8Array|null} [proof_client] MsgConnectionOpenTry proof_client - * @property {Uint8Array|null} [proof_consensus] MsgConnectionOpenTry proof_consensus - * @property {ibc.core.client.v1.IHeight|null} [consensus_height] MsgConnectionOpenTry consensus_height - * @property {string|null} [signer] MsgConnectionOpenTry signer - */ - - /** - * Constructs a new MsgConnectionOpenTry. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenTry. - * @implements IMsgConnectionOpenTry - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry=} [properties] Properties to set - */ - function MsgConnectionOpenTry(properties) { - this.counterparty_versions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgConnectionOpenTry client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.client_id = ""; - - /** - * MsgConnectionOpenTry previous_connection_id. - * @member {string} previous_connection_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.previous_connection_id = ""; - - /** - * MsgConnectionOpenTry client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.client_state = null; - - /** - * MsgConnectionOpenTry counterparty. - * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.counterparty = null; - - /** - * MsgConnectionOpenTry delay_period. - * @member {Long} delay_period - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.delay_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgConnectionOpenTry counterparty_versions. - * @member {Array.} counterparty_versions - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.counterparty_versions = $util.emptyArray; - - /** - * MsgConnectionOpenTry proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.proof_height = null; - - /** - * MsgConnectionOpenTry proof_init. - * @member {Uint8Array} proof_init - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.proof_init = $util.newBuffer([]); - - /** - * MsgConnectionOpenTry proof_client. - * @member {Uint8Array} proof_client - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.proof_client = $util.newBuffer([]); - - /** - * MsgConnectionOpenTry proof_consensus. - * @member {Uint8Array} proof_consensus - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.proof_consensus = $util.newBuffer([]); - - /** - * MsgConnectionOpenTry consensus_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} consensus_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.consensus_height = null; - - /** - * MsgConnectionOpenTry signer. - * @member {string} signer - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.signer = ""; - - /** - * Encodes the specified MsgConnectionOpenTry message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTry.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} message MsgConnectionOpenTry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenTry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.previous_connection_id != null && Object.hasOwnProperty.call(message, "previous_connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.previous_connection_id); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.delay_period != null && Object.hasOwnProperty.call(message, "delay_period")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.delay_period); - if (message.counterparty_versions != null && message.counterparty_versions.length) - for (var i = 0; i < message.counterparty_versions.length; ++i) - $root.ibc.core.connection.v1.Version.encode(message.counterparty_versions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.proof_init != null && Object.hasOwnProperty.call(message, "proof_init")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.proof_init); - if (message.proof_client != null && Object.hasOwnProperty.call(message, "proof_client")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.proof_client); - if (message.proof_consensus != null && Object.hasOwnProperty.call(message, "proof_consensus")) - writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.proof_consensus); - if (message.consensus_height != null && Object.hasOwnProperty.call(message, "consensus_height")) - $root.ibc.core.client.v1.Height.encode(message.consensus_height, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenTry message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTry.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} message MsgConnectionOpenTry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenTry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenTry message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenTry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenTry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.previous_connection_id = reader.string(); - break; - case 3: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 4: - message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 5: - message.delay_period = reader.uint64(); - break; - case 6: - if (!(message.counterparty_versions && message.counterparty_versions.length)) - message.counterparty_versions = []; - message.counterparty_versions.push($root.ibc.core.connection.v1.Version.decode(reader, reader.uint32())); - break; - case 7: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 8: - message.proof_init = reader.bytes(); - break; - case 9: - message.proof_client = reader.bytes(); - break; - case 10: - message.proof_consensus = reader.bytes(); - break; - case 11: - message.consensus_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 12: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenTry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenTry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenTry message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenTry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.previous_connection_id != null && message.hasOwnProperty("previous_connection_id")) - if (!$util.isString(message.previous_connection_id)) - return "previous_connection_id: string expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - var error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - var error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (!$util.isInteger(message.delay_period) && !(message.delay_period && $util.isInteger(message.delay_period.low) && $util.isInteger(message.delay_period.high))) - return "delay_period: integer|Long expected"; - if (message.counterparty_versions != null && message.hasOwnProperty("counterparty_versions")) { - if (!Array.isArray(message.counterparty_versions)) - return "counterparty_versions: array expected"; - for (var i = 0; i < message.counterparty_versions.length; ++i) { - var error = $root.ibc.core.connection.v1.Version.verify(message.counterparty_versions[i]); - if (error) - return "counterparty_versions." + error; - } - } - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - if (!(message.proof_init && typeof message.proof_init.length === "number" || $util.isString(message.proof_init))) - return "proof_init: buffer expected"; - if (message.proof_client != null && message.hasOwnProperty("proof_client")) - if (!(message.proof_client && typeof message.proof_client.length === "number" || $util.isString(message.proof_client))) - return "proof_client: buffer expected"; - if (message.proof_consensus != null && message.hasOwnProperty("proof_consensus")) - if (!(message.proof_consensus && typeof message.proof_consensus.length === "number" || $util.isString(message.proof_consensus))) - return "proof_consensus: buffer expected"; - if (message.consensus_height != null && message.hasOwnProperty("consensus_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.consensus_height); - if (error) - return "consensus_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenTry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry - */ - MsgConnectionOpenTry.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenTry) - return object; - var message = new $root.ibc.core.connection.v1.MsgConnectionOpenTry(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.previous_connection_id != null) - message.previous_connection_id = String(object.previous_connection_id); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.counterparty: object expected"); - message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); - } - if (object.delay_period != null) - if ($util.Long) - (message.delay_period = $util.Long.fromValue(object.delay_period)).unsigned = true; - else if (typeof object.delay_period === "string") - message.delay_period = parseInt(object.delay_period, 10); - else if (typeof object.delay_period === "number") - message.delay_period = object.delay_period; - else if (typeof object.delay_period === "object") - message.delay_period = new $util.LongBits(object.delay_period.low >>> 0, object.delay_period.high >>> 0).toNumber(true); - if (object.counterparty_versions) { - if (!Array.isArray(object.counterparty_versions)) - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.counterparty_versions: array expected"); - message.counterparty_versions = []; - for (var i = 0; i < object.counterparty_versions.length; ++i) { - if (typeof object.counterparty_versions[i] !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.counterparty_versions: object expected"); - message.counterparty_versions[i] = $root.ibc.core.connection.v1.Version.fromObject(object.counterparty_versions[i]); - } - } - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.proof_init != null) - if (typeof object.proof_init === "string") - $util.base64.decode(object.proof_init, message.proof_init = $util.newBuffer($util.base64.length(object.proof_init)), 0); - else if (object.proof_init.length) - message.proof_init = object.proof_init; - if (object.proof_client != null) - if (typeof object.proof_client === "string") - $util.base64.decode(object.proof_client, message.proof_client = $util.newBuffer($util.base64.length(object.proof_client)), 0); - else if (object.proof_client.length) - message.proof_client = object.proof_client; - if (object.proof_consensus != null) - if (typeof object.proof_consensus === "string") - $util.base64.decode(object.proof_consensus, message.proof_consensus = $util.newBuffer($util.base64.length(object.proof_consensus)), 0); - else if (object.proof_consensus.length) - message.proof_consensus = object.proof_consensus; - if (object.consensus_height != null) { - if (typeof object.consensus_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.consensus_height: object expected"); - message.consensus_height = $root.ibc.core.client.v1.Height.fromObject(object.consensus_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgConnectionOpenTry message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenTry} message MsgConnectionOpenTry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenTry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.counterparty_versions = []; - if (options.defaults) { - object.client_id = ""; - object.previous_connection_id = ""; - object.client_state = null; - object.counterparty = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.delay_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.delay_period = options.longs === String ? "0" : 0; - object.proof_height = null; - if (options.bytes === String) - object.proof_init = ""; - else { - object.proof_init = []; - if (options.bytes !== Array) - object.proof_init = $util.newBuffer(object.proof_init); - } - if (options.bytes === String) - object.proof_client = ""; - else { - object.proof_client = []; - if (options.bytes !== Array) - object.proof_client = $util.newBuffer(object.proof_client); - } - if (options.bytes === String) - object.proof_consensus = ""; - else { - object.proof_consensus = []; - if (options.bytes !== Array) - object.proof_consensus = $util.newBuffer(object.proof_consensus); - } - object.consensus_height = null; - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.previous_connection_id != null && message.hasOwnProperty("previous_connection_id")) - object.previous_connection_id = message.previous_connection_id; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (typeof message.delay_period === "number") - object.delay_period = options.longs === String ? String(message.delay_period) : message.delay_period; - else - object.delay_period = options.longs === String ? $util.Long.prototype.toString.call(message.delay_period) : options.longs === Number ? new $util.LongBits(message.delay_period.low >>> 0, message.delay_period.high >>> 0).toNumber(true) : message.delay_period; - if (message.counterparty_versions && message.counterparty_versions.length) { - object.counterparty_versions = []; - for (var j = 0; j < message.counterparty_versions.length; ++j) - object.counterparty_versions[j] = $root.ibc.core.connection.v1.Version.toObject(message.counterparty_versions[j], options); - } - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - object.proof_init = options.bytes === String ? $util.base64.encode(message.proof_init, 0, message.proof_init.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_init) : message.proof_init; - if (message.proof_client != null && message.hasOwnProperty("proof_client")) - object.proof_client = options.bytes === String ? $util.base64.encode(message.proof_client, 0, message.proof_client.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_client) : message.proof_client; - if (message.proof_consensus != null && message.hasOwnProperty("proof_consensus")) - object.proof_consensus = options.bytes === String ? $util.base64.encode(message.proof_consensus, 0, message.proof_consensus.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_consensus) : message.proof_consensus; - if (message.consensus_height != null && message.hasOwnProperty("consensus_height")) - object.consensus_height = $root.ibc.core.client.v1.Height.toObject(message.consensus_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgConnectionOpenTry to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenTry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenTry; - })(); - - v1.MsgConnectionOpenTryResponse = (function() { - - /** - * Properties of a MsgConnectionOpenTryResponse. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenTryResponse - */ - - /** - * Constructs a new MsgConnectionOpenTryResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenTryResponse. - * @implements IMsgConnectionOpenTryResponse - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse=} [properties] Properties to set - */ - function MsgConnectionOpenTryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgConnectionOpenTryResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTryResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse} message MsgConnectionOpenTryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenTryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenTryResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse} message MsgConnectionOpenTryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenTryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenTryResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenTryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenTryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenTryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenTryResponse message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenTryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenTryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse - */ - MsgConnectionOpenTryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse) - return object; - return new $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse(); - }; - - /** - * Creates a plain object from a MsgConnectionOpenTryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenTryResponse} message MsgConnectionOpenTryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenTryResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgConnectionOpenTryResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenTryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenTryResponse; - })(); - - v1.MsgConnectionOpenAck = (function() { - - /** - * Properties of a MsgConnectionOpenAck. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenAck - * @property {string|null} [connection_id] MsgConnectionOpenAck connection_id - * @property {string|null} [counterparty_connection_id] MsgConnectionOpenAck counterparty_connection_id - * @property {ibc.core.connection.v1.IVersion|null} [version] MsgConnectionOpenAck version - * @property {google.protobuf.IAny|null} [client_state] MsgConnectionOpenAck client_state - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgConnectionOpenAck proof_height - * @property {Uint8Array|null} [proof_try] MsgConnectionOpenAck proof_try - * @property {Uint8Array|null} [proof_client] MsgConnectionOpenAck proof_client - * @property {Uint8Array|null} [proof_consensus] MsgConnectionOpenAck proof_consensus - * @property {ibc.core.client.v1.IHeight|null} [consensus_height] MsgConnectionOpenAck consensus_height - * @property {string|null} [signer] MsgConnectionOpenAck signer - */ - - /** - * Constructs a new MsgConnectionOpenAck. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenAck. - * @implements IMsgConnectionOpenAck - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck=} [properties] Properties to set - */ - function MsgConnectionOpenAck(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgConnectionOpenAck connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.connection_id = ""; - - /** - * MsgConnectionOpenAck counterparty_connection_id. - * @member {string} counterparty_connection_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.counterparty_connection_id = ""; - - /** - * MsgConnectionOpenAck version. - * @member {ibc.core.connection.v1.IVersion|null|undefined} version - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.version = null; - - /** - * MsgConnectionOpenAck client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.client_state = null; - - /** - * MsgConnectionOpenAck proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.proof_height = null; - - /** - * MsgConnectionOpenAck proof_try. - * @member {Uint8Array} proof_try - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.proof_try = $util.newBuffer([]); - - /** - * MsgConnectionOpenAck proof_client. - * @member {Uint8Array} proof_client - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.proof_client = $util.newBuffer([]); - - /** - * MsgConnectionOpenAck proof_consensus. - * @member {Uint8Array} proof_consensus - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.proof_consensus = $util.newBuffer([]); - - /** - * MsgConnectionOpenAck consensus_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} consensus_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.consensus_height = null; - - /** - * MsgConnectionOpenAck signer. - * @member {string} signer - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.signer = ""; - - /** - * Encodes the specified MsgConnectionOpenAck message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAck.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} message MsgConnectionOpenAck message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenAck.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.counterparty_connection_id != null && Object.hasOwnProperty.call(message, "counterparty_connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_connection_id); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.ibc.core.connection.v1.Version.encode(message.version, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.proof_try != null && Object.hasOwnProperty.call(message, "proof_try")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.proof_try); - if (message.proof_client != null && Object.hasOwnProperty.call(message, "proof_client")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.proof_client); - if (message.proof_consensus != null && Object.hasOwnProperty.call(message, "proof_consensus")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.proof_consensus); - if (message.consensus_height != null && Object.hasOwnProperty.call(message, "consensus_height")) - $root.ibc.core.client.v1.Height.encode(message.consensus_height, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenAck message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAck.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} message MsgConnectionOpenAck message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenAck.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenAck message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenAck.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenAck(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.counterparty_connection_id = reader.string(); - break; - case 3: - message.version = $root.ibc.core.connection.v1.Version.decode(reader, reader.uint32()); - break; - case 4: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 5: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 6: - message.proof_try = reader.bytes(); - break; - case 7: - message.proof_client = reader.bytes(); - break; - case 8: - message.proof_consensus = reader.bytes(); - break; - case 9: - message.consensus_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 10: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenAck message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenAck.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenAck message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenAck.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.counterparty_connection_id != null && message.hasOwnProperty("counterparty_connection_id")) - if (!$util.isString(message.counterparty_connection_id)) - return "counterparty_connection_id: string expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.ibc.core.connection.v1.Version.verify(message.version); - if (error) - return "version." + error; - } - if (message.client_state != null && message.hasOwnProperty("client_state")) { - var error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.proof_try != null && message.hasOwnProperty("proof_try")) - if (!(message.proof_try && typeof message.proof_try.length === "number" || $util.isString(message.proof_try))) - return "proof_try: buffer expected"; - if (message.proof_client != null && message.hasOwnProperty("proof_client")) - if (!(message.proof_client && typeof message.proof_client.length === "number" || $util.isString(message.proof_client))) - return "proof_client: buffer expected"; - if (message.proof_consensus != null && message.hasOwnProperty("proof_consensus")) - if (!(message.proof_consensus && typeof message.proof_consensus.length === "number" || $util.isString(message.proof_consensus))) - return "proof_consensus: buffer expected"; - if (message.consensus_height != null && message.hasOwnProperty("consensus_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.consensus_height); - if (error) - return "consensus_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenAck message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck - */ - MsgConnectionOpenAck.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenAck) - return object; - var message = new $root.ibc.core.connection.v1.MsgConnectionOpenAck(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.counterparty_connection_id != null) - message.counterparty_connection_id = String(object.counterparty_connection_id); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.version: object expected"); - message.version = $root.ibc.core.connection.v1.Version.fromObject(object.version); - } - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.proof_try != null) - if (typeof object.proof_try === "string") - $util.base64.decode(object.proof_try, message.proof_try = $util.newBuffer($util.base64.length(object.proof_try)), 0); - else if (object.proof_try.length) - message.proof_try = object.proof_try; - if (object.proof_client != null) - if (typeof object.proof_client === "string") - $util.base64.decode(object.proof_client, message.proof_client = $util.newBuffer($util.base64.length(object.proof_client)), 0); - else if (object.proof_client.length) - message.proof_client = object.proof_client; - if (object.proof_consensus != null) - if (typeof object.proof_consensus === "string") - $util.base64.decode(object.proof_consensus, message.proof_consensus = $util.newBuffer($util.base64.length(object.proof_consensus)), 0); - else if (object.proof_consensus.length) - message.proof_consensus = object.proof_consensus; - if (object.consensus_height != null) { - if (typeof object.consensus_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.consensus_height: object expected"); - message.consensus_height = $root.ibc.core.client.v1.Height.fromObject(object.consensus_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgConnectionOpenAck message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenAck} message MsgConnectionOpenAck - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenAck.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connection_id = ""; - object.counterparty_connection_id = ""; - object.version = null; - object.client_state = null; - object.proof_height = null; - if (options.bytes === String) - object.proof_try = ""; - else { - object.proof_try = []; - if (options.bytes !== Array) - object.proof_try = $util.newBuffer(object.proof_try); - } - if (options.bytes === String) - object.proof_client = ""; - else { - object.proof_client = []; - if (options.bytes !== Array) - object.proof_client = $util.newBuffer(object.proof_client); - } - if (options.bytes === String) - object.proof_consensus = ""; - else { - object.proof_consensus = []; - if (options.bytes !== Array) - object.proof_consensus = $util.newBuffer(object.proof_consensus); - } - object.consensus_height = null; - object.signer = ""; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.counterparty_connection_id != null && message.hasOwnProperty("counterparty_connection_id")) - object.counterparty_connection_id = message.counterparty_connection_id; - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.ibc.core.connection.v1.Version.toObject(message.version, options); - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.proof_try != null && message.hasOwnProperty("proof_try")) - object.proof_try = options.bytes === String ? $util.base64.encode(message.proof_try, 0, message.proof_try.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_try) : message.proof_try; - if (message.proof_client != null && message.hasOwnProperty("proof_client")) - object.proof_client = options.bytes === String ? $util.base64.encode(message.proof_client, 0, message.proof_client.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_client) : message.proof_client; - if (message.proof_consensus != null && message.hasOwnProperty("proof_consensus")) - object.proof_consensus = options.bytes === String ? $util.base64.encode(message.proof_consensus, 0, message.proof_consensus.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_consensus) : message.proof_consensus; - if (message.consensus_height != null && message.hasOwnProperty("consensus_height")) - object.consensus_height = $root.ibc.core.client.v1.Height.toObject(message.consensus_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgConnectionOpenAck to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenAck.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenAck; - })(); - - v1.MsgConnectionOpenAckResponse = (function() { - - /** - * Properties of a MsgConnectionOpenAckResponse. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenAckResponse - */ - - /** - * Constructs a new MsgConnectionOpenAckResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenAckResponse. - * @implements IMsgConnectionOpenAckResponse - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse=} [properties] Properties to set - */ - function MsgConnectionOpenAckResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgConnectionOpenAckResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAckResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse} message MsgConnectionOpenAckResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenAckResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenAckResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAckResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse} message MsgConnectionOpenAckResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenAckResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenAckResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenAckResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenAckResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenAckResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenAckResponse message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenAckResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenAckResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse - */ - MsgConnectionOpenAckResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse) - return object; - return new $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse(); - }; - - /** - * Creates a plain object from a MsgConnectionOpenAckResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenAckResponse} message MsgConnectionOpenAckResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenAckResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgConnectionOpenAckResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenAckResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenAckResponse; - })(); - - v1.MsgConnectionOpenConfirm = (function() { - - /** - * Properties of a MsgConnectionOpenConfirm. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenConfirm - * @property {string|null} [connection_id] MsgConnectionOpenConfirm connection_id - * @property {Uint8Array|null} [proof_ack] MsgConnectionOpenConfirm proof_ack - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgConnectionOpenConfirm proof_height - * @property {string|null} [signer] MsgConnectionOpenConfirm signer - */ - - /** - * Constructs a new MsgConnectionOpenConfirm. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenConfirm. - * @implements IMsgConnectionOpenConfirm - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm=} [properties] Properties to set - */ - function MsgConnectionOpenConfirm(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgConnectionOpenConfirm connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - */ - MsgConnectionOpenConfirm.prototype.connection_id = ""; - - /** - * MsgConnectionOpenConfirm proof_ack. - * @member {Uint8Array} proof_ack - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - */ - MsgConnectionOpenConfirm.prototype.proof_ack = $util.newBuffer([]); - - /** - * MsgConnectionOpenConfirm proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - */ - MsgConnectionOpenConfirm.prototype.proof_height = null; - - /** - * MsgConnectionOpenConfirm signer. - * @member {string} signer - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - */ - MsgConnectionOpenConfirm.prototype.signer = ""; - - /** - * Encodes the specified MsgConnectionOpenConfirm message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirm.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} message MsgConnectionOpenConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenConfirm.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.proof_ack != null && Object.hasOwnProperty.call(message, "proof_ack")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof_ack); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenConfirm message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirm.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} message MsgConnectionOpenConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenConfirm.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenConfirm message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenConfirm.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenConfirm(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.proof_ack = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 4: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenConfirm message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenConfirm.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenConfirm message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenConfirm.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.proof_ack != null && message.hasOwnProperty("proof_ack")) - if (!(message.proof_ack && typeof message.proof_ack.length === "number" || $util.isString(message.proof_ack))) - return "proof_ack: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenConfirm message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm - */ - MsgConnectionOpenConfirm.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenConfirm) - return object; - var message = new $root.ibc.core.connection.v1.MsgConnectionOpenConfirm(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.proof_ack != null) - if (typeof object.proof_ack === "string") - $util.base64.decode(object.proof_ack, message.proof_ack = $util.newBuffer($util.base64.length(object.proof_ack)), 0); - else if (object.proof_ack.length) - message.proof_ack = object.proof_ack; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenConfirm.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgConnectionOpenConfirm message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenConfirm} message MsgConnectionOpenConfirm - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenConfirm.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connection_id = ""; - if (options.bytes === String) - object.proof_ack = ""; - else { - object.proof_ack = []; - if (options.bytes !== Array) - object.proof_ack = $util.newBuffer(object.proof_ack); - } - object.proof_height = null; - object.signer = ""; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.proof_ack != null && message.hasOwnProperty("proof_ack")) - object.proof_ack = options.bytes === String ? $util.base64.encode(message.proof_ack, 0, message.proof_ack.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_ack) : message.proof_ack; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgConnectionOpenConfirm to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenConfirm.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenConfirm; - })(); - - v1.MsgConnectionOpenConfirmResponse = (function() { - - /** - * Properties of a MsgConnectionOpenConfirmResponse. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenConfirmResponse - */ - - /** - * Constructs a new MsgConnectionOpenConfirmResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenConfirmResponse. - * @implements IMsgConnectionOpenConfirmResponse - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse=} [properties] Properties to set - */ - function MsgConnectionOpenConfirmResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgConnectionOpenConfirmResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirmResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse} message MsgConnectionOpenConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenConfirmResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirmResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse} message MsgConnectionOpenConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenConfirmResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenConfirmResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenConfirmResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenConfirmResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenConfirmResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenConfirmResponse message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenConfirmResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenConfirmResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse - */ - MsgConnectionOpenConfirmResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse) - return object; - return new $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse(); - }; - - /** - * Creates a plain object from a MsgConnectionOpenConfirmResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} message MsgConnectionOpenConfirmResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenConfirmResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgConnectionOpenConfirmResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenConfirmResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenConfirmResponse; - })(); - - v1.ConnectionEnd = (function() { - - /** - * Properties of a ConnectionEnd. - * @memberof ibc.core.connection.v1 - * @interface IConnectionEnd - * @property {string|null} [client_id] ConnectionEnd client_id - * @property {Array.|null} [versions] ConnectionEnd versions - * @property {ibc.core.connection.v1.State|null} [state] ConnectionEnd state - * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] ConnectionEnd counterparty - * @property {Long|null} [delay_period] ConnectionEnd delay_period - */ - - /** - * Constructs a new ConnectionEnd. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a ConnectionEnd. - * @implements IConnectionEnd - * @constructor - * @param {ibc.core.connection.v1.IConnectionEnd=} [properties] Properties to set - */ - function ConnectionEnd(properties) { - this.versions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionEnd client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.client_id = ""; - - /** - * ConnectionEnd versions. - * @member {Array.} versions - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.versions = $util.emptyArray; - - /** - * ConnectionEnd state. - * @member {ibc.core.connection.v1.State} state - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.state = 0; - - /** - * ConnectionEnd counterparty. - * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.counterparty = null; - - /** - * ConnectionEnd delay_period. - * @member {Long} delay_period - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.delay_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified ConnectionEnd message. Does not implicitly {@link ibc.core.connection.v1.ConnectionEnd.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {ibc.core.connection.v1.IConnectionEnd} message ConnectionEnd message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionEnd.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.versions != null && message.versions.length) - for (var i = 0; i < message.versions.length; ++i) - $root.ibc.core.connection.v1.Version.encode(message.versions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.delay_period != null && Object.hasOwnProperty.call(message, "delay_period")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.delay_period); - return writer; - }; - - /** - * Encodes the specified ConnectionEnd message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ConnectionEnd.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {ibc.core.connection.v1.IConnectionEnd} message ConnectionEnd message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionEnd.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionEnd message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionEnd.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.ConnectionEnd(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - if (!(message.versions && message.versions.length)) - message.versions = []; - message.versions.push($root.ibc.core.connection.v1.Version.decode(reader, reader.uint32())); - break; - case 3: - message.state = reader.int32(); - break; - case 4: - message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 5: - message.delay_period = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionEnd message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionEnd.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionEnd message. - * @function verify - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionEnd.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.versions != null && message.hasOwnProperty("versions")) { - if (!Array.isArray(message.versions)) - return "versions: array expected"; - for (var i = 0; i < message.versions.length; ++i) { - var error = $root.ibc.core.connection.v1.Version.verify(message.versions[i]); - if (error) - return "versions." + error; - } - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - var error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (!$util.isInteger(message.delay_period) && !(message.delay_period && $util.isInteger(message.delay_period.low) && $util.isInteger(message.delay_period.high))) - return "delay_period: integer|Long expected"; - return null; - }; - - /** - * Creates a ConnectionEnd message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd - */ - ConnectionEnd.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.ConnectionEnd) - return object; - var message = new $root.ibc.core.connection.v1.ConnectionEnd(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.versions) { - if (!Array.isArray(object.versions)) - throw TypeError(".ibc.core.connection.v1.ConnectionEnd.versions: array expected"); - message.versions = []; - for (var i = 0; i < object.versions.length; ++i) { - if (typeof object.versions[i] !== "object") - throw TypeError(".ibc.core.connection.v1.ConnectionEnd.versions: object expected"); - message.versions[i] = $root.ibc.core.connection.v1.Version.fromObject(object.versions[i]); - } - } - switch (object.state) { - case "STATE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STATE_INIT": - case 1: - message.state = 1; - break; - case "STATE_TRYOPEN": - case 2: - message.state = 2; - break; - case "STATE_OPEN": - case 3: - message.state = 3; - break; - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.connection.v1.ConnectionEnd.counterparty: object expected"); - message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); - } - if (object.delay_period != null) - if ($util.Long) - (message.delay_period = $util.Long.fromValue(object.delay_period)).unsigned = true; - else if (typeof object.delay_period === "string") - message.delay_period = parseInt(object.delay_period, 10); - else if (typeof object.delay_period === "number") - message.delay_period = object.delay_period; - else if (typeof object.delay_period === "object") - message.delay_period = new $util.LongBits(object.delay_period.low >>> 0, object.delay_period.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a ConnectionEnd message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {ibc.core.connection.v1.ConnectionEnd} message ConnectionEnd - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionEnd.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.versions = []; - if (options.defaults) { - object.client_id = ""; - object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; - object.counterparty = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.delay_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.delay_period = options.longs === String ? "0" : 0; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.versions && message.versions.length) { - object.versions = []; - for (var j = 0; j < message.versions.length; ++j) - object.versions[j] = $root.ibc.core.connection.v1.Version.toObject(message.versions[j], options); - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.ibc.core.connection.v1.State[message.state] : message.state; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (typeof message.delay_period === "number") - object.delay_period = options.longs === String ? String(message.delay_period) : message.delay_period; - else - object.delay_period = options.longs === String ? $util.Long.prototype.toString.call(message.delay_period) : options.longs === Number ? new $util.LongBits(message.delay_period.low >>> 0, message.delay_period.high >>> 0).toNumber(true) : message.delay_period; - return object; - }; - - /** - * Converts this ConnectionEnd to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - * @returns {Object.} JSON object - */ - ConnectionEnd.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConnectionEnd; - })(); - - v1.IdentifiedConnection = (function() { - - /** - * Properties of an IdentifiedConnection. - * @memberof ibc.core.connection.v1 - * @interface IIdentifiedConnection - * @property {string|null} [id] IdentifiedConnection id - * @property {string|null} [client_id] IdentifiedConnection client_id - * @property {Array.|null} [versions] IdentifiedConnection versions - * @property {ibc.core.connection.v1.State|null} [state] IdentifiedConnection state - * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] IdentifiedConnection counterparty - * @property {Long|null} [delay_period] IdentifiedConnection delay_period - */ - - /** - * Constructs a new IdentifiedConnection. - * @memberof ibc.core.connection.v1 - * @classdesc Represents an IdentifiedConnection. - * @implements IIdentifiedConnection - * @constructor - * @param {ibc.core.connection.v1.IIdentifiedConnection=} [properties] Properties to set - */ - function IdentifiedConnection(properties) { - this.versions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedConnection id. - * @member {string} id - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.id = ""; - - /** - * IdentifiedConnection client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.client_id = ""; - - /** - * IdentifiedConnection versions. - * @member {Array.} versions - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.versions = $util.emptyArray; - - /** - * IdentifiedConnection state. - * @member {ibc.core.connection.v1.State} state - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.state = 0; - - /** - * IdentifiedConnection counterparty. - * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.counterparty = null; - - /** - * IdentifiedConnection delay_period. - * @member {Long} delay_period - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.delay_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified IdentifiedConnection message. Does not implicitly {@link ibc.core.connection.v1.IdentifiedConnection.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {ibc.core.connection.v1.IIdentifiedConnection} message IdentifiedConnection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedConnection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.client_id); - if (message.versions != null && message.versions.length) - for (var i = 0; i < message.versions.length; ++i) - $root.ibc.core.connection.v1.Version.encode(message.versions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.delay_period != null && Object.hasOwnProperty.call(message, "delay_period")) - writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.delay_period); - return writer; - }; - - /** - * Encodes the specified IdentifiedConnection message, length delimited. Does not implicitly {@link ibc.core.connection.v1.IdentifiedConnection.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {ibc.core.connection.v1.IIdentifiedConnection} message IdentifiedConnection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedConnection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedConnection message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedConnection.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.IdentifiedConnection(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.client_id = reader.string(); - break; - case 3: - if (!(message.versions && message.versions.length)) - message.versions = []; - message.versions.push($root.ibc.core.connection.v1.Version.decode(reader, reader.uint32())); - break; - case 4: - message.state = reader.int32(); - break; - case 5: - message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 6: - message.delay_period = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedConnection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedConnection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedConnection message. - * @function verify - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedConnection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.versions != null && message.hasOwnProperty("versions")) { - if (!Array.isArray(message.versions)) - return "versions: array expected"; - for (var i = 0; i < message.versions.length; ++i) { - var error = $root.ibc.core.connection.v1.Version.verify(message.versions[i]); - if (error) - return "versions." + error; - } - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - var error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (!$util.isInteger(message.delay_period) && !(message.delay_period && $util.isInteger(message.delay_period.low) && $util.isInteger(message.delay_period.high))) - return "delay_period: integer|Long expected"; - return null; - }; - - /** - * Creates an IdentifiedConnection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection - */ - IdentifiedConnection.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.IdentifiedConnection) - return object; - var message = new $root.ibc.core.connection.v1.IdentifiedConnection(); - if (object.id != null) - message.id = String(object.id); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.versions) { - if (!Array.isArray(object.versions)) - throw TypeError(".ibc.core.connection.v1.IdentifiedConnection.versions: array expected"); - message.versions = []; - for (var i = 0; i < object.versions.length; ++i) { - if (typeof object.versions[i] !== "object") - throw TypeError(".ibc.core.connection.v1.IdentifiedConnection.versions: object expected"); - message.versions[i] = $root.ibc.core.connection.v1.Version.fromObject(object.versions[i]); - } - } - switch (object.state) { - case "STATE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STATE_INIT": - case 1: - message.state = 1; - break; - case "STATE_TRYOPEN": - case 2: - message.state = 2; - break; - case "STATE_OPEN": - case 3: - message.state = 3; - break; - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.connection.v1.IdentifiedConnection.counterparty: object expected"); - message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); - } - if (object.delay_period != null) - if ($util.Long) - (message.delay_period = $util.Long.fromValue(object.delay_period)).unsigned = true; - else if (typeof object.delay_period === "string") - message.delay_period = parseInt(object.delay_period, 10); - else if (typeof object.delay_period === "number") - message.delay_period = object.delay_period; - else if (typeof object.delay_period === "object") - message.delay_period = new $util.LongBits(object.delay_period.low >>> 0, object.delay_period.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an IdentifiedConnection message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {ibc.core.connection.v1.IdentifiedConnection} message IdentifiedConnection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedConnection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.versions = []; - if (options.defaults) { - object.id = ""; - object.client_id = ""; - object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; - object.counterparty = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.delay_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.delay_period = options.longs === String ? "0" : 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.versions && message.versions.length) { - object.versions = []; - for (var j = 0; j < message.versions.length; ++j) - object.versions[j] = $root.ibc.core.connection.v1.Version.toObject(message.versions[j], options); - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.ibc.core.connection.v1.State[message.state] : message.state; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (typeof message.delay_period === "number") - object.delay_period = options.longs === String ? String(message.delay_period) : message.delay_period; - else - object.delay_period = options.longs === String ? $util.Long.prototype.toString.call(message.delay_period) : options.longs === Number ? new $util.LongBits(message.delay_period.low >>> 0, message.delay_period.high >>> 0).toNumber(true) : message.delay_period; - return object; - }; - - /** - * Converts this IdentifiedConnection to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - * @returns {Object.} JSON object - */ - IdentifiedConnection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedConnection; - })(); - - /** - * State enum. - * @name ibc.core.connection.v1.State - * @enum {number} - * @property {number} STATE_UNINITIALIZED_UNSPECIFIED=0 STATE_UNINITIALIZED_UNSPECIFIED value - * @property {number} STATE_INIT=1 STATE_INIT value - * @property {number} STATE_TRYOPEN=2 STATE_TRYOPEN value - * @property {number} STATE_OPEN=3 STATE_OPEN value - */ - v1.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNINITIALIZED_UNSPECIFIED"] = 0; - values[valuesById[1] = "STATE_INIT"] = 1; - values[valuesById[2] = "STATE_TRYOPEN"] = 2; - values[valuesById[3] = "STATE_OPEN"] = 3; - return values; - })(); - - v1.Counterparty = (function() { - - /** - * Properties of a Counterparty. - * @memberof ibc.core.connection.v1 - * @interface ICounterparty - * @property {string|null} [client_id] Counterparty client_id - * @property {string|null} [connection_id] Counterparty connection_id - * @property {ibc.core.commitment.v1.IMerklePrefix|null} [prefix] Counterparty prefix - */ - - /** - * Constructs a new Counterparty. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Counterparty. - * @implements ICounterparty - * @constructor - * @param {ibc.core.connection.v1.ICounterparty=} [properties] Properties to set - */ - function Counterparty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Counterparty client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.Counterparty - * @instance - */ - Counterparty.prototype.client_id = ""; - - /** - * Counterparty connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.Counterparty - * @instance - */ - Counterparty.prototype.connection_id = ""; - - /** - * Counterparty prefix. - * @member {ibc.core.commitment.v1.IMerklePrefix|null|undefined} prefix - * @memberof ibc.core.connection.v1.Counterparty - * @instance - */ - Counterparty.prototype.prefix = null; - - /** - * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.connection.v1.Counterparty.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {ibc.core.connection.v1.ICounterparty} message Counterparty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counterparty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.connection_id); - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) - $root.ibc.core.commitment.v1.MerklePrefix.encode(message.prefix, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Counterparty message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Counterparty.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {ibc.core.connection.v1.ICounterparty} message Counterparty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counterparty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Counterparty message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.Counterparty} Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counterparty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.Counterparty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.connection_id = reader.string(); - break; - case 3: - message.prefix = $root.ibc.core.commitment.v1.MerklePrefix.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Counterparty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.Counterparty} Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counterparty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Counterparty message. - * @function verify - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Counterparty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.prefix != null && message.hasOwnProperty("prefix")) { - var error = $root.ibc.core.commitment.v1.MerklePrefix.verify(message.prefix); - if (error) - return "prefix." + error; - } - return null; - }; - - /** - * Creates a Counterparty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.Counterparty} Counterparty - */ - Counterparty.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.Counterparty) - return object; - var message = new $root.ibc.core.connection.v1.Counterparty(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.prefix != null) { - if (typeof object.prefix !== "object") - throw TypeError(".ibc.core.connection.v1.Counterparty.prefix: object expected"); - message.prefix = $root.ibc.core.commitment.v1.MerklePrefix.fromObject(object.prefix); - } - return message; - }; - - /** - * Creates a plain object from a Counterparty message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {ibc.core.connection.v1.Counterparty} message Counterparty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Counterparty.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.connection_id = ""; - object.prefix = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.prefix != null && message.hasOwnProperty("prefix")) - object.prefix = $root.ibc.core.commitment.v1.MerklePrefix.toObject(message.prefix, options); - return object; - }; - - /** - * Converts this Counterparty to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.Counterparty - * @instance - * @returns {Object.} JSON object - */ - Counterparty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Counterparty; - })(); - - v1.ClientPaths = (function() { - - /** - * Properties of a ClientPaths. - * @memberof ibc.core.connection.v1 - * @interface IClientPaths - * @property {Array.|null} [paths] ClientPaths paths - */ - - /** - * Constructs a new ClientPaths. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a ClientPaths. - * @implements IClientPaths - * @constructor - * @param {ibc.core.connection.v1.IClientPaths=} [properties] Properties to set - */ - function ClientPaths(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientPaths paths. - * @member {Array.} paths - * @memberof ibc.core.connection.v1.ClientPaths - * @instance - */ - ClientPaths.prototype.paths = $util.emptyArray; - - /** - * Encodes the specified ClientPaths message. Does not implicitly {@link ibc.core.connection.v1.ClientPaths.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {ibc.core.connection.v1.IClientPaths} message ClientPaths message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientPaths.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified ClientPaths message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ClientPaths.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {ibc.core.connection.v1.IClientPaths} message ClientPaths message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientPaths.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientPaths message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientPaths.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.ClientPaths(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientPaths message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientPaths.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientPaths message. - * @function verify - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientPaths.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a ClientPaths message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths - */ - ClientPaths.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.ClientPaths) - return object; - var message = new $root.ibc.core.connection.v1.ClientPaths(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".ibc.core.connection.v1.ClientPaths.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a ClientPaths message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {ibc.core.connection.v1.ClientPaths} message ClientPaths - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientPaths.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this ClientPaths to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.ClientPaths - * @instance - * @returns {Object.} JSON object - */ - ClientPaths.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientPaths; - })(); - - v1.ConnectionPaths = (function() { - - /** - * Properties of a ConnectionPaths. - * @memberof ibc.core.connection.v1 - * @interface IConnectionPaths - * @property {string|null} [client_id] ConnectionPaths client_id - * @property {Array.|null} [paths] ConnectionPaths paths - */ - - /** - * Constructs a new ConnectionPaths. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a ConnectionPaths. - * @implements IConnectionPaths - * @constructor - * @param {ibc.core.connection.v1.IConnectionPaths=} [properties] Properties to set - */ - function ConnectionPaths(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionPaths client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.ConnectionPaths - * @instance - */ - ConnectionPaths.prototype.client_id = ""; - - /** - * ConnectionPaths paths. - * @member {Array.} paths - * @memberof ibc.core.connection.v1.ConnectionPaths - * @instance - */ - ConnectionPaths.prototype.paths = $util.emptyArray; - - /** - * Encodes the specified ConnectionPaths message. Does not implicitly {@link ibc.core.connection.v1.ConnectionPaths.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {ibc.core.connection.v1.IConnectionPaths} message ConnectionPaths message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPaths.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified ConnectionPaths message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ConnectionPaths.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {ibc.core.connection.v1.IConnectionPaths} message ConnectionPaths message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPaths.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionPaths message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPaths.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.ConnectionPaths(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionPaths message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPaths.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionPaths message. - * @function verify - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionPaths.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a ConnectionPaths message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths - */ - ConnectionPaths.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.ConnectionPaths) - return object; - var message = new $root.ibc.core.connection.v1.ConnectionPaths(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".ibc.core.connection.v1.ConnectionPaths.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a ConnectionPaths message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {ibc.core.connection.v1.ConnectionPaths} message ConnectionPaths - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionPaths.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this ConnectionPaths to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.ConnectionPaths - * @instance - * @returns {Object.} JSON object - */ - ConnectionPaths.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConnectionPaths; - })(); - - v1.Version = (function() { - - /** - * Properties of a Version. - * @memberof ibc.core.connection.v1 - * @interface IVersion - * @property {string|null} [identifier] Version identifier - * @property {Array.|null} [features] Version features - */ - - /** - * Constructs a new Version. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Version. - * @implements IVersion - * @constructor - * @param {ibc.core.connection.v1.IVersion=} [properties] Properties to set - */ - function Version(properties) { - this.features = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Version identifier. - * @member {string} identifier - * @memberof ibc.core.connection.v1.Version - * @instance - */ - Version.prototype.identifier = ""; - - /** - * Version features. - * @member {Array.} features - * @memberof ibc.core.connection.v1.Version - * @instance - */ - Version.prototype.features = $util.emptyArray; - - /** - * Encodes the specified Version message. Does not implicitly {@link ibc.core.connection.v1.Version.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.Version - * @static - * @param {ibc.core.connection.v1.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.identifier); - if (message.features != null && message.features.length) - for (var i = 0; i < message.features.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.features[i]); - return writer; - }; - - /** - * Encodes the specified Version message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Version.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.Version - * @static - * @param {ibc.core.connection.v1.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Version message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.Version(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identifier = reader.string(); - break; - case 2: - if (!(message.features && message.features.length)) - message.features = []; - message.features.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Version message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Version message. - * @function verify - * @memberof ibc.core.connection.v1.Version - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Version.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identifier != null && message.hasOwnProperty("identifier")) - if (!$util.isString(message.identifier)) - return "identifier: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - if (!Array.isArray(message.features)) - return "features: array expected"; - for (var i = 0; i < message.features.length; ++i) - if (!$util.isString(message.features[i])) - return "features: string[] expected"; - } - return null; - }; - - /** - * Creates a Version message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.Version - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.Version} Version - */ - Version.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.Version) - return object; - var message = new $root.ibc.core.connection.v1.Version(); - if (object.identifier != null) - message.identifier = String(object.identifier); - if (object.features) { - if (!Array.isArray(object.features)) - throw TypeError(".ibc.core.connection.v1.Version.features: array expected"); - message.features = []; - for (var i = 0; i < object.features.length; ++i) - message.features[i] = String(object.features[i]); - } - return message; - }; - - /** - * Creates a plain object from a Version message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.Version - * @static - * @param {ibc.core.connection.v1.Version} message Version - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Version.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.features = []; - if (options.defaults) - object.identifier = ""; - if (message.identifier != null && message.hasOwnProperty("identifier")) - object.identifier = message.identifier; - if (message.features && message.features.length) { - object.features = []; - for (var j = 0; j < message.features.length; ++j) - object.features[j] = message.features[j]; - } - return object; - }; - - /** - * Converts this Version to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.Version - * @instance - * @returns {Object.} JSON object - */ - Version.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Version; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.core.connection.v1 - * @interface IParams - * @property {Long|null} [max_expected_time_per_block] Params max_expected_time_per_block - */ - - /** - * Constructs a new Params. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.core.connection.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params max_expected_time_per_block. - * @member {Long} max_expected_time_per_block - * @memberof ibc.core.connection.v1.Params - * @instance - */ - Params.prototype.max_expected_time_per_block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.core.connection.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.Params - * @static - * @param {ibc.core.connection.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.max_expected_time_per_block != null && Object.hasOwnProperty.call(message, "max_expected_time_per_block")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.max_expected_time_per_block); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.Params - * @static - * @param {ibc.core.connection.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_expected_time_per_block = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.core.connection.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.max_expected_time_per_block != null && message.hasOwnProperty("max_expected_time_per_block")) - if (!$util.isInteger(message.max_expected_time_per_block) && !(message.max_expected_time_per_block && $util.isInteger(message.max_expected_time_per_block.low) && $util.isInteger(message.max_expected_time_per_block.high))) - return "max_expected_time_per_block: integer|Long expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.Params) - return object; - var message = new $root.ibc.core.connection.v1.Params(); - if (object.max_expected_time_per_block != null) - if ($util.Long) - (message.max_expected_time_per_block = $util.Long.fromValue(object.max_expected_time_per_block)).unsigned = true; - else if (typeof object.max_expected_time_per_block === "string") - message.max_expected_time_per_block = parseInt(object.max_expected_time_per_block, 10); - else if (typeof object.max_expected_time_per_block === "number") - message.max_expected_time_per_block = object.max_expected_time_per_block; - else if (typeof object.max_expected_time_per_block === "object") - message.max_expected_time_per_block = new $util.LongBits(object.max_expected_time_per_block.low >>> 0, object.max_expected_time_per_block.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.Params - * @static - * @param {ibc.core.connection.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.max_expected_time_per_block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_expected_time_per_block = options.longs === String ? "0" : 0; - if (message.max_expected_time_per_block != null && message.hasOwnProperty("max_expected_time_per_block")) - if (typeof message.max_expected_time_per_block === "number") - object.max_expected_time_per_block = options.longs === String ? String(message.max_expected_time_per_block) : message.max_expected_time_per_block; - else - object.max_expected_time_per_block = options.longs === String ? $util.Long.prototype.toString.call(message.max_expected_time_per_block) : options.longs === Number ? new $util.LongBits(message.max_expected_time_per_block.low >>> 0, message.max_expected_time_per_block.high >>> 0).toNumber(true) : message.max_expected_time_per_block; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connection}. - * @memberof ibc.core.connection.v1.Query - * @typedef ConnectionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryConnectionResponse} [response] QueryConnectionResponse - */ - - /** - * Calls Connection. - * @function connection - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionRequest} request QueryConnectionRequest message or plain object - * @param {ibc.core.connection.v1.Query.ConnectionCallback} callback Node-style callback called with the error, if any, and QueryConnectionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connection = function connection(request, callback) { - return this.rpcCall(connection, $root.ibc.core.connection.v1.QueryConnectionRequest, $root.ibc.core.connection.v1.QueryConnectionResponse, request, callback); - }, "name", { value: "Connection" }); - - /** - * Calls Connection. - * @function connection - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionRequest} request QueryConnectionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connections}. - * @memberof ibc.core.connection.v1.Query - * @typedef ConnectionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryConnectionsResponse} [response] QueryConnectionsResponse - */ - - /** - * Calls Connections. - * @function connections - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionsRequest} request QueryConnectionsRequest message or plain object - * @param {ibc.core.connection.v1.Query.ConnectionsCallback} callback Node-style callback called with the error, if any, and QueryConnectionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connections = function connections(request, callback) { - return this.rpcCall(connections, $root.ibc.core.connection.v1.QueryConnectionsRequest, $root.ibc.core.connection.v1.QueryConnectionsResponse, request, callback); - }, "name", { value: "Connections" }); - - /** - * Calls Connections. - * @function connections - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionsRequest} request QueryConnectionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#clientConnections}. - * @memberof ibc.core.connection.v1.Query - * @typedef ClientConnectionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryClientConnectionsResponse} [response] QueryClientConnectionsResponse - */ - - /** - * Calls ClientConnections. - * @function clientConnections - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} request QueryClientConnectionsRequest message or plain object - * @param {ibc.core.connection.v1.Query.ClientConnectionsCallback} callback Node-style callback called with the error, if any, and QueryClientConnectionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientConnections = function clientConnections(request, callback) { - return this.rpcCall(clientConnections, $root.ibc.core.connection.v1.QueryClientConnectionsRequest, $root.ibc.core.connection.v1.QueryClientConnectionsResponse, request, callback); - }, "name", { value: "ClientConnections" }); - - /** - * Calls ClientConnections. - * @function clientConnections - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} request QueryClientConnectionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connectionClientState}. - * @memberof ibc.core.connection.v1.Query - * @typedef ConnectionClientStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryConnectionClientStateResponse} [response] QueryConnectionClientStateResponse - */ - - /** - * Calls ConnectionClientState. - * @function connectionClientState - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} request QueryConnectionClientStateRequest message or plain object - * @param {ibc.core.connection.v1.Query.ConnectionClientStateCallback} callback Node-style callback called with the error, if any, and QueryConnectionClientStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connectionClientState = function connectionClientState(request, callback) { - return this.rpcCall(connectionClientState, $root.ibc.core.connection.v1.QueryConnectionClientStateRequest, $root.ibc.core.connection.v1.QueryConnectionClientStateResponse, request, callback); - }, "name", { value: "ConnectionClientState" }); - - /** - * Calls ConnectionClientState. - * @function connectionClientState - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} request QueryConnectionClientStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connectionConsensusState}. - * @memberof ibc.core.connection.v1.Query - * @typedef ConnectionConsensusStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} [response] QueryConnectionConsensusStateResponse - */ - - /** - * Calls ConnectionConsensusState. - * @function connectionConsensusState - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} request QueryConnectionConsensusStateRequest message or plain object - * @param {ibc.core.connection.v1.Query.ConnectionConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryConnectionConsensusStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connectionConsensusState = function connectionConsensusState(request, callback) { - return this.rpcCall(connectionConsensusState, $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest, $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse, request, callback); - }, "name", { value: "ConnectionConsensusState" }); - - /** - * Calls ConnectionConsensusState. - * @function connectionConsensusState - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} request QueryConnectionConsensusStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryConnectionRequest = (function() { - - /** - * Properties of a QueryConnectionRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionRequest - * @property {string|null} [connection_id] QueryConnectionRequest connection_id - */ - - /** - * Constructs a new QueryConnectionRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionRequest. - * @implements IQueryConnectionRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionRequest=} [properties] Properties to set - */ - function QueryConnectionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionRequest connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @instance - */ - QueryConnectionRequest.prototype.connection_id = ""; - - /** - * Encodes the specified QueryConnectionRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionRequest} message QueryConnectionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - return writer; - }; - - /** - * Encodes the specified QueryConnectionRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionRequest} message QueryConnectionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - return null; - }; - - /** - * Creates a QueryConnectionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest - */ - QueryConnectionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionRequest) - return object; - var message = new $root.ibc.core.connection.v1.QueryConnectionRequest(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - return message; - }; - - /** - * Creates a plain object from a QueryConnectionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {ibc.core.connection.v1.QueryConnectionRequest} message QueryConnectionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.connection_id = ""; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - return object; - }; - - /** - * Converts this QueryConnectionRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionRequest; - })(); - - v1.QueryConnectionResponse = (function() { - - /** - * Properties of a QueryConnectionResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionResponse - * @property {ibc.core.connection.v1.IConnectionEnd|null} [connection] QueryConnectionResponse connection - * @property {Uint8Array|null} [proof] QueryConnectionResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryConnectionResponse proof_height - */ - - /** - * Constructs a new QueryConnectionResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionResponse. - * @implements IQueryConnectionResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionResponse=} [properties] Properties to set - */ - function QueryConnectionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionResponse connection. - * @member {ibc.core.connection.v1.IConnectionEnd|null|undefined} connection - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @instance - */ - QueryConnectionResponse.prototype.connection = null; - - /** - * QueryConnectionResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @instance - */ - QueryConnectionResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryConnectionResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @instance - */ - QueryConnectionResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryConnectionResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionResponse} message QueryConnectionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - $root.ibc.core.connection.v1.ConnectionEnd.encode(message.connection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionResponse} message QueryConnectionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection != null && message.hasOwnProperty("connection")) { - var error = $root.ibc.core.connection.v1.ConnectionEnd.verify(message.connection); - if (error) - return "connection." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse - */ - QueryConnectionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionResponse) - return object; - var message = new $root.ibc.core.connection.v1.QueryConnectionResponse(); - if (object.connection != null) { - if (typeof object.connection !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionResponse.connection: object expected"); - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.fromObject(object.connection); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {ibc.core.connection.v1.QueryConnectionResponse} message QueryConnectionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connection = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = $root.ibc.core.connection.v1.ConnectionEnd.toObject(message.connection, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryConnectionResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionResponse; - })(); - - v1.QueryConnectionsRequest = (function() { - - /** - * Properties of a QueryConnectionsRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionsRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConnectionsRequest pagination - */ - - /** - * Constructs a new QueryConnectionsRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionsRequest. - * @implements IQueryConnectionsRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionsRequest=} [properties] Properties to set - */ - function QueryConnectionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @instance - */ - QueryConnectionsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionsRequest} message QueryConnectionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionsRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionsRequest} message QueryConnectionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionsRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest - */ - QueryConnectionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionsRequest) - return object; - var message = new $root.ibc.core.connection.v1.QueryConnectionsRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {ibc.core.connection.v1.QueryConnectionsRequest} message QueryConnectionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConnectionsRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionsRequest; - })(); - - v1.QueryConnectionsResponse = (function() { - - /** - * Properties of a QueryConnectionsResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionsResponse - * @property {Array.|null} [connections] QueryConnectionsResponse connections - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConnectionsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryConnectionsResponse height - */ - - /** - * Constructs a new QueryConnectionsResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionsResponse. - * @implements IQueryConnectionsResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionsResponse=} [properties] Properties to set - */ - function QueryConnectionsResponse(properties) { - this.connections = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionsResponse connections. - * @member {Array.} connections - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @instance - */ - QueryConnectionsResponse.prototype.connections = $util.emptyArray; - - /** - * QueryConnectionsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @instance - */ - QueryConnectionsResponse.prototype.pagination = null; - - /** - * QueryConnectionsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @instance - */ - QueryConnectionsResponse.prototype.height = null; - - /** - * Encodes the specified QueryConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionsResponse} message QueryConnectionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connections != null && message.connections.length) - for (var i = 0; i < message.connections.length; ++i) - $root.ibc.core.connection.v1.IdentifiedConnection.encode(message.connections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionsResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionsResponse} message QueryConnectionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.connections && message.connections.length)) - message.connections = []; - message.connections.push($root.ibc.core.connection.v1.IdentifiedConnection.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionsResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connections != null && message.hasOwnProperty("connections")) { - if (!Array.isArray(message.connections)) - return "connections: array expected"; - for (var i = 0; i < message.connections.length; ++i) { - var error = $root.ibc.core.connection.v1.IdentifiedConnection.verify(message.connections[i]); - if (error) - return "connections." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse - */ - QueryConnectionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionsResponse) - return object; - var message = new $root.ibc.core.connection.v1.QueryConnectionsResponse(); - if (object.connections) { - if (!Array.isArray(object.connections)) - throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.connections: array expected"); - message.connections = []; - for (var i = 0; i < object.connections.length; ++i) { - if (typeof object.connections[i] !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.connections: object expected"); - message.connections[i] = $root.ibc.core.connection.v1.IdentifiedConnection.fromObject(object.connections[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {ibc.core.connection.v1.QueryConnectionsResponse} message QueryConnectionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.connections = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.connections && message.connections.length) { - object.connections = []; - for (var j = 0; j < message.connections.length; ++j) - object.connections[j] = $root.ibc.core.connection.v1.IdentifiedConnection.toObject(message.connections[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryConnectionsResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionsResponse; - })(); - - v1.QueryClientConnectionsRequest = (function() { - - /** - * Properties of a QueryClientConnectionsRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryClientConnectionsRequest - * @property {string|null} [client_id] QueryClientConnectionsRequest client_id - */ - - /** - * Constructs a new QueryClientConnectionsRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryClientConnectionsRequest. - * @implements IQueryClientConnectionsRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest=} [properties] Properties to set - */ - function QueryClientConnectionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientConnectionsRequest client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @instance - */ - QueryClientConnectionsRequest.prototype.client_id = ""; - - /** - * Encodes the specified QueryClientConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} message QueryClientConnectionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientConnectionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - return writer; - }; - - /** - * Encodes the specified QueryClientConnectionsRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} message QueryClientConnectionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientConnectionsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientConnectionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryClientConnectionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientConnectionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientConnectionsRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientConnectionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - return null; - }; - - /** - * Creates a QueryClientConnectionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest - */ - QueryClientConnectionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryClientConnectionsRequest) - return object; - var message = new $root.ibc.core.connection.v1.QueryClientConnectionsRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - return message; - }; - - /** - * Creates a plain object from a QueryClientConnectionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {ibc.core.connection.v1.QueryClientConnectionsRequest} message QueryClientConnectionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientConnectionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - return object; - }; - - /** - * Converts this QueryClientConnectionsRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientConnectionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientConnectionsRequest; - })(); - - v1.QueryClientConnectionsResponse = (function() { - - /** - * Properties of a QueryClientConnectionsResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryClientConnectionsResponse - * @property {Array.|null} [connection_paths] QueryClientConnectionsResponse connection_paths - * @property {Uint8Array|null} [proof] QueryClientConnectionsResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryClientConnectionsResponse proof_height - */ - - /** - * Constructs a new QueryClientConnectionsResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryClientConnectionsResponse. - * @implements IQueryClientConnectionsResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse=} [properties] Properties to set - */ - function QueryClientConnectionsResponse(properties) { - this.connection_paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientConnectionsResponse connection_paths. - * @member {Array.} connection_paths - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @instance - */ - QueryClientConnectionsResponse.prototype.connection_paths = $util.emptyArray; - - /** - * QueryClientConnectionsResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @instance - */ - QueryClientConnectionsResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryClientConnectionsResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @instance - */ - QueryClientConnectionsResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryClientConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse} message QueryClientConnectionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientConnectionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_paths != null && message.connection_paths.length) - for (var i = 0; i < message.connection_paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_paths[i]); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientConnectionsResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse} message QueryClientConnectionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientConnectionsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientConnectionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryClientConnectionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.connection_paths && message.connection_paths.length)) - message.connection_paths = []; - message.connection_paths.push(reader.string()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientConnectionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientConnectionsResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientConnectionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_paths != null && message.hasOwnProperty("connection_paths")) { - if (!Array.isArray(message.connection_paths)) - return "connection_paths: array expected"; - for (var i = 0; i < message.connection_paths.length; ++i) - if (!$util.isString(message.connection_paths[i])) - return "connection_paths: string[] expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryClientConnectionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse - */ - QueryClientConnectionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryClientConnectionsResponse) - return object; - var message = new $root.ibc.core.connection.v1.QueryClientConnectionsResponse(); - if (object.connection_paths) { - if (!Array.isArray(object.connection_paths)) - throw TypeError(".ibc.core.connection.v1.QueryClientConnectionsResponse.connection_paths: array expected"); - message.connection_paths = []; - for (var i = 0; i < object.connection_paths.length; ++i) - message.connection_paths[i] = String(object.connection_paths[i]); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryClientConnectionsResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientConnectionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {ibc.core.connection.v1.QueryClientConnectionsResponse} message QueryClientConnectionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientConnectionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.connection_paths = []; - if (options.defaults) { - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.connection_paths && message.connection_paths.length) { - object.connection_paths = []; - for (var j = 0; j < message.connection_paths.length; ++j) - object.connection_paths[j] = message.connection_paths[j]; - } - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryClientConnectionsResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientConnectionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientConnectionsResponse; - })(); - - v1.QueryConnectionClientStateRequest = (function() { - - /** - * Properties of a QueryConnectionClientStateRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionClientStateRequest - * @property {string|null} [connection_id] QueryConnectionClientStateRequest connection_id - */ - - /** - * Constructs a new QueryConnectionClientStateRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionClientStateRequest. - * @implements IQueryConnectionClientStateRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest=} [properties] Properties to set - */ - function QueryConnectionClientStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionClientStateRequest connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @instance - */ - QueryConnectionClientStateRequest.prototype.connection_id = ""; - - /** - * Encodes the specified QueryConnectionClientStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} message QueryConnectionClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionClientStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - return writer; - }; - - /** - * Encodes the specified QueryConnectionClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} message QueryConnectionClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionClientStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionClientStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionClientStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionClientStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionClientStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionClientStateRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionClientStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - return null; - }; - - /** - * Creates a QueryConnectionClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest - */ - QueryConnectionClientStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionClientStateRequest) - return object; - var message = new $root.ibc.core.connection.v1.QueryConnectionClientStateRequest(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - return message; - }; - - /** - * Creates a plain object from a QueryConnectionClientStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {ibc.core.connection.v1.QueryConnectionClientStateRequest} message QueryConnectionClientStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionClientStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.connection_id = ""; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - return object; - }; - - /** - * Converts this QueryConnectionClientStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionClientStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionClientStateRequest; - })(); - - v1.QueryConnectionClientStateResponse = (function() { - - /** - * Properties of a QueryConnectionClientStateResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionClientStateResponse - * @property {ibc.core.client.v1.IIdentifiedClientState|null} [identified_client_state] QueryConnectionClientStateResponse identified_client_state - * @property {Uint8Array|null} [proof] QueryConnectionClientStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryConnectionClientStateResponse proof_height - */ - - /** - * Constructs a new QueryConnectionClientStateResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionClientStateResponse. - * @implements IQueryConnectionClientStateResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse=} [properties] Properties to set - */ - function QueryConnectionClientStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionClientStateResponse identified_client_state. - * @member {ibc.core.client.v1.IIdentifiedClientState|null|undefined} identified_client_state - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @instance - */ - QueryConnectionClientStateResponse.prototype.identified_client_state = null; - - /** - * QueryConnectionClientStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @instance - */ - QueryConnectionClientStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryConnectionClientStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @instance - */ - QueryConnectionClientStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryConnectionClientStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse} message QueryConnectionClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionClientStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identified_client_state != null && Object.hasOwnProperty.call(message, "identified_client_state")) - $root.ibc.core.client.v1.IdentifiedClientState.encode(message.identified_client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse} message QueryConnectionClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionClientStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionClientStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionClientStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionClientStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionClientStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionClientStateResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionClientStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identified_client_state != null && message.hasOwnProperty("identified_client_state")) { - var error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.identified_client_state); - if (error) - return "identified_client_state." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse - */ - QueryConnectionClientStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionClientStateResponse) - return object; - var message = new $root.ibc.core.connection.v1.QueryConnectionClientStateResponse(); - if (object.identified_client_state != null) { - if (typeof object.identified_client_state !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionClientStateResponse.identified_client_state: object expected"); - message.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.identified_client_state); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionClientStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionClientStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {ibc.core.connection.v1.QueryConnectionClientStateResponse} message QueryConnectionClientStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionClientStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.identified_client_state = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.identified_client_state != null && message.hasOwnProperty("identified_client_state")) - object.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.identified_client_state, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryConnectionClientStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionClientStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionClientStateResponse; - })(); - - v1.QueryConnectionConsensusStateRequest = (function() { - - /** - * Properties of a QueryConnectionConsensusStateRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionConsensusStateRequest - * @property {string|null} [connection_id] QueryConnectionConsensusStateRequest connection_id - * @property {Long|null} [revision_number] QueryConnectionConsensusStateRequest revision_number - * @property {Long|null} [revision_height] QueryConnectionConsensusStateRequest revision_height - */ - - /** - * Constructs a new QueryConnectionConsensusStateRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionConsensusStateRequest. - * @implements IQueryConnectionConsensusStateRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest=} [properties] Properties to set - */ - function QueryConnectionConsensusStateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionConsensusStateRequest connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @instance - */ - QueryConnectionConsensusStateRequest.prototype.connection_id = ""; - - /** - * QueryConnectionConsensusStateRequest revision_number. - * @member {Long} revision_number - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @instance - */ - QueryConnectionConsensusStateRequest.prototype.revision_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryConnectionConsensusStateRequest revision_height. - * @member {Long} revision_height - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @instance - */ - QueryConnectionConsensusStateRequest.prototype.revision_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryConnectionConsensusStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} message QueryConnectionConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionConsensusStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.revision_number != null && Object.hasOwnProperty.call(message, "revision_number")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision_number); - if (message.revision_height != null && Object.hasOwnProperty.call(message, "revision_height")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revision_height); - return writer; - }; - - /** - * Encodes the specified QueryConnectionConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} message QueryConnectionConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionConsensusStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionConsensusStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.revision_number = reader.uint64(); - break; - case 3: - message.revision_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionConsensusStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionConsensusStateRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionConsensusStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (!$util.isInteger(message.revision_number) && !(message.revision_number && $util.isInteger(message.revision_number.low) && $util.isInteger(message.revision_number.high))) - return "revision_number: integer|Long expected"; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (!$util.isInteger(message.revision_height) && !(message.revision_height && $util.isInteger(message.revision_height.low) && $util.isInteger(message.revision_height.high))) - return "revision_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryConnectionConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest - */ - QueryConnectionConsensusStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest) - return object; - var message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.revision_number != null) - if ($util.Long) - (message.revision_number = $util.Long.fromValue(object.revision_number)).unsigned = true; - else if (typeof object.revision_number === "string") - message.revision_number = parseInt(object.revision_number, 10); - else if (typeof object.revision_number === "number") - message.revision_number = object.revision_number; - else if (typeof object.revision_number === "object") - message.revision_number = new $util.LongBits(object.revision_number.low >>> 0, object.revision_number.high >>> 0).toNumber(true); - if (object.revision_height != null) - if ($util.Long) - (message.revision_height = $util.Long.fromValue(object.revision_height)).unsigned = true; - else if (typeof object.revision_height === "string") - message.revision_height = parseInt(object.revision_height, 10); - else if (typeof object.revision_height === "number") - message.revision_height = object.revision_height; - else if (typeof object.revision_height === "object") - message.revision_height = new $util.LongBits(object.revision_height.low >>> 0, object.revision_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryConnectionConsensusStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} message QueryConnectionConsensusStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionConsensusStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.connection_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_number = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_height = options.longs === String ? "0" : 0; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (typeof message.revision_number === "number") - object.revision_number = options.longs === String ? String(message.revision_number) : message.revision_number; - else - object.revision_number = options.longs === String ? $util.Long.prototype.toString.call(message.revision_number) : options.longs === Number ? new $util.LongBits(message.revision_number.low >>> 0, message.revision_number.high >>> 0).toNumber(true) : message.revision_number; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (typeof message.revision_height === "number") - object.revision_height = options.longs === String ? String(message.revision_height) : message.revision_height; - else - object.revision_height = options.longs === String ? $util.Long.prototype.toString.call(message.revision_height) : options.longs === Number ? new $util.LongBits(message.revision_height.low >>> 0, message.revision_height.high >>> 0).toNumber(true) : message.revision_height; - return object; - }; - - /** - * Converts this QueryConnectionConsensusStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionConsensusStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionConsensusStateRequest; - })(); - - v1.QueryConnectionConsensusStateResponse = (function() { - - /** - * Properties of a QueryConnectionConsensusStateResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionConsensusStateResponse - * @property {google.protobuf.IAny|null} [consensus_state] QueryConnectionConsensusStateResponse consensus_state - * @property {string|null} [client_id] QueryConnectionConsensusStateResponse client_id - * @property {Uint8Array|null} [proof] QueryConnectionConsensusStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryConnectionConsensusStateResponse proof_height - */ - - /** - * Constructs a new QueryConnectionConsensusStateResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionConsensusStateResponse. - * @implements IQueryConnectionConsensusStateResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse=} [properties] Properties to set - */ - function QueryConnectionConsensusStateResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionConsensusStateResponse consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - */ - QueryConnectionConsensusStateResponse.prototype.consensus_state = null; - - /** - * QueryConnectionConsensusStateResponse client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - */ - QueryConnectionConsensusStateResponse.prototype.client_id = ""; - - /** - * QueryConnectionConsensusStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - */ - QueryConnectionConsensusStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryConnectionConsensusStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - */ - QueryConnectionConsensusStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryConnectionConsensusStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse} message QueryConnectionConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionConsensusStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.client_id); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse} message QueryConnectionConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionConsensusStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionConsensusStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.client_id = reader.string(); - break; - case 3: - message.proof = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionConsensusStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionConsensusStateResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionConsensusStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse - */ - QueryConnectionConsensusStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse) - return object; - var message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse(); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionConsensusStateResponse.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionConsensusStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionConsensusStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} message QueryConnectionConsensusStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionConsensusStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.consensus_state = null; - object.client_id = ""; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryConnectionConsensusStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionConsensusStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionConsensusStateResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.core.connection.v1 - * @interface IGenesisState - * @property {Array.|null} [connections] GenesisState connections - * @property {Array.|null} [client_connection_paths] GenesisState client_connection_paths - * @property {Long|null} [next_connection_sequence] GenesisState next_connection_sequence - * @property {ibc.core.connection.v1.IParams|null} [params] GenesisState params - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.core.connection.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.connections = []; - this.client_connection_paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState connections. - * @member {Array.} connections - * @memberof ibc.core.connection.v1.GenesisState - * @instance - */ - GenesisState.prototype.connections = $util.emptyArray; - - /** - * GenesisState client_connection_paths. - * @member {Array.} client_connection_paths - * @memberof ibc.core.connection.v1.GenesisState - * @instance - */ - GenesisState.prototype.client_connection_paths = $util.emptyArray; - - /** - * GenesisState next_connection_sequence. - * @member {Long} next_connection_sequence - * @memberof ibc.core.connection.v1.GenesisState - * @instance - */ - GenesisState.prototype.next_connection_sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GenesisState params. - * @member {ibc.core.connection.v1.IParams|null|undefined} params - * @memberof ibc.core.connection.v1.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.connection.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {ibc.core.connection.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connections != null && message.connections.length) - for (var i = 0; i < message.connections.length; ++i) - $root.ibc.core.connection.v1.IdentifiedConnection.encode(message.connections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.client_connection_paths != null && message.client_connection_paths.length) - for (var i = 0; i < message.client_connection_paths.length; ++i) - $root.ibc.core.connection.v1.ConnectionPaths.encode(message.client_connection_paths[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.next_connection_sequence != null && Object.hasOwnProperty.call(message, "next_connection_sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.next_connection_sequence); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.core.connection.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.connection.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {ibc.core.connection.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.connections && message.connections.length)) - message.connections = []; - message.connections.push($root.ibc.core.connection.v1.IdentifiedConnection.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.client_connection_paths && message.client_connection_paths.length)) - message.client_connection_paths = []; - message.client_connection_paths.push($root.ibc.core.connection.v1.ConnectionPaths.decode(reader, reader.uint32())); - break; - case 3: - message.next_connection_sequence = reader.uint64(); - break; - case 4: - message.params = $root.ibc.core.connection.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connections != null && message.hasOwnProperty("connections")) { - if (!Array.isArray(message.connections)) - return "connections: array expected"; - for (var i = 0; i < message.connections.length; ++i) { - var error = $root.ibc.core.connection.v1.IdentifiedConnection.verify(message.connections[i]); - if (error) - return "connections." + error; - } - } - if (message.client_connection_paths != null && message.hasOwnProperty("client_connection_paths")) { - if (!Array.isArray(message.client_connection_paths)) - return "client_connection_paths: array expected"; - for (var i = 0; i < message.client_connection_paths.length; ++i) { - var error = $root.ibc.core.connection.v1.ConnectionPaths.verify(message.client_connection_paths[i]); - if (error) - return "client_connection_paths." + error; - } - } - if (message.next_connection_sequence != null && message.hasOwnProperty("next_connection_sequence")) - if (!$util.isInteger(message.next_connection_sequence) && !(message.next_connection_sequence && $util.isInteger(message.next_connection_sequence.low) && $util.isInteger(message.next_connection_sequence.high))) - return "next_connection_sequence: integer|Long expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.core.connection.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.GenesisState) - return object; - var message = new $root.ibc.core.connection.v1.GenesisState(); - if (object.connections) { - if (!Array.isArray(object.connections)) - throw TypeError(".ibc.core.connection.v1.GenesisState.connections: array expected"); - message.connections = []; - for (var i = 0; i < object.connections.length; ++i) { - if (typeof object.connections[i] !== "object") - throw TypeError(".ibc.core.connection.v1.GenesisState.connections: object expected"); - message.connections[i] = $root.ibc.core.connection.v1.IdentifiedConnection.fromObject(object.connections[i]); - } - } - if (object.client_connection_paths) { - if (!Array.isArray(object.client_connection_paths)) - throw TypeError(".ibc.core.connection.v1.GenesisState.client_connection_paths: array expected"); - message.client_connection_paths = []; - for (var i = 0; i < object.client_connection_paths.length; ++i) { - if (typeof object.client_connection_paths[i] !== "object") - throw TypeError(".ibc.core.connection.v1.GenesisState.client_connection_paths: object expected"); - message.client_connection_paths[i] = $root.ibc.core.connection.v1.ConnectionPaths.fromObject(object.client_connection_paths[i]); - } - } - if (object.next_connection_sequence != null) - if ($util.Long) - (message.next_connection_sequence = $util.Long.fromValue(object.next_connection_sequence)).unsigned = true; - else if (typeof object.next_connection_sequence === "string") - message.next_connection_sequence = parseInt(object.next_connection_sequence, 10); - else if (typeof object.next_connection_sequence === "number") - message.next_connection_sequence = object.next_connection_sequence; - else if (typeof object.next_connection_sequence === "object") - message.next_connection_sequence = new $util.LongBits(object.next_connection_sequence.low >>> 0, object.next_connection_sequence.high >>> 0).toNumber(true); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.core.connection.v1.GenesisState.params: object expected"); - message.params = $root.ibc.core.connection.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {ibc.core.connection.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.connections = []; - object.client_connection_paths = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.next_connection_sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_connection_sequence = options.longs === String ? "0" : 0; - object.params = null; - } - if (message.connections && message.connections.length) { - object.connections = []; - for (var j = 0; j < message.connections.length; ++j) - object.connections[j] = $root.ibc.core.connection.v1.IdentifiedConnection.toObject(message.connections[j], options); - } - if (message.client_connection_paths && message.client_connection_paths.length) { - object.client_connection_paths = []; - for (var j = 0; j < message.client_connection_paths.length; ++j) - object.client_connection_paths[j] = $root.ibc.core.connection.v1.ConnectionPaths.toObject(message.client_connection_paths[j], options); - } - if (message.next_connection_sequence != null && message.hasOwnProperty("next_connection_sequence")) - if (typeof message.next_connection_sequence === "number") - object.next_connection_sequence = options.longs === String ? String(message.next_connection_sequence) : message.next_connection_sequence; - else - object.next_connection_sequence = options.longs === String ? $util.Long.prototype.toString.call(message.next_connection_sequence) : options.longs === Number ? new $util.LongBits(message.next_connection_sequence.low >>> 0, message.next_connection_sequence.high >>> 0).toNumber(true) : message.next_connection_sequence; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.core.connection.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return v1; - })(); - - return connection; - })(); - - core.types = (function() { - - /** - * Namespace types. - * @memberof ibc.core - * @namespace - */ - var types = {}; - - types.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.types - * @namespace - */ - var v1 = {}; - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.core.types.v1 - * @interface IGenesisState - * @property {ibc.core.client.v1.IGenesisState|null} [client_genesis] GenesisState client_genesis - * @property {ibc.core.connection.v1.IGenesisState|null} [connection_genesis] GenesisState connection_genesis - * @property {ibc.core.channel.v1.IGenesisState|null} [channel_genesis] GenesisState channel_genesis - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.core.types.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.core.types.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState client_genesis. - * @member {ibc.core.client.v1.IGenesisState|null|undefined} client_genesis - * @memberof ibc.core.types.v1.GenesisState - * @instance - */ - GenesisState.prototype.client_genesis = null; - - /** - * GenesisState connection_genesis. - * @member {ibc.core.connection.v1.IGenesisState|null|undefined} connection_genesis - * @memberof ibc.core.types.v1.GenesisState - * @instance - */ - GenesisState.prototype.connection_genesis = null; - - /** - * GenesisState channel_genesis. - * @member {ibc.core.channel.v1.IGenesisState|null|undefined} channel_genesis - * @memberof ibc.core.types.v1.GenesisState - * @instance - */ - GenesisState.prototype.channel_genesis = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.types.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {ibc.core.types.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_genesis != null && Object.hasOwnProperty.call(message, "client_genesis")) - $root.ibc.core.client.v1.GenesisState.encode(message.client_genesis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.connection_genesis != null && Object.hasOwnProperty.call(message, "connection_genesis")) - $root.ibc.core.connection.v1.GenesisState.encode(message.connection_genesis, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.channel_genesis != null && Object.hasOwnProperty.call(message, "channel_genesis")) - $root.ibc.core.channel.v1.GenesisState.encode(message.channel_genesis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.types.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {ibc.core.types.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.types.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.types.v1.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_genesis = $root.ibc.core.client.v1.GenesisState.decode(reader, reader.uint32()); - break; - case 2: - message.connection_genesis = $root.ibc.core.connection.v1.GenesisState.decode(reader, reader.uint32()); - break; - case 3: - message.channel_genesis = $root.ibc.core.channel.v1.GenesisState.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.types.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_genesis != null && message.hasOwnProperty("client_genesis")) { - var error = $root.ibc.core.client.v1.GenesisState.verify(message.client_genesis); - if (error) - return "client_genesis." + error; - } - if (message.connection_genesis != null && message.hasOwnProperty("connection_genesis")) { - var error = $root.ibc.core.connection.v1.GenesisState.verify(message.connection_genesis); - if (error) - return "connection_genesis." + error; - } - if (message.channel_genesis != null && message.hasOwnProperty("channel_genesis")) { - var error = $root.ibc.core.channel.v1.GenesisState.verify(message.channel_genesis); - if (error) - return "channel_genesis." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.types.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.types.v1.GenesisState) - return object; - var message = new $root.ibc.core.types.v1.GenesisState(); - if (object.client_genesis != null) { - if (typeof object.client_genesis !== "object") - throw TypeError(".ibc.core.types.v1.GenesisState.client_genesis: object expected"); - message.client_genesis = $root.ibc.core.client.v1.GenesisState.fromObject(object.client_genesis); - } - if (object.connection_genesis != null) { - if (typeof object.connection_genesis !== "object") - throw TypeError(".ibc.core.types.v1.GenesisState.connection_genesis: object expected"); - message.connection_genesis = $root.ibc.core.connection.v1.GenesisState.fromObject(object.connection_genesis); - } - if (object.channel_genesis != null) { - if (typeof object.channel_genesis !== "object") - throw TypeError(".ibc.core.types.v1.GenesisState.channel_genesis: object expected"); - message.channel_genesis = $root.ibc.core.channel.v1.GenesisState.fromObject(object.channel_genesis); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {ibc.core.types.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_genesis = null; - object.connection_genesis = null; - object.channel_genesis = null; - } - if (message.client_genesis != null && message.hasOwnProperty("client_genesis")) - object.client_genesis = $root.ibc.core.client.v1.GenesisState.toObject(message.client_genesis, options); - if (message.connection_genesis != null && message.hasOwnProperty("connection_genesis")) - object.connection_genesis = $root.ibc.core.connection.v1.GenesisState.toObject(message.connection_genesis, options); - if (message.channel_genesis != null && message.hasOwnProperty("channel_genesis")) - object.channel_genesis = $root.ibc.core.channel.v1.GenesisState.toObject(message.channel_genesis, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.core.types.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return v1; - })(); - - return types; - })(); - - return core; - })(); - - ibc.lightclients = (function() { - - /** - * Namespace lightclients. - * @memberof ibc - * @namespace - */ - var lightclients = {}; - - lightclients.localhost = (function() { - - /** - * Namespace localhost. - * @memberof ibc.lightclients - * @namespace - */ - var localhost = {}; - - localhost.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.lightclients.localhost - * @namespace - */ - var v1 = {}; - - v1.ClientState = (function() { - - /** - * Properties of a ClientState. - * @memberof ibc.lightclients.localhost.v1 - * @interface IClientState - * @property {string|null} [chain_id] ClientState chain_id - * @property {ibc.core.client.v1.IHeight|null} [height] ClientState height - */ - - /** - * Constructs a new ClientState. - * @memberof ibc.lightclients.localhost.v1 - * @classdesc Represents a ClientState. - * @implements IClientState - * @constructor - * @param {ibc.lightclients.localhost.v1.IClientState=} [properties] Properties to set - */ - function ClientState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientState chain_id. - * @member {string} chain_id - * @memberof ibc.lightclients.localhost.v1.ClientState - * @instance - */ - ClientState.prototype.chain_id = ""; - - /** - * ClientState height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.lightclients.localhost.v1.ClientState - * @instance - */ - ClientState.prototype.height = null; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.localhost.v1.ClientState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {ibc.lightclients.localhost.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chain_id != null && Object.hasOwnProperty.call(message, "chain_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.chain_id); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.localhost.v1.ClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {ibc.lightclients.localhost.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.localhost.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.localhost.v1.ClientState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.chain_id = reader.string(); - break; - case 2: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.localhost.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientState message. - * @function verify - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - if (!$util.isString(message.chain_id)) - return "chain_id: string expected"; - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.localhost.v1.ClientState} ClientState - */ - ClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.localhost.v1.ClientState) - return object; - var message = new $root.ibc.lightclients.localhost.v1.ClientState(); - if (object.chain_id != null) - message.chain_id = String(object.chain_id); - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.lightclients.localhost.v1.ClientState.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {ibc.lightclients.localhost.v1.ClientState} message ClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.chain_id = ""; - object.height = null; - } - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - object.chain_id = message.chain_id; - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this ClientState to JSON. - * @function toJSON - * @memberof ibc.lightclients.localhost.v1.ClientState - * @instance - * @returns {Object.} JSON object - */ - ClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientState; - })(); - - return v1; - })(); - - return localhost; - })(); - - lightclients.solomachine = (function() { - - /** - * Namespace solomachine. - * @memberof ibc.lightclients - * @namespace - */ - var solomachine = {}; - - solomachine.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.lightclients.solomachine - * @namespace - */ - var v1 = {}; - - v1.ClientState = (function() { - - /** - * Properties of a ClientState. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IClientState - * @property {Long|null} [sequence] ClientState sequence - * @property {Long|null} [frozen_sequence] ClientState frozen_sequence - * @property {ibc.lightclients.solomachine.v1.IConsensusState|null} [consensus_state] ClientState consensus_state - * @property {boolean|null} [allow_update_after_proposal] ClientState allow_update_after_proposal - */ - - /** - * Constructs a new ClientState. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ClientState. - * @implements IClientState - * @constructor - * @param {ibc.lightclients.solomachine.v1.IClientState=} [properties] Properties to set - */ - function ClientState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientState sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - */ - ClientState.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ClientState frozen_sequence. - * @member {Long} frozen_sequence - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - */ - ClientState.prototype.frozen_sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ClientState consensus_state. - * @member {ibc.lightclients.solomachine.v1.IConsensusState|null|undefined} consensus_state - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - */ - ClientState.prototype.consensus_state = null; - - /** - * ClientState allow_update_after_proposal. - * @member {boolean} allow_update_after_proposal - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - */ - ClientState.prototype.allow_update_after_proposal = false; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {ibc.lightclients.solomachine.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.frozen_sequence != null && Object.hasOwnProperty.call(message, "frozen_sequence")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.frozen_sequence); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.ibc.lightclients.solomachine.v1.ConsensusState.encode(message.consensus_state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.allow_update_after_proposal != null && Object.hasOwnProperty.call(message, "allow_update_after_proposal")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allow_update_after_proposal); - return writer; - }; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {ibc.lightclients.solomachine.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ClientState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.frozen_sequence = reader.uint64(); - break; - case 3: - message.consensus_state = $root.ibc.lightclients.solomachine.v1.ConsensusState.decode(reader, reader.uint32()); - break; - case 4: - message.allow_update_after_proposal = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientState message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.frozen_sequence != null && message.hasOwnProperty("frozen_sequence")) - if (!$util.isInteger(message.frozen_sequence) && !(message.frozen_sequence && $util.isInteger(message.frozen_sequence.low) && $util.isInteger(message.frozen_sequence.high))) - return "frozen_sequence: integer|Long expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.ibc.lightclients.solomachine.v1.ConsensusState.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.allow_update_after_proposal != null && message.hasOwnProperty("allow_update_after_proposal")) - if (typeof message.allow_update_after_proposal !== "boolean") - return "allow_update_after_proposal: boolean expected"; - return null; - }; - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ClientState} ClientState - */ - ClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ClientState) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.ClientState(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.frozen_sequence != null) - if ($util.Long) - (message.frozen_sequence = $util.Long.fromValue(object.frozen_sequence)).unsigned = true; - else if (typeof object.frozen_sequence === "string") - message.frozen_sequence = parseInt(object.frozen_sequence, 10); - else if (typeof object.frozen_sequence === "number") - message.frozen_sequence = object.frozen_sequence; - else if (typeof object.frozen_sequence === "object") - message.frozen_sequence = new $util.LongBits(object.frozen_sequence.low >>> 0, object.frozen_sequence.high >>> 0).toNumber(true); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ClientState.consensus_state: object expected"); - message.consensus_state = $root.ibc.lightclients.solomachine.v1.ConsensusState.fromObject(object.consensus_state); - } - if (object.allow_update_after_proposal != null) - message.allow_update_after_proposal = Boolean(object.allow_update_after_proposal); - return message; - }; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {ibc.lightclients.solomachine.v1.ClientState} message ClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.frozen_sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.frozen_sequence = options.longs === String ? "0" : 0; - object.consensus_state = null; - object.allow_update_after_proposal = false; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.frozen_sequence != null && message.hasOwnProperty("frozen_sequence")) - if (typeof message.frozen_sequence === "number") - object.frozen_sequence = options.longs === String ? String(message.frozen_sequence) : message.frozen_sequence; - else - object.frozen_sequence = options.longs === String ? $util.Long.prototype.toString.call(message.frozen_sequence) : options.longs === Number ? new $util.LongBits(message.frozen_sequence.low >>> 0, message.frozen_sequence.high >>> 0).toNumber(true) : message.frozen_sequence; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.ibc.lightclients.solomachine.v1.ConsensusState.toObject(message.consensus_state, options); - if (message.allow_update_after_proposal != null && message.hasOwnProperty("allow_update_after_proposal")) - object.allow_update_after_proposal = message.allow_update_after_proposal; - return object; - }; - - /** - * Converts this ClientState to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - * @returns {Object.} JSON object - */ - ClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientState; - })(); - - v1.ConsensusState = (function() { - - /** - * Properties of a ConsensusState. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IConsensusState - * @property {google.protobuf.IAny|null} [public_key] ConsensusState public_key - * @property {string|null} [diversifier] ConsensusState diversifier - * @property {Long|null} [timestamp] ConsensusState timestamp - */ - - /** - * Constructs a new ConsensusState. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ConsensusState. - * @implements IConsensusState - * @constructor - * @param {ibc.lightclients.solomachine.v1.IConsensusState=} [properties] Properties to set - */ - function ConsensusState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusState public_key. - * @member {google.protobuf.IAny|null|undefined} public_key - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.public_key = null; - - /** - * ConsensusState diversifier. - * @member {string} diversifier - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.diversifier = ""; - - /** - * ConsensusState timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified ConsensusState message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v1.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.public_key != null && Object.hasOwnProperty.call(message, "public_key")) - $root.google.protobuf.Any.encode(message.public_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.diversifier != null && Object.hasOwnProperty.call(message, "diversifier")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.diversifier); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified ConsensusState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v1.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ConsensusState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.public_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.diversifier = reader.string(); - break; - case 3: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusState message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.public_key != null && message.hasOwnProperty("public_key")) { - var error = $root.google.protobuf.Any.verify(message.public_key); - if (error) - return "public_key." + error; - } - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - if (!$util.isString(message.diversifier)) - return "diversifier: string expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a ConsensusState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ConsensusState} ConsensusState - */ - ConsensusState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ConsensusState) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.ConsensusState(); - if (object.public_key != null) { - if (typeof object.public_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ConsensusState.public_key: object expected"); - message.public_key = $root.google.protobuf.Any.fromObject(object.public_key); - } - if (object.diversifier != null) - message.diversifier = String(object.diversifier); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a ConsensusState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v1.ConsensusState} message ConsensusState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.public_key = null; - object.diversifier = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.public_key != null && message.hasOwnProperty("public_key")) - object.public_key = $root.google.protobuf.Any.toObject(message.public_key, options); - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - object.diversifier = message.diversifier; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this ConsensusState to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @instance - * @returns {Object.} JSON object - */ - ConsensusState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusState; - })(); - - v1.Header = (function() { - - /** - * Properties of a Header. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IHeader - * @property {Long|null} [sequence] Header sequence - * @property {Long|null} [timestamp] Header timestamp - * @property {Uint8Array|null} [signature] Header signature - * @property {google.protobuf.IAny|null} [new_public_key] Header new_public_key - * @property {string|null} [new_diversifier] Header new_diversifier - */ - - /** - * Constructs a new Header. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a Header. - * @implements IHeader - * @constructor - * @param {ibc.lightclients.solomachine.v1.IHeader=} [properties] Properties to set - */ - function Header(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Header sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Header timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Header signature. - * @member {Uint8Array} signature - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.signature = $util.newBuffer([]); - - /** - * Header new_public_key. - * @member {google.protobuf.IAny|null|undefined} new_public_key - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.new_public_key = null; - - /** - * Header new_diversifier. - * @member {string} new_diversifier - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.new_diversifier = ""; - - /** - * Encodes the specified Header message. Does not implicitly {@link ibc.lightclients.solomachine.v1.Header.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {ibc.lightclients.solomachine.v1.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature); - if (message.new_public_key != null && Object.hasOwnProperty.call(message, "new_public_key")) - $root.google.protobuf.Any.encode(message.new_public_key, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.new_diversifier != null && Object.hasOwnProperty.call(message, "new_diversifier")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.new_diversifier); - return writer; - }; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.Header.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {ibc.lightclients.solomachine.v1.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Header message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.Header(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - case 3: - message.signature = reader.bytes(); - break; - case 4: - message.new_public_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 5: - message.new_diversifier = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Header message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Header.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.new_public_key != null && message.hasOwnProperty("new_public_key")) { - var error = $root.google.protobuf.Any.verify(message.new_public_key); - if (error) - return "new_public_key." + error; - } - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - if (!$util.isString(message.new_diversifier)) - return "new_diversifier: string expected"; - return null; - }; - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.Header} Header - */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.Header) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.Header(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - if (object.new_public_key != null) { - if (typeof object.new_public_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.Header.new_public_key: object expected"); - message.new_public_key = $root.google.protobuf.Any.fromObject(object.new_public_key); - } - if (object.new_diversifier != null) - message.new_diversifier = String(object.new_diversifier); - return message; - }; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {ibc.lightclients.solomachine.v1.Header} message Header - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Header.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.new_public_key = null; - object.new_diversifier = ""; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.new_public_key != null && message.hasOwnProperty("new_public_key")) - object.new_public_key = $root.google.protobuf.Any.toObject(message.new_public_key, options); - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - object.new_diversifier = message.new_diversifier; - return object; - }; - - /** - * Converts this Header to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - * @returns {Object.} JSON object - */ - Header.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Header; - })(); - - v1.Misbehaviour = (function() { - - /** - * Properties of a Misbehaviour. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IMisbehaviour - * @property {string|null} [client_id] Misbehaviour client_id - * @property {Long|null} [sequence] Misbehaviour sequence - * @property {ibc.lightclients.solomachine.v1.ISignatureAndData|null} [signature_one] Misbehaviour signature_one - * @property {ibc.lightclients.solomachine.v1.ISignatureAndData|null} [signature_two] Misbehaviour signature_two - */ - - /** - * Constructs a new Misbehaviour. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a Misbehaviour. - * @implements IMisbehaviour - * @constructor - * @param {ibc.lightclients.solomachine.v1.IMisbehaviour=} [properties] Properties to set - */ - function Misbehaviour(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Misbehaviour client_id. - * @member {string} client_id - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.client_id = ""; - - /** - * Misbehaviour sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Misbehaviour signature_one. - * @member {ibc.lightclients.solomachine.v1.ISignatureAndData|null|undefined} signature_one - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.signature_one = null; - - /** - * Misbehaviour signature_two. - * @member {ibc.lightclients.solomachine.v1.ISignatureAndData|null|undefined} signature_two - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.signature_two = null; - - /** - * Encodes the specified Misbehaviour message. Does not implicitly {@link ibc.lightclients.solomachine.v1.Misbehaviour.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v1.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.sequence); - if (message.signature_one != null && Object.hasOwnProperty.call(message, "signature_one")) - $root.ibc.lightclients.solomachine.v1.SignatureAndData.encode(message.signature_one, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signature_two != null && Object.hasOwnProperty.call(message, "signature_two")) - $root.ibc.lightclients.solomachine.v1.SignatureAndData.encode(message.signature_two, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Misbehaviour message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.Misbehaviour.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v1.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.Misbehaviour(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.sequence = reader.uint64(); - break; - case 3: - message.signature_one = $root.ibc.lightclients.solomachine.v1.SignatureAndData.decode(reader, reader.uint32()); - break; - case 4: - message.signature_two = $root.ibc.lightclients.solomachine.v1.SignatureAndData.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Misbehaviour message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Misbehaviour.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.signature_one != null && message.hasOwnProperty("signature_one")) { - var error = $root.ibc.lightclients.solomachine.v1.SignatureAndData.verify(message.signature_one); - if (error) - return "signature_one." + error; - } - if (message.signature_two != null && message.hasOwnProperty("signature_two")) { - var error = $root.ibc.lightclients.solomachine.v1.SignatureAndData.verify(message.signature_two); - if (error) - return "signature_two." + error; - } - return null; - }; - - /** - * Creates a Misbehaviour message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.Misbehaviour} Misbehaviour - */ - Misbehaviour.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.Misbehaviour) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.Misbehaviour(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.signature_one != null) { - if (typeof object.signature_one !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.Misbehaviour.signature_one: object expected"); - message.signature_one = $root.ibc.lightclients.solomachine.v1.SignatureAndData.fromObject(object.signature_one); - } - if (object.signature_two != null) { - if (typeof object.signature_two !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.Misbehaviour.signature_two: object expected"); - message.signature_two = $root.ibc.lightclients.solomachine.v1.SignatureAndData.fromObject(object.signature_two); - } - return message; - }; - - /** - * Creates a plain object from a Misbehaviour message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v1.Misbehaviour} message Misbehaviour - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Misbehaviour.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - object.signature_one = null; - object.signature_two = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.signature_one != null && message.hasOwnProperty("signature_one")) - object.signature_one = $root.ibc.lightclients.solomachine.v1.SignatureAndData.toObject(message.signature_one, options); - if (message.signature_two != null && message.hasOwnProperty("signature_two")) - object.signature_two = $root.ibc.lightclients.solomachine.v1.SignatureAndData.toObject(message.signature_two, options); - return object; - }; - - /** - * Converts this Misbehaviour to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - * @returns {Object.} JSON object - */ - Misbehaviour.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Misbehaviour; - })(); - - v1.SignatureAndData = (function() { - - /** - * Properties of a SignatureAndData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface ISignatureAndData - * @property {Uint8Array|null} [signature] SignatureAndData signature - * @property {ibc.lightclients.solomachine.v1.DataType|null} [data_type] SignatureAndData data_type - * @property {Uint8Array|null} [data] SignatureAndData data - * @property {Long|null} [timestamp] SignatureAndData timestamp - */ - - /** - * Constructs a new SignatureAndData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a SignatureAndData. - * @implements ISignatureAndData - * @constructor - * @param {ibc.lightclients.solomachine.v1.ISignatureAndData=} [properties] Properties to set - */ - function SignatureAndData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignatureAndData signature. - * @member {Uint8Array} signature - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - */ - SignatureAndData.prototype.signature = $util.newBuffer([]); - - /** - * SignatureAndData data_type. - * @member {ibc.lightclients.solomachine.v1.DataType} data_type - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - */ - SignatureAndData.prototype.data_type = 0; - - /** - * SignatureAndData data. - * @member {Uint8Array} data - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - */ - SignatureAndData.prototype.data = $util.newBuffer([]); - - /** - * SignatureAndData timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - */ - SignatureAndData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified SignatureAndData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignatureAndData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v1.ISignatureAndData} message SignatureAndData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignatureAndData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature); - if (message.data_type != null && Object.hasOwnProperty.call(message, "data_type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.data_type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified SignatureAndData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignatureAndData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v1.ISignatureAndData} message SignatureAndData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignatureAndData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.SignatureAndData} SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignatureAndData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.SignatureAndData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature = reader.bytes(); - break; - case 2: - message.data_type = reader.int32(); - break; - case 3: - message.data = reader.bytes(); - break; - case 4: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.SignatureAndData} SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignatureAndData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignatureAndData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignatureAndData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.data_type != null && message.hasOwnProperty("data_type")) - switch (message.data_type) { - default: - return "data_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a SignatureAndData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.SignatureAndData} SignatureAndData - */ - SignatureAndData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.SignatureAndData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.SignatureAndData(); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - switch (object.data_type) { - case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.data_type = 0; - break; - case "DATA_TYPE_CLIENT_STATE": - case 1: - message.data_type = 1; - break; - case "DATA_TYPE_CONSENSUS_STATE": - case 2: - message.data_type = 2; - break; - case "DATA_TYPE_CONNECTION_STATE": - case 3: - message.data_type = 3; - break; - case "DATA_TYPE_CHANNEL_STATE": - case 4: - message.data_type = 4; - break; - case "DATA_TYPE_PACKET_COMMITMENT": - case 5: - message.data_type = 5; - break; - case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": - case 6: - message.data_type = 6; - break; - case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": - case 7: - message.data_type = 7; - break; - case "DATA_TYPE_NEXT_SEQUENCE_RECV": - case 8: - message.data_type = 8; - break; - case "DATA_TYPE_HEADER": - case 9: - message.data_type = 9; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a SignatureAndData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v1.SignatureAndData} message SignatureAndData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignatureAndData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.data_type = options.enums === String ? "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.data_type != null && message.hasOwnProperty("data_type")) - object.data_type = options.enums === String ? $root.ibc.lightclients.solomachine.v1.DataType[message.data_type] : message.data_type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this SignatureAndData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - * @returns {Object.} JSON object - */ - SignatureAndData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignatureAndData; - })(); - - v1.TimestampedSignatureData = (function() { - - /** - * Properties of a TimestampedSignatureData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface ITimestampedSignatureData - * @property {Uint8Array|null} [signature_data] TimestampedSignatureData signature_data - * @property {Long|null} [timestamp] TimestampedSignatureData timestamp - */ - - /** - * Constructs a new TimestampedSignatureData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a TimestampedSignatureData. - * @implements ITimestampedSignatureData - * @constructor - * @param {ibc.lightclients.solomachine.v1.ITimestampedSignatureData=} [properties] Properties to set - */ - function TimestampedSignatureData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimestampedSignatureData signature_data. - * @member {Uint8Array} signature_data - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @instance - */ - TimestampedSignatureData.prototype.signature_data = $util.newBuffer([]); - - /** - * TimestampedSignatureData timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @instance - */ - TimestampedSignatureData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified TimestampedSignatureData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.TimestampedSignatureData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v1.ITimestampedSignatureData} message TimestampedSignatureData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampedSignatureData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature_data != null && Object.hasOwnProperty.call(message, "signature_data")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature_data); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified TimestampedSignatureData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.TimestampedSignatureData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v1.ITimestampedSignatureData} message TimestampedSignatureData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampedSignatureData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.TimestampedSignatureData} TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampedSignatureData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.TimestampedSignatureData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature_data = reader.bytes(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.TimestampedSignatureData} TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampedSignatureData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimestampedSignatureData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimestampedSignatureData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signature_data != null && message.hasOwnProperty("signature_data")) - if (!(message.signature_data && typeof message.signature_data.length === "number" || $util.isString(message.signature_data))) - return "signature_data: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a TimestampedSignatureData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.TimestampedSignatureData} TimestampedSignatureData - */ - TimestampedSignatureData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.TimestampedSignatureData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.TimestampedSignatureData(); - if (object.signature_data != null) - if (typeof object.signature_data === "string") - $util.base64.decode(object.signature_data, message.signature_data = $util.newBuffer($util.base64.length(object.signature_data)), 0); - else if (object.signature_data.length) - message.signature_data = object.signature_data; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TimestampedSignatureData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v1.TimestampedSignatureData} message TimestampedSignatureData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimestampedSignatureData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature_data = ""; - else { - object.signature_data = []; - if (options.bytes !== Array) - object.signature_data = $util.newBuffer(object.signature_data); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.signature_data != null && message.hasOwnProperty("signature_data")) - object.signature_data = options.bytes === String ? $util.base64.encode(message.signature_data, 0, message.signature_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature_data) : message.signature_data; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this TimestampedSignatureData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @instance - * @returns {Object.} JSON object - */ - TimestampedSignatureData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TimestampedSignatureData; - })(); - - v1.SignBytes = (function() { - - /** - * Properties of a SignBytes. - * @memberof ibc.lightclients.solomachine.v1 - * @interface ISignBytes - * @property {Long|null} [sequence] SignBytes sequence - * @property {Long|null} [timestamp] SignBytes timestamp - * @property {string|null} [diversifier] SignBytes diversifier - * @property {ibc.lightclients.solomachine.v1.DataType|null} [data_type] SignBytes data_type - * @property {Uint8Array|null} [data] SignBytes data - */ - - /** - * Constructs a new SignBytes. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a SignBytes. - * @implements ISignBytes - * @constructor - * @param {ibc.lightclients.solomachine.v1.ISignBytes=} [properties] Properties to set - */ - function SignBytes(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignBytes sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SignBytes timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SignBytes diversifier. - * @member {string} diversifier - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.diversifier = ""; - - /** - * SignBytes data_type. - * @member {ibc.lightclients.solomachine.v1.DataType} data_type - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.data_type = 0; - - /** - * SignBytes data. - * @member {Uint8Array} data - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified SignBytes message. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignBytes.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v1.ISignBytes} message SignBytes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignBytes.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.diversifier != null && Object.hasOwnProperty.call(message, "diversifier")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.diversifier); - if (message.data_type != null && Object.hasOwnProperty.call(message, "data_type")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.data_type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified SignBytes message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignBytes.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v1.ISignBytes} message SignBytes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignBytes.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignBytes message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.SignBytes} SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignBytes.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.SignBytes(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - case 3: - message.diversifier = reader.string(); - break; - case 4: - message.data_type = reader.int32(); - break; - case 5: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignBytes message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.SignBytes} SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignBytes.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignBytes message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignBytes.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - if (!$util.isString(message.diversifier)) - return "diversifier: string expected"; - if (message.data_type != null && message.hasOwnProperty("data_type")) - switch (message.data_type) { - default: - return "data_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a SignBytes message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.SignBytes} SignBytes - */ - SignBytes.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.SignBytes) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.SignBytes(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.diversifier != null) - message.diversifier = String(object.diversifier); - switch (object.data_type) { - case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.data_type = 0; - break; - case "DATA_TYPE_CLIENT_STATE": - case 1: - message.data_type = 1; - break; - case "DATA_TYPE_CONSENSUS_STATE": - case 2: - message.data_type = 2; - break; - case "DATA_TYPE_CONNECTION_STATE": - case 3: - message.data_type = 3; - break; - case "DATA_TYPE_CHANNEL_STATE": - case 4: - message.data_type = 4; - break; - case "DATA_TYPE_PACKET_COMMITMENT": - case 5: - message.data_type = 5; - break; - case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": - case 6: - message.data_type = 6; - break; - case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": - case 7: - message.data_type = 7; - break; - case "DATA_TYPE_NEXT_SEQUENCE_RECV": - case 8: - message.data_type = 8; - break; - case "DATA_TYPE_HEADER": - case 9: - message.data_type = 9; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a SignBytes message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v1.SignBytes} message SignBytes - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignBytes.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - object.diversifier = ""; - object.data_type = options.enums === String ? "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - object.diversifier = message.diversifier; - if (message.data_type != null && message.hasOwnProperty("data_type")) - object.data_type = options.enums === String ? $root.ibc.lightclients.solomachine.v1.DataType[message.data_type] : message.data_type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this SignBytes to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - * @returns {Object.} JSON object - */ - SignBytes.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignBytes; - })(); - - /** - * DataType enum. - * @name ibc.lightclients.solomachine.v1.DataType - * @enum {number} - * @property {number} DATA_TYPE_UNINITIALIZED_UNSPECIFIED=0 DATA_TYPE_UNINITIALIZED_UNSPECIFIED value - * @property {number} DATA_TYPE_CLIENT_STATE=1 DATA_TYPE_CLIENT_STATE value - * @property {number} DATA_TYPE_CONSENSUS_STATE=2 DATA_TYPE_CONSENSUS_STATE value - * @property {number} DATA_TYPE_CONNECTION_STATE=3 DATA_TYPE_CONNECTION_STATE value - * @property {number} DATA_TYPE_CHANNEL_STATE=4 DATA_TYPE_CHANNEL_STATE value - * @property {number} DATA_TYPE_PACKET_COMMITMENT=5 DATA_TYPE_PACKET_COMMITMENT value - * @property {number} DATA_TYPE_PACKET_ACKNOWLEDGEMENT=6 DATA_TYPE_PACKET_ACKNOWLEDGEMENT value - * @property {number} DATA_TYPE_PACKET_RECEIPT_ABSENCE=7 DATA_TYPE_PACKET_RECEIPT_ABSENCE value - * @property {number} DATA_TYPE_NEXT_SEQUENCE_RECV=8 DATA_TYPE_NEXT_SEQUENCE_RECV value - * @property {number} DATA_TYPE_HEADER=9 DATA_TYPE_HEADER value - */ - v1.DataType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_TYPE_UNINITIALIZED_UNSPECIFIED"] = 0; - values[valuesById[1] = "DATA_TYPE_CLIENT_STATE"] = 1; - values[valuesById[2] = "DATA_TYPE_CONSENSUS_STATE"] = 2; - values[valuesById[3] = "DATA_TYPE_CONNECTION_STATE"] = 3; - values[valuesById[4] = "DATA_TYPE_CHANNEL_STATE"] = 4; - values[valuesById[5] = "DATA_TYPE_PACKET_COMMITMENT"] = 5; - values[valuesById[6] = "DATA_TYPE_PACKET_ACKNOWLEDGEMENT"] = 6; - values[valuesById[7] = "DATA_TYPE_PACKET_RECEIPT_ABSENCE"] = 7; - values[valuesById[8] = "DATA_TYPE_NEXT_SEQUENCE_RECV"] = 8; - values[valuesById[9] = "DATA_TYPE_HEADER"] = 9; - return values; - })(); - - v1.HeaderData = (function() { - - /** - * Properties of a HeaderData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IHeaderData - * @property {google.protobuf.IAny|null} [new_pub_key] HeaderData new_pub_key - * @property {string|null} [new_diversifier] HeaderData new_diversifier - */ - - /** - * Constructs a new HeaderData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a HeaderData. - * @implements IHeaderData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IHeaderData=} [properties] Properties to set - */ - function HeaderData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HeaderData new_pub_key. - * @member {google.protobuf.IAny|null|undefined} new_pub_key - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @instance - */ - HeaderData.prototype.new_pub_key = null; - - /** - * HeaderData new_diversifier. - * @member {string} new_diversifier - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @instance - */ - HeaderData.prototype.new_diversifier = ""; - - /** - * Encodes the specified HeaderData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.HeaderData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v1.IHeaderData} message HeaderData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeaderData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.new_pub_key != null && Object.hasOwnProperty.call(message, "new_pub_key")) - $root.google.protobuf.Any.encode(message.new_pub_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.new_diversifier != null && Object.hasOwnProperty.call(message, "new_diversifier")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.new_diversifier); - return writer; - }; - - /** - * Encodes the specified HeaderData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.HeaderData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v1.IHeaderData} message HeaderData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeaderData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HeaderData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.HeaderData} HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeaderData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.HeaderData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.new_pub_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.new_diversifier = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HeaderData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.HeaderData} HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeaderData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HeaderData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HeaderData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.new_pub_key != null && message.hasOwnProperty("new_pub_key")) { - var error = $root.google.protobuf.Any.verify(message.new_pub_key); - if (error) - return "new_pub_key." + error; - } - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - if (!$util.isString(message.new_diversifier)) - return "new_diversifier: string expected"; - return null; - }; - - /** - * Creates a HeaderData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.HeaderData} HeaderData - */ - HeaderData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.HeaderData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.HeaderData(); - if (object.new_pub_key != null) { - if (typeof object.new_pub_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.HeaderData.new_pub_key: object expected"); - message.new_pub_key = $root.google.protobuf.Any.fromObject(object.new_pub_key); - } - if (object.new_diversifier != null) - message.new_diversifier = String(object.new_diversifier); - return message; - }; - - /** - * Creates a plain object from a HeaderData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v1.HeaderData} message HeaderData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HeaderData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.new_pub_key = null; - object.new_diversifier = ""; - } - if (message.new_pub_key != null && message.hasOwnProperty("new_pub_key")) - object.new_pub_key = $root.google.protobuf.Any.toObject(message.new_pub_key, options); - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - object.new_diversifier = message.new_diversifier; - return object; - }; - - /** - * Converts this HeaderData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @instance - * @returns {Object.} JSON object - */ - HeaderData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HeaderData; - })(); - - v1.ClientStateData = (function() { - - /** - * Properties of a ClientStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IClientStateData - * @property {Uint8Array|null} [path] ClientStateData path - * @property {google.protobuf.IAny|null} [client_state] ClientStateData client_state - */ - - /** - * Constructs a new ClientStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ClientStateData. - * @implements IClientStateData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IClientStateData=} [properties] Properties to set - */ - function ClientStateData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @instance - */ - ClientStateData.prototype.path = $util.newBuffer([]); - - /** - * ClientStateData client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @instance - */ - ClientStateData.prototype.client_state = null; - - /** - * Encodes the specified ClientStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IClientStateData} message ClientStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IClientStateData} message ClientStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ClientStateData} ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ClientStateData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ClientStateData} ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - var error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - return null; - }; - - /** - * Creates a ClientStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ClientStateData} ClientStateData - */ - ClientStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ClientStateData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.ClientStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ClientStateData.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - return message; - }; - - /** - * Creates a plain object from a ClientStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v1.ClientStateData} message ClientStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.client_state = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - return object; - }; - - /** - * Converts this ClientStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @instance - * @returns {Object.} JSON object - */ - ClientStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientStateData; - })(); - - v1.ConsensusStateData = (function() { - - /** - * Properties of a ConsensusStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IConsensusStateData - * @property {Uint8Array|null} [path] ConsensusStateData path - * @property {google.protobuf.IAny|null} [consensus_state] ConsensusStateData consensus_state - */ - - /** - * Constructs a new ConsensusStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ConsensusStateData. - * @implements IConsensusStateData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IConsensusStateData=} [properties] Properties to set - */ - function ConsensusStateData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @instance - */ - ConsensusStateData.prototype.path = $util.newBuffer([]); - - /** - * ConsensusStateData consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @instance - */ - ConsensusStateData.prototype.consensus_state = null; - - /** - * Encodes the specified ConsensusStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IConsensusStateData} message ConsensusStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConsensusStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IConsensusStateData} message ConsensusStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ConsensusStateData} ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ConsensusStateData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ConsensusStateData} ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - return null; - }; - - /** - * Creates a ConsensusStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ConsensusStateData} ConsensusStateData - */ - ConsensusStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ConsensusStateData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.ConsensusStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ConsensusStateData.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - return message; - }; - - /** - * Creates a plain object from a ConsensusStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v1.ConsensusStateData} message ConsensusStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.consensus_state = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - return object; - }; - - /** - * Converts this ConsensusStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @instance - * @returns {Object.} JSON object - */ - ConsensusStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusStateData; - })(); - - v1.ConnectionStateData = (function() { - - /** - * Properties of a ConnectionStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IConnectionStateData - * @property {Uint8Array|null} [path] ConnectionStateData path - * @property {ibc.core.connection.v1.IConnectionEnd|null} [connection] ConnectionStateData connection - */ - - /** - * Constructs a new ConnectionStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ConnectionStateData. - * @implements IConnectionStateData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IConnectionStateData=} [properties] Properties to set - */ - function ConnectionStateData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @instance - */ - ConnectionStateData.prototype.path = $util.newBuffer([]); - - /** - * ConnectionStateData connection. - * @member {ibc.core.connection.v1.IConnectionEnd|null|undefined} connection - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @instance - */ - ConnectionStateData.prototype.connection = null; - - /** - * Encodes the specified ConnectionStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConnectionStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IConnectionStateData} message ConnectionStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - $root.ibc.core.connection.v1.ConnectionEnd.encode(message.connection, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConnectionStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConnectionStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IConnectionStateData} message ConnectionStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ConnectionStateData} ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ConnectionStateData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ConnectionStateData} ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.connection != null && message.hasOwnProperty("connection")) { - var error = $root.ibc.core.connection.v1.ConnectionEnd.verify(message.connection); - if (error) - return "connection." + error; - } - return null; - }; - - /** - * Creates a ConnectionStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ConnectionStateData} ConnectionStateData - */ - ConnectionStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ConnectionStateData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.ConnectionStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.connection != null) { - if (typeof object.connection !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ConnectionStateData.connection: object expected"); - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.fromObject(object.connection); - } - return message; - }; - - /** - * Creates a plain object from a ConnectionStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v1.ConnectionStateData} message ConnectionStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.connection = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = $root.ibc.core.connection.v1.ConnectionEnd.toObject(message.connection, options); - return object; - }; - - /** - * Converts this ConnectionStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @instance - * @returns {Object.} JSON object - */ - ConnectionStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConnectionStateData; - })(); - - v1.ChannelStateData = (function() { - - /** - * Properties of a ChannelStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IChannelStateData - * @property {Uint8Array|null} [path] ChannelStateData path - * @property {ibc.core.channel.v1.IChannel|null} [channel] ChannelStateData channel - */ - - /** - * Constructs a new ChannelStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ChannelStateData. - * @implements IChannelStateData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IChannelStateData=} [properties] Properties to set - */ - function ChannelStateData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChannelStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @instance - */ - ChannelStateData.prototype.path = $util.newBuffer([]); - - /** - * ChannelStateData channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @instance - */ - ChannelStateData.prototype.channel = null; - - /** - * Encodes the specified ChannelStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ChannelStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IChannelStateData} message ChannelStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChannelStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ChannelStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IChannelStateData} message ChannelStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ChannelStateData} ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ChannelStateData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ChannelStateData} ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChannelStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChannelStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - var error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - return null; - }; - - /** - * Creates a ChannelStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ChannelStateData} ChannelStateData - */ - ChannelStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ChannelStateData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.ChannelStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ChannelStateData.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - return message; - }; - - /** - * Creates a plain object from a ChannelStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v1.ChannelStateData} message ChannelStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChannelStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.channel = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - return object; - }; - - /** - * Converts this ChannelStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @instance - * @returns {Object.} JSON object - */ - ChannelStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ChannelStateData; - })(); - - v1.PacketCommitmentData = (function() { - - /** - * Properties of a PacketCommitmentData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IPacketCommitmentData - * @property {Uint8Array|null} [path] PacketCommitmentData path - * @property {Uint8Array|null} [commitment] PacketCommitmentData commitment - */ - - /** - * Constructs a new PacketCommitmentData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a PacketCommitmentData. - * @implements IPacketCommitmentData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IPacketCommitmentData=} [properties] Properties to set - */ - function PacketCommitmentData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketCommitmentData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @instance - */ - PacketCommitmentData.prototype.path = $util.newBuffer([]); - - /** - * PacketCommitmentData commitment. - * @member {Uint8Array} commitment - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @instance - */ - PacketCommitmentData.prototype.commitment = $util.newBuffer([]); - - /** - * Encodes the specified PacketCommitmentData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketCommitmentData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketCommitmentData} message PacketCommitmentData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketCommitmentData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.commitment); - return writer; - }; - - /** - * Encodes the specified PacketCommitmentData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketCommitmentData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketCommitmentData} message PacketCommitmentData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketCommitmentData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.PacketCommitmentData} PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketCommitmentData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.PacketCommitmentData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.commitment = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.PacketCommitmentData} PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketCommitmentData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketCommitmentData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketCommitmentData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.commitment != null && message.hasOwnProperty("commitment")) - if (!(message.commitment && typeof message.commitment.length === "number" || $util.isString(message.commitment))) - return "commitment: buffer expected"; - return null; - }; - - /** - * Creates a PacketCommitmentData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.PacketCommitmentData} PacketCommitmentData - */ - PacketCommitmentData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.PacketCommitmentData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.PacketCommitmentData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.commitment != null) - if (typeof object.commitment === "string") - $util.base64.decode(object.commitment, message.commitment = $util.newBuffer($util.base64.length(object.commitment)), 0); - else if (object.commitment.length) - message.commitment = object.commitment; - return message; - }; - - /** - * Creates a plain object from a PacketCommitmentData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v1.PacketCommitmentData} message PacketCommitmentData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketCommitmentData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (options.bytes === String) - object.commitment = ""; - else { - object.commitment = []; - if (options.bytes !== Array) - object.commitment = $util.newBuffer(object.commitment); - } - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.commitment != null && message.hasOwnProperty("commitment")) - object.commitment = options.bytes === String ? $util.base64.encode(message.commitment, 0, message.commitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.commitment) : message.commitment; - return object; - }; - - /** - * Converts this PacketCommitmentData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @instance - * @returns {Object.} JSON object - */ - PacketCommitmentData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketCommitmentData; - })(); - - v1.PacketAcknowledgementData = (function() { - - /** - * Properties of a PacketAcknowledgementData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IPacketAcknowledgementData - * @property {Uint8Array|null} [path] PacketAcknowledgementData path - * @property {Uint8Array|null} [acknowledgement] PacketAcknowledgementData acknowledgement - */ - - /** - * Constructs a new PacketAcknowledgementData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a PacketAcknowledgementData. - * @implements IPacketAcknowledgementData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IPacketAcknowledgementData=} [properties] Properties to set - */ - function PacketAcknowledgementData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketAcknowledgementData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @instance - */ - PacketAcknowledgementData.prototype.path = $util.newBuffer([]); - - /** - * PacketAcknowledgementData acknowledgement. - * @member {Uint8Array} acknowledgement - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @instance - */ - PacketAcknowledgementData.prototype.acknowledgement = $util.newBuffer([]); - - /** - * Encodes the specified PacketAcknowledgementData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketAcknowledgementData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketAcknowledgementData} message PacketAcknowledgementData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketAcknowledgementData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.acknowledgement); - return writer; - }; - - /** - * Encodes the specified PacketAcknowledgementData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketAcknowledgementData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketAcknowledgementData} message PacketAcknowledgementData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketAcknowledgementData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.PacketAcknowledgementData} PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketAcknowledgementData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.PacketAcknowledgementData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.acknowledgement = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.PacketAcknowledgementData} PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketAcknowledgementData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketAcknowledgementData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketAcknowledgementData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) - return "acknowledgement: buffer expected"; - return null; - }; - - /** - * Creates a PacketAcknowledgementData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.PacketAcknowledgementData} PacketAcknowledgementData - */ - PacketAcknowledgementData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.PacketAcknowledgementData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.PacketAcknowledgementData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.acknowledgement != null) - if (typeof object.acknowledgement === "string") - $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); - else if (object.acknowledgement.length) - message.acknowledgement = object.acknowledgement; - return message; - }; - - /** - * Creates a plain object from a PacketAcknowledgementData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v1.PacketAcknowledgementData} message PacketAcknowledgementData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketAcknowledgementData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (options.bytes === String) - object.acknowledgement = ""; - else { - object.acknowledgement = []; - if (options.bytes !== Array) - object.acknowledgement = $util.newBuffer(object.acknowledgement); - } - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; - return object; - }; - - /** - * Converts this PacketAcknowledgementData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @instance - * @returns {Object.} JSON object - */ - PacketAcknowledgementData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketAcknowledgementData; - })(); - - v1.PacketReceiptAbsenceData = (function() { - - /** - * Properties of a PacketReceiptAbsenceData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IPacketReceiptAbsenceData - * @property {Uint8Array|null} [path] PacketReceiptAbsenceData path - */ - - /** - * Constructs a new PacketReceiptAbsenceData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a PacketReceiptAbsenceData. - * @implements IPacketReceiptAbsenceData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IPacketReceiptAbsenceData=} [properties] Properties to set - */ - function PacketReceiptAbsenceData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketReceiptAbsenceData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @instance - */ - PacketReceiptAbsenceData.prototype.path = $util.newBuffer([]); - - /** - * Encodes the specified PacketReceiptAbsenceData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketReceiptAbsenceData} message PacketReceiptAbsenceData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketReceiptAbsenceData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - return writer; - }; - - /** - * Encodes the specified PacketReceiptAbsenceData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketReceiptAbsenceData} message PacketReceiptAbsenceData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketReceiptAbsenceData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData} PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketReceiptAbsenceData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData} PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketReceiptAbsenceData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketReceiptAbsenceData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketReceiptAbsenceData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - return null; - }; - - /** - * Creates a PacketReceiptAbsenceData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData} PacketReceiptAbsenceData - */ - PacketReceiptAbsenceData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - return message; - }; - - /** - * Creates a plain object from a PacketReceiptAbsenceData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData} message PacketReceiptAbsenceData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketReceiptAbsenceData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - return object; - }; - - /** - * Converts this PacketReceiptAbsenceData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @instance - * @returns {Object.} JSON object - */ - PacketReceiptAbsenceData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketReceiptAbsenceData; - })(); - - v1.NextSequenceRecvData = (function() { - - /** - * Properties of a NextSequenceRecvData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface INextSequenceRecvData - * @property {Uint8Array|null} [path] NextSequenceRecvData path - * @property {Long|null} [next_seq_recv] NextSequenceRecvData next_seq_recv - */ - - /** - * Constructs a new NextSequenceRecvData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a NextSequenceRecvData. - * @implements INextSequenceRecvData - * @constructor - * @param {ibc.lightclients.solomachine.v1.INextSequenceRecvData=} [properties] Properties to set - */ - function NextSequenceRecvData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NextSequenceRecvData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @instance - */ - NextSequenceRecvData.prototype.path = $util.newBuffer([]); - - /** - * NextSequenceRecvData next_seq_recv. - * @member {Long} next_seq_recv - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @instance - */ - NextSequenceRecvData.prototype.next_seq_recv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified NextSequenceRecvData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.NextSequenceRecvData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v1.INextSequenceRecvData} message NextSequenceRecvData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NextSequenceRecvData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.next_seq_recv != null && Object.hasOwnProperty.call(message, "next_seq_recv")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.next_seq_recv); - return writer; - }; - - /** - * Encodes the specified NextSequenceRecvData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.NextSequenceRecvData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v1.INextSequenceRecvData} message NextSequenceRecvData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NextSequenceRecvData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.NextSequenceRecvData} NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NextSequenceRecvData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.NextSequenceRecvData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.next_seq_recv = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.NextSequenceRecvData} NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NextSequenceRecvData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NextSequenceRecvData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NextSequenceRecvData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.next_seq_recv != null && message.hasOwnProperty("next_seq_recv")) - if (!$util.isInteger(message.next_seq_recv) && !(message.next_seq_recv && $util.isInteger(message.next_seq_recv.low) && $util.isInteger(message.next_seq_recv.high))) - return "next_seq_recv: integer|Long expected"; - return null; - }; - - /** - * Creates a NextSequenceRecvData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.NextSequenceRecvData} NextSequenceRecvData - */ - NextSequenceRecvData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.NextSequenceRecvData) - return object; - var message = new $root.ibc.lightclients.solomachine.v1.NextSequenceRecvData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.next_seq_recv != null) - if ($util.Long) - (message.next_seq_recv = $util.Long.fromValue(object.next_seq_recv)).unsigned = true; - else if (typeof object.next_seq_recv === "string") - message.next_seq_recv = parseInt(object.next_seq_recv, 10); - else if (typeof object.next_seq_recv === "number") - message.next_seq_recv = object.next_seq_recv; - else if (typeof object.next_seq_recv === "object") - message.next_seq_recv = new $util.LongBits(object.next_seq_recv.low >>> 0, object.next_seq_recv.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a NextSequenceRecvData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v1.NextSequenceRecvData} message NextSequenceRecvData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NextSequenceRecvData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.next_seq_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_seq_recv = options.longs === String ? "0" : 0; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.next_seq_recv != null && message.hasOwnProperty("next_seq_recv")) - if (typeof message.next_seq_recv === "number") - object.next_seq_recv = options.longs === String ? String(message.next_seq_recv) : message.next_seq_recv; - else - object.next_seq_recv = options.longs === String ? $util.Long.prototype.toString.call(message.next_seq_recv) : options.longs === Number ? new $util.LongBits(message.next_seq_recv.low >>> 0, message.next_seq_recv.high >>> 0).toNumber(true) : message.next_seq_recv; - return object; - }; - - /** - * Converts this NextSequenceRecvData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @instance - * @returns {Object.} JSON object - */ - NextSequenceRecvData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NextSequenceRecvData; - })(); - - return v1; - })(); - - solomachine.v2 = (function() { - - /** - * Namespace v2. - * @memberof ibc.lightclients.solomachine - * @namespace - */ - var v2 = {}; - - v2.ClientState = (function() { - - /** - * Properties of a ClientState. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IClientState - * @property {Long|null} [sequence] ClientState sequence - * @property {boolean|null} [is_frozen] ClientState is_frozen - * @property {ibc.lightclients.solomachine.v2.IConsensusState|null} [consensus_state] ClientState consensus_state - * @property {boolean|null} [allow_update_after_proposal] ClientState allow_update_after_proposal - */ - - /** - * Constructs a new ClientState. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ClientState. - * @implements IClientState - * @constructor - * @param {ibc.lightclients.solomachine.v2.IClientState=} [properties] Properties to set - */ - function ClientState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientState sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - */ - ClientState.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ClientState is_frozen. - * @member {boolean} is_frozen - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - */ - ClientState.prototype.is_frozen = false; - - /** - * ClientState consensus_state. - * @member {ibc.lightclients.solomachine.v2.IConsensusState|null|undefined} consensus_state - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - */ - ClientState.prototype.consensus_state = null; - - /** - * ClientState allow_update_after_proposal. - * @member {boolean} allow_update_after_proposal - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - */ - ClientState.prototype.allow_update_after_proposal = false; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {ibc.lightclients.solomachine.v2.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.is_frozen != null && Object.hasOwnProperty.call(message, "is_frozen")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_frozen); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.ibc.lightclients.solomachine.v2.ConsensusState.encode(message.consensus_state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.allow_update_after_proposal != null && Object.hasOwnProperty.call(message, "allow_update_after_proposal")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allow_update_after_proposal); - return writer; - }; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {ibc.lightclients.solomachine.v2.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ClientState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.is_frozen = reader.bool(); - break; - case 3: - message.consensus_state = $root.ibc.lightclients.solomachine.v2.ConsensusState.decode(reader, reader.uint32()); - break; - case 4: - message.allow_update_after_proposal = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientState message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.is_frozen != null && message.hasOwnProperty("is_frozen")) - if (typeof message.is_frozen !== "boolean") - return "is_frozen: boolean expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.ibc.lightclients.solomachine.v2.ConsensusState.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.allow_update_after_proposal != null && message.hasOwnProperty("allow_update_after_proposal")) - if (typeof message.allow_update_after_proposal !== "boolean") - return "allow_update_after_proposal: boolean expected"; - return null; - }; - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ClientState} ClientState - */ - ClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ClientState) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.ClientState(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.is_frozen != null) - message.is_frozen = Boolean(object.is_frozen); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ClientState.consensus_state: object expected"); - message.consensus_state = $root.ibc.lightclients.solomachine.v2.ConsensusState.fromObject(object.consensus_state); - } - if (object.allow_update_after_proposal != null) - message.allow_update_after_proposal = Boolean(object.allow_update_after_proposal); - return message; - }; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {ibc.lightclients.solomachine.v2.ClientState} message ClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - object.is_frozen = false; - object.consensus_state = null; - object.allow_update_after_proposal = false; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.is_frozen != null && message.hasOwnProperty("is_frozen")) - object.is_frozen = message.is_frozen; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.ibc.lightclients.solomachine.v2.ConsensusState.toObject(message.consensus_state, options); - if (message.allow_update_after_proposal != null && message.hasOwnProperty("allow_update_after_proposal")) - object.allow_update_after_proposal = message.allow_update_after_proposal; - return object; - }; - - /** - * Converts this ClientState to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - * @returns {Object.} JSON object - */ - ClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientState; - })(); - - v2.ConsensusState = (function() { - - /** - * Properties of a ConsensusState. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IConsensusState - * @property {google.protobuf.IAny|null} [public_key] ConsensusState public_key - * @property {string|null} [diversifier] ConsensusState diversifier - * @property {Long|null} [timestamp] ConsensusState timestamp - */ - - /** - * Constructs a new ConsensusState. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ConsensusState. - * @implements IConsensusState - * @constructor - * @param {ibc.lightclients.solomachine.v2.IConsensusState=} [properties] Properties to set - */ - function ConsensusState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusState public_key. - * @member {google.protobuf.IAny|null|undefined} public_key - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @instance - */ - ConsensusState.prototype.public_key = null; - - /** - * ConsensusState diversifier. - * @member {string} diversifier - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @instance - */ - ConsensusState.prototype.diversifier = ""; - - /** - * ConsensusState timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @instance - */ - ConsensusState.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified ConsensusState message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v2.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.public_key != null && Object.hasOwnProperty.call(message, "public_key")) - $root.google.protobuf.Any.encode(message.public_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.diversifier != null && Object.hasOwnProperty.call(message, "diversifier")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.diversifier); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified ConsensusState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v2.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ConsensusState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.public_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.diversifier = reader.string(); - break; - case 3: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusState message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.public_key != null && message.hasOwnProperty("public_key")) { - var error = $root.google.protobuf.Any.verify(message.public_key); - if (error) - return "public_key." + error; - } - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - if (!$util.isString(message.diversifier)) - return "diversifier: string expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a ConsensusState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ConsensusState} ConsensusState - */ - ConsensusState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ConsensusState) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.ConsensusState(); - if (object.public_key != null) { - if (typeof object.public_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ConsensusState.public_key: object expected"); - message.public_key = $root.google.protobuf.Any.fromObject(object.public_key); - } - if (object.diversifier != null) - message.diversifier = String(object.diversifier); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a ConsensusState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v2.ConsensusState} message ConsensusState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.public_key = null; - object.diversifier = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.public_key != null && message.hasOwnProperty("public_key")) - object.public_key = $root.google.protobuf.Any.toObject(message.public_key, options); - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - object.diversifier = message.diversifier; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this ConsensusState to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @instance - * @returns {Object.} JSON object - */ - ConsensusState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusState; - })(); - - v2.Header = (function() { - - /** - * Properties of a Header. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IHeader - * @property {Long|null} [sequence] Header sequence - * @property {Long|null} [timestamp] Header timestamp - * @property {Uint8Array|null} [signature] Header signature - * @property {google.protobuf.IAny|null} [new_public_key] Header new_public_key - * @property {string|null} [new_diversifier] Header new_diversifier - */ - - /** - * Constructs a new Header. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a Header. - * @implements IHeader - * @constructor - * @param {ibc.lightclients.solomachine.v2.IHeader=} [properties] Properties to set - */ - function Header(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Header sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Header timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Header signature. - * @member {Uint8Array} signature - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.signature = $util.newBuffer([]); - - /** - * Header new_public_key. - * @member {google.protobuf.IAny|null|undefined} new_public_key - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.new_public_key = null; - - /** - * Header new_diversifier. - * @member {string} new_diversifier - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.new_diversifier = ""; - - /** - * Encodes the specified Header message. Does not implicitly {@link ibc.lightclients.solomachine.v2.Header.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {ibc.lightclients.solomachine.v2.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature); - if (message.new_public_key != null && Object.hasOwnProperty.call(message, "new_public_key")) - $root.google.protobuf.Any.encode(message.new_public_key, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.new_diversifier != null && Object.hasOwnProperty.call(message, "new_diversifier")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.new_diversifier); - return writer; - }; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.Header.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {ibc.lightclients.solomachine.v2.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Header message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.Header(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - case 3: - message.signature = reader.bytes(); - break; - case 4: - message.new_public_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 5: - message.new_diversifier = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Header message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Header.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.new_public_key != null && message.hasOwnProperty("new_public_key")) { - var error = $root.google.protobuf.Any.verify(message.new_public_key); - if (error) - return "new_public_key." + error; - } - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - if (!$util.isString(message.new_diversifier)) - return "new_diversifier: string expected"; - return null; - }; - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.Header} Header - */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.Header) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.Header(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - if (object.new_public_key != null) { - if (typeof object.new_public_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.Header.new_public_key: object expected"); - message.new_public_key = $root.google.protobuf.Any.fromObject(object.new_public_key); - } - if (object.new_diversifier != null) - message.new_diversifier = String(object.new_diversifier); - return message; - }; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {ibc.lightclients.solomachine.v2.Header} message Header - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Header.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.new_public_key = null; - object.new_diversifier = ""; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.new_public_key != null && message.hasOwnProperty("new_public_key")) - object.new_public_key = $root.google.protobuf.Any.toObject(message.new_public_key, options); - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - object.new_diversifier = message.new_diversifier; - return object; - }; - - /** - * Converts this Header to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - * @returns {Object.} JSON object - */ - Header.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Header; - })(); - - v2.Misbehaviour = (function() { - - /** - * Properties of a Misbehaviour. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IMisbehaviour - * @property {string|null} [client_id] Misbehaviour client_id - * @property {Long|null} [sequence] Misbehaviour sequence - * @property {ibc.lightclients.solomachine.v2.ISignatureAndData|null} [signature_one] Misbehaviour signature_one - * @property {ibc.lightclients.solomachine.v2.ISignatureAndData|null} [signature_two] Misbehaviour signature_two - */ - - /** - * Constructs a new Misbehaviour. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a Misbehaviour. - * @implements IMisbehaviour - * @constructor - * @param {ibc.lightclients.solomachine.v2.IMisbehaviour=} [properties] Properties to set - */ - function Misbehaviour(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Misbehaviour client_id. - * @member {string} client_id - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - */ - Misbehaviour.prototype.client_id = ""; - - /** - * Misbehaviour sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - */ - Misbehaviour.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Misbehaviour signature_one. - * @member {ibc.lightclients.solomachine.v2.ISignatureAndData|null|undefined} signature_one - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - */ - Misbehaviour.prototype.signature_one = null; - - /** - * Misbehaviour signature_two. - * @member {ibc.lightclients.solomachine.v2.ISignatureAndData|null|undefined} signature_two - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - */ - Misbehaviour.prototype.signature_two = null; - - /** - * Encodes the specified Misbehaviour message. Does not implicitly {@link ibc.lightclients.solomachine.v2.Misbehaviour.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v2.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.sequence); - if (message.signature_one != null && Object.hasOwnProperty.call(message, "signature_one")) - $root.ibc.lightclients.solomachine.v2.SignatureAndData.encode(message.signature_one, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signature_two != null && Object.hasOwnProperty.call(message, "signature_two")) - $root.ibc.lightclients.solomachine.v2.SignatureAndData.encode(message.signature_two, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Misbehaviour message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.Misbehaviour.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v2.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.Misbehaviour(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.sequence = reader.uint64(); - break; - case 3: - message.signature_one = $root.ibc.lightclients.solomachine.v2.SignatureAndData.decode(reader, reader.uint32()); - break; - case 4: - message.signature_two = $root.ibc.lightclients.solomachine.v2.SignatureAndData.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Misbehaviour message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Misbehaviour.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.signature_one != null && message.hasOwnProperty("signature_one")) { - var error = $root.ibc.lightclients.solomachine.v2.SignatureAndData.verify(message.signature_one); - if (error) - return "signature_one." + error; - } - if (message.signature_two != null && message.hasOwnProperty("signature_two")) { - var error = $root.ibc.lightclients.solomachine.v2.SignatureAndData.verify(message.signature_two); - if (error) - return "signature_two." + error; - } - return null; - }; - - /** - * Creates a Misbehaviour message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.Misbehaviour} Misbehaviour - */ - Misbehaviour.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.Misbehaviour) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.Misbehaviour(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.signature_one != null) { - if (typeof object.signature_one !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.Misbehaviour.signature_one: object expected"); - message.signature_one = $root.ibc.lightclients.solomachine.v2.SignatureAndData.fromObject(object.signature_one); - } - if (object.signature_two != null) { - if (typeof object.signature_two !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.Misbehaviour.signature_two: object expected"); - message.signature_two = $root.ibc.lightclients.solomachine.v2.SignatureAndData.fromObject(object.signature_two); - } - return message; - }; - - /** - * Creates a plain object from a Misbehaviour message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v2.Misbehaviour} message Misbehaviour - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Misbehaviour.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - object.signature_one = null; - object.signature_two = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.signature_one != null && message.hasOwnProperty("signature_one")) - object.signature_one = $root.ibc.lightclients.solomachine.v2.SignatureAndData.toObject(message.signature_one, options); - if (message.signature_two != null && message.hasOwnProperty("signature_two")) - object.signature_two = $root.ibc.lightclients.solomachine.v2.SignatureAndData.toObject(message.signature_two, options); - return object; - }; - - /** - * Converts this Misbehaviour to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - * @returns {Object.} JSON object - */ - Misbehaviour.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Misbehaviour; - })(); - - v2.SignatureAndData = (function() { - - /** - * Properties of a SignatureAndData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface ISignatureAndData - * @property {Uint8Array|null} [signature] SignatureAndData signature - * @property {ibc.lightclients.solomachine.v2.DataType|null} [data_type] SignatureAndData data_type - * @property {Uint8Array|null} [data] SignatureAndData data - * @property {Long|null} [timestamp] SignatureAndData timestamp - */ - - /** - * Constructs a new SignatureAndData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a SignatureAndData. - * @implements ISignatureAndData - * @constructor - * @param {ibc.lightclients.solomachine.v2.ISignatureAndData=} [properties] Properties to set - */ - function SignatureAndData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignatureAndData signature. - * @member {Uint8Array} signature - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - */ - SignatureAndData.prototype.signature = $util.newBuffer([]); - - /** - * SignatureAndData data_type. - * @member {ibc.lightclients.solomachine.v2.DataType} data_type - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - */ - SignatureAndData.prototype.data_type = 0; - - /** - * SignatureAndData data. - * @member {Uint8Array} data - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - */ - SignatureAndData.prototype.data = $util.newBuffer([]); - - /** - * SignatureAndData timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - */ - SignatureAndData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified SignatureAndData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignatureAndData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v2.ISignatureAndData} message SignatureAndData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignatureAndData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature); - if (message.data_type != null && Object.hasOwnProperty.call(message, "data_type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.data_type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified SignatureAndData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignatureAndData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v2.ISignatureAndData} message SignatureAndData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignatureAndData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.SignatureAndData} SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignatureAndData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.SignatureAndData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature = reader.bytes(); - break; - case 2: - message.data_type = reader.int32(); - break; - case 3: - message.data = reader.bytes(); - break; - case 4: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.SignatureAndData} SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignatureAndData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignatureAndData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignatureAndData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.data_type != null && message.hasOwnProperty("data_type")) - switch (message.data_type) { - default: - return "data_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a SignatureAndData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.SignatureAndData} SignatureAndData - */ - SignatureAndData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.SignatureAndData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.SignatureAndData(); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - switch (object.data_type) { - case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.data_type = 0; - break; - case "DATA_TYPE_CLIENT_STATE": - case 1: - message.data_type = 1; - break; - case "DATA_TYPE_CONSENSUS_STATE": - case 2: - message.data_type = 2; - break; - case "DATA_TYPE_CONNECTION_STATE": - case 3: - message.data_type = 3; - break; - case "DATA_TYPE_CHANNEL_STATE": - case 4: - message.data_type = 4; - break; - case "DATA_TYPE_PACKET_COMMITMENT": - case 5: - message.data_type = 5; - break; - case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": - case 6: - message.data_type = 6; - break; - case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": - case 7: - message.data_type = 7; - break; - case "DATA_TYPE_NEXT_SEQUENCE_RECV": - case 8: - message.data_type = 8; - break; - case "DATA_TYPE_HEADER": - case 9: - message.data_type = 9; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a SignatureAndData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v2.SignatureAndData} message SignatureAndData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignatureAndData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.data_type = options.enums === String ? "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.data_type != null && message.hasOwnProperty("data_type")) - object.data_type = options.enums === String ? $root.ibc.lightclients.solomachine.v2.DataType[message.data_type] : message.data_type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this SignatureAndData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - * @returns {Object.} JSON object - */ - SignatureAndData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignatureAndData; - })(); - - v2.TimestampedSignatureData = (function() { - - /** - * Properties of a TimestampedSignatureData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface ITimestampedSignatureData - * @property {Uint8Array|null} [signature_data] TimestampedSignatureData signature_data - * @property {Long|null} [timestamp] TimestampedSignatureData timestamp - */ - - /** - * Constructs a new TimestampedSignatureData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a TimestampedSignatureData. - * @implements ITimestampedSignatureData - * @constructor - * @param {ibc.lightclients.solomachine.v2.ITimestampedSignatureData=} [properties] Properties to set - */ - function TimestampedSignatureData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimestampedSignatureData signature_data. - * @member {Uint8Array} signature_data - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @instance - */ - TimestampedSignatureData.prototype.signature_data = $util.newBuffer([]); - - /** - * TimestampedSignatureData timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @instance - */ - TimestampedSignatureData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified TimestampedSignatureData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.TimestampedSignatureData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v2.ITimestampedSignatureData} message TimestampedSignatureData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampedSignatureData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature_data != null && Object.hasOwnProperty.call(message, "signature_data")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature_data); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified TimestampedSignatureData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.TimestampedSignatureData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v2.ITimestampedSignatureData} message TimestampedSignatureData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampedSignatureData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.TimestampedSignatureData} TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampedSignatureData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.TimestampedSignatureData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature_data = reader.bytes(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.TimestampedSignatureData} TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampedSignatureData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimestampedSignatureData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimestampedSignatureData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signature_data != null && message.hasOwnProperty("signature_data")) - if (!(message.signature_data && typeof message.signature_data.length === "number" || $util.isString(message.signature_data))) - return "signature_data: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a TimestampedSignatureData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.TimestampedSignatureData} TimestampedSignatureData - */ - TimestampedSignatureData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.TimestampedSignatureData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.TimestampedSignatureData(); - if (object.signature_data != null) - if (typeof object.signature_data === "string") - $util.base64.decode(object.signature_data, message.signature_data = $util.newBuffer($util.base64.length(object.signature_data)), 0); - else if (object.signature_data.length) - message.signature_data = object.signature_data; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TimestampedSignatureData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v2.TimestampedSignatureData} message TimestampedSignatureData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimestampedSignatureData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature_data = ""; - else { - object.signature_data = []; - if (options.bytes !== Array) - object.signature_data = $util.newBuffer(object.signature_data); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.signature_data != null && message.hasOwnProperty("signature_data")) - object.signature_data = options.bytes === String ? $util.base64.encode(message.signature_data, 0, message.signature_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature_data) : message.signature_data; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this TimestampedSignatureData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @instance - * @returns {Object.} JSON object - */ - TimestampedSignatureData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TimestampedSignatureData; - })(); - - v2.SignBytes = (function() { - - /** - * Properties of a SignBytes. - * @memberof ibc.lightclients.solomachine.v2 - * @interface ISignBytes - * @property {Long|null} [sequence] SignBytes sequence - * @property {Long|null} [timestamp] SignBytes timestamp - * @property {string|null} [diversifier] SignBytes diversifier - * @property {ibc.lightclients.solomachine.v2.DataType|null} [data_type] SignBytes data_type - * @property {Uint8Array|null} [data] SignBytes data - */ - - /** - * Constructs a new SignBytes. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a SignBytes. - * @implements ISignBytes - * @constructor - * @param {ibc.lightclients.solomachine.v2.ISignBytes=} [properties] Properties to set - */ - function SignBytes(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignBytes sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SignBytes timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SignBytes diversifier. - * @member {string} diversifier - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.diversifier = ""; - - /** - * SignBytes data_type. - * @member {ibc.lightclients.solomachine.v2.DataType} data_type - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.data_type = 0; - - /** - * SignBytes data. - * @member {Uint8Array} data - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified SignBytes message. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignBytes.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v2.ISignBytes} message SignBytes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignBytes.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.diversifier != null && Object.hasOwnProperty.call(message, "diversifier")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.diversifier); - if (message.data_type != null && Object.hasOwnProperty.call(message, "data_type")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.data_type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified SignBytes message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignBytes.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v2.ISignBytes} message SignBytes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignBytes.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignBytes message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.SignBytes} SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignBytes.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.SignBytes(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - case 3: - message.diversifier = reader.string(); - break; - case 4: - message.data_type = reader.int32(); - break; - case 5: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignBytes message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.SignBytes} SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignBytes.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignBytes message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignBytes.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - if (!$util.isString(message.diversifier)) - return "diversifier: string expected"; - if (message.data_type != null && message.hasOwnProperty("data_type")) - switch (message.data_type) { - default: - return "data_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a SignBytes message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.SignBytes} SignBytes - */ - SignBytes.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.SignBytes) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.SignBytes(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.diversifier != null) - message.diversifier = String(object.diversifier); - switch (object.data_type) { - case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.data_type = 0; - break; - case "DATA_TYPE_CLIENT_STATE": - case 1: - message.data_type = 1; - break; - case "DATA_TYPE_CONSENSUS_STATE": - case 2: - message.data_type = 2; - break; - case "DATA_TYPE_CONNECTION_STATE": - case 3: - message.data_type = 3; - break; - case "DATA_TYPE_CHANNEL_STATE": - case 4: - message.data_type = 4; - break; - case "DATA_TYPE_PACKET_COMMITMENT": - case 5: - message.data_type = 5; - break; - case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": - case 6: - message.data_type = 6; - break; - case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": - case 7: - message.data_type = 7; - break; - case "DATA_TYPE_NEXT_SEQUENCE_RECV": - case 8: - message.data_type = 8; - break; - case "DATA_TYPE_HEADER": - case 9: - message.data_type = 9; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a SignBytes message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v2.SignBytes} message SignBytes - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignBytes.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - object.diversifier = ""; - object.data_type = options.enums === String ? "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - object.diversifier = message.diversifier; - if (message.data_type != null && message.hasOwnProperty("data_type")) - object.data_type = options.enums === String ? $root.ibc.lightclients.solomachine.v2.DataType[message.data_type] : message.data_type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this SignBytes to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - * @returns {Object.} JSON object - */ - SignBytes.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignBytes; - })(); - - /** - * DataType enum. - * @name ibc.lightclients.solomachine.v2.DataType - * @enum {number} - * @property {number} DATA_TYPE_UNINITIALIZED_UNSPECIFIED=0 DATA_TYPE_UNINITIALIZED_UNSPECIFIED value - * @property {number} DATA_TYPE_CLIENT_STATE=1 DATA_TYPE_CLIENT_STATE value - * @property {number} DATA_TYPE_CONSENSUS_STATE=2 DATA_TYPE_CONSENSUS_STATE value - * @property {number} DATA_TYPE_CONNECTION_STATE=3 DATA_TYPE_CONNECTION_STATE value - * @property {number} DATA_TYPE_CHANNEL_STATE=4 DATA_TYPE_CHANNEL_STATE value - * @property {number} DATA_TYPE_PACKET_COMMITMENT=5 DATA_TYPE_PACKET_COMMITMENT value - * @property {number} DATA_TYPE_PACKET_ACKNOWLEDGEMENT=6 DATA_TYPE_PACKET_ACKNOWLEDGEMENT value - * @property {number} DATA_TYPE_PACKET_RECEIPT_ABSENCE=7 DATA_TYPE_PACKET_RECEIPT_ABSENCE value - * @property {number} DATA_TYPE_NEXT_SEQUENCE_RECV=8 DATA_TYPE_NEXT_SEQUENCE_RECV value - * @property {number} DATA_TYPE_HEADER=9 DATA_TYPE_HEADER value - */ - v2.DataType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_TYPE_UNINITIALIZED_UNSPECIFIED"] = 0; - values[valuesById[1] = "DATA_TYPE_CLIENT_STATE"] = 1; - values[valuesById[2] = "DATA_TYPE_CONSENSUS_STATE"] = 2; - values[valuesById[3] = "DATA_TYPE_CONNECTION_STATE"] = 3; - values[valuesById[4] = "DATA_TYPE_CHANNEL_STATE"] = 4; - values[valuesById[5] = "DATA_TYPE_PACKET_COMMITMENT"] = 5; - values[valuesById[6] = "DATA_TYPE_PACKET_ACKNOWLEDGEMENT"] = 6; - values[valuesById[7] = "DATA_TYPE_PACKET_RECEIPT_ABSENCE"] = 7; - values[valuesById[8] = "DATA_TYPE_NEXT_SEQUENCE_RECV"] = 8; - values[valuesById[9] = "DATA_TYPE_HEADER"] = 9; - return values; - })(); - - v2.HeaderData = (function() { - - /** - * Properties of a HeaderData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IHeaderData - * @property {google.protobuf.IAny|null} [new_pub_key] HeaderData new_pub_key - * @property {string|null} [new_diversifier] HeaderData new_diversifier - */ - - /** - * Constructs a new HeaderData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a HeaderData. - * @implements IHeaderData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IHeaderData=} [properties] Properties to set - */ - function HeaderData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HeaderData new_pub_key. - * @member {google.protobuf.IAny|null|undefined} new_pub_key - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @instance - */ - HeaderData.prototype.new_pub_key = null; - - /** - * HeaderData new_diversifier. - * @member {string} new_diversifier - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @instance - */ - HeaderData.prototype.new_diversifier = ""; - - /** - * Encodes the specified HeaderData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.HeaderData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v2.IHeaderData} message HeaderData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeaderData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.new_pub_key != null && Object.hasOwnProperty.call(message, "new_pub_key")) - $root.google.protobuf.Any.encode(message.new_pub_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.new_diversifier != null && Object.hasOwnProperty.call(message, "new_diversifier")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.new_diversifier); - return writer; - }; - - /** - * Encodes the specified HeaderData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.HeaderData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v2.IHeaderData} message HeaderData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeaderData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HeaderData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.HeaderData} HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeaderData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.HeaderData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.new_pub_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.new_diversifier = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HeaderData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.HeaderData} HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeaderData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HeaderData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HeaderData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.new_pub_key != null && message.hasOwnProperty("new_pub_key")) { - var error = $root.google.protobuf.Any.verify(message.new_pub_key); - if (error) - return "new_pub_key." + error; - } - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - if (!$util.isString(message.new_diversifier)) - return "new_diversifier: string expected"; - return null; - }; - - /** - * Creates a HeaderData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.HeaderData} HeaderData - */ - HeaderData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.HeaderData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.HeaderData(); - if (object.new_pub_key != null) { - if (typeof object.new_pub_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.HeaderData.new_pub_key: object expected"); - message.new_pub_key = $root.google.protobuf.Any.fromObject(object.new_pub_key); - } - if (object.new_diversifier != null) - message.new_diversifier = String(object.new_diversifier); - return message; - }; - - /** - * Creates a plain object from a HeaderData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v2.HeaderData} message HeaderData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HeaderData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.new_pub_key = null; - object.new_diversifier = ""; - } - if (message.new_pub_key != null && message.hasOwnProperty("new_pub_key")) - object.new_pub_key = $root.google.protobuf.Any.toObject(message.new_pub_key, options); - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - object.new_diversifier = message.new_diversifier; - return object; - }; - - /** - * Converts this HeaderData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @instance - * @returns {Object.} JSON object - */ - HeaderData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HeaderData; - })(); - - v2.ClientStateData = (function() { - - /** - * Properties of a ClientStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IClientStateData - * @property {Uint8Array|null} [path] ClientStateData path - * @property {google.protobuf.IAny|null} [client_state] ClientStateData client_state - */ - - /** - * Constructs a new ClientStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ClientStateData. - * @implements IClientStateData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IClientStateData=} [properties] Properties to set - */ - function ClientStateData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @instance - */ - ClientStateData.prototype.path = $util.newBuffer([]); - - /** - * ClientStateData client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @instance - */ - ClientStateData.prototype.client_state = null; - - /** - * Encodes the specified ClientStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IClientStateData} message ClientStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IClientStateData} message ClientStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ClientStateData} ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ClientStateData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ClientStateData} ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - var error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - return null; - }; - - /** - * Creates a ClientStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ClientStateData} ClientStateData - */ - ClientStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ClientStateData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.ClientStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ClientStateData.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - return message; - }; - - /** - * Creates a plain object from a ClientStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v2.ClientStateData} message ClientStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.client_state = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - return object; - }; - - /** - * Converts this ClientStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @instance - * @returns {Object.} JSON object - */ - ClientStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientStateData; - })(); - - v2.ConsensusStateData = (function() { - - /** - * Properties of a ConsensusStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IConsensusStateData - * @property {Uint8Array|null} [path] ConsensusStateData path - * @property {google.protobuf.IAny|null} [consensus_state] ConsensusStateData consensus_state - */ - - /** - * Constructs a new ConsensusStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ConsensusStateData. - * @implements IConsensusStateData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IConsensusStateData=} [properties] Properties to set - */ - function ConsensusStateData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @instance - */ - ConsensusStateData.prototype.path = $util.newBuffer([]); - - /** - * ConsensusStateData consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @instance - */ - ConsensusStateData.prototype.consensus_state = null; - - /** - * Encodes the specified ConsensusStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IConsensusStateData} message ConsensusStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConsensusStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IConsensusStateData} message ConsensusStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ConsensusStateData} ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ConsensusStateData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ConsensusStateData} ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - return null; - }; - - /** - * Creates a ConsensusStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ConsensusStateData} ConsensusStateData - */ - ConsensusStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ConsensusStateData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.ConsensusStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ConsensusStateData.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - return message; - }; - - /** - * Creates a plain object from a ConsensusStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v2.ConsensusStateData} message ConsensusStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.consensus_state = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - return object; - }; - - /** - * Converts this ConsensusStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @instance - * @returns {Object.} JSON object - */ - ConsensusStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusStateData; - })(); - - v2.ConnectionStateData = (function() { - - /** - * Properties of a ConnectionStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IConnectionStateData - * @property {Uint8Array|null} [path] ConnectionStateData path - * @property {ibc.core.connection.v1.IConnectionEnd|null} [connection] ConnectionStateData connection - */ - - /** - * Constructs a new ConnectionStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ConnectionStateData. - * @implements IConnectionStateData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IConnectionStateData=} [properties] Properties to set - */ - function ConnectionStateData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @instance - */ - ConnectionStateData.prototype.path = $util.newBuffer([]); - - /** - * ConnectionStateData connection. - * @member {ibc.core.connection.v1.IConnectionEnd|null|undefined} connection - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @instance - */ - ConnectionStateData.prototype.connection = null; - - /** - * Encodes the specified ConnectionStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConnectionStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IConnectionStateData} message ConnectionStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - $root.ibc.core.connection.v1.ConnectionEnd.encode(message.connection, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConnectionStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConnectionStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IConnectionStateData} message ConnectionStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ConnectionStateData} ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ConnectionStateData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ConnectionStateData} ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.connection != null && message.hasOwnProperty("connection")) { - var error = $root.ibc.core.connection.v1.ConnectionEnd.verify(message.connection); - if (error) - return "connection." + error; - } - return null; - }; - - /** - * Creates a ConnectionStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ConnectionStateData} ConnectionStateData - */ - ConnectionStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ConnectionStateData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.ConnectionStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.connection != null) { - if (typeof object.connection !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ConnectionStateData.connection: object expected"); - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.fromObject(object.connection); - } - return message; - }; - - /** - * Creates a plain object from a ConnectionStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v2.ConnectionStateData} message ConnectionStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.connection = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = $root.ibc.core.connection.v1.ConnectionEnd.toObject(message.connection, options); - return object; - }; - - /** - * Converts this ConnectionStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @instance - * @returns {Object.} JSON object - */ - ConnectionStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConnectionStateData; - })(); - - v2.ChannelStateData = (function() { - - /** - * Properties of a ChannelStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IChannelStateData - * @property {Uint8Array|null} [path] ChannelStateData path - * @property {ibc.core.channel.v1.IChannel|null} [channel] ChannelStateData channel - */ - - /** - * Constructs a new ChannelStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ChannelStateData. - * @implements IChannelStateData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IChannelStateData=} [properties] Properties to set - */ - function ChannelStateData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChannelStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @instance - */ - ChannelStateData.prototype.path = $util.newBuffer([]); - - /** - * ChannelStateData channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @instance - */ - ChannelStateData.prototype.channel = null; - - /** - * Encodes the specified ChannelStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ChannelStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IChannelStateData} message ChannelStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChannelStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ChannelStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IChannelStateData} message ChannelStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ChannelStateData} ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ChannelStateData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ChannelStateData} ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChannelStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChannelStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - var error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - return null; - }; - - /** - * Creates a ChannelStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ChannelStateData} ChannelStateData - */ - ChannelStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ChannelStateData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.ChannelStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ChannelStateData.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - return message; - }; - - /** - * Creates a plain object from a ChannelStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v2.ChannelStateData} message ChannelStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChannelStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.channel = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - return object; - }; - - /** - * Converts this ChannelStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @instance - * @returns {Object.} JSON object - */ - ChannelStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ChannelStateData; - })(); - - v2.PacketCommitmentData = (function() { - - /** - * Properties of a PacketCommitmentData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IPacketCommitmentData - * @property {Uint8Array|null} [path] PacketCommitmentData path - * @property {Uint8Array|null} [commitment] PacketCommitmentData commitment - */ - - /** - * Constructs a new PacketCommitmentData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a PacketCommitmentData. - * @implements IPacketCommitmentData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IPacketCommitmentData=} [properties] Properties to set - */ - function PacketCommitmentData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketCommitmentData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @instance - */ - PacketCommitmentData.prototype.path = $util.newBuffer([]); - - /** - * PacketCommitmentData commitment. - * @member {Uint8Array} commitment - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @instance - */ - PacketCommitmentData.prototype.commitment = $util.newBuffer([]); - - /** - * Encodes the specified PacketCommitmentData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketCommitmentData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketCommitmentData} message PacketCommitmentData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketCommitmentData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.commitment); - return writer; - }; - - /** - * Encodes the specified PacketCommitmentData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketCommitmentData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketCommitmentData} message PacketCommitmentData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketCommitmentData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.PacketCommitmentData} PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketCommitmentData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.PacketCommitmentData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.commitment = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.PacketCommitmentData} PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketCommitmentData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketCommitmentData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketCommitmentData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.commitment != null && message.hasOwnProperty("commitment")) - if (!(message.commitment && typeof message.commitment.length === "number" || $util.isString(message.commitment))) - return "commitment: buffer expected"; - return null; - }; - - /** - * Creates a PacketCommitmentData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.PacketCommitmentData} PacketCommitmentData - */ - PacketCommitmentData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.PacketCommitmentData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.PacketCommitmentData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.commitment != null) - if (typeof object.commitment === "string") - $util.base64.decode(object.commitment, message.commitment = $util.newBuffer($util.base64.length(object.commitment)), 0); - else if (object.commitment.length) - message.commitment = object.commitment; - return message; - }; - - /** - * Creates a plain object from a PacketCommitmentData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v2.PacketCommitmentData} message PacketCommitmentData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketCommitmentData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (options.bytes === String) - object.commitment = ""; - else { - object.commitment = []; - if (options.bytes !== Array) - object.commitment = $util.newBuffer(object.commitment); - } - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.commitment != null && message.hasOwnProperty("commitment")) - object.commitment = options.bytes === String ? $util.base64.encode(message.commitment, 0, message.commitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.commitment) : message.commitment; - return object; - }; - - /** - * Converts this PacketCommitmentData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @instance - * @returns {Object.} JSON object - */ - PacketCommitmentData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketCommitmentData; - })(); - - v2.PacketAcknowledgementData = (function() { - - /** - * Properties of a PacketAcknowledgementData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IPacketAcknowledgementData - * @property {Uint8Array|null} [path] PacketAcknowledgementData path - * @property {Uint8Array|null} [acknowledgement] PacketAcknowledgementData acknowledgement - */ - - /** - * Constructs a new PacketAcknowledgementData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a PacketAcknowledgementData. - * @implements IPacketAcknowledgementData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IPacketAcknowledgementData=} [properties] Properties to set - */ - function PacketAcknowledgementData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketAcknowledgementData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @instance - */ - PacketAcknowledgementData.prototype.path = $util.newBuffer([]); - - /** - * PacketAcknowledgementData acknowledgement. - * @member {Uint8Array} acknowledgement - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @instance - */ - PacketAcknowledgementData.prototype.acknowledgement = $util.newBuffer([]); - - /** - * Encodes the specified PacketAcknowledgementData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketAcknowledgementData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketAcknowledgementData} message PacketAcknowledgementData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketAcknowledgementData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.acknowledgement); - return writer; - }; - - /** - * Encodes the specified PacketAcknowledgementData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketAcknowledgementData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketAcknowledgementData} message PacketAcknowledgementData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketAcknowledgementData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.PacketAcknowledgementData} PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketAcknowledgementData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.PacketAcknowledgementData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.acknowledgement = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.PacketAcknowledgementData} PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketAcknowledgementData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketAcknowledgementData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketAcknowledgementData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) - return "acknowledgement: buffer expected"; - return null; - }; - - /** - * Creates a PacketAcknowledgementData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.PacketAcknowledgementData} PacketAcknowledgementData - */ - PacketAcknowledgementData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.PacketAcknowledgementData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.PacketAcknowledgementData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.acknowledgement != null) - if (typeof object.acknowledgement === "string") - $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); - else if (object.acknowledgement.length) - message.acknowledgement = object.acknowledgement; - return message; - }; - - /** - * Creates a plain object from a PacketAcknowledgementData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v2.PacketAcknowledgementData} message PacketAcknowledgementData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketAcknowledgementData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (options.bytes === String) - object.acknowledgement = ""; - else { - object.acknowledgement = []; - if (options.bytes !== Array) - object.acknowledgement = $util.newBuffer(object.acknowledgement); - } - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; - return object; - }; - - /** - * Converts this PacketAcknowledgementData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @instance - * @returns {Object.} JSON object - */ - PacketAcknowledgementData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketAcknowledgementData; - })(); - - v2.PacketReceiptAbsenceData = (function() { - - /** - * Properties of a PacketReceiptAbsenceData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IPacketReceiptAbsenceData - * @property {Uint8Array|null} [path] PacketReceiptAbsenceData path - */ - - /** - * Constructs a new PacketReceiptAbsenceData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a PacketReceiptAbsenceData. - * @implements IPacketReceiptAbsenceData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IPacketReceiptAbsenceData=} [properties] Properties to set - */ - function PacketReceiptAbsenceData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketReceiptAbsenceData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @instance - */ - PacketReceiptAbsenceData.prototype.path = $util.newBuffer([]); - - /** - * Encodes the specified PacketReceiptAbsenceData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketReceiptAbsenceData} message PacketReceiptAbsenceData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketReceiptAbsenceData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - return writer; - }; - - /** - * Encodes the specified PacketReceiptAbsenceData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketReceiptAbsenceData} message PacketReceiptAbsenceData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketReceiptAbsenceData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData} PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketReceiptAbsenceData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData} PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketReceiptAbsenceData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketReceiptAbsenceData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketReceiptAbsenceData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - return null; - }; - - /** - * Creates a PacketReceiptAbsenceData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData} PacketReceiptAbsenceData - */ - PacketReceiptAbsenceData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - return message; - }; - - /** - * Creates a plain object from a PacketReceiptAbsenceData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData} message PacketReceiptAbsenceData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketReceiptAbsenceData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - return object; - }; - - /** - * Converts this PacketReceiptAbsenceData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @instance - * @returns {Object.} JSON object - */ - PacketReceiptAbsenceData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketReceiptAbsenceData; - })(); - - v2.NextSequenceRecvData = (function() { - - /** - * Properties of a NextSequenceRecvData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface INextSequenceRecvData - * @property {Uint8Array|null} [path] NextSequenceRecvData path - * @property {Long|null} [next_seq_recv] NextSequenceRecvData next_seq_recv - */ - - /** - * Constructs a new NextSequenceRecvData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a NextSequenceRecvData. - * @implements INextSequenceRecvData - * @constructor - * @param {ibc.lightclients.solomachine.v2.INextSequenceRecvData=} [properties] Properties to set - */ - function NextSequenceRecvData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NextSequenceRecvData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @instance - */ - NextSequenceRecvData.prototype.path = $util.newBuffer([]); - - /** - * NextSequenceRecvData next_seq_recv. - * @member {Long} next_seq_recv - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @instance - */ - NextSequenceRecvData.prototype.next_seq_recv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified NextSequenceRecvData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.NextSequenceRecvData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v2.INextSequenceRecvData} message NextSequenceRecvData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NextSequenceRecvData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.next_seq_recv != null && Object.hasOwnProperty.call(message, "next_seq_recv")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.next_seq_recv); - return writer; - }; - - /** - * Encodes the specified NextSequenceRecvData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.NextSequenceRecvData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v2.INextSequenceRecvData} message NextSequenceRecvData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NextSequenceRecvData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.NextSequenceRecvData} NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NextSequenceRecvData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.NextSequenceRecvData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.next_seq_recv = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.NextSequenceRecvData} NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NextSequenceRecvData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NextSequenceRecvData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NextSequenceRecvData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.next_seq_recv != null && message.hasOwnProperty("next_seq_recv")) - if (!$util.isInteger(message.next_seq_recv) && !(message.next_seq_recv && $util.isInteger(message.next_seq_recv.low) && $util.isInteger(message.next_seq_recv.high))) - return "next_seq_recv: integer|Long expected"; - return null; - }; - - /** - * Creates a NextSequenceRecvData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.NextSequenceRecvData} NextSequenceRecvData - */ - NextSequenceRecvData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.NextSequenceRecvData) - return object; - var message = new $root.ibc.lightclients.solomachine.v2.NextSequenceRecvData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.next_seq_recv != null) - if ($util.Long) - (message.next_seq_recv = $util.Long.fromValue(object.next_seq_recv)).unsigned = true; - else if (typeof object.next_seq_recv === "string") - message.next_seq_recv = parseInt(object.next_seq_recv, 10); - else if (typeof object.next_seq_recv === "number") - message.next_seq_recv = object.next_seq_recv; - else if (typeof object.next_seq_recv === "object") - message.next_seq_recv = new $util.LongBits(object.next_seq_recv.low >>> 0, object.next_seq_recv.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a NextSequenceRecvData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v2.NextSequenceRecvData} message NextSequenceRecvData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NextSequenceRecvData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.next_seq_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_seq_recv = options.longs === String ? "0" : 0; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.next_seq_recv != null && message.hasOwnProperty("next_seq_recv")) - if (typeof message.next_seq_recv === "number") - object.next_seq_recv = options.longs === String ? String(message.next_seq_recv) : message.next_seq_recv; - else - object.next_seq_recv = options.longs === String ? $util.Long.prototype.toString.call(message.next_seq_recv) : options.longs === Number ? new $util.LongBits(message.next_seq_recv.low >>> 0, message.next_seq_recv.high >>> 0).toNumber(true) : message.next_seq_recv; - return object; - }; - - /** - * Converts this NextSequenceRecvData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @instance - * @returns {Object.} JSON object - */ - NextSequenceRecvData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NextSequenceRecvData; - })(); - - return v2; - })(); - - return solomachine; - })(); - - lightclients.tendermint = (function() { - - /** - * Namespace tendermint. - * @memberof ibc.lightclients - * @namespace - */ - var tendermint = {}; - - tendermint.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.lightclients.tendermint - * @namespace - */ - var v1 = {}; - - v1.ClientState = (function() { - - /** - * Properties of a ClientState. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IClientState - * @property {string|null} [chain_id] ClientState chain_id - * @property {ibc.lightclients.tendermint.v1.IFraction|null} [trust_level] ClientState trust_level - * @property {google.protobuf.IDuration|null} [trusting_period] ClientState trusting_period - * @property {google.protobuf.IDuration|null} [unbonding_period] ClientState unbonding_period - * @property {google.protobuf.IDuration|null} [max_clock_drift] ClientState max_clock_drift - * @property {ibc.core.client.v1.IHeight|null} [frozen_height] ClientState frozen_height - * @property {ibc.core.client.v1.IHeight|null} [latest_height] ClientState latest_height - * @property {Array.|null} [proof_specs] ClientState proof_specs - * @property {Array.|null} [upgrade_path] ClientState upgrade_path - * @property {boolean|null} [allow_update_after_expiry] ClientState allow_update_after_expiry - * @property {boolean|null} [allow_update_after_misbehaviour] ClientState allow_update_after_misbehaviour - */ - - /** - * Constructs a new ClientState. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a ClientState. - * @implements IClientState - * @constructor - * @param {ibc.lightclients.tendermint.v1.IClientState=} [properties] Properties to set - */ - function ClientState(properties) { - this.proof_specs = []; - this.upgrade_path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientState chain_id. - * @member {string} chain_id - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.chain_id = ""; - - /** - * ClientState trust_level. - * @member {ibc.lightclients.tendermint.v1.IFraction|null|undefined} trust_level - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.trust_level = null; - - /** - * ClientState trusting_period. - * @member {google.protobuf.IDuration|null|undefined} trusting_period - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.trusting_period = null; - - /** - * ClientState unbonding_period. - * @member {google.protobuf.IDuration|null|undefined} unbonding_period - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.unbonding_period = null; - - /** - * ClientState max_clock_drift. - * @member {google.protobuf.IDuration|null|undefined} max_clock_drift - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.max_clock_drift = null; - - /** - * ClientState frozen_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} frozen_height - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.frozen_height = null; - - /** - * ClientState latest_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} latest_height - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.latest_height = null; - - /** - * ClientState proof_specs. - * @member {Array.} proof_specs - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.proof_specs = $util.emptyArray; - - /** - * ClientState upgrade_path. - * @member {Array.} upgrade_path - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.upgrade_path = $util.emptyArray; - - /** - * ClientState allow_update_after_expiry. - * @member {boolean} allow_update_after_expiry - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.allow_update_after_expiry = false; - - /** - * ClientState allow_update_after_misbehaviour. - * @member {boolean} allow_update_after_misbehaviour - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.allow_update_after_misbehaviour = false; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.tendermint.v1.ClientState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {ibc.lightclients.tendermint.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chain_id != null && Object.hasOwnProperty.call(message, "chain_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.chain_id); - if (message.trust_level != null && Object.hasOwnProperty.call(message, "trust_level")) - $root.ibc.lightclients.tendermint.v1.Fraction.encode(message.trust_level, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.trusting_period != null && Object.hasOwnProperty.call(message, "trusting_period")) - $root.google.protobuf.Duration.encode(message.trusting_period, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.unbonding_period != null && Object.hasOwnProperty.call(message, "unbonding_period")) - $root.google.protobuf.Duration.encode(message.unbonding_period, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.max_clock_drift != null && Object.hasOwnProperty.call(message, "max_clock_drift")) - $root.google.protobuf.Duration.encode(message.max_clock_drift, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.frozen_height != null && Object.hasOwnProperty.call(message, "frozen_height")) - $root.ibc.core.client.v1.Height.encode(message.frozen_height, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.latest_height != null && Object.hasOwnProperty.call(message, "latest_height")) - $root.ibc.core.client.v1.Height.encode(message.latest_height, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.proof_specs != null && message.proof_specs.length) - for (var i = 0; i < message.proof_specs.length; ++i) - $root.ics23.ProofSpec.encode(message.proof_specs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.upgrade_path != null && message.upgrade_path.length) - for (var i = 0; i < message.upgrade_path.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.upgrade_path[i]); - if (message.allow_update_after_expiry != null && Object.hasOwnProperty.call(message, "allow_update_after_expiry")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.allow_update_after_expiry); - if (message.allow_update_after_misbehaviour != null && Object.hasOwnProperty.call(message, "allow_update_after_misbehaviour")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.allow_update_after_misbehaviour); - return writer; - }; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.ClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {ibc.lightclients.tendermint.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.ClientState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.chain_id = reader.string(); - break; - case 2: - message.trust_level = $root.ibc.lightclients.tendermint.v1.Fraction.decode(reader, reader.uint32()); - break; - case 3: - message.trusting_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 4: - message.unbonding_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: - message.max_clock_drift = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 6: - message.frozen_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 7: - message.latest_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 8: - if (!(message.proof_specs && message.proof_specs.length)) - message.proof_specs = []; - message.proof_specs.push($root.ics23.ProofSpec.decode(reader, reader.uint32())); - break; - case 9: - if (!(message.upgrade_path && message.upgrade_path.length)) - message.upgrade_path = []; - message.upgrade_path.push(reader.string()); - break; - case 10: - message.allow_update_after_expiry = reader.bool(); - break; - case 11: - message.allow_update_after_misbehaviour = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientState message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - if (!$util.isString(message.chain_id)) - return "chain_id: string expected"; - if (message.trust_level != null && message.hasOwnProperty("trust_level")) { - var error = $root.ibc.lightclients.tendermint.v1.Fraction.verify(message.trust_level); - if (error) - return "trust_level." + error; - } - if (message.trusting_period != null && message.hasOwnProperty("trusting_period")) { - var error = $root.google.protobuf.Duration.verify(message.trusting_period); - if (error) - return "trusting_period." + error; - } - if (message.unbonding_period != null && message.hasOwnProperty("unbonding_period")) { - var error = $root.google.protobuf.Duration.verify(message.unbonding_period); - if (error) - return "unbonding_period." + error; - } - if (message.max_clock_drift != null && message.hasOwnProperty("max_clock_drift")) { - var error = $root.google.protobuf.Duration.verify(message.max_clock_drift); - if (error) - return "max_clock_drift." + error; - } - if (message.frozen_height != null && message.hasOwnProperty("frozen_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.frozen_height); - if (error) - return "frozen_height." + error; - } - if (message.latest_height != null && message.hasOwnProperty("latest_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.latest_height); - if (error) - return "latest_height." + error; - } - if (message.proof_specs != null && message.hasOwnProperty("proof_specs")) { - if (!Array.isArray(message.proof_specs)) - return "proof_specs: array expected"; - for (var i = 0; i < message.proof_specs.length; ++i) { - var error = $root.ics23.ProofSpec.verify(message.proof_specs[i]); - if (error) - return "proof_specs." + error; - } - } - if (message.upgrade_path != null && message.hasOwnProperty("upgrade_path")) { - if (!Array.isArray(message.upgrade_path)) - return "upgrade_path: array expected"; - for (var i = 0; i < message.upgrade_path.length; ++i) - if (!$util.isString(message.upgrade_path[i])) - return "upgrade_path: string[] expected"; - } - if (message.allow_update_after_expiry != null && message.hasOwnProperty("allow_update_after_expiry")) - if (typeof message.allow_update_after_expiry !== "boolean") - return "allow_update_after_expiry: boolean expected"; - if (message.allow_update_after_misbehaviour != null && message.hasOwnProperty("allow_update_after_misbehaviour")) - if (typeof message.allow_update_after_misbehaviour !== "boolean") - return "allow_update_after_misbehaviour: boolean expected"; - return null; - }; - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.ClientState} ClientState - */ - ClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.ClientState) - return object; - var message = new $root.ibc.lightclients.tendermint.v1.ClientState(); - if (object.chain_id != null) - message.chain_id = String(object.chain_id); - if (object.trust_level != null) { - if (typeof object.trust_level !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.trust_level: object expected"); - message.trust_level = $root.ibc.lightclients.tendermint.v1.Fraction.fromObject(object.trust_level); - } - if (object.trusting_period != null) { - if (typeof object.trusting_period !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.trusting_period: object expected"); - message.trusting_period = $root.google.protobuf.Duration.fromObject(object.trusting_period); - } - if (object.unbonding_period != null) { - if (typeof object.unbonding_period !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.unbonding_period: object expected"); - message.unbonding_period = $root.google.protobuf.Duration.fromObject(object.unbonding_period); - } - if (object.max_clock_drift != null) { - if (typeof object.max_clock_drift !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.max_clock_drift: object expected"); - message.max_clock_drift = $root.google.protobuf.Duration.fromObject(object.max_clock_drift); - } - if (object.frozen_height != null) { - if (typeof object.frozen_height !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.frozen_height: object expected"); - message.frozen_height = $root.ibc.core.client.v1.Height.fromObject(object.frozen_height); - } - if (object.latest_height != null) { - if (typeof object.latest_height !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.latest_height: object expected"); - message.latest_height = $root.ibc.core.client.v1.Height.fromObject(object.latest_height); - } - if (object.proof_specs) { - if (!Array.isArray(object.proof_specs)) - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.proof_specs: array expected"); - message.proof_specs = []; - for (var i = 0; i < object.proof_specs.length; ++i) { - if (typeof object.proof_specs[i] !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.proof_specs: object expected"); - message.proof_specs[i] = $root.ics23.ProofSpec.fromObject(object.proof_specs[i]); - } - } - if (object.upgrade_path) { - if (!Array.isArray(object.upgrade_path)) - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.upgrade_path: array expected"); - message.upgrade_path = []; - for (var i = 0; i < object.upgrade_path.length; ++i) - message.upgrade_path[i] = String(object.upgrade_path[i]); - } - if (object.allow_update_after_expiry != null) - message.allow_update_after_expiry = Boolean(object.allow_update_after_expiry); - if (object.allow_update_after_misbehaviour != null) - message.allow_update_after_misbehaviour = Boolean(object.allow_update_after_misbehaviour); - return message; - }; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {ibc.lightclients.tendermint.v1.ClientState} message ClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.proof_specs = []; - object.upgrade_path = []; - } - if (options.defaults) { - object.chain_id = ""; - object.trust_level = null; - object.trusting_period = null; - object.unbonding_period = null; - object.max_clock_drift = null; - object.frozen_height = null; - object.latest_height = null; - object.allow_update_after_expiry = false; - object.allow_update_after_misbehaviour = false; - } - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - object.chain_id = message.chain_id; - if (message.trust_level != null && message.hasOwnProperty("trust_level")) - object.trust_level = $root.ibc.lightclients.tendermint.v1.Fraction.toObject(message.trust_level, options); - if (message.trusting_period != null && message.hasOwnProperty("trusting_period")) - object.trusting_period = $root.google.protobuf.Duration.toObject(message.trusting_period, options); - if (message.unbonding_period != null && message.hasOwnProperty("unbonding_period")) - object.unbonding_period = $root.google.protobuf.Duration.toObject(message.unbonding_period, options); - if (message.max_clock_drift != null && message.hasOwnProperty("max_clock_drift")) - object.max_clock_drift = $root.google.protobuf.Duration.toObject(message.max_clock_drift, options); - if (message.frozen_height != null && message.hasOwnProperty("frozen_height")) - object.frozen_height = $root.ibc.core.client.v1.Height.toObject(message.frozen_height, options); - if (message.latest_height != null && message.hasOwnProperty("latest_height")) - object.latest_height = $root.ibc.core.client.v1.Height.toObject(message.latest_height, options); - if (message.proof_specs && message.proof_specs.length) { - object.proof_specs = []; - for (var j = 0; j < message.proof_specs.length; ++j) - object.proof_specs[j] = $root.ics23.ProofSpec.toObject(message.proof_specs[j], options); - } - if (message.upgrade_path && message.upgrade_path.length) { - object.upgrade_path = []; - for (var j = 0; j < message.upgrade_path.length; ++j) - object.upgrade_path[j] = message.upgrade_path[j]; - } - if (message.allow_update_after_expiry != null && message.hasOwnProperty("allow_update_after_expiry")) - object.allow_update_after_expiry = message.allow_update_after_expiry; - if (message.allow_update_after_misbehaviour != null && message.hasOwnProperty("allow_update_after_misbehaviour")) - object.allow_update_after_misbehaviour = message.allow_update_after_misbehaviour; - return object; - }; - - /** - * Converts this ClientState to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - * @returns {Object.} JSON object - */ - ClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientState; - })(); - - v1.ConsensusState = (function() { - - /** - * Properties of a ConsensusState. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IConsensusState - * @property {google.protobuf.ITimestamp|null} [timestamp] ConsensusState timestamp - * @property {ibc.core.commitment.v1.IMerkleRoot|null} [root] ConsensusState root - * @property {Uint8Array|null} [next_validators_hash] ConsensusState next_validators_hash - */ - - /** - * Constructs a new ConsensusState. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a ConsensusState. - * @implements IConsensusState - * @constructor - * @param {ibc.lightclients.tendermint.v1.IConsensusState=} [properties] Properties to set - */ - function ConsensusState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusState timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.timestamp = null; - - /** - * ConsensusState root. - * @member {ibc.core.commitment.v1.IMerkleRoot|null|undefined} root - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.root = null; - - /** - * ConsensusState next_validators_hash. - * @member {Uint8Array} next_validators_hash - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.next_validators_hash = $util.newBuffer([]); - - /** - * Encodes the specified ConsensusState message. Does not implicitly {@link ibc.lightclients.tendermint.v1.ConsensusState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {ibc.lightclients.tendermint.v1.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.root != null && Object.hasOwnProperty.call(message, "root")) - $root.ibc.core.commitment.v1.MerkleRoot.encode(message.root, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.next_validators_hash != null && Object.hasOwnProperty.call(message, "next_validators_hash")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.next_validators_hash); - return writer; - }; - - /** - * Encodes the specified ConsensusState message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.ConsensusState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {ibc.lightclients.tendermint.v1.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.ConsensusState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.root = $root.ibc.core.commitment.v1.MerkleRoot.decode(reader, reader.uint32()); - break; - case 3: - message.next_validators_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusState message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.root != null && message.hasOwnProperty("root")) { - var error = $root.ibc.core.commitment.v1.MerkleRoot.verify(message.root); - if (error) - return "root." + error; - } - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - if (!(message.next_validators_hash && typeof message.next_validators_hash.length === "number" || $util.isString(message.next_validators_hash))) - return "next_validators_hash: buffer expected"; - return null; - }; - - /** - * Creates a ConsensusState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.ConsensusState} ConsensusState - */ - ConsensusState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.ConsensusState) - return object; - var message = new $root.ibc.lightclients.tendermint.v1.ConsensusState(); - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ConsensusState.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.root != null) { - if (typeof object.root !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ConsensusState.root: object expected"); - message.root = $root.ibc.core.commitment.v1.MerkleRoot.fromObject(object.root); - } - if (object.next_validators_hash != null) - if (typeof object.next_validators_hash === "string") - $util.base64.decode(object.next_validators_hash, message.next_validators_hash = $util.newBuffer($util.base64.length(object.next_validators_hash)), 0); - else if (object.next_validators_hash.length) - message.next_validators_hash = object.next_validators_hash; - return message; - }; - - /** - * Creates a plain object from a ConsensusState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {ibc.lightclients.tendermint.v1.ConsensusState} message ConsensusState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.timestamp = null; - object.root = null; - if (options.bytes === String) - object.next_validators_hash = ""; - else { - object.next_validators_hash = []; - if (options.bytes !== Array) - object.next_validators_hash = $util.newBuffer(object.next_validators_hash); - } - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.root != null && message.hasOwnProperty("root")) - object.root = $root.ibc.core.commitment.v1.MerkleRoot.toObject(message.root, options); - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - object.next_validators_hash = options.bytes === String ? $util.base64.encode(message.next_validators_hash, 0, message.next_validators_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.next_validators_hash) : message.next_validators_hash; - return object; - }; - - /** - * Converts this ConsensusState to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @instance - * @returns {Object.} JSON object - */ - ConsensusState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusState; - })(); - - v1.Misbehaviour = (function() { - - /** - * Properties of a Misbehaviour. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IMisbehaviour - * @property {string|null} [client_id] Misbehaviour client_id - * @property {ibc.lightclients.tendermint.v1.IHeader|null} [header_1] Misbehaviour header_1 - * @property {ibc.lightclients.tendermint.v1.IHeader|null} [header_2] Misbehaviour header_2 - */ - - /** - * Constructs a new Misbehaviour. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a Misbehaviour. - * @implements IMisbehaviour - * @constructor - * @param {ibc.lightclients.tendermint.v1.IMisbehaviour=} [properties] Properties to set - */ - function Misbehaviour(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Misbehaviour client_id. - * @member {string} client_id - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.client_id = ""; - - /** - * Misbehaviour header_1. - * @member {ibc.lightclients.tendermint.v1.IHeader|null|undefined} header_1 - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.header_1 = null; - - /** - * Misbehaviour header_2. - * @member {ibc.lightclients.tendermint.v1.IHeader|null|undefined} header_2 - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.header_2 = null; - - /** - * Encodes the specified Misbehaviour message. Does not implicitly {@link ibc.lightclients.tendermint.v1.Misbehaviour.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {ibc.lightclients.tendermint.v1.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.header_1 != null && Object.hasOwnProperty.call(message, "header_1")) - $root.ibc.lightclients.tendermint.v1.Header.encode(message.header_1, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.header_2 != null && Object.hasOwnProperty.call(message, "header_2")) - $root.ibc.lightclients.tendermint.v1.Header.encode(message.header_2, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Misbehaviour message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.Misbehaviour.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {ibc.lightclients.tendermint.v1.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.Misbehaviour(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.header_1 = $root.ibc.lightclients.tendermint.v1.Header.decode(reader, reader.uint32()); - break; - case 3: - message.header_2 = $root.ibc.lightclients.tendermint.v1.Header.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Misbehaviour message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Misbehaviour.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.header_1 != null && message.hasOwnProperty("header_1")) { - var error = $root.ibc.lightclients.tendermint.v1.Header.verify(message.header_1); - if (error) - return "header_1." + error; - } - if (message.header_2 != null && message.hasOwnProperty("header_2")) { - var error = $root.ibc.lightclients.tendermint.v1.Header.verify(message.header_2); - if (error) - return "header_2." + error; - } - return null; - }; - - /** - * Creates a Misbehaviour message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.Misbehaviour} Misbehaviour - */ - Misbehaviour.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.Misbehaviour) - return object; - var message = new $root.ibc.lightclients.tendermint.v1.Misbehaviour(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.header_1 != null) { - if (typeof object.header_1 !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Misbehaviour.header_1: object expected"); - message.header_1 = $root.ibc.lightclients.tendermint.v1.Header.fromObject(object.header_1); - } - if (object.header_2 != null) { - if (typeof object.header_2 !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Misbehaviour.header_2: object expected"); - message.header_2 = $root.ibc.lightclients.tendermint.v1.Header.fromObject(object.header_2); - } - return message; - }; - - /** - * Creates a plain object from a Misbehaviour message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {ibc.lightclients.tendermint.v1.Misbehaviour} message Misbehaviour - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Misbehaviour.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.header_1 = null; - object.header_2 = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.header_1 != null && message.hasOwnProperty("header_1")) - object.header_1 = $root.ibc.lightclients.tendermint.v1.Header.toObject(message.header_1, options); - if (message.header_2 != null && message.hasOwnProperty("header_2")) - object.header_2 = $root.ibc.lightclients.tendermint.v1.Header.toObject(message.header_2, options); - return object; - }; - - /** - * Converts this Misbehaviour to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @instance - * @returns {Object.} JSON object - */ - Misbehaviour.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Misbehaviour; - })(); - - v1.Header = (function() { - - /** - * Properties of a Header. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IHeader - * @property {tendermint.types.ISignedHeader|null} [signed_header] Header signed_header - * @property {tendermint.types.IValidatorSet|null} [validator_set] Header validator_set - * @property {ibc.core.client.v1.IHeight|null} [trusted_height] Header trusted_height - * @property {tendermint.types.IValidatorSet|null} [trusted_validators] Header trusted_validators - */ - - /** - * Constructs a new Header. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a Header. - * @implements IHeader - * @constructor - * @param {ibc.lightclients.tendermint.v1.IHeader=} [properties] Properties to set - */ - function Header(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Header signed_header. - * @member {tendermint.types.ISignedHeader|null|undefined} signed_header - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - */ - Header.prototype.signed_header = null; - - /** - * Header validator_set. - * @member {tendermint.types.IValidatorSet|null|undefined} validator_set - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - */ - Header.prototype.validator_set = null; - - /** - * Header trusted_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} trusted_height - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - */ - Header.prototype.trusted_height = null; - - /** - * Header trusted_validators. - * @member {tendermint.types.IValidatorSet|null|undefined} trusted_validators - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - */ - Header.prototype.trusted_validators = null; - - /** - * Encodes the specified Header message. Does not implicitly {@link ibc.lightclients.tendermint.v1.Header.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {ibc.lightclients.tendermint.v1.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signed_header != null && Object.hasOwnProperty.call(message, "signed_header")) - $root.tendermint.types.SignedHeader.encode(message.signed_header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.validator_set != null && Object.hasOwnProperty.call(message, "validator_set")) - $root.tendermint.types.ValidatorSet.encode(message.validator_set, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.trusted_height != null && Object.hasOwnProperty.call(message, "trusted_height")) - $root.ibc.core.client.v1.Height.encode(message.trusted_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.trusted_validators != null && Object.hasOwnProperty.call(message, "trusted_validators")) - $root.tendermint.types.ValidatorSet.encode(message.trusted_validators, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.Header.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {ibc.lightclients.tendermint.v1.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Header message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.Header(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signed_header = $root.tendermint.types.SignedHeader.decode(reader, reader.uint32()); - break; - case 2: - message.validator_set = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); - break; - case 3: - message.trusted_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 4: - message.trusted_validators = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Header message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Header.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signed_header != null && message.hasOwnProperty("signed_header")) { - var error = $root.tendermint.types.SignedHeader.verify(message.signed_header); - if (error) - return "signed_header." + error; - } - if (message.validator_set != null && message.hasOwnProperty("validator_set")) { - var error = $root.tendermint.types.ValidatorSet.verify(message.validator_set); - if (error) - return "validator_set." + error; - } - if (message.trusted_height != null && message.hasOwnProperty("trusted_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.trusted_height); - if (error) - return "trusted_height." + error; - } - if (message.trusted_validators != null && message.hasOwnProperty("trusted_validators")) { - var error = $root.tendermint.types.ValidatorSet.verify(message.trusted_validators); - if (error) - return "trusted_validators." + error; - } - return null; - }; - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.Header} Header - */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.Header) - return object; - var message = new $root.ibc.lightclients.tendermint.v1.Header(); - if (object.signed_header != null) { - if (typeof object.signed_header !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Header.signed_header: object expected"); - message.signed_header = $root.tendermint.types.SignedHeader.fromObject(object.signed_header); - } - if (object.validator_set != null) { - if (typeof object.validator_set !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Header.validator_set: object expected"); - message.validator_set = $root.tendermint.types.ValidatorSet.fromObject(object.validator_set); - } - if (object.trusted_height != null) { - if (typeof object.trusted_height !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Header.trusted_height: object expected"); - message.trusted_height = $root.ibc.core.client.v1.Height.fromObject(object.trusted_height); - } - if (object.trusted_validators != null) { - if (typeof object.trusted_validators !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Header.trusted_validators: object expected"); - message.trusted_validators = $root.tendermint.types.ValidatorSet.fromObject(object.trusted_validators); - } - return message; - }; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {ibc.lightclients.tendermint.v1.Header} message Header - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Header.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.signed_header = null; - object.validator_set = null; - object.trusted_height = null; - object.trusted_validators = null; - } - if (message.signed_header != null && message.hasOwnProperty("signed_header")) - object.signed_header = $root.tendermint.types.SignedHeader.toObject(message.signed_header, options); - if (message.validator_set != null && message.hasOwnProperty("validator_set")) - object.validator_set = $root.tendermint.types.ValidatorSet.toObject(message.validator_set, options); - if (message.trusted_height != null && message.hasOwnProperty("trusted_height")) - object.trusted_height = $root.ibc.core.client.v1.Height.toObject(message.trusted_height, options); - if (message.trusted_validators != null && message.hasOwnProperty("trusted_validators")) - object.trusted_validators = $root.tendermint.types.ValidatorSet.toObject(message.trusted_validators, options); - return object; - }; - - /** - * Converts this Header to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - * @returns {Object.} JSON object - */ - Header.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Header; - })(); - - v1.Fraction = (function() { - - /** - * Properties of a Fraction. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IFraction - * @property {Long|null} [numerator] Fraction numerator - * @property {Long|null} [denominator] Fraction denominator - */ - - /** - * Constructs a new Fraction. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a Fraction. - * @implements IFraction - * @constructor - * @param {ibc.lightclients.tendermint.v1.IFraction=} [properties] Properties to set - */ - function Fraction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Fraction numerator. - * @member {Long} numerator - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @instance - */ - Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Fraction denominator. - * @member {Long} denominator - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @instance - */ - Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Fraction message. Does not implicitly {@link ibc.lightclients.tendermint.v1.Fraction.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {ibc.lightclients.tendermint.v1.IFraction} message Fraction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fraction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.numerator != null && Object.hasOwnProperty.call(message, "numerator")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.numerator); - if (message.denominator != null && Object.hasOwnProperty.call(message, "denominator")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.denominator); - return writer; - }; - - /** - * Encodes the specified Fraction message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.Fraction.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {ibc.lightclients.tendermint.v1.IFraction} message Fraction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fraction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Fraction message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.Fraction} Fraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fraction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.Fraction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.numerator = reader.uint64(); - break; - case 2: - message.denominator = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Fraction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.Fraction} Fraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fraction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Fraction message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Fraction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.numerator != null && message.hasOwnProperty("numerator")) - if (!$util.isInteger(message.numerator) && !(message.numerator && $util.isInteger(message.numerator.low) && $util.isInteger(message.numerator.high))) - return "numerator: integer|Long expected"; - if (message.denominator != null && message.hasOwnProperty("denominator")) - if (!$util.isInteger(message.denominator) && !(message.denominator && $util.isInteger(message.denominator.low) && $util.isInteger(message.denominator.high))) - return "denominator: integer|Long expected"; - return null; - }; - - /** - * Creates a Fraction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.Fraction} Fraction - */ - Fraction.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.Fraction) - return object; - var message = new $root.ibc.lightclients.tendermint.v1.Fraction(); - if (object.numerator != null) - if ($util.Long) - (message.numerator = $util.Long.fromValue(object.numerator)).unsigned = true; - else if (typeof object.numerator === "string") - message.numerator = parseInt(object.numerator, 10); - else if (typeof object.numerator === "number") - message.numerator = object.numerator; - else if (typeof object.numerator === "object") - message.numerator = new $util.LongBits(object.numerator.low >>> 0, object.numerator.high >>> 0).toNumber(true); - if (object.denominator != null) - if ($util.Long) - (message.denominator = $util.Long.fromValue(object.denominator)).unsigned = true; - else if (typeof object.denominator === "string") - message.denominator = parseInt(object.denominator, 10); - else if (typeof object.denominator === "number") - message.denominator = object.denominator; - else if (typeof object.denominator === "object") - message.denominator = new $util.LongBits(object.denominator.low >>> 0, object.denominator.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Fraction message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {ibc.lightclients.tendermint.v1.Fraction} message Fraction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Fraction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.numerator = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.numerator = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.denominator = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.denominator = options.longs === String ? "0" : 0; - } - if (message.numerator != null && message.hasOwnProperty("numerator")) - if (typeof message.numerator === "number") - object.numerator = options.longs === String ? String(message.numerator) : message.numerator; - else - object.numerator = options.longs === String ? $util.Long.prototype.toString.call(message.numerator) : options.longs === Number ? new $util.LongBits(message.numerator.low >>> 0, message.numerator.high >>> 0).toNumber(true) : message.numerator; - if (message.denominator != null && message.hasOwnProperty("denominator")) - if (typeof message.denominator === "number") - object.denominator = options.longs === String ? String(message.denominator) : message.denominator; - else - object.denominator = options.longs === String ? $util.Long.prototype.toString.call(message.denominator) : options.longs === Number ? new $util.LongBits(message.denominator.low >>> 0, message.denominator.high >>> 0).toNumber(true) : message.denominator; - return object; - }; - - /** - * Converts this Fraction to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @instance - * @returns {Object.} JSON object - */ - Fraction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Fraction; - })(); - - return v1; - })(); - - return tendermint; - })(); - - return lightclients; - })(); - - return ibc; - })(); - - $root.ics23 = (function() { - - /** - * Namespace ics23. - * @exports ics23 - * @namespace - */ - var ics23 = {}; - - /** - * HashOp enum. - * @name ics23.HashOp - * @enum {number} - * @property {number} NO_HASH=0 NO_HASH value - * @property {number} SHA256=1 SHA256 value - * @property {number} SHA512=2 SHA512 value - * @property {number} KECCAK=3 KECCAK value - * @property {number} RIPEMD160=4 RIPEMD160 value - * @property {number} BITCOIN=5 BITCOIN value - */ - ics23.HashOp = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NO_HASH"] = 0; - values[valuesById[1] = "SHA256"] = 1; - values[valuesById[2] = "SHA512"] = 2; - values[valuesById[3] = "KECCAK"] = 3; - values[valuesById[4] = "RIPEMD160"] = 4; - values[valuesById[5] = "BITCOIN"] = 5; - return values; - })(); - - /** - * LengthOp defines how to process the key and value of the LeafOp - * to include length information. After encoding the length with the given - * algorithm, the length will be prepended to the key and value bytes. - * (Each one with it's own encoded length) - * @name ics23.LengthOp - * @enum {number} - * @property {number} NO_PREFIX=0 NO_PREFIX value - * @property {number} VAR_PROTO=1 VAR_PROTO value - * @property {number} VAR_RLP=2 VAR_RLP value - * @property {number} FIXED32_BIG=3 FIXED32_BIG value - * @property {number} FIXED32_LITTLE=4 FIXED32_LITTLE value - * @property {number} FIXED64_BIG=5 FIXED64_BIG value - * @property {number} FIXED64_LITTLE=6 FIXED64_LITTLE value - * @property {number} REQUIRE_32_BYTES=7 REQUIRE_32_BYTES value - * @property {number} REQUIRE_64_BYTES=8 REQUIRE_64_BYTES value - */ - ics23.LengthOp = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NO_PREFIX"] = 0; - values[valuesById[1] = "VAR_PROTO"] = 1; - values[valuesById[2] = "VAR_RLP"] = 2; - values[valuesById[3] = "FIXED32_BIG"] = 3; - values[valuesById[4] = "FIXED32_LITTLE"] = 4; - values[valuesById[5] = "FIXED64_BIG"] = 5; - values[valuesById[6] = "FIXED64_LITTLE"] = 6; - values[valuesById[7] = "REQUIRE_32_BYTES"] = 7; - values[valuesById[8] = "REQUIRE_64_BYTES"] = 8; - return values; - })(); - - ics23.ExistenceProof = (function() { - - /** - * Properties of an ExistenceProof. - * @memberof ics23 - * @interface IExistenceProof - * @property {Uint8Array|null} [key] ExistenceProof key - * @property {Uint8Array|null} [value] ExistenceProof value - * @property {ics23.ILeafOp|null} [leaf] ExistenceProof leaf - * @property {Array.|null} [path] ExistenceProof path - */ - - /** - * Constructs a new ExistenceProof. - * @memberof ics23 - * @classdesc ExistenceProof takes a key and a value and a set of steps to perform on it. - * The result of peforming all these steps will provide a "root hash", which can - * be compared to the value in a header. - * - * Since it is computationally infeasible to produce a hash collission for any of the used - * cryptographic hash functions, if someone can provide a series of operations to transform - * a given key and value into a root hash that matches some trusted root, these key and values - * must be in the referenced merkle tree. - * - * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, - * which should be controlled by a spec. Eg. with lengthOp as NONE, - * prefix = FOO, key = BAR, value = CHOICE - * and - * prefix = F, key = OOBAR, value = CHOICE - * would produce the same value. - * - * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field - * in the ProofSpec is valuable to prevent this mutability. And why all trees should - * length-prefix the data before hashing it. - * @implements IExistenceProof - * @constructor - * @param {ics23.IExistenceProof=} [properties] Properties to set - */ - function ExistenceProof(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExistenceProof key. - * @member {Uint8Array} key - * @memberof ics23.ExistenceProof - * @instance - */ - ExistenceProof.prototype.key = $util.newBuffer([]); - - /** - * ExistenceProof value. - * @member {Uint8Array} value - * @memberof ics23.ExistenceProof - * @instance - */ - ExistenceProof.prototype.value = $util.newBuffer([]); - - /** - * ExistenceProof leaf. - * @member {ics23.ILeafOp|null|undefined} leaf - * @memberof ics23.ExistenceProof - * @instance - */ - ExistenceProof.prototype.leaf = null; - - /** - * ExistenceProof path. - * @member {Array.} path - * @memberof ics23.ExistenceProof - * @instance - */ - ExistenceProof.prototype.path = $util.emptyArray; - - /** - * Encodes the specified ExistenceProof message. Does not implicitly {@link ics23.ExistenceProof.verify|verify} messages. - * @function encode - * @memberof ics23.ExistenceProof - * @static - * @param {ics23.IExistenceProof} message ExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExistenceProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - if (message.leaf != null && Object.hasOwnProperty.call(message, "leaf")) - $root.ics23.LeafOp.encode(message.leaf, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.path != null && message.path.length) - for (var i = 0; i < message.path.length; ++i) - $root.ics23.InnerOp.encode(message.path[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExistenceProof message, length delimited. Does not implicitly {@link ics23.ExistenceProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.ExistenceProof - * @static - * @param {ics23.IExistenceProof} message ExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExistenceProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.ExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.ExistenceProof} ExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExistenceProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.ExistenceProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - case 3: - message.leaf = $root.ics23.LeafOp.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.path && message.path.length)) - message.path = []; - message.path.push($root.ics23.InnerOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExistenceProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.ExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.ExistenceProof} ExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExistenceProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExistenceProof message. - * @function verify - * @memberof ics23.ExistenceProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExistenceProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - if (message.leaf != null && message.hasOwnProperty("leaf")) { - var error = $root.ics23.LeafOp.verify(message.leaf); - if (error) - return "leaf." + error; - } - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) { - var error = $root.ics23.InnerOp.verify(message.path[i]); - if (error) - return "path." + error; - } - } - return null; - }; - - /** - * Creates an ExistenceProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.ExistenceProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.ExistenceProof} ExistenceProof - */ - ExistenceProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.ExistenceProof) - return object; - var message = new $root.ics23.ExistenceProof(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - if (object.leaf != null) { - if (typeof object.leaf !== "object") - throw TypeError(".ics23.ExistenceProof.leaf: object expected"); - message.leaf = $root.ics23.LeafOp.fromObject(object.leaf); - } - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".ics23.ExistenceProof.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) { - if (typeof object.path[i] !== "object") - throw TypeError(".ics23.ExistenceProof.path: object expected"); - message.path[i] = $root.ics23.InnerOp.fromObject(object.path[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ExistenceProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.ExistenceProof - * @static - * @param {ics23.ExistenceProof} message ExistenceProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExistenceProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - object.leaf = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - if (message.leaf != null && message.hasOwnProperty("leaf")) - object.leaf = $root.ics23.LeafOp.toObject(message.leaf, options); - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = $root.ics23.InnerOp.toObject(message.path[j], options); - } - return object; - }; - - /** - * Converts this ExistenceProof to JSON. - * @function toJSON - * @memberof ics23.ExistenceProof - * @instance - * @returns {Object.} JSON object - */ - ExistenceProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExistenceProof; - })(); - - ics23.NonExistenceProof = (function() { - - /** - * Properties of a NonExistenceProof. - * @memberof ics23 - * @interface INonExistenceProof - * @property {Uint8Array|null} [key] NonExistenceProof key - * @property {ics23.IExistenceProof|null} [left] NonExistenceProof left - * @property {ics23.IExistenceProof|null} [right] NonExistenceProof right - */ - - /** - * Constructs a new NonExistenceProof. - * @memberof ics23 - * @classdesc Represents a NonExistenceProof. - * @implements INonExistenceProof - * @constructor - * @param {ics23.INonExistenceProof=} [properties] Properties to set - */ - function NonExistenceProof(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NonExistenceProof key. - * @member {Uint8Array} key - * @memberof ics23.NonExistenceProof - * @instance - */ - NonExistenceProof.prototype.key = $util.newBuffer([]); - - /** - * NonExistenceProof left. - * @member {ics23.IExistenceProof|null|undefined} left - * @memberof ics23.NonExistenceProof - * @instance - */ - NonExistenceProof.prototype.left = null; - - /** - * NonExistenceProof right. - * @member {ics23.IExistenceProof|null|undefined} right - * @memberof ics23.NonExistenceProof - * @instance - */ - NonExistenceProof.prototype.right = null; - - /** - * Encodes the specified NonExistenceProof message. Does not implicitly {@link ics23.NonExistenceProof.verify|verify} messages. - * @function encode - * @memberof ics23.NonExistenceProof - * @static - * @param {ics23.INonExistenceProof} message NonExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NonExistenceProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.left != null && Object.hasOwnProperty.call(message, "left")) - $root.ics23.ExistenceProof.encode(message.left, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.right != null && Object.hasOwnProperty.call(message, "right")) - $root.ics23.ExistenceProof.encode(message.right, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NonExistenceProof message, length delimited. Does not implicitly {@link ics23.NonExistenceProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.NonExistenceProof - * @static - * @param {ics23.INonExistenceProof} message NonExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NonExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NonExistenceProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.NonExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.NonExistenceProof} NonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NonExistenceProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.NonExistenceProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.left = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); - break; - case 3: - message.right = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NonExistenceProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.NonExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.NonExistenceProof} NonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NonExistenceProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NonExistenceProof message. - * @function verify - * @memberof ics23.NonExistenceProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NonExistenceProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.left != null && message.hasOwnProperty("left")) { - var error = $root.ics23.ExistenceProof.verify(message.left); - if (error) - return "left." + error; - } - if (message.right != null && message.hasOwnProperty("right")) { - var error = $root.ics23.ExistenceProof.verify(message.right); - if (error) - return "right." + error; - } - return null; - }; - - /** - * Creates a NonExistenceProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.NonExistenceProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.NonExistenceProof} NonExistenceProof - */ - NonExistenceProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.NonExistenceProof) - return object; - var message = new $root.ics23.NonExistenceProof(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.left != null) { - if (typeof object.left !== "object") - throw TypeError(".ics23.NonExistenceProof.left: object expected"); - message.left = $root.ics23.ExistenceProof.fromObject(object.left); - } - if (object.right != null) { - if (typeof object.right !== "object") - throw TypeError(".ics23.NonExistenceProof.right: object expected"); - message.right = $root.ics23.ExistenceProof.fromObject(object.right); - } - return message; - }; - - /** - * Creates a plain object from a NonExistenceProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.NonExistenceProof - * @static - * @param {ics23.NonExistenceProof} message NonExistenceProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NonExistenceProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - object.left = null; - object.right = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.left != null && message.hasOwnProperty("left")) - object.left = $root.ics23.ExistenceProof.toObject(message.left, options); - if (message.right != null && message.hasOwnProperty("right")) - object.right = $root.ics23.ExistenceProof.toObject(message.right, options); - return object; - }; - - /** - * Converts this NonExistenceProof to JSON. - * @function toJSON - * @memberof ics23.NonExistenceProof - * @instance - * @returns {Object.} JSON object - */ - NonExistenceProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NonExistenceProof; - })(); - - ics23.CommitmentProof = (function() { - - /** - * Properties of a CommitmentProof. - * @memberof ics23 - * @interface ICommitmentProof - * @property {ics23.IExistenceProof|null} [exist] CommitmentProof exist - * @property {ics23.INonExistenceProof|null} [nonexist] CommitmentProof nonexist - * @property {ics23.IBatchProof|null} [batch] CommitmentProof batch - * @property {ics23.ICompressedBatchProof|null} [compressed] CommitmentProof compressed - */ - - /** - * Constructs a new CommitmentProof. - * @memberof ics23 - * @classdesc Represents a CommitmentProof. - * @implements ICommitmentProof - * @constructor - * @param {ics23.ICommitmentProof=} [properties] Properties to set - */ - function CommitmentProof(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitmentProof exist. - * @member {ics23.IExistenceProof|null|undefined} exist - * @memberof ics23.CommitmentProof - * @instance - */ - CommitmentProof.prototype.exist = null; - - /** - * CommitmentProof nonexist. - * @member {ics23.INonExistenceProof|null|undefined} nonexist - * @memberof ics23.CommitmentProof - * @instance - */ - CommitmentProof.prototype.nonexist = null; - - /** - * CommitmentProof batch. - * @member {ics23.IBatchProof|null|undefined} batch - * @memberof ics23.CommitmentProof - * @instance - */ - CommitmentProof.prototype.batch = null; - - /** - * CommitmentProof compressed. - * @member {ics23.ICompressedBatchProof|null|undefined} compressed - * @memberof ics23.CommitmentProof - * @instance - */ - CommitmentProof.prototype.compressed = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CommitmentProof proof. - * @member {"exist"|"nonexist"|"batch"|"compressed"|undefined} proof - * @memberof ics23.CommitmentProof - * @instance - */ - Object.defineProperty(CommitmentProof.prototype, "proof", { - get: $util.oneOfGetter($oneOfFields = ["exist", "nonexist", "batch", "compressed"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified CommitmentProof message. Does not implicitly {@link ics23.CommitmentProof.verify|verify} messages. - * @function encode - * @memberof ics23.CommitmentProof - * @static - * @param {ics23.ICommitmentProof} message CommitmentProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitmentProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exist != null && Object.hasOwnProperty.call(message, "exist")) - $root.ics23.ExistenceProof.encode(message.exist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nonexist != null && Object.hasOwnProperty.call(message, "nonexist")) - $root.ics23.NonExistenceProof.encode(message.nonexist, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) - $root.ics23.BatchProof.encode(message.batch, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.compressed != null && Object.hasOwnProperty.call(message, "compressed")) - $root.ics23.CompressedBatchProof.encode(message.compressed, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommitmentProof message, length delimited. Does not implicitly {@link ics23.CommitmentProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CommitmentProof - * @static - * @param {ics23.ICommitmentProof} message CommitmentProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitmentProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitmentProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.CommitmentProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CommitmentProof} CommitmentProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitmentProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CommitmentProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exist = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); - break; - case 2: - message.nonexist = $root.ics23.NonExistenceProof.decode(reader, reader.uint32()); - break; - case 3: - message.batch = $root.ics23.BatchProof.decode(reader, reader.uint32()); - break; - case 4: - message.compressed = $root.ics23.CompressedBatchProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitmentProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CommitmentProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CommitmentProof} CommitmentProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitmentProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitmentProof message. - * @function verify - * @memberof ics23.CommitmentProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitmentProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - properties.proof = 1; - { - var error = $root.ics23.ExistenceProof.verify(message.exist); - if (error) - return "exist." + error; - } - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - var error = $root.ics23.NonExistenceProof.verify(message.nonexist); - if (error) - return "nonexist." + error; - } - } - if (message.batch != null && message.hasOwnProperty("batch")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - var error = $root.ics23.BatchProof.verify(message.batch); - if (error) - return "batch." + error; - } - } - if (message.compressed != null && message.hasOwnProperty("compressed")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - var error = $root.ics23.CompressedBatchProof.verify(message.compressed); - if (error) - return "compressed." + error; - } - } - return null; - }; - - /** - * Creates a CommitmentProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CommitmentProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.CommitmentProof} CommitmentProof - */ - CommitmentProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CommitmentProof) - return object; - var message = new $root.ics23.CommitmentProof(); - if (object.exist != null) { - if (typeof object.exist !== "object") - throw TypeError(".ics23.CommitmentProof.exist: object expected"); - message.exist = $root.ics23.ExistenceProof.fromObject(object.exist); - } - if (object.nonexist != null) { - if (typeof object.nonexist !== "object") - throw TypeError(".ics23.CommitmentProof.nonexist: object expected"); - message.nonexist = $root.ics23.NonExistenceProof.fromObject(object.nonexist); - } - if (object.batch != null) { - if (typeof object.batch !== "object") - throw TypeError(".ics23.CommitmentProof.batch: object expected"); - message.batch = $root.ics23.BatchProof.fromObject(object.batch); - } - if (object.compressed != null) { - if (typeof object.compressed !== "object") - throw TypeError(".ics23.CommitmentProof.compressed: object expected"); - message.compressed = $root.ics23.CompressedBatchProof.fromObject(object.compressed); - } - return message; - }; - - /** - * Creates a plain object from a CommitmentProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CommitmentProof - * @static - * @param {ics23.CommitmentProof} message CommitmentProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitmentProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - object.exist = $root.ics23.ExistenceProof.toObject(message.exist, options); - if (options.oneofs) - object.proof = "exist"; - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - object.nonexist = $root.ics23.NonExistenceProof.toObject(message.nonexist, options); - if (options.oneofs) - object.proof = "nonexist"; - } - if (message.batch != null && message.hasOwnProperty("batch")) { - object.batch = $root.ics23.BatchProof.toObject(message.batch, options); - if (options.oneofs) - object.proof = "batch"; - } - if (message.compressed != null && message.hasOwnProperty("compressed")) { - object.compressed = $root.ics23.CompressedBatchProof.toObject(message.compressed, options); - if (options.oneofs) - object.proof = "compressed"; - } - return object; - }; - - /** - * Converts this CommitmentProof to JSON. - * @function toJSON - * @memberof ics23.CommitmentProof - * @instance - * @returns {Object.} JSON object - */ - CommitmentProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CommitmentProof; - })(); - - ics23.LeafOp = (function() { - - /** - * Properties of a LeafOp. - * @memberof ics23 - * @interface ILeafOp - * @property {ics23.HashOp|null} [hash] LeafOp hash - * @property {ics23.HashOp|null} [prehash_key] LeafOp prehash_key - * @property {ics23.HashOp|null} [prehash_value] LeafOp prehash_value - * @property {ics23.LengthOp|null} [length] LeafOp length - * @property {Uint8Array|null} [prefix] LeafOp prefix - */ - - /** - * Constructs a new LeafOp. - * @memberof ics23 - * @classdesc LeafOp represents the raw key-value data we wish to prove, and - * must be flexible to represent the internal transformation from - * the original key-value pairs into the basis hash, for many existing - * merkle trees. - * - * key and value are passed in. So that the signature of this operation is: - * leafOp(key, value) -> output - * - * To process this, first prehash the keys and values if needed (ANY means no hash in this case): - * hkey = prehashKey(key) - * hvalue = prehashValue(value) - * - * Then combine the bytes, and hash it - * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) - * @implements ILeafOp - * @constructor - * @param {ics23.ILeafOp=} [properties] Properties to set - */ - function LeafOp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LeafOp hash. - * @member {ics23.HashOp} hash - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.hash = 0; - - /** - * LeafOp prehash_key. - * @member {ics23.HashOp} prehash_key - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.prehash_key = 0; - - /** - * LeafOp prehash_value. - * @member {ics23.HashOp} prehash_value - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.prehash_value = 0; - - /** - * LeafOp length. - * @member {ics23.LengthOp} length - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.length = 0; - - /** - * LeafOp prefix. - * @member {Uint8Array} prefix - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.prefix = $util.newBuffer([]); - - /** - * Encodes the specified LeafOp message. Does not implicitly {@link ics23.LeafOp.verify|verify} messages. - * @function encode - * @memberof ics23.LeafOp - * @static - * @param {ics23.ILeafOp} message LeafOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LeafOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hash); - if (message.prehash_key != null && Object.hasOwnProperty.call(message, "prehash_key")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.prehash_key); - if (message.prehash_value != null && Object.hasOwnProperty.call(message, "prehash_value")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.prehash_value); - if (message.length != null && Object.hasOwnProperty.call(message, "length")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.length); - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.prefix); - return writer; - }; - - /** - * Encodes the specified LeafOp message, length delimited. Does not implicitly {@link ics23.LeafOp.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.LeafOp - * @static - * @param {ics23.ILeafOp} message LeafOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LeafOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LeafOp message from the specified reader or buffer. - * @function decode - * @memberof ics23.LeafOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.LeafOp} LeafOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LeafOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.LeafOp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.int32(); - break; - case 2: - message.prehash_key = reader.int32(); - break; - case 3: - message.prehash_value = reader.int32(); - break; - case 4: - message.length = reader.int32(); - break; - case 5: - message.prefix = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LeafOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.LeafOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.LeafOp} LeafOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LeafOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LeafOp message. - * @function verify - * @memberof ics23.LeafOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LeafOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - switch (message.hash) { - default: - return "hash: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.prehash_key != null && message.hasOwnProperty("prehash_key")) - switch (message.prehash_key) { - default: - return "prehash_key: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.prehash_value != null && message.hasOwnProperty("prehash_value")) - switch (message.prehash_value) { - default: - return "prehash_value: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.length != null && message.hasOwnProperty("length")) - switch (message.length) { - default: - return "length: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.prefix != null && message.hasOwnProperty("prefix")) - if (!(message.prefix && typeof message.prefix.length === "number" || $util.isString(message.prefix))) - return "prefix: buffer expected"; - return null; - }; - - /** - * Creates a LeafOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.LeafOp - * @static - * @param {Object.} object Plain object - * @returns {ics23.LeafOp} LeafOp - */ - LeafOp.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.LeafOp) - return object; - var message = new $root.ics23.LeafOp(); - switch (object.hash) { - case "NO_HASH": - case 0: - message.hash = 0; - break; - case "SHA256": - case 1: - message.hash = 1; - break; - case "SHA512": - case 2: - message.hash = 2; - break; - case "KECCAK": - case 3: - message.hash = 3; - break; - case "RIPEMD160": - case 4: - message.hash = 4; - break; - case "BITCOIN": - case 5: - message.hash = 5; - break; - } - switch (object.prehash_key) { - case "NO_HASH": - case 0: - message.prehash_key = 0; - break; - case "SHA256": - case 1: - message.prehash_key = 1; - break; - case "SHA512": - case 2: - message.prehash_key = 2; - break; - case "KECCAK": - case 3: - message.prehash_key = 3; - break; - case "RIPEMD160": - case 4: - message.prehash_key = 4; - break; - case "BITCOIN": - case 5: - message.prehash_key = 5; - break; - } - switch (object.prehash_value) { - case "NO_HASH": - case 0: - message.prehash_value = 0; - break; - case "SHA256": - case 1: - message.prehash_value = 1; - break; - case "SHA512": - case 2: - message.prehash_value = 2; - break; - case "KECCAK": - case 3: - message.prehash_value = 3; - break; - case "RIPEMD160": - case 4: - message.prehash_value = 4; - break; - case "BITCOIN": - case 5: - message.prehash_value = 5; - break; - } - switch (object.length) { - case "NO_PREFIX": - case 0: - message.length = 0; - break; - case "VAR_PROTO": - case 1: - message.length = 1; - break; - case "VAR_RLP": - case 2: - message.length = 2; - break; - case "FIXED32_BIG": - case 3: - message.length = 3; - break; - case "FIXED32_LITTLE": - case 4: - message.length = 4; - break; - case "FIXED64_BIG": - case 5: - message.length = 5; - break; - case "FIXED64_LITTLE": - case 6: - message.length = 6; - break; - case "REQUIRE_32_BYTES": - case 7: - message.length = 7; - break; - case "REQUIRE_64_BYTES": - case 8: - message.length = 8; - break; - } - if (object.prefix != null) - if (typeof object.prefix === "string") - $util.base64.decode(object.prefix, message.prefix = $util.newBuffer($util.base64.length(object.prefix)), 0); - else if (object.prefix.length) - message.prefix = object.prefix; - return message; - }; - - /** - * Creates a plain object from a LeafOp message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.LeafOp - * @static - * @param {ics23.LeafOp} message LeafOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LeafOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.hash = options.enums === String ? "NO_HASH" : 0; - object.prehash_key = options.enums === String ? "NO_HASH" : 0; - object.prehash_value = options.enums === String ? "NO_HASH" : 0; - object.length = options.enums === String ? "NO_PREFIX" : 0; - if (options.bytes === String) - object.prefix = ""; - else { - object.prefix = []; - if (options.bytes !== Array) - object.prefix = $util.newBuffer(object.prefix); - } - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.enums === String ? $root.ics23.HashOp[message.hash] : message.hash; - if (message.prehash_key != null && message.hasOwnProperty("prehash_key")) - object.prehash_key = options.enums === String ? $root.ics23.HashOp[message.prehash_key] : message.prehash_key; - if (message.prehash_value != null && message.hasOwnProperty("prehash_value")) - object.prehash_value = options.enums === String ? $root.ics23.HashOp[message.prehash_value] : message.prehash_value; - if (message.length != null && message.hasOwnProperty("length")) - object.length = options.enums === String ? $root.ics23.LengthOp[message.length] : message.length; - if (message.prefix != null && message.hasOwnProperty("prefix")) - object.prefix = options.bytes === String ? $util.base64.encode(message.prefix, 0, message.prefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.prefix) : message.prefix; - return object; - }; - - /** - * Converts this LeafOp to JSON. - * @function toJSON - * @memberof ics23.LeafOp - * @instance - * @returns {Object.} JSON object - */ - LeafOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return LeafOp; - })(); - - ics23.InnerOp = (function() { - - /** - * Properties of an InnerOp. - * @memberof ics23 - * @interface IInnerOp - * @property {ics23.HashOp|null} [hash] InnerOp hash - * @property {Uint8Array|null} [prefix] InnerOp prefix - * @property {Uint8Array|null} [suffix] InnerOp suffix - */ - - /** - * Constructs a new InnerOp. - * @memberof ics23 - * @classdesc InnerOp represents a merkle-proof step that is not a leaf. - * It represents concatenating two children and hashing them to provide the next result. - * - * The result of the previous step is passed in, so the signature of this op is: - * innerOp(child) -> output - * - * The result of applying InnerOp should be: - * output = op.hash(op.prefix || child || op.suffix) - * - * where the || operator is concatenation of binary data, - * and child is the result of hashing all the tree below this step. - * - * Any special data, like prepending child with the length, or prepending the entire operation with - * some value to differentiate from leaf nodes, should be included in prefix and suffix. - * If either of prefix or suffix is empty, we just treat it as an empty string - * @implements IInnerOp - * @constructor - * @param {ics23.IInnerOp=} [properties] Properties to set - */ - function InnerOp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InnerOp hash. - * @member {ics23.HashOp} hash - * @memberof ics23.InnerOp - * @instance - */ - InnerOp.prototype.hash = 0; - - /** - * InnerOp prefix. - * @member {Uint8Array} prefix - * @memberof ics23.InnerOp - * @instance - */ - InnerOp.prototype.prefix = $util.newBuffer([]); - - /** - * InnerOp suffix. - * @member {Uint8Array} suffix - * @memberof ics23.InnerOp - * @instance - */ - InnerOp.prototype.suffix = $util.newBuffer([]); - - /** - * Encodes the specified InnerOp message. Does not implicitly {@link ics23.InnerOp.verify|verify} messages. - * @function encode - * @memberof ics23.InnerOp - * @static - * @param {ics23.IInnerOp} message InnerOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InnerOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hash); - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.prefix); - if (message.suffix != null && Object.hasOwnProperty.call(message, "suffix")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.suffix); - return writer; - }; - - /** - * Encodes the specified InnerOp message, length delimited. Does not implicitly {@link ics23.InnerOp.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.InnerOp - * @static - * @param {ics23.IInnerOp} message InnerOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InnerOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InnerOp message from the specified reader or buffer. - * @function decode - * @memberof ics23.InnerOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.InnerOp} InnerOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InnerOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.InnerOp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.int32(); - break; - case 2: - message.prefix = reader.bytes(); - break; - case 3: - message.suffix = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InnerOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.InnerOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.InnerOp} InnerOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InnerOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InnerOp message. - * @function verify - * @memberof ics23.InnerOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InnerOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - switch (message.hash) { - default: - return "hash: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.prefix != null && message.hasOwnProperty("prefix")) - if (!(message.prefix && typeof message.prefix.length === "number" || $util.isString(message.prefix))) - return "prefix: buffer expected"; - if (message.suffix != null && message.hasOwnProperty("suffix")) - if (!(message.suffix && typeof message.suffix.length === "number" || $util.isString(message.suffix))) - return "suffix: buffer expected"; - return null; - }; - - /** - * Creates an InnerOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.InnerOp - * @static - * @param {Object.} object Plain object - * @returns {ics23.InnerOp} InnerOp - */ - InnerOp.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.InnerOp) - return object; - var message = new $root.ics23.InnerOp(); - switch (object.hash) { - case "NO_HASH": - case 0: - message.hash = 0; - break; - case "SHA256": - case 1: - message.hash = 1; - break; - case "SHA512": - case 2: - message.hash = 2; - break; - case "KECCAK": - case 3: - message.hash = 3; - break; - case "RIPEMD160": - case 4: - message.hash = 4; - break; - case "BITCOIN": - case 5: - message.hash = 5; - break; - } - if (object.prefix != null) - if (typeof object.prefix === "string") - $util.base64.decode(object.prefix, message.prefix = $util.newBuffer($util.base64.length(object.prefix)), 0); - else if (object.prefix.length) - message.prefix = object.prefix; - if (object.suffix != null) - if (typeof object.suffix === "string") - $util.base64.decode(object.suffix, message.suffix = $util.newBuffer($util.base64.length(object.suffix)), 0); - else if (object.suffix.length) - message.suffix = object.suffix; - return message; - }; - - /** - * Creates a plain object from an InnerOp message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.InnerOp - * @static - * @param {ics23.InnerOp} message InnerOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InnerOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.hash = options.enums === String ? "NO_HASH" : 0; - if (options.bytes === String) - object.prefix = ""; - else { - object.prefix = []; - if (options.bytes !== Array) - object.prefix = $util.newBuffer(object.prefix); - } - if (options.bytes === String) - object.suffix = ""; - else { - object.suffix = []; - if (options.bytes !== Array) - object.suffix = $util.newBuffer(object.suffix); - } - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.enums === String ? $root.ics23.HashOp[message.hash] : message.hash; - if (message.prefix != null && message.hasOwnProperty("prefix")) - object.prefix = options.bytes === String ? $util.base64.encode(message.prefix, 0, message.prefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.prefix) : message.prefix; - if (message.suffix != null && message.hasOwnProperty("suffix")) - object.suffix = options.bytes === String ? $util.base64.encode(message.suffix, 0, message.suffix.length) : options.bytes === Array ? Array.prototype.slice.call(message.suffix) : message.suffix; - return object; - }; - - /** - * Converts this InnerOp to JSON. - * @function toJSON - * @memberof ics23.InnerOp - * @instance - * @returns {Object.} JSON object - */ - InnerOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InnerOp; - })(); - - ics23.ProofSpec = (function() { - - /** - * Properties of a ProofSpec. - * @memberof ics23 - * @interface IProofSpec - * @property {ics23.ILeafOp|null} [leaf_spec] ProofSpec leaf_spec - * @property {ics23.IInnerSpec|null} [inner_spec] ProofSpec inner_spec - * @property {number|null} [max_depth] ProofSpec max_depth - * @property {number|null} [min_depth] ProofSpec min_depth - */ - - /** - * Constructs a new ProofSpec. - * @memberof ics23 - * @classdesc ProofSpec defines what the expected parameters are for a given proof type. - * This can be stored in the client and used to validate any incoming proofs. - * - * verify(ProofSpec, Proof) -> Proof | Error - * - * As demonstrated in tests, if we don't fix the algorithm used to calculate the - * LeafHash for a given tree, there are many possible key-value pairs that can - * generate a given hash (by interpretting the preimage differently). - * We need this for proper security, requires client knows a priori what - * tree format server uses. But not in code, rather a configuration object. - * @implements IProofSpec - * @constructor - * @param {ics23.IProofSpec=} [properties] Properties to set - */ - function ProofSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProofSpec leaf_spec. - * @member {ics23.ILeafOp|null|undefined} leaf_spec - * @memberof ics23.ProofSpec - * @instance - */ - ProofSpec.prototype.leaf_spec = null; - - /** - * ProofSpec inner_spec. - * @member {ics23.IInnerSpec|null|undefined} inner_spec - * @memberof ics23.ProofSpec - * @instance - */ - ProofSpec.prototype.inner_spec = null; - - /** - * ProofSpec max_depth. - * @member {number} max_depth - * @memberof ics23.ProofSpec - * @instance - */ - ProofSpec.prototype.max_depth = 0; - - /** - * ProofSpec min_depth. - * @member {number} min_depth - * @memberof ics23.ProofSpec - * @instance - */ - ProofSpec.prototype.min_depth = 0; - - /** - * Encodes the specified ProofSpec message. Does not implicitly {@link ics23.ProofSpec.verify|verify} messages. - * @function encode - * @memberof ics23.ProofSpec - * @static - * @param {ics23.IProofSpec} message ProofSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.leaf_spec != null && Object.hasOwnProperty.call(message, "leaf_spec")) - $root.ics23.LeafOp.encode(message.leaf_spec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.inner_spec != null && Object.hasOwnProperty.call(message, "inner_spec")) - $root.ics23.InnerSpec.encode(message.inner_spec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.max_depth != null && Object.hasOwnProperty.call(message, "max_depth")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.max_depth); - if (message.min_depth != null && Object.hasOwnProperty.call(message, "min_depth")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.min_depth); - return writer; - }; - - /** - * Encodes the specified ProofSpec message, length delimited. Does not implicitly {@link ics23.ProofSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.ProofSpec - * @static - * @param {ics23.IProofSpec} message ProofSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProofSpec message from the specified reader or buffer. - * @function decode - * @memberof ics23.ProofSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.ProofSpec} ProofSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.ProofSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.leaf_spec = $root.ics23.LeafOp.decode(reader, reader.uint32()); - break; - case 2: - message.inner_spec = $root.ics23.InnerSpec.decode(reader, reader.uint32()); - break; - case 3: - message.max_depth = reader.int32(); - break; - case 4: - message.min_depth = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProofSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.ProofSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.ProofSpec} ProofSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProofSpec message. - * @function verify - * @memberof ics23.ProofSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProofSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.leaf_spec != null && message.hasOwnProperty("leaf_spec")) { - var error = $root.ics23.LeafOp.verify(message.leaf_spec); - if (error) - return "leaf_spec." + error; - } - if (message.inner_spec != null && message.hasOwnProperty("inner_spec")) { - var error = $root.ics23.InnerSpec.verify(message.inner_spec); - if (error) - return "inner_spec." + error; - } - if (message.max_depth != null && message.hasOwnProperty("max_depth")) - if (!$util.isInteger(message.max_depth)) - return "max_depth: integer expected"; - if (message.min_depth != null && message.hasOwnProperty("min_depth")) - if (!$util.isInteger(message.min_depth)) - return "min_depth: integer expected"; - return null; - }; - - /** - * Creates a ProofSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.ProofSpec - * @static - * @param {Object.} object Plain object - * @returns {ics23.ProofSpec} ProofSpec - */ - ProofSpec.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.ProofSpec) - return object; - var message = new $root.ics23.ProofSpec(); - if (object.leaf_spec != null) { - if (typeof object.leaf_spec !== "object") - throw TypeError(".ics23.ProofSpec.leaf_spec: object expected"); - message.leaf_spec = $root.ics23.LeafOp.fromObject(object.leaf_spec); - } - if (object.inner_spec != null) { - if (typeof object.inner_spec !== "object") - throw TypeError(".ics23.ProofSpec.inner_spec: object expected"); - message.inner_spec = $root.ics23.InnerSpec.fromObject(object.inner_spec); - } - if (object.max_depth != null) - message.max_depth = object.max_depth | 0; - if (object.min_depth != null) - message.min_depth = object.min_depth | 0; - return message; - }; - - /** - * Creates a plain object from a ProofSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.ProofSpec - * @static - * @param {ics23.ProofSpec} message ProofSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProofSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.leaf_spec = null; - object.inner_spec = null; - object.max_depth = 0; - object.min_depth = 0; - } - if (message.leaf_spec != null && message.hasOwnProperty("leaf_spec")) - object.leaf_spec = $root.ics23.LeafOp.toObject(message.leaf_spec, options); - if (message.inner_spec != null && message.hasOwnProperty("inner_spec")) - object.inner_spec = $root.ics23.InnerSpec.toObject(message.inner_spec, options); - if (message.max_depth != null && message.hasOwnProperty("max_depth")) - object.max_depth = message.max_depth; - if (message.min_depth != null && message.hasOwnProperty("min_depth")) - object.min_depth = message.min_depth; - return object; - }; - - /** - * Converts this ProofSpec to JSON. - * @function toJSON - * @memberof ics23.ProofSpec - * @instance - * @returns {Object.} JSON object - */ - ProofSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProofSpec; - })(); - - ics23.InnerSpec = (function() { - - /** - * Properties of an InnerSpec. - * @memberof ics23 - * @interface IInnerSpec - * @property {Array.|null} [child_order] InnerSpec child_order - * @property {number|null} [child_size] InnerSpec child_size - * @property {number|null} [min_prefix_length] InnerSpec min_prefix_length - * @property {number|null} [max_prefix_length] InnerSpec max_prefix_length - * @property {Uint8Array|null} [empty_child] InnerSpec empty_child - * @property {ics23.HashOp|null} [hash] InnerSpec hash - */ - - /** - * Constructs a new InnerSpec. - * @memberof ics23 - * @classdesc Represents an InnerSpec. - * @implements IInnerSpec - * @constructor - * @param {ics23.IInnerSpec=} [properties] Properties to set - */ - function InnerSpec(properties) { - this.child_order = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InnerSpec child_order. - * @member {Array.} child_order - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.child_order = $util.emptyArray; - - /** - * InnerSpec child_size. - * @member {number} child_size - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.child_size = 0; - - /** - * InnerSpec min_prefix_length. - * @member {number} min_prefix_length - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.min_prefix_length = 0; - - /** - * InnerSpec max_prefix_length. - * @member {number} max_prefix_length - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.max_prefix_length = 0; - - /** - * InnerSpec empty_child. - * @member {Uint8Array} empty_child - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.empty_child = $util.newBuffer([]); - - /** - * InnerSpec hash. - * @member {ics23.HashOp} hash - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.hash = 0; - - /** - * Encodes the specified InnerSpec message. Does not implicitly {@link ics23.InnerSpec.verify|verify} messages. - * @function encode - * @memberof ics23.InnerSpec - * @static - * @param {ics23.IInnerSpec} message InnerSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InnerSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.child_order != null && message.child_order.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.child_order.length; ++i) - writer.int32(message.child_order[i]); - writer.ldelim(); - } - if (message.child_size != null && Object.hasOwnProperty.call(message, "child_size")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.child_size); - if (message.min_prefix_length != null && Object.hasOwnProperty.call(message, "min_prefix_length")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.min_prefix_length); - if (message.max_prefix_length != null && Object.hasOwnProperty.call(message, "max_prefix_length")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.max_prefix_length); - if (message.empty_child != null && Object.hasOwnProperty.call(message, "empty_child")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.empty_child); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.hash); - return writer; - }; - - /** - * Encodes the specified InnerSpec message, length delimited. Does not implicitly {@link ics23.InnerSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.InnerSpec - * @static - * @param {ics23.IInnerSpec} message InnerSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InnerSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InnerSpec message from the specified reader or buffer. - * @function decode - * @memberof ics23.InnerSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.InnerSpec} InnerSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InnerSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.InnerSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.child_order && message.child_order.length)) - message.child_order = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.child_order.push(reader.int32()); - } else - message.child_order.push(reader.int32()); - break; - case 2: - message.child_size = reader.int32(); - break; - case 3: - message.min_prefix_length = reader.int32(); - break; - case 4: - message.max_prefix_length = reader.int32(); - break; - case 5: - message.empty_child = reader.bytes(); - break; - case 6: - message.hash = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InnerSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.InnerSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.InnerSpec} InnerSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InnerSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InnerSpec message. - * @function verify - * @memberof ics23.InnerSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InnerSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.child_order != null && message.hasOwnProperty("child_order")) { - if (!Array.isArray(message.child_order)) - return "child_order: array expected"; - for (var i = 0; i < message.child_order.length; ++i) - if (!$util.isInteger(message.child_order[i])) - return "child_order: integer[] expected"; - } - if (message.child_size != null && message.hasOwnProperty("child_size")) - if (!$util.isInteger(message.child_size)) - return "child_size: integer expected"; - if (message.min_prefix_length != null && message.hasOwnProperty("min_prefix_length")) - if (!$util.isInteger(message.min_prefix_length)) - return "min_prefix_length: integer expected"; - if (message.max_prefix_length != null && message.hasOwnProperty("max_prefix_length")) - if (!$util.isInteger(message.max_prefix_length)) - return "max_prefix_length: integer expected"; - if (message.empty_child != null && message.hasOwnProperty("empty_child")) - if (!(message.empty_child && typeof message.empty_child.length === "number" || $util.isString(message.empty_child))) - return "empty_child: buffer expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - switch (message.hash) { - default: - return "hash: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates an InnerSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.InnerSpec - * @static - * @param {Object.} object Plain object - * @returns {ics23.InnerSpec} InnerSpec - */ - InnerSpec.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.InnerSpec) - return object; - var message = new $root.ics23.InnerSpec(); - if (object.child_order) { - if (!Array.isArray(object.child_order)) - throw TypeError(".ics23.InnerSpec.child_order: array expected"); - message.child_order = []; - for (var i = 0; i < object.child_order.length; ++i) - message.child_order[i] = object.child_order[i] | 0; - } - if (object.child_size != null) - message.child_size = object.child_size | 0; - if (object.min_prefix_length != null) - message.min_prefix_length = object.min_prefix_length | 0; - if (object.max_prefix_length != null) - message.max_prefix_length = object.max_prefix_length | 0; - if (object.empty_child != null) - if (typeof object.empty_child === "string") - $util.base64.decode(object.empty_child, message.empty_child = $util.newBuffer($util.base64.length(object.empty_child)), 0); - else if (object.empty_child.length) - message.empty_child = object.empty_child; - switch (object.hash) { - case "NO_HASH": - case 0: - message.hash = 0; - break; - case "SHA256": - case 1: - message.hash = 1; - break; - case "SHA512": - case 2: - message.hash = 2; - break; - case "KECCAK": - case 3: - message.hash = 3; - break; - case "RIPEMD160": - case 4: - message.hash = 4; - break; - case "BITCOIN": - case 5: - message.hash = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from an InnerSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.InnerSpec - * @static - * @param {ics23.InnerSpec} message InnerSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InnerSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.child_order = []; - if (options.defaults) { - object.child_size = 0; - object.min_prefix_length = 0; - object.max_prefix_length = 0; - if (options.bytes === String) - object.empty_child = ""; - else { - object.empty_child = []; - if (options.bytes !== Array) - object.empty_child = $util.newBuffer(object.empty_child); - } - object.hash = options.enums === String ? "NO_HASH" : 0; - } - if (message.child_order && message.child_order.length) { - object.child_order = []; - for (var j = 0; j < message.child_order.length; ++j) - object.child_order[j] = message.child_order[j]; - } - if (message.child_size != null && message.hasOwnProperty("child_size")) - object.child_size = message.child_size; - if (message.min_prefix_length != null && message.hasOwnProperty("min_prefix_length")) - object.min_prefix_length = message.min_prefix_length; - if (message.max_prefix_length != null && message.hasOwnProperty("max_prefix_length")) - object.max_prefix_length = message.max_prefix_length; - if (message.empty_child != null && message.hasOwnProperty("empty_child")) - object.empty_child = options.bytes === String ? $util.base64.encode(message.empty_child, 0, message.empty_child.length) : options.bytes === Array ? Array.prototype.slice.call(message.empty_child) : message.empty_child; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.enums === String ? $root.ics23.HashOp[message.hash] : message.hash; - return object; - }; - - /** - * Converts this InnerSpec to JSON. - * @function toJSON - * @memberof ics23.InnerSpec - * @instance - * @returns {Object.} JSON object - */ - InnerSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InnerSpec; - })(); - - ics23.BatchProof = (function() { - - /** - * Properties of a BatchProof. - * @memberof ics23 - * @interface IBatchProof - * @property {Array.|null} [entries] BatchProof entries - */ - - /** - * Constructs a new BatchProof. - * @memberof ics23 - * @classdesc Represents a BatchProof. - * @implements IBatchProof - * @constructor - * @param {ics23.IBatchProof=} [properties] Properties to set - */ - function BatchProof(properties) { - this.entries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchProof entries. - * @member {Array.} entries - * @memberof ics23.BatchProof - * @instance - */ - BatchProof.prototype.entries = $util.emptyArray; - - /** - * Encodes the specified BatchProof message. Does not implicitly {@link ics23.BatchProof.verify|verify} messages. - * @function encode - * @memberof ics23.BatchProof - * @static - * @param {ics23.IBatchProof} message BatchProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entries != null && message.entries.length) - for (var i = 0; i < message.entries.length; ++i) - $root.ics23.BatchEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchProof message, length delimited. Does not implicitly {@link ics23.BatchProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.BatchProof - * @static - * @param {ics23.IBatchProof} message BatchProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.BatchProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.BatchProof} BatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.BatchProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push($root.ics23.BatchEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.BatchProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.BatchProof} BatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchProof message. - * @function verify - * @memberof ics23.BatchProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (var i = 0; i < message.entries.length; ++i) { - var error = $root.ics23.BatchEntry.verify(message.entries[i]); - if (error) - return "entries." + error; - } - } - return null; - }; - - /** - * Creates a BatchProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.BatchProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.BatchProof} BatchProof - */ - BatchProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.BatchProof) - return object; - var message = new $root.ics23.BatchProof(); - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".ics23.BatchProof.entries: array expected"); - message.entries = []; - for (var i = 0; i < object.entries.length; ++i) { - if (typeof object.entries[i] !== "object") - throw TypeError(".ics23.BatchProof.entries: object expected"); - message.entries[i] = $root.ics23.BatchEntry.fromObject(object.entries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.BatchProof - * @static - * @param {ics23.BatchProof} message BatchProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entries = []; - if (message.entries && message.entries.length) { - object.entries = []; - for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.ics23.BatchEntry.toObject(message.entries[j], options); - } - return object; - }; - - /** - * Converts this BatchProof to JSON. - * @function toJSON - * @memberof ics23.BatchProof - * @instance - * @returns {Object.} JSON object - */ - BatchProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BatchProof; - })(); - - ics23.BatchEntry = (function() { - - /** - * Properties of a BatchEntry. - * @memberof ics23 - * @interface IBatchEntry - * @property {ics23.IExistenceProof|null} [exist] BatchEntry exist - * @property {ics23.INonExistenceProof|null} [nonexist] BatchEntry nonexist - */ - - /** - * Constructs a new BatchEntry. - * @memberof ics23 - * @classdesc Represents a BatchEntry. - * @implements IBatchEntry - * @constructor - * @param {ics23.IBatchEntry=} [properties] Properties to set - */ - function BatchEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchEntry exist. - * @member {ics23.IExistenceProof|null|undefined} exist - * @memberof ics23.BatchEntry - * @instance - */ - BatchEntry.prototype.exist = null; - - /** - * BatchEntry nonexist. - * @member {ics23.INonExistenceProof|null|undefined} nonexist - * @memberof ics23.BatchEntry - * @instance - */ - BatchEntry.prototype.nonexist = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BatchEntry proof. - * @member {"exist"|"nonexist"|undefined} proof - * @memberof ics23.BatchEntry - * @instance - */ - Object.defineProperty(BatchEntry.prototype, "proof", { - get: $util.oneOfGetter($oneOfFields = ["exist", "nonexist"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified BatchEntry message. Does not implicitly {@link ics23.BatchEntry.verify|verify} messages. - * @function encode - * @memberof ics23.BatchEntry - * @static - * @param {ics23.IBatchEntry} message BatchEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exist != null && Object.hasOwnProperty.call(message, "exist")) - $root.ics23.ExistenceProof.encode(message.exist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nonexist != null && Object.hasOwnProperty.call(message, "nonexist")) - $root.ics23.NonExistenceProof.encode(message.nonexist, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchEntry message, length delimited. Does not implicitly {@link ics23.BatchEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.BatchEntry - * @static - * @param {ics23.IBatchEntry} message BatchEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchEntry message from the specified reader or buffer. - * @function decode - * @memberof ics23.BatchEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.BatchEntry} BatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.BatchEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exist = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); - break; - case 2: - message.nonexist = $root.ics23.NonExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.BatchEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.BatchEntry} BatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchEntry message. - * @function verify - * @memberof ics23.BatchEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - properties.proof = 1; - { - var error = $root.ics23.ExistenceProof.verify(message.exist); - if (error) - return "exist." + error; - } - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - var error = $root.ics23.NonExistenceProof.verify(message.nonexist); - if (error) - return "nonexist." + error; - } - } - return null; - }; - - /** - * Creates a BatchEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.BatchEntry - * @static - * @param {Object.} object Plain object - * @returns {ics23.BatchEntry} BatchEntry - */ - BatchEntry.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.BatchEntry) - return object; - var message = new $root.ics23.BatchEntry(); - if (object.exist != null) { - if (typeof object.exist !== "object") - throw TypeError(".ics23.BatchEntry.exist: object expected"); - message.exist = $root.ics23.ExistenceProof.fromObject(object.exist); - } - if (object.nonexist != null) { - if (typeof object.nonexist !== "object") - throw TypeError(".ics23.BatchEntry.nonexist: object expected"); - message.nonexist = $root.ics23.NonExistenceProof.fromObject(object.nonexist); - } - return message; - }; - - /** - * Creates a plain object from a BatchEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.BatchEntry - * @static - * @param {ics23.BatchEntry} message BatchEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - object.exist = $root.ics23.ExistenceProof.toObject(message.exist, options); - if (options.oneofs) - object.proof = "exist"; - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - object.nonexist = $root.ics23.NonExistenceProof.toObject(message.nonexist, options); - if (options.oneofs) - object.proof = "nonexist"; - } - return object; - }; - - /** - * Converts this BatchEntry to JSON. - * @function toJSON - * @memberof ics23.BatchEntry - * @instance - * @returns {Object.} JSON object - */ - BatchEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BatchEntry; - })(); - - ics23.CompressedBatchProof = (function() { - - /** - * Properties of a CompressedBatchProof. - * @memberof ics23 - * @interface ICompressedBatchProof - * @property {Array.|null} [entries] CompressedBatchProof entries - * @property {Array.|null} [lookup_inners] CompressedBatchProof lookup_inners - */ - - /** - * Constructs a new CompressedBatchProof. - * @memberof ics23 - * @classdesc Represents a CompressedBatchProof. - * @implements ICompressedBatchProof - * @constructor - * @param {ics23.ICompressedBatchProof=} [properties] Properties to set - */ - function CompressedBatchProof(properties) { - this.entries = []; - this.lookup_inners = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CompressedBatchProof entries. - * @member {Array.} entries - * @memberof ics23.CompressedBatchProof - * @instance - */ - CompressedBatchProof.prototype.entries = $util.emptyArray; - - /** - * CompressedBatchProof lookup_inners. - * @member {Array.} lookup_inners - * @memberof ics23.CompressedBatchProof - * @instance - */ - CompressedBatchProof.prototype.lookup_inners = $util.emptyArray; - - /** - * Encodes the specified CompressedBatchProof message. Does not implicitly {@link ics23.CompressedBatchProof.verify|verify} messages. - * @function encode - * @memberof ics23.CompressedBatchProof - * @static - * @param {ics23.ICompressedBatchProof} message CompressedBatchProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedBatchProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entries != null && message.entries.length) - for (var i = 0; i < message.entries.length; ++i) - $root.ics23.CompressedBatchEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.lookup_inners != null && message.lookup_inners.length) - for (var i = 0; i < message.lookup_inners.length; ++i) - $root.ics23.InnerOp.encode(message.lookup_inners[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CompressedBatchProof message, length delimited. Does not implicitly {@link ics23.CompressedBatchProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CompressedBatchProof - * @static - * @param {ics23.ICompressedBatchProof} message CompressedBatchProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedBatchProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompressedBatchProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.CompressedBatchProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CompressedBatchProof} CompressedBatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedBatchProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedBatchProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push($root.ics23.CompressedBatchEntry.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.lookup_inners && message.lookup_inners.length)) - message.lookup_inners = []; - message.lookup_inners.push($root.ics23.InnerOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompressedBatchProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CompressedBatchProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CompressedBatchProof} CompressedBatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedBatchProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompressedBatchProof message. - * @function verify - * @memberof ics23.CompressedBatchProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompressedBatchProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (var i = 0; i < message.entries.length; ++i) { - var error = $root.ics23.CompressedBatchEntry.verify(message.entries[i]); - if (error) - return "entries." + error; - } - } - if (message.lookup_inners != null && message.hasOwnProperty("lookup_inners")) { - if (!Array.isArray(message.lookup_inners)) - return "lookup_inners: array expected"; - for (var i = 0; i < message.lookup_inners.length; ++i) { - var error = $root.ics23.InnerOp.verify(message.lookup_inners[i]); - if (error) - return "lookup_inners." + error; - } - } - return null; - }; - - /** - * Creates a CompressedBatchProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CompressedBatchProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.CompressedBatchProof} CompressedBatchProof - */ - CompressedBatchProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CompressedBatchProof) - return object; - var message = new $root.ics23.CompressedBatchProof(); - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".ics23.CompressedBatchProof.entries: array expected"); - message.entries = []; - for (var i = 0; i < object.entries.length; ++i) { - if (typeof object.entries[i] !== "object") - throw TypeError(".ics23.CompressedBatchProof.entries: object expected"); - message.entries[i] = $root.ics23.CompressedBatchEntry.fromObject(object.entries[i]); - } - } - if (object.lookup_inners) { - if (!Array.isArray(object.lookup_inners)) - throw TypeError(".ics23.CompressedBatchProof.lookup_inners: array expected"); - message.lookup_inners = []; - for (var i = 0; i < object.lookup_inners.length; ++i) { - if (typeof object.lookup_inners[i] !== "object") - throw TypeError(".ics23.CompressedBatchProof.lookup_inners: object expected"); - message.lookup_inners[i] = $root.ics23.InnerOp.fromObject(object.lookup_inners[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CompressedBatchProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CompressedBatchProof - * @static - * @param {ics23.CompressedBatchProof} message CompressedBatchProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompressedBatchProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.entries = []; - object.lookup_inners = []; - } - if (message.entries && message.entries.length) { - object.entries = []; - for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.ics23.CompressedBatchEntry.toObject(message.entries[j], options); - } - if (message.lookup_inners && message.lookup_inners.length) { - object.lookup_inners = []; - for (var j = 0; j < message.lookup_inners.length; ++j) - object.lookup_inners[j] = $root.ics23.InnerOp.toObject(message.lookup_inners[j], options); - } - return object; - }; - - /** - * Converts this CompressedBatchProof to JSON. - * @function toJSON - * @memberof ics23.CompressedBatchProof - * @instance - * @returns {Object.} JSON object - */ - CompressedBatchProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompressedBatchProof; - })(); - - ics23.CompressedBatchEntry = (function() { - - /** - * Properties of a CompressedBatchEntry. - * @memberof ics23 - * @interface ICompressedBatchEntry - * @property {ics23.ICompressedExistenceProof|null} [exist] CompressedBatchEntry exist - * @property {ics23.ICompressedNonExistenceProof|null} [nonexist] CompressedBatchEntry nonexist - */ - - /** - * Constructs a new CompressedBatchEntry. - * @memberof ics23 - * @classdesc Represents a CompressedBatchEntry. - * @implements ICompressedBatchEntry - * @constructor - * @param {ics23.ICompressedBatchEntry=} [properties] Properties to set - */ - function CompressedBatchEntry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CompressedBatchEntry exist. - * @member {ics23.ICompressedExistenceProof|null|undefined} exist - * @memberof ics23.CompressedBatchEntry - * @instance - */ - CompressedBatchEntry.prototype.exist = null; - - /** - * CompressedBatchEntry nonexist. - * @member {ics23.ICompressedNonExistenceProof|null|undefined} nonexist - * @memberof ics23.CompressedBatchEntry - * @instance - */ - CompressedBatchEntry.prototype.nonexist = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CompressedBatchEntry proof. - * @member {"exist"|"nonexist"|undefined} proof - * @memberof ics23.CompressedBatchEntry - * @instance - */ - Object.defineProperty(CompressedBatchEntry.prototype, "proof", { - get: $util.oneOfGetter($oneOfFields = ["exist", "nonexist"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified CompressedBatchEntry message. Does not implicitly {@link ics23.CompressedBatchEntry.verify|verify} messages. - * @function encode - * @memberof ics23.CompressedBatchEntry - * @static - * @param {ics23.ICompressedBatchEntry} message CompressedBatchEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedBatchEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exist != null && Object.hasOwnProperty.call(message, "exist")) - $root.ics23.CompressedExistenceProof.encode(message.exist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nonexist != null && Object.hasOwnProperty.call(message, "nonexist")) - $root.ics23.CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CompressedBatchEntry message, length delimited. Does not implicitly {@link ics23.CompressedBatchEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CompressedBatchEntry - * @static - * @param {ics23.ICompressedBatchEntry} message CompressedBatchEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedBatchEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompressedBatchEntry message from the specified reader or buffer. - * @function decode - * @memberof ics23.CompressedBatchEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedBatchEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedBatchEntry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exist = $root.ics23.CompressedExistenceProof.decode(reader, reader.uint32()); - break; - case 2: - message.nonexist = $root.ics23.CompressedNonExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompressedBatchEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CompressedBatchEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedBatchEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompressedBatchEntry message. - * @function verify - * @memberof ics23.CompressedBatchEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompressedBatchEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - properties.proof = 1; - { - var error = $root.ics23.CompressedExistenceProof.verify(message.exist); - if (error) - return "exist." + error; - } - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - var error = $root.ics23.CompressedNonExistenceProof.verify(message.nonexist); - if (error) - return "nonexist." + error; - } - } - return null; - }; - - /** - * Creates a CompressedBatchEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CompressedBatchEntry - * @static - * @param {Object.} object Plain object - * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry - */ - CompressedBatchEntry.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CompressedBatchEntry) - return object; - var message = new $root.ics23.CompressedBatchEntry(); - if (object.exist != null) { - if (typeof object.exist !== "object") - throw TypeError(".ics23.CompressedBatchEntry.exist: object expected"); - message.exist = $root.ics23.CompressedExistenceProof.fromObject(object.exist); - } - if (object.nonexist != null) { - if (typeof object.nonexist !== "object") - throw TypeError(".ics23.CompressedBatchEntry.nonexist: object expected"); - message.nonexist = $root.ics23.CompressedNonExistenceProof.fromObject(object.nonexist); - } - return message; - }; - - /** - * Creates a plain object from a CompressedBatchEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CompressedBatchEntry - * @static - * @param {ics23.CompressedBatchEntry} message CompressedBatchEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompressedBatchEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - object.exist = $root.ics23.CompressedExistenceProof.toObject(message.exist, options); - if (options.oneofs) - object.proof = "exist"; - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - object.nonexist = $root.ics23.CompressedNonExistenceProof.toObject(message.nonexist, options); - if (options.oneofs) - object.proof = "nonexist"; - } - return object; - }; - - /** - * Converts this CompressedBatchEntry to JSON. - * @function toJSON - * @memberof ics23.CompressedBatchEntry - * @instance - * @returns {Object.} JSON object - */ - CompressedBatchEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompressedBatchEntry; - })(); - - ics23.CompressedExistenceProof = (function() { - - /** - * Properties of a CompressedExistenceProof. - * @memberof ics23 - * @interface ICompressedExistenceProof - * @property {Uint8Array|null} [key] CompressedExistenceProof key - * @property {Uint8Array|null} [value] CompressedExistenceProof value - * @property {ics23.ILeafOp|null} [leaf] CompressedExistenceProof leaf - * @property {Array.|null} [path] CompressedExistenceProof path - */ - - /** - * Constructs a new CompressedExistenceProof. - * @memberof ics23 - * @classdesc Represents a CompressedExistenceProof. - * @implements ICompressedExistenceProof - * @constructor - * @param {ics23.ICompressedExistenceProof=} [properties] Properties to set - */ - function CompressedExistenceProof(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CompressedExistenceProof key. - * @member {Uint8Array} key - * @memberof ics23.CompressedExistenceProof - * @instance - */ - CompressedExistenceProof.prototype.key = $util.newBuffer([]); - - /** - * CompressedExistenceProof value. - * @member {Uint8Array} value - * @memberof ics23.CompressedExistenceProof - * @instance - */ - CompressedExistenceProof.prototype.value = $util.newBuffer([]); - - /** - * CompressedExistenceProof leaf. - * @member {ics23.ILeafOp|null|undefined} leaf - * @memberof ics23.CompressedExistenceProof - * @instance - */ - CompressedExistenceProof.prototype.leaf = null; - - /** - * CompressedExistenceProof path. - * @member {Array.} path - * @memberof ics23.CompressedExistenceProof - * @instance - */ - CompressedExistenceProof.prototype.path = $util.emptyArray; - - /** - * Encodes the specified CompressedExistenceProof message. Does not implicitly {@link ics23.CompressedExistenceProof.verify|verify} messages. - * @function encode - * @memberof ics23.CompressedExistenceProof - * @static - * @param {ics23.ICompressedExistenceProof} message CompressedExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedExistenceProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - if (message.leaf != null && Object.hasOwnProperty.call(message, "leaf")) - $root.ics23.LeafOp.encode(message.leaf, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CompressedExistenceProof message, length delimited. Does not implicitly {@link ics23.CompressedExistenceProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CompressedExistenceProof - * @static - * @param {ics23.ICompressedExistenceProof} message CompressedExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompressedExistenceProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.CompressedExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedExistenceProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedExistenceProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - case 3: - message.leaf = $root.ics23.LeafOp.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompressedExistenceProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CompressedExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedExistenceProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompressedExistenceProof message. - * @function verify - * @memberof ics23.CompressedExistenceProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompressedExistenceProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - if (message.leaf != null && message.hasOwnProperty("leaf")) { - var error = $root.ics23.LeafOp.verify(message.leaf); - if (error) - return "leaf." + error; - } - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - return null; - }; - - /** - * Creates a CompressedExistenceProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CompressedExistenceProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof - */ - CompressedExistenceProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CompressedExistenceProof) - return object; - var message = new $root.ics23.CompressedExistenceProof(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - if (object.leaf != null) { - if (typeof object.leaf !== "object") - throw TypeError(".ics23.CompressedExistenceProof.leaf: object expected"); - message.leaf = $root.ics23.LeafOp.fromObject(object.leaf); - } - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".ics23.CompressedExistenceProof.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from a CompressedExistenceProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CompressedExistenceProof - * @static - * @param {ics23.CompressedExistenceProof} message CompressedExistenceProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompressedExistenceProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - object.leaf = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - if (message.leaf != null && message.hasOwnProperty("leaf")) - object.leaf = $root.ics23.LeafOp.toObject(message.leaf, options); - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - return object; - }; - - /** - * Converts this CompressedExistenceProof to JSON. - * @function toJSON - * @memberof ics23.CompressedExistenceProof - * @instance - * @returns {Object.} JSON object - */ - CompressedExistenceProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompressedExistenceProof; - })(); - - ics23.CompressedNonExistenceProof = (function() { - - /** - * Properties of a CompressedNonExistenceProof. - * @memberof ics23 - * @interface ICompressedNonExistenceProof - * @property {Uint8Array|null} [key] CompressedNonExistenceProof key - * @property {ics23.ICompressedExistenceProof|null} [left] CompressedNonExistenceProof left - * @property {ics23.ICompressedExistenceProof|null} [right] CompressedNonExistenceProof right - */ - - /** - * Constructs a new CompressedNonExistenceProof. - * @memberof ics23 - * @classdesc Represents a CompressedNonExistenceProof. - * @implements ICompressedNonExistenceProof - * @constructor - * @param {ics23.ICompressedNonExistenceProof=} [properties] Properties to set - */ - function CompressedNonExistenceProof(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CompressedNonExistenceProof key. - * @member {Uint8Array} key - * @memberof ics23.CompressedNonExistenceProof - * @instance - */ - CompressedNonExistenceProof.prototype.key = $util.newBuffer([]); - - /** - * CompressedNonExistenceProof left. - * @member {ics23.ICompressedExistenceProof|null|undefined} left - * @memberof ics23.CompressedNonExistenceProof - * @instance - */ - CompressedNonExistenceProof.prototype.left = null; - - /** - * CompressedNonExistenceProof right. - * @member {ics23.ICompressedExistenceProof|null|undefined} right - * @memberof ics23.CompressedNonExistenceProof - * @instance - */ - CompressedNonExistenceProof.prototype.right = null; - - /** - * Encodes the specified CompressedNonExistenceProof message. Does not implicitly {@link ics23.CompressedNonExistenceProof.verify|verify} messages. - * @function encode - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {ics23.ICompressedNonExistenceProof} message CompressedNonExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedNonExistenceProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.left != null && Object.hasOwnProperty.call(message, "left")) - $root.ics23.CompressedExistenceProof.encode(message.left, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.right != null && Object.hasOwnProperty.call(message, "right")) - $root.ics23.CompressedExistenceProof.encode(message.right, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CompressedNonExistenceProof message, length delimited. Does not implicitly {@link ics23.CompressedNonExistenceProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {ics23.ICompressedNonExistenceProof} message CompressedNonExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedNonExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompressedNonExistenceProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedNonExistenceProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedNonExistenceProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.left = $root.ics23.CompressedExistenceProof.decode(reader, reader.uint32()); - break; - case 3: - message.right = $root.ics23.CompressedExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompressedNonExistenceProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedNonExistenceProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompressedNonExistenceProof message. - * @function verify - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompressedNonExistenceProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.left != null && message.hasOwnProperty("left")) { - var error = $root.ics23.CompressedExistenceProof.verify(message.left); - if (error) - return "left." + error; - } - if (message.right != null && message.hasOwnProperty("right")) { - var error = $root.ics23.CompressedExistenceProof.verify(message.right); - if (error) - return "right." + error; - } - return null; - }; - - /** - * Creates a CompressedNonExistenceProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof - */ - CompressedNonExistenceProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CompressedNonExistenceProof) - return object; - var message = new $root.ics23.CompressedNonExistenceProof(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.left != null) { - if (typeof object.left !== "object") - throw TypeError(".ics23.CompressedNonExistenceProof.left: object expected"); - message.left = $root.ics23.CompressedExistenceProof.fromObject(object.left); - } - if (object.right != null) { - if (typeof object.right !== "object") - throw TypeError(".ics23.CompressedNonExistenceProof.right: object expected"); - message.right = $root.ics23.CompressedExistenceProof.fromObject(object.right); - } - return message; - }; - - /** - * Creates a plain object from a CompressedNonExistenceProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {ics23.CompressedNonExistenceProof} message CompressedNonExistenceProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompressedNonExistenceProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - object.left = null; - object.right = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.left != null && message.hasOwnProperty("left")) - object.left = $root.ics23.CompressedExistenceProof.toObject(message.left, options); - if (message.right != null && message.hasOwnProperty("right")) - object.right = $root.ics23.CompressedExistenceProof.toObject(message.right, options); - return object; - }; - - /** - * Converts this CompressedNonExistenceProof to JSON. - * @function toJSON - * @memberof ics23.CompressedNonExistenceProof - * @instance - * @returns {Object.} JSON object - */ - CompressedNonExistenceProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompressedNonExistenceProof; - })(); - - return ics23; - })(); - - $root.tendermint = (function() { - - /** - * Namespace tendermint. - * @exports tendermint - * @namespace - */ - var tendermint = {}; - - tendermint.types = (function() { - - /** - * Namespace types. - * @memberof tendermint - * @namespace - */ - var types = {}; - - types.ValidatorSet = (function() { - - /** - * Properties of a ValidatorSet. - * @memberof tendermint.types - * @interface IValidatorSet - * @property {Array.|null} [validators] ValidatorSet validators - * @property {tendermint.types.IValidator|null} [proposer] ValidatorSet proposer - * @property {Long|null} [total_voting_power] ValidatorSet total_voting_power - */ - - /** - * Constructs a new ValidatorSet. - * @memberof tendermint.types - * @classdesc Represents a ValidatorSet. - * @implements IValidatorSet - * @constructor - * @param {tendermint.types.IValidatorSet=} [properties] Properties to set - */ - function ValidatorSet(properties) { - this.validators = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidatorSet validators. - * @member {Array.} validators - * @memberof tendermint.types.ValidatorSet - * @instance - */ - ValidatorSet.prototype.validators = $util.emptyArray; - - /** - * ValidatorSet proposer. - * @member {tendermint.types.IValidator|null|undefined} proposer - * @memberof tendermint.types.ValidatorSet - * @instance - */ - ValidatorSet.prototype.proposer = null; - - /** - * ValidatorSet total_voting_power. - * @member {Long} total_voting_power - * @memberof tendermint.types.ValidatorSet - * @instance - */ - ValidatorSet.prototype.total_voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified ValidatorSet message. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @function encode - * @memberof tendermint.types.ValidatorSet - * @static - * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.validators != null && message.validators.length) - for (var i = 0; i < message.validators.length; ++i) - $root.tendermint.types.Validator.encode(message.validators[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) - $root.tendermint.types.Validator.encode(message.proposer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.total_voting_power != null && Object.hasOwnProperty.call(message, "total_voting_power")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.total_voting_power); - return writer; - }; - - /** - * Encodes the specified ValidatorSet message, length delimited. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.ValidatorSet - * @static - * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.ValidatorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.ValidatorSet} ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.validators && message.validators.length)) - message.validators = []; - message.validators.push($root.tendermint.types.Validator.decode(reader, reader.uint32())); - break; - case 2: - message.proposer = $root.tendermint.types.Validator.decode(reader, reader.uint32()); - break; - case 3: - message.total_voting_power = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.ValidatorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.ValidatorSet} ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidatorSet message. - * @function verify - * @memberof tendermint.types.ValidatorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidatorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.validators != null && message.hasOwnProperty("validators")) { - if (!Array.isArray(message.validators)) - return "validators: array expected"; - for (var i = 0; i < message.validators.length; ++i) { - var error = $root.tendermint.types.Validator.verify(message.validators[i]); - if (error) - return "validators." + error; - } - } - if (message.proposer != null && message.hasOwnProperty("proposer")) { - var error = $root.tendermint.types.Validator.verify(message.proposer); - if (error) - return "proposer." + error; - } - if (message.total_voting_power != null && message.hasOwnProperty("total_voting_power")) - if (!$util.isInteger(message.total_voting_power) && !(message.total_voting_power && $util.isInteger(message.total_voting_power.low) && $util.isInteger(message.total_voting_power.high))) - return "total_voting_power: integer|Long expected"; - return null; - }; - - /** - * Creates a ValidatorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.ValidatorSet - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.ValidatorSet} ValidatorSet - */ - ValidatorSet.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.ValidatorSet) - return object; - var message = new $root.tendermint.types.ValidatorSet(); - if (object.validators) { - if (!Array.isArray(object.validators)) - throw TypeError(".tendermint.types.ValidatorSet.validators: array expected"); - message.validators = []; - for (var i = 0; i < object.validators.length; ++i) { - if (typeof object.validators[i] !== "object") - throw TypeError(".tendermint.types.ValidatorSet.validators: object expected"); - message.validators[i] = $root.tendermint.types.Validator.fromObject(object.validators[i]); - } - } - if (object.proposer != null) { - if (typeof object.proposer !== "object") - throw TypeError(".tendermint.types.ValidatorSet.proposer: object expected"); - message.proposer = $root.tendermint.types.Validator.fromObject(object.proposer); - } - if (object.total_voting_power != null) - if ($util.Long) - (message.total_voting_power = $util.Long.fromValue(object.total_voting_power)).unsigned = false; - else if (typeof object.total_voting_power === "string") - message.total_voting_power = parseInt(object.total_voting_power, 10); - else if (typeof object.total_voting_power === "number") - message.total_voting_power = object.total_voting_power; - else if (typeof object.total_voting_power === "object") - message.total_voting_power = new $util.LongBits(object.total_voting_power.low >>> 0, object.total_voting_power.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ValidatorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.ValidatorSet - * @static - * @param {tendermint.types.ValidatorSet} message ValidatorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidatorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.validators = []; - if (options.defaults) { - object.proposer = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.total_voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total_voting_power = options.longs === String ? "0" : 0; - } - if (message.validators && message.validators.length) { - object.validators = []; - for (var j = 0; j < message.validators.length; ++j) - object.validators[j] = $root.tendermint.types.Validator.toObject(message.validators[j], options); - } - if (message.proposer != null && message.hasOwnProperty("proposer")) - object.proposer = $root.tendermint.types.Validator.toObject(message.proposer, options); - if (message.total_voting_power != null && message.hasOwnProperty("total_voting_power")) - if (typeof message.total_voting_power === "number") - object.total_voting_power = options.longs === String ? String(message.total_voting_power) : message.total_voting_power; - else - object.total_voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.total_voting_power) : options.longs === Number ? new $util.LongBits(message.total_voting_power.low >>> 0, message.total_voting_power.high >>> 0).toNumber() : message.total_voting_power; - return object; - }; - - /** - * Converts this ValidatorSet to JSON. - * @function toJSON - * @memberof tendermint.types.ValidatorSet - * @instance - * @returns {Object.} JSON object - */ - ValidatorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValidatorSet; - })(); - - types.Validator = (function() { - - /** - * Properties of a Validator. - * @memberof tendermint.types - * @interface IValidator - * @property {Uint8Array|null} [address] Validator address - * @property {tendermint.crypto.IPublicKey|null} [pub_key] Validator pub_key - * @property {Long|null} [voting_power] Validator voting_power - * @property {Long|null} [proposer_priority] Validator proposer_priority - */ - - /** - * Constructs a new Validator. - * @memberof tendermint.types - * @classdesc Represents a Validator. - * @implements IValidator - * @constructor - * @param {tendermint.types.IValidator=} [properties] Properties to set - */ - function Validator(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Validator address. - * @member {Uint8Array} address - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.address = $util.newBuffer([]); - - /** - * Validator pub_key. - * @member {tendermint.crypto.IPublicKey|null|undefined} pub_key - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.pub_key = null; - - /** - * Validator voting_power. - * @member {Long} voting_power - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Validator proposer_priority. - * @member {Long} proposer_priority - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.proposer_priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified Validator message. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Validator - * @static - * @param {tendermint.types.IValidator} message Validator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Validator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); - if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key")) - $root.tendermint.crypto.PublicKey.encode(message.pub_key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.voting_power != null && Object.hasOwnProperty.call(message, "voting_power")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.voting_power); - if (message.proposer_priority != null && Object.hasOwnProperty.call(message, "proposer_priority")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.proposer_priority); - return writer; - }; - - /** - * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Validator - * @static - * @param {tendermint.types.IValidator} message Validator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Validator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Validator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Validator} Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Validator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Validator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.bytes(); - break; - case 2: - message.pub_key = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); - break; - case 3: - message.voting_power = reader.int64(); - break; - case 4: - message.proposer_priority = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Validator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Validator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Validator} Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Validator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Validator message. - * @function verify - * @memberof tendermint.types.Validator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Validator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) - return "address: buffer expected"; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) { - var error = $root.tendermint.crypto.PublicKey.verify(message.pub_key); - if (error) - return "pub_key." + error; - } - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (!$util.isInteger(message.voting_power) && !(message.voting_power && $util.isInteger(message.voting_power.low) && $util.isInteger(message.voting_power.high))) - return "voting_power: integer|Long expected"; - if (message.proposer_priority != null && message.hasOwnProperty("proposer_priority")) - if (!$util.isInteger(message.proposer_priority) && !(message.proposer_priority && $util.isInteger(message.proposer_priority.low) && $util.isInteger(message.proposer_priority.high))) - return "proposer_priority: integer|Long expected"; - return null; - }; - - /** - * Creates a Validator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Validator - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Validator} Validator - */ - Validator.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Validator) - return object; - var message = new $root.tendermint.types.Validator(); - if (object.address != null) - if (typeof object.address === "string") - $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); - else if (object.address.length) - message.address = object.address; - if (object.pub_key != null) { - if (typeof object.pub_key !== "object") - throw TypeError(".tendermint.types.Validator.pub_key: object expected"); - message.pub_key = $root.tendermint.crypto.PublicKey.fromObject(object.pub_key); - } - if (object.voting_power != null) - if ($util.Long) - (message.voting_power = $util.Long.fromValue(object.voting_power)).unsigned = false; - else if (typeof object.voting_power === "string") - message.voting_power = parseInt(object.voting_power, 10); - else if (typeof object.voting_power === "number") - message.voting_power = object.voting_power; - else if (typeof object.voting_power === "object") - message.voting_power = new $util.LongBits(object.voting_power.low >>> 0, object.voting_power.high >>> 0).toNumber(); - if (object.proposer_priority != null) - if ($util.Long) - (message.proposer_priority = $util.Long.fromValue(object.proposer_priority)).unsigned = false; - else if (typeof object.proposer_priority === "string") - message.proposer_priority = parseInt(object.proposer_priority, 10); - else if (typeof object.proposer_priority === "number") - message.proposer_priority = object.proposer_priority; - else if (typeof object.proposer_priority === "object") - message.proposer_priority = new $util.LongBits(object.proposer_priority.low >>> 0, object.proposer_priority.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Validator message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Validator - * @static - * @param {tendermint.types.Validator} message Validator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Validator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.address = ""; - else { - object.address = []; - if (options.bytes !== Array) - object.address = $util.newBuffer(object.address); - } - object.pub_key = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.voting_power = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.proposer_priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposer_priority = options.longs === String ? "0" : 0; - } - if (message.address != null && message.hasOwnProperty("address")) - object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) - object.pub_key = $root.tendermint.crypto.PublicKey.toObject(message.pub_key, options); - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (typeof message.voting_power === "number") - object.voting_power = options.longs === String ? String(message.voting_power) : message.voting_power; - else - object.voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.voting_power) : options.longs === Number ? new $util.LongBits(message.voting_power.low >>> 0, message.voting_power.high >>> 0).toNumber() : message.voting_power; - if (message.proposer_priority != null && message.hasOwnProperty("proposer_priority")) - if (typeof message.proposer_priority === "number") - object.proposer_priority = options.longs === String ? String(message.proposer_priority) : message.proposer_priority; - else - object.proposer_priority = options.longs === String ? $util.Long.prototype.toString.call(message.proposer_priority) : options.longs === Number ? new $util.LongBits(message.proposer_priority.low >>> 0, message.proposer_priority.high >>> 0).toNumber() : message.proposer_priority; - return object; - }; - - /** - * Converts this Validator to JSON. - * @function toJSON - * @memberof tendermint.types.Validator - * @instance - * @returns {Object.} JSON object - */ - Validator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Validator; - })(); - - types.SimpleValidator = (function() { - - /** - * Properties of a SimpleValidator. - * @memberof tendermint.types - * @interface ISimpleValidator - * @property {tendermint.crypto.IPublicKey|null} [pub_key] SimpleValidator pub_key - * @property {Long|null} [voting_power] SimpleValidator voting_power - */ - - /** - * Constructs a new SimpleValidator. - * @memberof tendermint.types - * @classdesc Represents a SimpleValidator. - * @implements ISimpleValidator - * @constructor - * @param {tendermint.types.ISimpleValidator=} [properties] Properties to set - */ - function SimpleValidator(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SimpleValidator pub_key. - * @member {tendermint.crypto.IPublicKey|null|undefined} pub_key - * @memberof tendermint.types.SimpleValidator - * @instance - */ - SimpleValidator.prototype.pub_key = null; - - /** - * SimpleValidator voting_power. - * @member {Long} voting_power - * @memberof tendermint.types.SimpleValidator - * @instance - */ - SimpleValidator.prototype.voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified SimpleValidator message. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @function encode - * @memberof tendermint.types.SimpleValidator - * @static - * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleValidator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key")) - $root.tendermint.crypto.PublicKey.encode(message.pub_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.voting_power != null && Object.hasOwnProperty.call(message, "voting_power")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.voting_power); - return writer; - }; - - /** - * Encodes the specified SimpleValidator message, length delimited. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.SimpleValidator - * @static - * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleValidator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.SimpleValidator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.SimpleValidator} SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleValidator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SimpleValidator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pub_key = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); - break; - case 2: - message.voting_power = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.SimpleValidator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.SimpleValidator} SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleValidator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SimpleValidator message. - * @function verify - * @memberof tendermint.types.SimpleValidator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimpleValidator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) { - var error = $root.tendermint.crypto.PublicKey.verify(message.pub_key); - if (error) - return "pub_key." + error; - } - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (!$util.isInteger(message.voting_power) && !(message.voting_power && $util.isInteger(message.voting_power.low) && $util.isInteger(message.voting_power.high))) - return "voting_power: integer|Long expected"; - return null; - }; - - /** - * Creates a SimpleValidator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.SimpleValidator - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.SimpleValidator} SimpleValidator - */ - SimpleValidator.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.SimpleValidator) - return object; - var message = new $root.tendermint.types.SimpleValidator(); - if (object.pub_key != null) { - if (typeof object.pub_key !== "object") - throw TypeError(".tendermint.types.SimpleValidator.pub_key: object expected"); - message.pub_key = $root.tendermint.crypto.PublicKey.fromObject(object.pub_key); - } - if (object.voting_power != null) - if ($util.Long) - (message.voting_power = $util.Long.fromValue(object.voting_power)).unsigned = false; - else if (typeof object.voting_power === "string") - message.voting_power = parseInt(object.voting_power, 10); - else if (typeof object.voting_power === "number") - message.voting_power = object.voting_power; - else if (typeof object.voting_power === "object") - message.voting_power = new $util.LongBits(object.voting_power.low >>> 0, object.voting_power.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a SimpleValidator message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.SimpleValidator - * @static - * @param {tendermint.types.SimpleValidator} message SimpleValidator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimpleValidator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pub_key = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.voting_power = options.longs === String ? "0" : 0; - } - if (message.pub_key != null && message.hasOwnProperty("pub_key")) - object.pub_key = $root.tendermint.crypto.PublicKey.toObject(message.pub_key, options); - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (typeof message.voting_power === "number") - object.voting_power = options.longs === String ? String(message.voting_power) : message.voting_power; - else - object.voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.voting_power) : options.longs === Number ? new $util.LongBits(message.voting_power.low >>> 0, message.voting_power.high >>> 0).toNumber() : message.voting_power; - return object; - }; - - /** - * Converts this SimpleValidator to JSON. - * @function toJSON - * @memberof tendermint.types.SimpleValidator - * @instance - * @returns {Object.} JSON object - */ - SimpleValidator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SimpleValidator; - })(); - - /** - * BlockIDFlag enum. - * @name tendermint.types.BlockIDFlag - * @enum {number} - * @property {number} BLOCK_ID_FLAG_UNKNOWN=0 BLOCK_ID_FLAG_UNKNOWN value - * @property {number} BLOCK_ID_FLAG_ABSENT=1 BLOCK_ID_FLAG_ABSENT value - * @property {number} BLOCK_ID_FLAG_COMMIT=2 BLOCK_ID_FLAG_COMMIT value - * @property {number} BLOCK_ID_FLAG_NIL=3 BLOCK_ID_FLAG_NIL value - */ - types.BlockIDFlag = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BLOCK_ID_FLAG_UNKNOWN"] = 0; - values[valuesById[1] = "BLOCK_ID_FLAG_ABSENT"] = 1; - values[valuesById[2] = "BLOCK_ID_FLAG_COMMIT"] = 2; - values[valuesById[3] = "BLOCK_ID_FLAG_NIL"] = 3; - return values; - })(); - - /** - * SignedMsgType enum. - * @name tendermint.types.SignedMsgType - * @enum {number} - * @property {number} SIGNED_MSG_TYPE_UNKNOWN=0 SIGNED_MSG_TYPE_UNKNOWN value - * @property {number} SIGNED_MSG_TYPE_PREVOTE=1 SIGNED_MSG_TYPE_PREVOTE value - * @property {number} SIGNED_MSG_TYPE_PRECOMMIT=2 SIGNED_MSG_TYPE_PRECOMMIT value - * @property {number} SIGNED_MSG_TYPE_PROPOSAL=32 SIGNED_MSG_TYPE_PROPOSAL value - */ - types.SignedMsgType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SIGNED_MSG_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "SIGNED_MSG_TYPE_PREVOTE"] = 1; - values[valuesById[2] = "SIGNED_MSG_TYPE_PRECOMMIT"] = 2; - values[valuesById[32] = "SIGNED_MSG_TYPE_PROPOSAL"] = 32; - return values; - })(); - - types.PartSetHeader = (function() { - - /** - * Properties of a PartSetHeader. - * @memberof tendermint.types - * @interface IPartSetHeader - * @property {number|null} [total] PartSetHeader total - * @property {Uint8Array|null} [hash] PartSetHeader hash - */ - - /** - * Constructs a new PartSetHeader. - * @memberof tendermint.types - * @classdesc Represents a PartSetHeader. - * @implements IPartSetHeader - * @constructor - * @param {tendermint.types.IPartSetHeader=} [properties] Properties to set - */ - function PartSetHeader(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartSetHeader total. - * @member {number} total - * @memberof tendermint.types.PartSetHeader - * @instance - */ - PartSetHeader.prototype.total = 0; - - /** - * PartSetHeader hash. - * @member {Uint8Array} hash - * @memberof tendermint.types.PartSetHeader - * @instance - */ - PartSetHeader.prototype.hash = $util.newBuffer([]); - - /** - * Encodes the specified PartSetHeader message. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @function encode - * @memberof tendermint.types.PartSetHeader - * @static - * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartSetHeader.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.total != null && Object.hasOwnProperty.call(message, "total")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.total); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hash); - return writer; - }; - - /** - * Encodes the specified PartSetHeader message, length delimited. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.PartSetHeader - * @static - * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartSetHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.PartSetHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.PartSetHeader} PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartSetHeader.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.PartSetHeader(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = reader.uint32(); - break; - case 2: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.PartSetHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.PartSetHeader} PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartSetHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartSetHeader message. - * @function verify - * @memberof tendermint.types.PartSetHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartSetHeader.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.total != null && message.hasOwnProperty("total")) - if (!$util.isInteger(message.total)) - return "total: integer expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - return null; - }; - - /** - * Creates a PartSetHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.PartSetHeader - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.PartSetHeader} PartSetHeader - */ - PartSetHeader.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.PartSetHeader) - return object; - var message = new $root.tendermint.types.PartSetHeader(); - if (object.total != null) - message.total = object.total >>> 0; - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - return message; - }; - - /** - * Creates a plain object from a PartSetHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.PartSetHeader - * @static - * @param {tendermint.types.PartSetHeader} message PartSetHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartSetHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.total = 0; - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - } - if (message.total != null && message.hasOwnProperty("total")) - object.total = message.total; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - return object; - }; - - /** - * Converts this PartSetHeader to JSON. - * @function toJSON - * @memberof tendermint.types.PartSetHeader - * @instance - * @returns {Object.} JSON object - */ - PartSetHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PartSetHeader; - })(); - - types.Part = (function() { - - /** - * Properties of a Part. - * @memberof tendermint.types - * @interface IPart - * @property {number|null} [index] Part index - * @property {Uint8Array|null} [bytes] Part bytes - * @property {tendermint.crypto.IProof|null} [proof] Part proof - */ - - /** - * Constructs a new Part. - * @memberof tendermint.types - * @classdesc Represents a Part. - * @implements IPart - * @constructor - * @param {tendermint.types.IPart=} [properties] Properties to set - */ - function Part(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Part index. - * @member {number} index - * @memberof tendermint.types.Part - * @instance - */ - Part.prototype.index = 0; - - /** - * Part bytes. - * @member {Uint8Array} bytes - * @memberof tendermint.types.Part - * @instance - */ - Part.prototype.bytes = $util.newBuffer([]); - - /** - * Part proof. - * @member {tendermint.crypto.IProof|null|undefined} proof - * @memberof tendermint.types.Part - * @instance - */ - Part.prototype.proof = null; - - /** - * Encodes the specified Part message. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Part - * @static - * @param {tendermint.types.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); - if (message.bytes != null && Object.hasOwnProperty.call(message, "bytes")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bytes); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Part - * @static - * @param {tendermint.types.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Part message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Part(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.bytes = reader.bytes(); - break; - case 3: - message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Part message. - * @function verify - * @memberof tendermint.types.Part - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Part.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.bytes != null && message.hasOwnProperty("bytes")) - if (!(message.bytes && typeof message.bytes.length === "number" || $util.isString(message.bytes))) - return "bytes: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - var error = $root.tendermint.crypto.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - return null; - }; - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Part - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Part} Part - */ - Part.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Part) - return object; - var message = new $root.tendermint.types.Part(); - if (object.index != null) - message.index = object.index >>> 0; - if (object.bytes != null) - if (typeof object.bytes === "string") - $util.base64.decode(object.bytes, message.bytes = $util.newBuffer($util.base64.length(object.bytes)), 0); - else if (object.bytes.length) - message.bytes = object.bytes; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".tendermint.types.Part.proof: object expected"); - message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); - } - return message; - }; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Part - * @static - * @param {tendermint.types.Part} message Part - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Part.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.index = 0; - if (options.bytes === String) - object.bytes = ""; - else { - object.bytes = []; - if (options.bytes !== Array) - object.bytes = $util.newBuffer(object.bytes); - } - object.proof = null; - } - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.bytes != null && message.hasOwnProperty("bytes")) - object.bytes = options.bytes === String ? $util.base64.encode(message.bytes, 0, message.bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytes) : message.bytes; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); - return object; - }; - - /** - * Converts this Part to JSON. - * @function toJSON - * @memberof tendermint.types.Part - * @instance - * @returns {Object.} JSON object - */ - Part.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Part; - })(); - - types.BlockID = (function() { - - /** - * Properties of a BlockID. - * @memberof tendermint.types - * @interface IBlockID - * @property {Uint8Array|null} [hash] BlockID hash - * @property {tendermint.types.IPartSetHeader|null} [part_set_header] BlockID part_set_header - */ - - /** - * Constructs a new BlockID. - * @memberof tendermint.types - * @classdesc Represents a BlockID. - * @implements IBlockID - * @constructor - * @param {tendermint.types.IBlockID=} [properties] Properties to set - */ - function BlockID(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockID hash. - * @member {Uint8Array} hash - * @memberof tendermint.types.BlockID - * @instance - */ - BlockID.prototype.hash = $util.newBuffer([]); - - /** - * BlockID part_set_header. - * @member {tendermint.types.IPartSetHeader|null|undefined} part_set_header - * @memberof tendermint.types.BlockID - * @instance - */ - BlockID.prototype.part_set_header = null; - - /** - * Encodes the specified BlockID message. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @function encode - * @memberof tendermint.types.BlockID - * @static - * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockID.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); - if (message.part_set_header != null && Object.hasOwnProperty.call(message, "part_set_header")) - $root.tendermint.types.PartSetHeader.encode(message.part_set_header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BlockID message, length delimited. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.BlockID - * @static - * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockID.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockID message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.BlockID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.BlockID} BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockID.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockID(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - case 2: - message.part_set_header = $root.tendermint.types.PartSetHeader.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockID message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.BlockID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.BlockID} BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockID.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockID message. - * @function verify - * @memberof tendermint.types.BlockID - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockID.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - if (message.part_set_header != null && message.hasOwnProperty("part_set_header")) { - var error = $root.tendermint.types.PartSetHeader.verify(message.part_set_header); - if (error) - return "part_set_header." + error; - } - return null; - }; - - /** - * Creates a BlockID message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.BlockID - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.BlockID} BlockID - */ - BlockID.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.BlockID) - return object; - var message = new $root.tendermint.types.BlockID(); - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - if (object.part_set_header != null) { - if (typeof object.part_set_header !== "object") - throw TypeError(".tendermint.types.BlockID.part_set_header: object expected"); - message.part_set_header = $root.tendermint.types.PartSetHeader.fromObject(object.part_set_header); - } - return message; - }; - - /** - * Creates a plain object from a BlockID message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.BlockID - * @static - * @param {tendermint.types.BlockID} message BlockID - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockID.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - object.part_set_header = null; - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - if (message.part_set_header != null && message.hasOwnProperty("part_set_header")) - object.part_set_header = $root.tendermint.types.PartSetHeader.toObject(message.part_set_header, options); - return object; - }; - - /** - * Converts this BlockID to JSON. - * @function toJSON - * @memberof tendermint.types.BlockID - * @instance - * @returns {Object.} JSON object - */ - BlockID.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockID; - })(); - - types.Header = (function() { - - /** - * Properties of a Header. - * @memberof tendermint.types - * @interface IHeader - * @property {tendermint.version.IConsensus|null} [version] Header version - * @property {string|null} [chain_id] Header chain_id - * @property {Long|null} [height] Header height - * @property {google.protobuf.ITimestamp|null} [time] Header time - * @property {tendermint.types.IBlockID|null} [last_block_id] Header last_block_id - * @property {Uint8Array|null} [last_commit_hash] Header last_commit_hash - * @property {Uint8Array|null} [data_hash] Header data_hash - * @property {Uint8Array|null} [validators_hash] Header validators_hash - * @property {Uint8Array|null} [next_validators_hash] Header next_validators_hash - * @property {Uint8Array|null} [consensus_hash] Header consensus_hash - * @property {Uint8Array|null} [app_hash] Header app_hash - * @property {Uint8Array|null} [last_results_hash] Header last_results_hash - * @property {Uint8Array|null} [evidence_hash] Header evidence_hash - * @property {Uint8Array|null} [proposer_address] Header proposer_address - */ - - /** - * Constructs a new Header. - * @memberof tendermint.types - * @classdesc Represents a Header. - * @implements IHeader - * @constructor - * @param {tendermint.types.IHeader=} [properties] Properties to set - */ - function Header(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Header version. - * @member {tendermint.version.IConsensus|null|undefined} version - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.version = null; - - /** - * Header chain_id. - * @member {string} chain_id - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.chain_id = ""; - - /** - * Header height. - * @member {Long} height - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Header time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.time = null; - - /** - * Header last_block_id. - * @member {tendermint.types.IBlockID|null|undefined} last_block_id - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.last_block_id = null; - - /** - * Header last_commit_hash. - * @member {Uint8Array} last_commit_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.last_commit_hash = $util.newBuffer([]); - - /** - * Header data_hash. - * @member {Uint8Array} data_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.data_hash = $util.newBuffer([]); - - /** - * Header validators_hash. - * @member {Uint8Array} validators_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.validators_hash = $util.newBuffer([]); - - /** - * Header next_validators_hash. - * @member {Uint8Array} next_validators_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.next_validators_hash = $util.newBuffer([]); - - /** - * Header consensus_hash. - * @member {Uint8Array} consensus_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.consensus_hash = $util.newBuffer([]); - - /** - * Header app_hash. - * @member {Uint8Array} app_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.app_hash = $util.newBuffer([]); - - /** - * Header last_results_hash. - * @member {Uint8Array} last_results_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.last_results_hash = $util.newBuffer([]); - - /** - * Header evidence_hash. - * @member {Uint8Array} evidence_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.evidence_hash = $util.newBuffer([]); - - /** - * Header proposer_address. - * @member {Uint8Array} proposer_address - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.proposer_address = $util.newBuffer([]); - - /** - * Encodes the specified Header message. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Header - * @static - * @param {tendermint.types.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.tendermint.version.Consensus.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.chain_id != null && Object.hasOwnProperty.call(message, "chain_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain_id); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.last_block_id != null && Object.hasOwnProperty.call(message, "last_block_id")) - $root.tendermint.types.BlockID.encode(message.last_block_id, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.last_commit_hash != null && Object.hasOwnProperty.call(message, "last_commit_hash")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.last_commit_hash); - if (message.data_hash != null && Object.hasOwnProperty.call(message, "data_hash")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.data_hash); - if (message.validators_hash != null && Object.hasOwnProperty.call(message, "validators_hash")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.validators_hash); - if (message.next_validators_hash != null && Object.hasOwnProperty.call(message, "next_validators_hash")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.next_validators_hash); - if (message.consensus_hash != null && Object.hasOwnProperty.call(message, "consensus_hash")) - writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.consensus_hash); - if (message.app_hash != null && Object.hasOwnProperty.call(message, "app_hash")) - writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.app_hash); - if (message.last_results_hash != null && Object.hasOwnProperty.call(message, "last_results_hash")) - writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.last_results_hash); - if (message.evidence_hash != null && Object.hasOwnProperty.call(message, "evidence_hash")) - writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.evidence_hash); - if (message.proposer_address != null && Object.hasOwnProperty.call(message, "proposer_address")) - writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.proposer_address); - return writer; - }; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Header - * @static - * @param {tendermint.types.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Header message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Header(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = $root.tendermint.version.Consensus.decode(reader, reader.uint32()); - break; - case 2: - message.chain_id = reader.string(); - break; - case 3: - message.height = reader.int64(); - break; - case 4: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.last_block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.last_commit_hash = reader.bytes(); - break; - case 7: - message.data_hash = reader.bytes(); - break; - case 8: - message.validators_hash = reader.bytes(); - break; - case 9: - message.next_validators_hash = reader.bytes(); - break; - case 10: - message.consensus_hash = reader.bytes(); - break; - case 11: - message.app_hash = reader.bytes(); - break; - case 12: - message.last_results_hash = reader.bytes(); - break; - case 13: - message.evidence_hash = reader.bytes(); - break; - case 14: - message.proposer_address = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Header message. - * @function verify - * @memberof tendermint.types.Header - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Header.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.tendermint.version.Consensus.verify(message.version); - if (error) - return "version." + error; - } - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - if (!$util.isString(message.chain_id)) - return "chain_id: string expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - if (message.last_block_id != null && message.hasOwnProperty("last_block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.last_block_id); - if (error) - return "last_block_id." + error; - } - if (message.last_commit_hash != null && message.hasOwnProperty("last_commit_hash")) - if (!(message.last_commit_hash && typeof message.last_commit_hash.length === "number" || $util.isString(message.last_commit_hash))) - return "last_commit_hash: buffer expected"; - if (message.data_hash != null && message.hasOwnProperty("data_hash")) - if (!(message.data_hash && typeof message.data_hash.length === "number" || $util.isString(message.data_hash))) - return "data_hash: buffer expected"; - if (message.validators_hash != null && message.hasOwnProperty("validators_hash")) - if (!(message.validators_hash && typeof message.validators_hash.length === "number" || $util.isString(message.validators_hash))) - return "validators_hash: buffer expected"; - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - if (!(message.next_validators_hash && typeof message.next_validators_hash.length === "number" || $util.isString(message.next_validators_hash))) - return "next_validators_hash: buffer expected"; - if (message.consensus_hash != null && message.hasOwnProperty("consensus_hash")) - if (!(message.consensus_hash && typeof message.consensus_hash.length === "number" || $util.isString(message.consensus_hash))) - return "consensus_hash: buffer expected"; - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - if (!(message.app_hash && typeof message.app_hash.length === "number" || $util.isString(message.app_hash))) - return "app_hash: buffer expected"; - if (message.last_results_hash != null && message.hasOwnProperty("last_results_hash")) - if (!(message.last_results_hash && typeof message.last_results_hash.length === "number" || $util.isString(message.last_results_hash))) - return "last_results_hash: buffer expected"; - if (message.evidence_hash != null && message.hasOwnProperty("evidence_hash")) - if (!(message.evidence_hash && typeof message.evidence_hash.length === "number" || $util.isString(message.evidence_hash))) - return "evidence_hash: buffer expected"; - if (message.proposer_address != null && message.hasOwnProperty("proposer_address")) - if (!(message.proposer_address && typeof message.proposer_address.length === "number" || $util.isString(message.proposer_address))) - return "proposer_address: buffer expected"; - return null; - }; - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Header - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Header} Header - */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Header) - return object; - var message = new $root.tendermint.types.Header(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".tendermint.types.Header.version: object expected"); - message.version = $root.tendermint.version.Consensus.fromObject(object.version); - } - if (object.chain_id != null) - message.chain_id = String(object.chain_id); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".tendermint.types.Header.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.last_block_id != null) { - if (typeof object.last_block_id !== "object") - throw TypeError(".tendermint.types.Header.last_block_id: object expected"); - message.last_block_id = $root.tendermint.types.BlockID.fromObject(object.last_block_id); - } - if (object.last_commit_hash != null) - if (typeof object.last_commit_hash === "string") - $util.base64.decode(object.last_commit_hash, message.last_commit_hash = $util.newBuffer($util.base64.length(object.last_commit_hash)), 0); - else if (object.last_commit_hash.length) - message.last_commit_hash = object.last_commit_hash; - if (object.data_hash != null) - if (typeof object.data_hash === "string") - $util.base64.decode(object.data_hash, message.data_hash = $util.newBuffer($util.base64.length(object.data_hash)), 0); - else if (object.data_hash.length) - message.data_hash = object.data_hash; - if (object.validators_hash != null) - if (typeof object.validators_hash === "string") - $util.base64.decode(object.validators_hash, message.validators_hash = $util.newBuffer($util.base64.length(object.validators_hash)), 0); - else if (object.validators_hash.length) - message.validators_hash = object.validators_hash; - if (object.next_validators_hash != null) - if (typeof object.next_validators_hash === "string") - $util.base64.decode(object.next_validators_hash, message.next_validators_hash = $util.newBuffer($util.base64.length(object.next_validators_hash)), 0); - else if (object.next_validators_hash.length) - message.next_validators_hash = object.next_validators_hash; - if (object.consensus_hash != null) - if (typeof object.consensus_hash === "string") - $util.base64.decode(object.consensus_hash, message.consensus_hash = $util.newBuffer($util.base64.length(object.consensus_hash)), 0); - else if (object.consensus_hash.length) - message.consensus_hash = object.consensus_hash; - if (object.app_hash != null) - if (typeof object.app_hash === "string") - $util.base64.decode(object.app_hash, message.app_hash = $util.newBuffer($util.base64.length(object.app_hash)), 0); - else if (object.app_hash.length) - message.app_hash = object.app_hash; - if (object.last_results_hash != null) - if (typeof object.last_results_hash === "string") - $util.base64.decode(object.last_results_hash, message.last_results_hash = $util.newBuffer($util.base64.length(object.last_results_hash)), 0); - else if (object.last_results_hash.length) - message.last_results_hash = object.last_results_hash; - if (object.evidence_hash != null) - if (typeof object.evidence_hash === "string") - $util.base64.decode(object.evidence_hash, message.evidence_hash = $util.newBuffer($util.base64.length(object.evidence_hash)), 0); - else if (object.evidence_hash.length) - message.evidence_hash = object.evidence_hash; - if (object.proposer_address != null) - if (typeof object.proposer_address === "string") - $util.base64.decode(object.proposer_address, message.proposer_address = $util.newBuffer($util.base64.length(object.proposer_address)), 0); - else if (object.proposer_address.length) - message.proposer_address = object.proposer_address; - return message; - }; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Header - * @static - * @param {tendermint.types.Header} message Header - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Header.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = null; - object.chain_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.time = null; - object.last_block_id = null; - if (options.bytes === String) - object.last_commit_hash = ""; - else { - object.last_commit_hash = []; - if (options.bytes !== Array) - object.last_commit_hash = $util.newBuffer(object.last_commit_hash); - } - if (options.bytes === String) - object.data_hash = ""; - else { - object.data_hash = []; - if (options.bytes !== Array) - object.data_hash = $util.newBuffer(object.data_hash); - } - if (options.bytes === String) - object.validators_hash = ""; - else { - object.validators_hash = []; - if (options.bytes !== Array) - object.validators_hash = $util.newBuffer(object.validators_hash); - } - if (options.bytes === String) - object.next_validators_hash = ""; - else { - object.next_validators_hash = []; - if (options.bytes !== Array) - object.next_validators_hash = $util.newBuffer(object.next_validators_hash); - } - if (options.bytes === String) - object.consensus_hash = ""; - else { - object.consensus_hash = []; - if (options.bytes !== Array) - object.consensus_hash = $util.newBuffer(object.consensus_hash); - } - if (options.bytes === String) - object.app_hash = ""; - else { - object.app_hash = []; - if (options.bytes !== Array) - object.app_hash = $util.newBuffer(object.app_hash); - } - if (options.bytes === String) - object.last_results_hash = ""; - else { - object.last_results_hash = []; - if (options.bytes !== Array) - object.last_results_hash = $util.newBuffer(object.last_results_hash); - } - if (options.bytes === String) - object.evidence_hash = ""; - else { - object.evidence_hash = []; - if (options.bytes !== Array) - object.evidence_hash = $util.newBuffer(object.evidence_hash); - } - if (options.bytes === String) - object.proposer_address = ""; - else { - object.proposer_address = []; - if (options.bytes !== Array) - object.proposer_address = $util.newBuffer(object.proposer_address); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.tendermint.version.Consensus.toObject(message.version, options); - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - object.chain_id = message.chain_id; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (message.last_block_id != null && message.hasOwnProperty("last_block_id")) - object.last_block_id = $root.tendermint.types.BlockID.toObject(message.last_block_id, options); - if (message.last_commit_hash != null && message.hasOwnProperty("last_commit_hash")) - object.last_commit_hash = options.bytes === String ? $util.base64.encode(message.last_commit_hash, 0, message.last_commit_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_commit_hash) : message.last_commit_hash; - if (message.data_hash != null && message.hasOwnProperty("data_hash")) - object.data_hash = options.bytes === String ? $util.base64.encode(message.data_hash, 0, message.data_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.data_hash) : message.data_hash; - if (message.validators_hash != null && message.hasOwnProperty("validators_hash")) - object.validators_hash = options.bytes === String ? $util.base64.encode(message.validators_hash, 0, message.validators_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.validators_hash) : message.validators_hash; - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - object.next_validators_hash = options.bytes === String ? $util.base64.encode(message.next_validators_hash, 0, message.next_validators_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.next_validators_hash) : message.next_validators_hash; - if (message.consensus_hash != null && message.hasOwnProperty("consensus_hash")) - object.consensus_hash = options.bytes === String ? $util.base64.encode(message.consensus_hash, 0, message.consensus_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.consensus_hash) : message.consensus_hash; - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - object.app_hash = options.bytes === String ? $util.base64.encode(message.app_hash, 0, message.app_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.app_hash) : message.app_hash; - if (message.last_results_hash != null && message.hasOwnProperty("last_results_hash")) - object.last_results_hash = options.bytes === String ? $util.base64.encode(message.last_results_hash, 0, message.last_results_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_results_hash) : message.last_results_hash; - if (message.evidence_hash != null && message.hasOwnProperty("evidence_hash")) - object.evidence_hash = options.bytes === String ? $util.base64.encode(message.evidence_hash, 0, message.evidence_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.evidence_hash) : message.evidence_hash; - if (message.proposer_address != null && message.hasOwnProperty("proposer_address")) - object.proposer_address = options.bytes === String ? $util.base64.encode(message.proposer_address, 0, message.proposer_address.length) : options.bytes === Array ? Array.prototype.slice.call(message.proposer_address) : message.proposer_address; - return object; - }; - - /** - * Converts this Header to JSON. - * @function toJSON - * @memberof tendermint.types.Header - * @instance - * @returns {Object.} JSON object - */ - Header.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Header; - })(); - - types.Data = (function() { - - /** - * Properties of a Data. - * @memberof tendermint.types - * @interface IData - * @property {Array.|null} [txs] Data txs - */ - - /** - * Constructs a new Data. - * @memberof tendermint.types - * @classdesc Represents a Data. - * @implements IData - * @constructor - * @param {tendermint.types.IData=} [properties] Properties to set - */ - function Data(properties) { - this.txs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Data txs. - * @member {Array.} txs - * @memberof tendermint.types.Data - * @instance - */ - Data.prototype.txs = $util.emptyArray; - - /** - * Encodes the specified Data message. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Data - * @static - * @param {tendermint.types.IData} message Data message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Data.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.txs != null && message.txs.length) - for (var i = 0; i < message.txs.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txs[i]); - return writer; - }; - - /** - * Encodes the specified Data message, length delimited. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Data - * @static - * @param {tendermint.types.IData} message Data message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Data.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Data message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Data - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Data} Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Data.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Data(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.txs && message.txs.length)) - message.txs = []; - message.txs.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Data message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Data - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Data} Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Data.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Data message. - * @function verify - * @memberof tendermint.types.Data - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Data.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.txs != null && message.hasOwnProperty("txs")) { - if (!Array.isArray(message.txs)) - return "txs: array expected"; - for (var i = 0; i < message.txs.length; ++i) - if (!(message.txs[i] && typeof message.txs[i].length === "number" || $util.isString(message.txs[i]))) - return "txs: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Data message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Data - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Data} Data - */ - Data.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Data) - return object; - var message = new $root.tendermint.types.Data(); - if (object.txs) { - if (!Array.isArray(object.txs)) - throw TypeError(".tendermint.types.Data.txs: array expected"); - message.txs = []; - for (var i = 0; i < object.txs.length; ++i) - if (typeof object.txs[i] === "string") - $util.base64.decode(object.txs[i], message.txs[i] = $util.newBuffer($util.base64.length(object.txs[i])), 0); - else if (object.txs[i].length) - message.txs[i] = object.txs[i]; - } - return message; - }; - - /** - * Creates a plain object from a Data message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Data - * @static - * @param {tendermint.types.Data} message Data - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Data.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.txs = []; - if (message.txs && message.txs.length) { - object.txs = []; - for (var j = 0; j < message.txs.length; ++j) - object.txs[j] = options.bytes === String ? $util.base64.encode(message.txs[j], 0, message.txs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.txs[j]) : message.txs[j]; - } - return object; - }; - - /** - * Converts this Data to JSON. - * @function toJSON - * @memberof tendermint.types.Data - * @instance - * @returns {Object.} JSON object - */ - Data.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Data; - })(); - - types.Vote = (function() { - - /** - * Properties of a Vote. - * @memberof tendermint.types - * @interface IVote - * @property {tendermint.types.SignedMsgType|null} [type] Vote type - * @property {Long|null} [height] Vote height - * @property {number|null} [round] Vote round - * @property {tendermint.types.IBlockID|null} [block_id] Vote block_id - * @property {google.protobuf.ITimestamp|null} [timestamp] Vote timestamp - * @property {Uint8Array|null} [validator_address] Vote validator_address - * @property {number|null} [validator_index] Vote validator_index - * @property {Uint8Array|null} [signature] Vote signature - */ - - /** - * Constructs a new Vote. - * @memberof tendermint.types - * @classdesc Represents a Vote. - * @implements IVote - * @constructor - * @param {tendermint.types.IVote=} [properties] Properties to set - */ - function Vote(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Vote type. - * @member {tendermint.types.SignedMsgType} type - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.type = 0; - - /** - * Vote height. - * @member {Long} height - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Vote round. - * @member {number} round - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.round = 0; - - /** - * Vote block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.block_id = null; - - /** - * Vote timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.timestamp = null; - - /** - * Vote validator_address. - * @member {Uint8Array} validator_address - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.validator_address = $util.newBuffer([]); - - /** - * Vote validator_index. - * @member {number} validator_index - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.validator_index = 0; - - /** - * Vote signature. - * @member {Uint8Array} signature - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.signature = $util.newBuffer([]); - - /** - * Encodes the specified Vote message. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Vote - * @static - * @param {tendermint.types.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.validator_address != null && Object.hasOwnProperty.call(message, "validator_address")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.validator_address); - if (message.validator_index != null && Object.hasOwnProperty.call(message, "validator_index")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.validator_index); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.signature); - return writer; - }; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Vote - * @static - * @param {tendermint.types.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Vote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.height = reader.int64(); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 5: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.validator_address = reader.bytes(); - break; - case 7: - message.validator_index = reader.int32(); - break; - case 8: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vote message. - * @function verify - * @memberof tendermint.types.Vote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 32: - break; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - if (!(message.validator_address && typeof message.validator_address.length === "number" || $util.isString(message.validator_address))) - return "validator_address: buffer expected"; - if (message.validator_index != null && message.hasOwnProperty("validator_index")) - if (!$util.isInteger(message.validator_index)) - return "validator_index: integer expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Vote - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Vote} Vote - */ - Vote.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Vote) - return object; - var message = new $root.tendermint.types.Vote(); - switch (object.type) { - case "SIGNED_MSG_TYPE_UNKNOWN": - case 0: - message.type = 0; - break; - case "SIGNED_MSG_TYPE_PREVOTE": - case 1: - message.type = 1; - break; - case "SIGNED_MSG_TYPE_PRECOMMIT": - case 2: - message.type = 2; - break; - case "SIGNED_MSG_TYPE_PROPOSAL": - case 32: - message.type = 32; - break; - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.round != null) - message.round = object.round | 0; - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.Vote.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".tendermint.types.Vote.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.validator_address != null) - if (typeof object.validator_address === "string") - $util.base64.decode(object.validator_address, message.validator_address = $util.newBuffer($util.base64.length(object.validator_address)), 0); - else if (object.validator_address.length) - message.validator_address = object.validator_address; - if (object.validator_index != null) - message.validator_index = object.validator_index | 0; - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Vote - * @static - * @param {tendermint.types.Vote} message Vote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.round = 0; - object.block_id = null; - object.timestamp = null; - if (options.bytes === String) - object.validator_address = ""; - else { - object.validator_address = []; - if (options.bytes !== Array) - object.validator_address = $util.newBuffer(object.validator_address); - } - object.validator_index = 0; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - object.validator_address = options.bytes === String ? $util.base64.encode(message.validator_address, 0, message.validator_address.length) : options.bytes === Array ? Array.prototype.slice.call(message.validator_address) : message.validator_address; - if (message.validator_index != null && message.hasOwnProperty("validator_index")) - object.validator_index = message.validator_index; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; - - /** - * Converts this Vote to JSON. - * @function toJSON - * @memberof tendermint.types.Vote - * @instance - * @returns {Object.} JSON object - */ - Vote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Vote; - })(); - - types.Commit = (function() { - - /** - * Properties of a Commit. - * @memberof tendermint.types - * @interface ICommit - * @property {Long|null} [height] Commit height - * @property {number|null} [round] Commit round - * @property {tendermint.types.IBlockID|null} [block_id] Commit block_id - * @property {Array.|null} [signatures] Commit signatures - */ - - /** - * Constructs a new Commit. - * @memberof tendermint.types - * @classdesc Represents a Commit. - * @implements ICommit - * @constructor - * @param {tendermint.types.ICommit=} [properties] Properties to set - */ - function Commit(properties) { - this.signatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Commit height. - * @member {Long} height - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Commit round. - * @member {number} round - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.round = 0; - - /** - * Commit block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.block_id = null; - - /** - * Commit signatures. - * @member {Array.} signatures - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.signatures = $util.emptyArray; - - /** - * Encodes the specified Commit message. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Commit - * @static - * @param {tendermint.types.ICommit} message Commit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Commit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.round); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signatures != null && message.signatures.length) - for (var i = 0; i < message.signatures.length; ++i) - $root.tendermint.types.CommitSig.encode(message.signatures[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Commit message, length delimited. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Commit - * @static - * @param {tendermint.types.ICommit} message Commit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Commit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Commit message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Commit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Commit} Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Commit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Commit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.int64(); - break; - case 2: - message.round = reader.int32(); - break; - case 3: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.signatures && message.signatures.length)) - message.signatures = []; - message.signatures.push($root.tendermint.types.CommitSig.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Commit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Commit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Commit} Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Commit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Commit message. - * @function verify - * @memberof tendermint.types.Commit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Commit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.signatures != null && message.hasOwnProperty("signatures")) { - if (!Array.isArray(message.signatures)) - return "signatures: array expected"; - for (var i = 0; i < message.signatures.length; ++i) { - var error = $root.tendermint.types.CommitSig.verify(message.signatures[i]); - if (error) - return "signatures." + error; - } - } - return null; - }; - - /** - * Creates a Commit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Commit - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Commit} Commit - */ - Commit.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Commit) - return object; - var message = new $root.tendermint.types.Commit(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.round != null) - message.round = object.round | 0; - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.Commit.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.signatures) { - if (!Array.isArray(object.signatures)) - throw TypeError(".tendermint.types.Commit.signatures: array expected"); - message.signatures = []; - for (var i = 0; i < object.signatures.length; ++i) { - if (typeof object.signatures[i] !== "object") - throw TypeError(".tendermint.types.Commit.signatures: object expected"); - message.signatures[i] = $root.tendermint.types.CommitSig.fromObject(object.signatures[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Commit message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Commit - * @static - * @param {tendermint.types.Commit} message Commit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Commit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.signatures = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.round = 0; - object.block_id = null; - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.signatures && message.signatures.length) { - object.signatures = []; - for (var j = 0; j < message.signatures.length; ++j) - object.signatures[j] = $root.tendermint.types.CommitSig.toObject(message.signatures[j], options); - } - return object; - }; - - /** - * Converts this Commit to JSON. - * @function toJSON - * @memberof tendermint.types.Commit - * @instance - * @returns {Object.} JSON object - */ - Commit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Commit; - })(); - - types.CommitSig = (function() { - - /** - * Properties of a CommitSig. - * @memberof tendermint.types - * @interface ICommitSig - * @property {tendermint.types.BlockIDFlag|null} [block_id_flag] CommitSig block_id_flag - * @property {Uint8Array|null} [validator_address] CommitSig validator_address - * @property {google.protobuf.ITimestamp|null} [timestamp] CommitSig timestamp - * @property {Uint8Array|null} [signature] CommitSig signature - */ - - /** - * Constructs a new CommitSig. - * @memberof tendermint.types - * @classdesc Represents a CommitSig. - * @implements ICommitSig - * @constructor - * @param {tendermint.types.ICommitSig=} [properties] Properties to set - */ - function CommitSig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitSig block_id_flag. - * @member {tendermint.types.BlockIDFlag} block_id_flag - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.block_id_flag = 0; - - /** - * CommitSig validator_address. - * @member {Uint8Array} validator_address - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.validator_address = $util.newBuffer([]); - - /** - * CommitSig timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.timestamp = null; - - /** - * CommitSig signature. - * @member {Uint8Array} signature - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.signature = $util.newBuffer([]); - - /** - * Encodes the specified CommitSig message. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @function encode - * @memberof tendermint.types.CommitSig - * @static - * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitSig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block_id_flag != null && Object.hasOwnProperty.call(message, "block_id_flag")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.block_id_flag); - if (message.validator_address != null && Object.hasOwnProperty.call(message, "validator_address")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.validator_address); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.signature); - return writer; - }; - - /** - * Encodes the specified CommitSig message, length delimited. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.CommitSig - * @static - * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitSig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitSig message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.CommitSig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.CommitSig} CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitSig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.CommitSig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id_flag = reader.int32(); - break; - case 2: - message.validator_address = reader.bytes(); - break; - case 3: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitSig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.CommitSig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.CommitSig} CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitSig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitSig message. - * @function verify - * @memberof tendermint.types.CommitSig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitSig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block_id_flag != null && message.hasOwnProperty("block_id_flag")) - switch (message.block_id_flag) { - default: - return "block_id_flag: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - if (!(message.validator_address && typeof message.validator_address.length === "number" || $util.isString(message.validator_address))) - return "validator_address: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; - - /** - * Creates a CommitSig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.CommitSig - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.CommitSig} CommitSig - */ - CommitSig.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.CommitSig) - return object; - var message = new $root.tendermint.types.CommitSig(); - switch (object.block_id_flag) { - case "BLOCK_ID_FLAG_UNKNOWN": - case 0: - message.block_id_flag = 0; - break; - case "BLOCK_ID_FLAG_ABSENT": - case 1: - message.block_id_flag = 1; - break; - case "BLOCK_ID_FLAG_COMMIT": - case 2: - message.block_id_flag = 2; - break; - case "BLOCK_ID_FLAG_NIL": - case 3: - message.block_id_flag = 3; - break; - } - if (object.validator_address != null) - if (typeof object.validator_address === "string") - $util.base64.decode(object.validator_address, message.validator_address = $util.newBuffer($util.base64.length(object.validator_address)), 0); - else if (object.validator_address.length) - message.validator_address = object.validator_address; - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".tendermint.types.CommitSig.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; - - /** - * Creates a plain object from a CommitSig message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.CommitSig - * @static - * @param {tendermint.types.CommitSig} message CommitSig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitSig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.block_id_flag = options.enums === String ? "BLOCK_ID_FLAG_UNKNOWN" : 0; - if (options.bytes === String) - object.validator_address = ""; - else { - object.validator_address = []; - if (options.bytes !== Array) - object.validator_address = $util.newBuffer(object.validator_address); - } - object.timestamp = null; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - } - if (message.block_id_flag != null && message.hasOwnProperty("block_id_flag")) - object.block_id_flag = options.enums === String ? $root.tendermint.types.BlockIDFlag[message.block_id_flag] : message.block_id_flag; - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - object.validator_address = options.bytes === String ? $util.base64.encode(message.validator_address, 0, message.validator_address.length) : options.bytes === Array ? Array.prototype.slice.call(message.validator_address) : message.validator_address; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; - - /** - * Converts this CommitSig to JSON. - * @function toJSON - * @memberof tendermint.types.CommitSig - * @instance - * @returns {Object.} JSON object - */ - CommitSig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CommitSig; - })(); - - types.Proposal = (function() { - - /** - * Properties of a Proposal. - * @memberof tendermint.types - * @interface IProposal - * @property {tendermint.types.SignedMsgType|null} [type] Proposal type - * @property {Long|null} [height] Proposal height - * @property {number|null} [round] Proposal round - * @property {number|null} [pol_round] Proposal pol_round - * @property {tendermint.types.IBlockID|null} [block_id] Proposal block_id - * @property {google.protobuf.ITimestamp|null} [timestamp] Proposal timestamp - * @property {Uint8Array|null} [signature] Proposal signature - */ - - /** - * Constructs a new Proposal. - * @memberof tendermint.types - * @classdesc Represents a Proposal. - * @implements IProposal - * @constructor - * @param {tendermint.types.IProposal=} [properties] Properties to set - */ - function Proposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proposal type. - * @member {tendermint.types.SignedMsgType} type - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.type = 0; - - /** - * Proposal height. - * @member {Long} height - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Proposal round. - * @member {number} round - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.round = 0; - - /** - * Proposal pol_round. - * @member {number} pol_round - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.pol_round = 0; - - /** - * Proposal block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.block_id = null; - - /** - * Proposal timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.timestamp = null; - - /** - * Proposal signature. - * @member {Uint8Array} signature - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.signature = $util.newBuffer([]); - - /** - * Encodes the specified Proposal message. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Proposal - * @static - * @param {tendermint.types.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); - if (message.pol_round != null && Object.hasOwnProperty.call(message, "pol_round")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pol_round); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.signature); - return writer; - }; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Proposal - * @static - * @param {tendermint.types.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Proposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.height = reader.int64(); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.pol_round = reader.int32(); - break; - case 5: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proposal message. - * @function verify - * @memberof tendermint.types.Proposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 32: - break; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.pol_round != null && message.hasOwnProperty("pol_round")) - if (!$util.isInteger(message.pol_round)) - return "pol_round: integer expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Proposal - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Proposal} Proposal - */ - Proposal.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Proposal) - return object; - var message = new $root.tendermint.types.Proposal(); - switch (object.type) { - case "SIGNED_MSG_TYPE_UNKNOWN": - case 0: - message.type = 0; - break; - case "SIGNED_MSG_TYPE_PREVOTE": - case 1: - message.type = 1; - break; - case "SIGNED_MSG_TYPE_PRECOMMIT": - case 2: - message.type = 2; - break; - case "SIGNED_MSG_TYPE_PROPOSAL": - case 32: - message.type = 32; - break; - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.round != null) - message.round = object.round | 0; - if (object.pol_round != null) - message.pol_round = object.pol_round | 0; - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.Proposal.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".tendermint.types.Proposal.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Proposal - * @static - * @param {tendermint.types.Proposal} message Proposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.round = 0; - object.pol_round = 0; - object.block_id = null; - object.timestamp = null; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.pol_round != null && message.hasOwnProperty("pol_round")) - object.pol_round = message.pol_round; - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; - - /** - * Converts this Proposal to JSON. - * @function toJSON - * @memberof tendermint.types.Proposal - * @instance - * @returns {Object.} JSON object - */ - Proposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proposal; - })(); - - types.SignedHeader = (function() { - - /** - * Properties of a SignedHeader. - * @memberof tendermint.types - * @interface ISignedHeader - * @property {tendermint.types.IHeader|null} [header] SignedHeader header - * @property {tendermint.types.ICommit|null} [commit] SignedHeader commit - */ - - /** - * Constructs a new SignedHeader. - * @memberof tendermint.types - * @classdesc Represents a SignedHeader. - * @implements ISignedHeader - * @constructor - * @param {tendermint.types.ISignedHeader=} [properties] Properties to set - */ - function SignedHeader(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignedHeader header. - * @member {tendermint.types.IHeader|null|undefined} header - * @memberof tendermint.types.SignedHeader - * @instance - */ - SignedHeader.prototype.header = null; - - /** - * SignedHeader commit. - * @member {tendermint.types.ICommit|null|undefined} commit - * @memberof tendermint.types.SignedHeader - * @instance - */ - SignedHeader.prototype.commit = null; - - /** - * Encodes the specified SignedHeader message. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @function encode - * @memberof tendermint.types.SignedHeader - * @static - * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedHeader.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) - $root.tendermint.types.Commit.encode(message.commit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SignedHeader message, length delimited. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.SignedHeader - * @static - * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignedHeader message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.SignedHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.SignedHeader} SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedHeader.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SignedHeader(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); - break; - case 2: - message.commit = $root.tendermint.types.Commit.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignedHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.SignedHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.SignedHeader} SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignedHeader message. - * @function verify - * @memberof tendermint.types.SignedHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignedHeader.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.header != null && message.hasOwnProperty("header")) { - var error = $root.tendermint.types.Header.verify(message.header); - if (error) - return "header." + error; - } - if (message.commit != null && message.hasOwnProperty("commit")) { - var error = $root.tendermint.types.Commit.verify(message.commit); - if (error) - return "commit." + error; - } - return null; - }; - - /** - * Creates a SignedHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.SignedHeader - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.SignedHeader} SignedHeader - */ - SignedHeader.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.SignedHeader) - return object; - var message = new $root.tendermint.types.SignedHeader(); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".tendermint.types.SignedHeader.header: object expected"); - message.header = $root.tendermint.types.Header.fromObject(object.header); - } - if (object.commit != null) { - if (typeof object.commit !== "object") - throw TypeError(".tendermint.types.SignedHeader.commit: object expected"); - message.commit = $root.tendermint.types.Commit.fromObject(object.commit); - } - return message; - }; - - /** - * Creates a plain object from a SignedHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.SignedHeader - * @static - * @param {tendermint.types.SignedHeader} message SignedHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignedHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.header = null; - object.commit = null; - } - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.tendermint.types.Header.toObject(message.header, options); - if (message.commit != null && message.hasOwnProperty("commit")) - object.commit = $root.tendermint.types.Commit.toObject(message.commit, options); - return object; - }; - - /** - * Converts this SignedHeader to JSON. - * @function toJSON - * @memberof tendermint.types.SignedHeader - * @instance - * @returns {Object.} JSON object - */ - SignedHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignedHeader; - })(); - - types.LightBlock = (function() { - - /** - * Properties of a LightBlock. - * @memberof tendermint.types - * @interface ILightBlock - * @property {tendermint.types.ISignedHeader|null} [signed_header] LightBlock signed_header - * @property {tendermint.types.IValidatorSet|null} [validator_set] LightBlock validator_set - */ - - /** - * Constructs a new LightBlock. - * @memberof tendermint.types - * @classdesc Represents a LightBlock. - * @implements ILightBlock - * @constructor - * @param {tendermint.types.ILightBlock=} [properties] Properties to set - */ - function LightBlock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LightBlock signed_header. - * @member {tendermint.types.ISignedHeader|null|undefined} signed_header - * @memberof tendermint.types.LightBlock - * @instance - */ - LightBlock.prototype.signed_header = null; - - /** - * LightBlock validator_set. - * @member {tendermint.types.IValidatorSet|null|undefined} validator_set - * @memberof tendermint.types.LightBlock - * @instance - */ - LightBlock.prototype.validator_set = null; - - /** - * Encodes the specified LightBlock message. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @function encode - * @memberof tendermint.types.LightBlock - * @static - * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LightBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signed_header != null && Object.hasOwnProperty.call(message, "signed_header")) - $root.tendermint.types.SignedHeader.encode(message.signed_header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.validator_set != null && Object.hasOwnProperty.call(message, "validator_set")) - $root.tendermint.types.ValidatorSet.encode(message.validator_set, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LightBlock message, length delimited. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.LightBlock - * @static - * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LightBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LightBlock message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.LightBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.LightBlock} LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LightBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.LightBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signed_header = $root.tendermint.types.SignedHeader.decode(reader, reader.uint32()); - break; - case 2: - message.validator_set = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LightBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.LightBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.LightBlock} LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LightBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LightBlock message. - * @function verify - * @memberof tendermint.types.LightBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LightBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signed_header != null && message.hasOwnProperty("signed_header")) { - var error = $root.tendermint.types.SignedHeader.verify(message.signed_header); - if (error) - return "signed_header." + error; - } - if (message.validator_set != null && message.hasOwnProperty("validator_set")) { - var error = $root.tendermint.types.ValidatorSet.verify(message.validator_set); - if (error) - return "validator_set." + error; - } - return null; - }; - - /** - * Creates a LightBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.LightBlock - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.LightBlock} LightBlock - */ - LightBlock.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.LightBlock) - return object; - var message = new $root.tendermint.types.LightBlock(); - if (object.signed_header != null) { - if (typeof object.signed_header !== "object") - throw TypeError(".tendermint.types.LightBlock.signed_header: object expected"); - message.signed_header = $root.tendermint.types.SignedHeader.fromObject(object.signed_header); - } - if (object.validator_set != null) { - if (typeof object.validator_set !== "object") - throw TypeError(".tendermint.types.LightBlock.validator_set: object expected"); - message.validator_set = $root.tendermint.types.ValidatorSet.fromObject(object.validator_set); - } - return message; - }; - - /** - * Creates a plain object from a LightBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.LightBlock - * @static - * @param {tendermint.types.LightBlock} message LightBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LightBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.signed_header = null; - object.validator_set = null; - } - if (message.signed_header != null && message.hasOwnProperty("signed_header")) - object.signed_header = $root.tendermint.types.SignedHeader.toObject(message.signed_header, options); - if (message.validator_set != null && message.hasOwnProperty("validator_set")) - object.validator_set = $root.tendermint.types.ValidatorSet.toObject(message.validator_set, options); - return object; - }; - - /** - * Converts this LightBlock to JSON. - * @function toJSON - * @memberof tendermint.types.LightBlock - * @instance - * @returns {Object.} JSON object - */ - LightBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return LightBlock; - })(); - - types.BlockMeta = (function() { - - /** - * Properties of a BlockMeta. - * @memberof tendermint.types - * @interface IBlockMeta - * @property {tendermint.types.IBlockID|null} [block_id] BlockMeta block_id - * @property {Long|null} [block_size] BlockMeta block_size - * @property {tendermint.types.IHeader|null} [header] BlockMeta header - * @property {Long|null} [num_txs] BlockMeta num_txs - */ - - /** - * Constructs a new BlockMeta. - * @memberof tendermint.types - * @classdesc Represents a BlockMeta. - * @implements IBlockMeta - * @constructor - * @param {tendermint.types.IBlockMeta=} [properties] Properties to set - */ - function BlockMeta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockMeta block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.block_id = null; - - /** - * BlockMeta block_size. - * @member {Long} block_size - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.block_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BlockMeta header. - * @member {tendermint.types.IHeader|null|undefined} header - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.header = null; - - /** - * BlockMeta num_txs. - * @member {Long} num_txs - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.num_txs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified BlockMeta message. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @function encode - * @memberof tendermint.types.BlockMeta - * @static - * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockMeta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.block_size != null && Object.hasOwnProperty.call(message, "block_size")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.block_size); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.num_txs != null && Object.hasOwnProperty.call(message, "num_txs")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.num_txs); - return writer; - }; - - /** - * Encodes the specified BlockMeta message, length delimited. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.BlockMeta - * @static - * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockMeta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockMeta message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.BlockMeta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.BlockMeta} BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockMeta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockMeta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 2: - message.block_size = reader.int64(); - break; - case 3: - message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); - break; - case 4: - message.num_txs = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockMeta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.BlockMeta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.BlockMeta} BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockMeta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockMeta message. - * @function verify - * @memberof tendermint.types.BlockMeta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockMeta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.block_size != null && message.hasOwnProperty("block_size")) - if (!$util.isInteger(message.block_size) && !(message.block_size && $util.isInteger(message.block_size.low) && $util.isInteger(message.block_size.high))) - return "block_size: integer|Long expected"; - if (message.header != null && message.hasOwnProperty("header")) { - var error = $root.tendermint.types.Header.verify(message.header); - if (error) - return "header." + error; - } - if (message.num_txs != null && message.hasOwnProperty("num_txs")) - if (!$util.isInteger(message.num_txs) && !(message.num_txs && $util.isInteger(message.num_txs.low) && $util.isInteger(message.num_txs.high))) - return "num_txs: integer|Long expected"; - return null; - }; - - /** - * Creates a BlockMeta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.BlockMeta - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.BlockMeta} BlockMeta - */ - BlockMeta.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.BlockMeta) - return object; - var message = new $root.tendermint.types.BlockMeta(); - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.BlockMeta.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.block_size != null) - if ($util.Long) - (message.block_size = $util.Long.fromValue(object.block_size)).unsigned = false; - else if (typeof object.block_size === "string") - message.block_size = parseInt(object.block_size, 10); - else if (typeof object.block_size === "number") - message.block_size = object.block_size; - else if (typeof object.block_size === "object") - message.block_size = new $util.LongBits(object.block_size.low >>> 0, object.block_size.high >>> 0).toNumber(); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".tendermint.types.BlockMeta.header: object expected"); - message.header = $root.tendermint.types.Header.fromObject(object.header); - } - if (object.num_txs != null) - if ($util.Long) - (message.num_txs = $util.Long.fromValue(object.num_txs)).unsigned = false; - else if (typeof object.num_txs === "string") - message.num_txs = parseInt(object.num_txs, 10); - else if (typeof object.num_txs === "number") - message.num_txs = object.num_txs; - else if (typeof object.num_txs === "object") - message.num_txs = new $util.LongBits(object.num_txs.low >>> 0, object.num_txs.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a BlockMeta message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.BlockMeta - * @static - * @param {tendermint.types.BlockMeta} message BlockMeta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockMeta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.block_id = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.block_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block_size = options.longs === String ? "0" : 0; - object.header = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.num_txs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.num_txs = options.longs === String ? "0" : 0; - } - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.block_size != null && message.hasOwnProperty("block_size")) - if (typeof message.block_size === "number") - object.block_size = options.longs === String ? String(message.block_size) : message.block_size; - else - object.block_size = options.longs === String ? $util.Long.prototype.toString.call(message.block_size) : options.longs === Number ? new $util.LongBits(message.block_size.low >>> 0, message.block_size.high >>> 0).toNumber() : message.block_size; - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.tendermint.types.Header.toObject(message.header, options); - if (message.num_txs != null && message.hasOwnProperty("num_txs")) - if (typeof message.num_txs === "number") - object.num_txs = options.longs === String ? String(message.num_txs) : message.num_txs; - else - object.num_txs = options.longs === String ? $util.Long.prototype.toString.call(message.num_txs) : options.longs === Number ? new $util.LongBits(message.num_txs.low >>> 0, message.num_txs.high >>> 0).toNumber() : message.num_txs; - return object; - }; - - /** - * Converts this BlockMeta to JSON. - * @function toJSON - * @memberof tendermint.types.BlockMeta - * @instance - * @returns {Object.} JSON object - */ - BlockMeta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockMeta; - })(); - - types.TxProof = (function() { - - /** - * Properties of a TxProof. - * @memberof tendermint.types - * @interface ITxProof - * @property {Uint8Array|null} [root_hash] TxProof root_hash - * @property {Uint8Array|null} [data] TxProof data - * @property {tendermint.crypto.IProof|null} [proof] TxProof proof - */ - - /** - * Constructs a new TxProof. - * @memberof tendermint.types - * @classdesc Represents a TxProof. - * @implements ITxProof - * @constructor - * @param {tendermint.types.ITxProof=} [properties] Properties to set - */ - function TxProof(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TxProof root_hash. - * @member {Uint8Array} root_hash - * @memberof tendermint.types.TxProof - * @instance - */ - TxProof.prototype.root_hash = $util.newBuffer([]); - - /** - * TxProof data. - * @member {Uint8Array} data - * @memberof tendermint.types.TxProof - * @instance - */ - TxProof.prototype.data = $util.newBuffer([]); - - /** - * TxProof proof. - * @member {tendermint.crypto.IProof|null|undefined} proof - * @memberof tendermint.types.TxProof - * @instance - */ - TxProof.prototype.proof = null; - - /** - * Encodes the specified TxProof message. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @function encode - * @memberof tendermint.types.TxProof - * @static - * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.root_hash != null && Object.hasOwnProperty.call(message, "root_hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.root_hash); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TxProof message, length delimited. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.TxProof - * @static - * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TxProof message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.TxProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.TxProof} TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.TxProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.root_hash = reader.bytes(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TxProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.TxProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.TxProof} TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TxProof message. - * @function verify - * @memberof tendermint.types.TxProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TxProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.root_hash != null && message.hasOwnProperty("root_hash")) - if (!(message.root_hash && typeof message.root_hash.length === "number" || $util.isString(message.root_hash))) - return "root_hash: buffer expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - var error = $root.tendermint.crypto.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - return null; - }; - - /** - * Creates a TxProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.TxProof - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.TxProof} TxProof - */ - TxProof.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.TxProof) - return object; - var message = new $root.tendermint.types.TxProof(); - if (object.root_hash != null) - if (typeof object.root_hash === "string") - $util.base64.decode(object.root_hash, message.root_hash = $util.newBuffer($util.base64.length(object.root_hash)), 0); - else if (object.root_hash.length) - message.root_hash = object.root_hash; - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".tendermint.types.TxProof.proof: object expected"); - message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); - } - return message; - }; - - /** - * Creates a plain object from a TxProof message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.TxProof - * @static - * @param {tendermint.types.TxProof} message TxProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TxProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.root_hash = ""; - else { - object.root_hash = []; - if (options.bytes !== Array) - object.root_hash = $util.newBuffer(object.root_hash); - } - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.proof = null; - } - if (message.root_hash != null && message.hasOwnProperty("root_hash")) - object.root_hash = options.bytes === String ? $util.base64.encode(message.root_hash, 0, message.root_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.root_hash) : message.root_hash; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); - return object; - }; - - /** - * Converts this TxProof to JSON. - * @function toJSON - * @memberof tendermint.types.TxProof - * @instance - * @returns {Object.} JSON object - */ - TxProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TxProof; - })(); - - return types; - })(); - - tendermint.crypto = (function() { - - /** - * Namespace crypto. - * @memberof tendermint - * @namespace - */ - var crypto = {}; - - crypto.PublicKey = (function() { - - /** - * Properties of a PublicKey. - * @memberof tendermint.crypto - * @interface IPublicKey - * @property {Uint8Array|null} [ed25519] PublicKey ed25519 - * @property {Uint8Array|null} [secp256k1] PublicKey secp256k1 - */ - - /** - * Constructs a new PublicKey. - * @memberof tendermint.crypto - * @classdesc Represents a PublicKey. - * @implements IPublicKey - * @constructor - * @param {tendermint.crypto.IPublicKey=} [properties] Properties to set - */ - function PublicKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PublicKey ed25519. - * @member {Uint8Array|null|undefined} ed25519 - * @memberof tendermint.crypto.PublicKey - * @instance - */ - PublicKey.prototype.ed25519 = null; - - /** - * PublicKey secp256k1. - * @member {Uint8Array|null|undefined} secp256k1 - * @memberof tendermint.crypto.PublicKey - * @instance - */ - PublicKey.prototype.secp256k1 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PublicKey sum. - * @member {"ed25519"|"secp256k1"|undefined} sum - * @memberof tendermint.crypto.PublicKey - * @instance - */ - Object.defineProperty(PublicKey.prototype, "sum", { - get: $util.oneOfGetter($oneOfFields = ["ed25519", "secp256k1"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.PublicKey - * @static - * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublicKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ed25519 != null && Object.hasOwnProperty.call(message, "ed25519")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ed25519); - if (message.secp256k1 != null && Object.hasOwnProperty.call(message, "secp256k1")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.secp256k1); - return writer; - }; - - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.PublicKey - * @static - * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublicKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.PublicKey} PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublicKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.PublicKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ed25519 = reader.bytes(); - break; - case 2: - message.secp256k1 = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PublicKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.PublicKey} PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublicKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PublicKey message. - * @function verify - * @memberof tendermint.crypto.PublicKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PublicKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { - properties.sum = 1; - if (!(message.ed25519 && typeof message.ed25519.length === "number" || $util.isString(message.ed25519))) - return "ed25519: buffer expected"; - } - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { - if (properties.sum === 1) - return "sum: multiple values"; - properties.sum = 1; - if (!(message.secp256k1 && typeof message.secp256k1.length === "number" || $util.isString(message.secp256k1))) - return "secp256k1: buffer expected"; - } - return null; - }; - - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.PublicKey - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.PublicKey} PublicKey - */ - PublicKey.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.PublicKey) - return object; - var message = new $root.tendermint.crypto.PublicKey(); - if (object.ed25519 != null) - if (typeof object.ed25519 === "string") - $util.base64.decode(object.ed25519, message.ed25519 = $util.newBuffer($util.base64.length(object.ed25519)), 0); - else if (object.ed25519.length) - message.ed25519 = object.ed25519; - if (object.secp256k1 != null) - if (typeof object.secp256k1 === "string") - $util.base64.decode(object.secp256k1, message.secp256k1 = $util.newBuffer($util.base64.length(object.secp256k1)), 0); - else if (object.secp256k1.length) - message.secp256k1 = object.secp256k1; - return message; - }; - - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.PublicKey - * @static - * @param {tendermint.crypto.PublicKey} message PublicKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PublicKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { - object.ed25519 = options.bytes === String ? $util.base64.encode(message.ed25519, 0, message.ed25519.length) : options.bytes === Array ? Array.prototype.slice.call(message.ed25519) : message.ed25519; - if (options.oneofs) - object.sum = "ed25519"; - } - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { - object.secp256k1 = options.bytes === String ? $util.base64.encode(message.secp256k1, 0, message.secp256k1.length) : options.bytes === Array ? Array.prototype.slice.call(message.secp256k1) : message.secp256k1; - if (options.oneofs) - object.sum = "secp256k1"; - } - return object; - }; - - /** - * Converts this PublicKey to JSON. - * @function toJSON - * @memberof tendermint.crypto.PublicKey - * @instance - * @returns {Object.} JSON object - */ - PublicKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PublicKey; - })(); - - crypto.Proof = (function() { - - /** - * Properties of a Proof. - * @memberof tendermint.crypto - * @interface IProof - * @property {Long|null} [total] Proof total - * @property {Long|null} [index] Proof index - * @property {Uint8Array|null} [leaf_hash] Proof leaf_hash - * @property {Array.|null} [aunts] Proof aunts - */ - - /** - * Constructs a new Proof. - * @memberof tendermint.crypto - * @classdesc Represents a Proof. - * @implements IProof - * @constructor - * @param {tendermint.crypto.IProof=} [properties] Properties to set - */ - function Proof(properties) { - this.aunts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proof total. - * @member {Long} total - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.total = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Proof index. - * @member {Long} index - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Proof leaf_hash. - * @member {Uint8Array} leaf_hash - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.leaf_hash = $util.newBuffer([]); - - /** - * Proof aunts. - * @member {Array.} aunts - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.aunts = $util.emptyArray; - - /** - * Encodes the specified Proof message. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.Proof - * @static - * @param {tendermint.crypto.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.total != null && Object.hasOwnProperty.call(message, "total")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.total); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.index); - if (message.leaf_hash != null && Object.hasOwnProperty.call(message, "leaf_hash")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.leaf_hash); - if (message.aunts != null && message.aunts.length) - for (var i = 0; i < message.aunts.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.aunts[i]); - return writer; - }; - - /** - * Encodes the specified Proof message, length delimited. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.Proof - * @static - * @param {tendermint.crypto.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proof message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.Proof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = reader.int64(); - break; - case 2: - message.index = reader.int64(); - break; - case 3: - message.leaf_hash = reader.bytes(); - break; - case 4: - if (!(message.aunts && message.aunts.length)) - message.aunts = []; - message.aunts.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proof message. - * @function verify - * @memberof tendermint.crypto.Proof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.total != null && message.hasOwnProperty("total")) - if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) - return "total: integer|Long expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) - return "index: integer|Long expected"; - if (message.leaf_hash != null && message.hasOwnProperty("leaf_hash")) - if (!(message.leaf_hash && typeof message.leaf_hash.length === "number" || $util.isString(message.leaf_hash))) - return "leaf_hash: buffer expected"; - if (message.aunts != null && message.hasOwnProperty("aunts")) { - if (!Array.isArray(message.aunts)) - return "aunts: array expected"; - for (var i = 0; i < message.aunts.length; ++i) - if (!(message.aunts[i] && typeof message.aunts[i].length === "number" || $util.isString(message.aunts[i]))) - return "aunts: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Proof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.Proof - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.Proof} Proof - */ - Proof.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.Proof) - return object; - var message = new $root.tendermint.crypto.Proof(); - if (object.total != null) - if ($util.Long) - (message.total = $util.Long.fromValue(object.total)).unsigned = false; - else if (typeof object.total === "string") - message.total = parseInt(object.total, 10); - else if (typeof object.total === "number") - message.total = object.total; - else if (typeof object.total === "object") - message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(); - if (object.index != null) - if ($util.Long) - (message.index = $util.Long.fromValue(object.index)).unsigned = false; - else if (typeof object.index === "string") - message.index = parseInt(object.index, 10); - else if (typeof object.index === "number") - message.index = object.index; - else if (typeof object.index === "object") - message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); - if (object.leaf_hash != null) - if (typeof object.leaf_hash === "string") - $util.base64.decode(object.leaf_hash, message.leaf_hash = $util.newBuffer($util.base64.length(object.leaf_hash)), 0); - else if (object.leaf_hash.length) - message.leaf_hash = object.leaf_hash; - if (object.aunts) { - if (!Array.isArray(object.aunts)) - throw TypeError(".tendermint.crypto.Proof.aunts: array expected"); - message.aunts = []; - for (var i = 0; i < object.aunts.length; ++i) - if (typeof object.aunts[i] === "string") - $util.base64.decode(object.aunts[i], message.aunts[i] = $util.newBuffer($util.base64.length(object.aunts[i])), 0); - else if (object.aunts[i].length) - message.aunts[i] = object.aunts[i]; - } - return message; - }; - - /** - * Creates a plain object from a Proof message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.Proof - * @static - * @param {tendermint.crypto.Proof} message Proof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.aunts = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.index = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.leaf_hash = ""; - else { - object.leaf_hash = []; - if (options.bytes !== Array) - object.leaf_hash = $util.newBuffer(object.leaf_hash); - } - } - if (message.total != null && message.hasOwnProperty("total")) - if (typeof message.total === "number") - object.total = options.longs === String ? String(message.total) : message.total; - else - object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber() : message.total; - if (message.index != null && message.hasOwnProperty("index")) - if (typeof message.index === "number") - object.index = options.longs === String ? String(message.index) : message.index; - else - object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; - if (message.leaf_hash != null && message.hasOwnProperty("leaf_hash")) - object.leaf_hash = options.bytes === String ? $util.base64.encode(message.leaf_hash, 0, message.leaf_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.leaf_hash) : message.leaf_hash; - if (message.aunts && message.aunts.length) { - object.aunts = []; - for (var j = 0; j < message.aunts.length; ++j) - object.aunts[j] = options.bytes === String ? $util.base64.encode(message.aunts[j], 0, message.aunts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.aunts[j]) : message.aunts[j]; - } - return object; - }; - - /** - * Converts this Proof to JSON. - * @function toJSON - * @memberof tendermint.crypto.Proof - * @instance - * @returns {Object.} JSON object - */ - Proof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proof; - })(); - - crypto.ValueOp = (function() { - - /** - * Properties of a ValueOp. - * @memberof tendermint.crypto - * @interface IValueOp - * @property {Uint8Array|null} [key] ValueOp key - * @property {tendermint.crypto.IProof|null} [proof] ValueOp proof - */ - - /** - * Constructs a new ValueOp. - * @memberof tendermint.crypto - * @classdesc Represents a ValueOp. - * @implements IValueOp - * @constructor - * @param {tendermint.crypto.IValueOp=} [properties] Properties to set - */ - function ValueOp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValueOp key. - * @member {Uint8Array} key - * @memberof tendermint.crypto.ValueOp - * @instance - */ - ValueOp.prototype.key = $util.newBuffer([]); - - /** - * ValueOp proof. - * @member {tendermint.crypto.IProof|null|undefined} proof - * @memberof tendermint.crypto.ValueOp - * @instance - */ - ValueOp.prototype.proof = null; - - /** - * Encodes the specified ValueOp message. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.ValueOp - * @static - * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ValueOp message, length delimited. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.ValueOp - * @static - * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValueOp message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.ValueOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.ValueOp} ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ValueOp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValueOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.ValueOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.ValueOp} ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValueOp message. - * @function verify - * @memberof tendermint.crypto.ValueOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValueOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - var error = $root.tendermint.crypto.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - return null; - }; - - /** - * Creates a ValueOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.ValueOp - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.ValueOp} ValueOp - */ - ValueOp.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.ValueOp) - return object; - var message = new $root.tendermint.crypto.ValueOp(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".tendermint.crypto.ValueOp.proof: object expected"); - message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); - } - return message; - }; - - /** - * Creates a plain object from a ValueOp message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.ValueOp - * @static - * @param {tendermint.crypto.ValueOp} message ValueOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValueOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - object.proof = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); - return object; - }; - - /** - * Converts this ValueOp to JSON. - * @function toJSON - * @memberof tendermint.crypto.ValueOp - * @instance - * @returns {Object.} JSON object - */ - ValueOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValueOp; - })(); - - crypto.DominoOp = (function() { - - /** - * Properties of a DominoOp. - * @memberof tendermint.crypto - * @interface IDominoOp - * @property {string|null} [key] DominoOp key - * @property {string|null} [input] DominoOp input - * @property {string|null} [output] DominoOp output - */ - - /** - * Constructs a new DominoOp. - * @memberof tendermint.crypto - * @classdesc Represents a DominoOp. - * @implements IDominoOp - * @constructor - * @param {tendermint.crypto.IDominoOp=} [properties] Properties to set - */ - function DominoOp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DominoOp key. - * @member {string} key - * @memberof tendermint.crypto.DominoOp - * @instance - */ - DominoOp.prototype.key = ""; - - /** - * DominoOp input. - * @member {string} input - * @memberof tendermint.crypto.DominoOp - * @instance - */ - DominoOp.prototype.input = ""; - - /** - * DominoOp output. - * @member {string} output - * @memberof tendermint.crypto.DominoOp - * @instance - */ - DominoOp.prototype.output = ""; - - /** - * Encodes the specified DominoOp message. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.DominoOp - * @static - * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DominoOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.input != null && Object.hasOwnProperty.call(message, "input")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.input); - if (message.output != null && Object.hasOwnProperty.call(message, "output")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.output); - return writer; - }; - - /** - * Encodes the specified DominoOp message, length delimited. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.DominoOp - * @static - * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DominoOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DominoOp message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.DominoOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.DominoOp} DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DominoOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.DominoOp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.input = reader.string(); - break; - case 3: - message.output = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DominoOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.DominoOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.DominoOp} DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DominoOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DominoOp message. - * @function verify - * @memberof tendermint.crypto.DominoOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DominoOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.input != null && message.hasOwnProperty("input")) - if (!$util.isString(message.input)) - return "input: string expected"; - if (message.output != null && message.hasOwnProperty("output")) - if (!$util.isString(message.output)) - return "output: string expected"; - return null; - }; - - /** - * Creates a DominoOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.DominoOp - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.DominoOp} DominoOp - */ - DominoOp.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.DominoOp) - return object; - var message = new $root.tendermint.crypto.DominoOp(); - if (object.key != null) - message.key = String(object.key); - if (object.input != null) - message.input = String(object.input); - if (object.output != null) - message.output = String(object.output); - return message; - }; - - /** - * Creates a plain object from a DominoOp message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.DominoOp - * @static - * @param {tendermint.crypto.DominoOp} message DominoOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DominoOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.key = ""; - object.input = ""; - object.output = ""; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.input != null && message.hasOwnProperty("input")) - object.input = message.input; - if (message.output != null && message.hasOwnProperty("output")) - object.output = message.output; - return object; - }; - - /** - * Converts this DominoOp to JSON. - * @function toJSON - * @memberof tendermint.crypto.DominoOp - * @instance - * @returns {Object.} JSON object - */ - DominoOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DominoOp; - })(); - - crypto.ProofOp = (function() { - - /** - * Properties of a ProofOp. - * @memberof tendermint.crypto - * @interface IProofOp - * @property {string|null} [type] ProofOp type - * @property {Uint8Array|null} [key] ProofOp key - * @property {Uint8Array|null} [data] ProofOp data - */ - - /** - * Constructs a new ProofOp. - * @memberof tendermint.crypto - * @classdesc Represents a ProofOp. - * @implements IProofOp - * @constructor - * @param {tendermint.crypto.IProofOp=} [properties] Properties to set - */ - function ProofOp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProofOp type. - * @member {string} type - * @memberof tendermint.crypto.ProofOp - * @instance - */ - ProofOp.prototype.type = ""; - - /** - * ProofOp key. - * @member {Uint8Array} key - * @memberof tendermint.crypto.ProofOp - * @instance - */ - ProofOp.prototype.key = $util.newBuffer([]); - - /** - * ProofOp data. - * @member {Uint8Array} data - * @memberof tendermint.crypto.ProofOp - * @instance - */ - ProofOp.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified ProofOp message. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.ProofOp - * @static - * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified ProofOp message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.ProofOp - * @static - * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProofOp message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.ProofOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.ProofOp} ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.key = reader.bytes(); - break; - case 3: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProofOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.ProofOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.ProofOp} ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProofOp message. - * @function verify - * @memberof tendermint.crypto.ProofOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProofOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a ProofOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.ProofOp - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.ProofOp} ProofOp - */ - ProofOp.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.ProofOp) - return object; - var message = new $root.tendermint.crypto.ProofOp(); - if (object.type != null) - message.type = String(object.type); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a ProofOp message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.ProofOp - * @static - * @param {tendermint.crypto.ProofOp} message ProofOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProofOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this ProofOp to JSON. - * @function toJSON - * @memberof tendermint.crypto.ProofOp - * @instance - * @returns {Object.} JSON object - */ - ProofOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProofOp; - })(); - - crypto.ProofOps = (function() { - - /** - * Properties of a ProofOps. - * @memberof tendermint.crypto - * @interface IProofOps - * @property {Array.|null} [ops] ProofOps ops - */ - - /** - * Constructs a new ProofOps. - * @memberof tendermint.crypto - * @classdesc Represents a ProofOps. - * @implements IProofOps - * @constructor - * @param {tendermint.crypto.IProofOps=} [properties] Properties to set - */ - function ProofOps(properties) { - this.ops = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProofOps ops. - * @member {Array.} ops - * @memberof tendermint.crypto.ProofOps - * @instance - */ - ProofOps.prototype.ops = $util.emptyArray; - - /** - * Encodes the specified ProofOps message. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.ProofOps - * @static - * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOps.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ops != null && message.ops.length) - for (var i = 0; i < message.ops.length; ++i) - $root.tendermint.crypto.ProofOp.encode(message.ops[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProofOps message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.ProofOps - * @static - * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOps.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProofOps message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.ProofOps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.ProofOps} ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOps.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOps(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ops && message.ops.length)) - message.ops = []; - message.ops.push($root.tendermint.crypto.ProofOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProofOps message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.ProofOps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.ProofOps} ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOps.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProofOps message. - * @function verify - * @memberof tendermint.crypto.ProofOps - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProofOps.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ops != null && message.hasOwnProperty("ops")) { - if (!Array.isArray(message.ops)) - return "ops: array expected"; - for (var i = 0; i < message.ops.length; ++i) { - var error = $root.tendermint.crypto.ProofOp.verify(message.ops[i]); - if (error) - return "ops." + error; - } - } - return null; - }; - - /** - * Creates a ProofOps message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.ProofOps - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.ProofOps} ProofOps - */ - ProofOps.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.ProofOps) - return object; - var message = new $root.tendermint.crypto.ProofOps(); - if (object.ops) { - if (!Array.isArray(object.ops)) - throw TypeError(".tendermint.crypto.ProofOps.ops: array expected"); - message.ops = []; - for (var i = 0; i < object.ops.length; ++i) { - if (typeof object.ops[i] !== "object") - throw TypeError(".tendermint.crypto.ProofOps.ops: object expected"); - message.ops[i] = $root.tendermint.crypto.ProofOp.fromObject(object.ops[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ProofOps message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.ProofOps - * @static - * @param {tendermint.crypto.ProofOps} message ProofOps - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProofOps.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ops = []; - if (message.ops && message.ops.length) { - object.ops = []; - for (var j = 0; j < message.ops.length; ++j) - object.ops[j] = $root.tendermint.crypto.ProofOp.toObject(message.ops[j], options); - } - return object; - }; - - /** - * Converts this ProofOps to JSON. - * @function toJSON - * @memberof tendermint.crypto.ProofOps - * @instance - * @returns {Object.} JSON object - */ - ProofOps.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProofOps; - })(); - - return crypto; - })(); - - tendermint.version = (function() { - - /** - * Namespace version. - * @memberof tendermint - * @namespace - */ - var version = {}; - - version.App = (function() { - - /** - * Properties of an App. - * @memberof tendermint.version - * @interface IApp - * @property {Long|null} [protocol] App protocol - * @property {string|null} [software] App software - */ - - /** - * Constructs a new App. - * @memberof tendermint.version - * @classdesc Represents an App. - * @implements IApp - * @constructor - * @param {tendermint.version.IApp=} [properties] Properties to set - */ - function App(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * App protocol. - * @member {Long} protocol - * @memberof tendermint.version.App - * @instance - */ - App.prototype.protocol = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * App software. - * @member {string} software - * @memberof tendermint.version.App - * @instance - */ - App.prototype.software = ""; - - /** - * Encodes the specified App message. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @function encode - * @memberof tendermint.version.App - * @static - * @param {tendermint.version.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.protocol); - if (message.software != null && Object.hasOwnProperty.call(message, "software")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.software); - return writer; - }; - - /** - * Encodes the specified App message, length delimited. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.version.App - * @static - * @param {tendermint.version.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an App message from the specified reader or buffer. - * @function decode - * @memberof tendermint.version.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.version.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.App(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.protocol = reader.uint64(); - break; - case 2: - message.software = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an App message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.version.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.version.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an App message. - * @function verify - * @memberof tendermint.version.App - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - App.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.protocol != null && message.hasOwnProperty("protocol")) - if (!$util.isInteger(message.protocol) && !(message.protocol && $util.isInteger(message.protocol.low) && $util.isInteger(message.protocol.high))) - return "protocol: integer|Long expected"; - if (message.software != null && message.hasOwnProperty("software")) - if (!$util.isString(message.software)) - return "software: string expected"; - return null; - }; - - /** - * Creates an App message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.version.App - * @static - * @param {Object.} object Plain object - * @returns {tendermint.version.App} App - */ - App.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.version.App) - return object; - var message = new $root.tendermint.version.App(); - if (object.protocol != null) - if ($util.Long) - (message.protocol = $util.Long.fromValue(object.protocol)).unsigned = true; - else if (typeof object.protocol === "string") - message.protocol = parseInt(object.protocol, 10); - else if (typeof object.protocol === "number") - message.protocol = object.protocol; - else if (typeof object.protocol === "object") - message.protocol = new $util.LongBits(object.protocol.low >>> 0, object.protocol.high >>> 0).toNumber(true); - if (object.software != null) - message.software = String(object.software); - return message; - }; - - /** - * Creates a plain object from an App message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.version.App - * @static - * @param {tendermint.version.App} message App - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - App.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.protocol = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.protocol = options.longs === String ? "0" : 0; - object.software = ""; - } - if (message.protocol != null && message.hasOwnProperty("protocol")) - if (typeof message.protocol === "number") - object.protocol = options.longs === String ? String(message.protocol) : message.protocol; - else - object.protocol = options.longs === String ? $util.Long.prototype.toString.call(message.protocol) : options.longs === Number ? new $util.LongBits(message.protocol.low >>> 0, message.protocol.high >>> 0).toNumber(true) : message.protocol; - if (message.software != null && message.hasOwnProperty("software")) - object.software = message.software; - return object; - }; - - /** - * Converts this App to JSON. - * @function toJSON - * @memberof tendermint.version.App - * @instance - * @returns {Object.} JSON object - */ - App.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return App; - })(); - - version.Consensus = (function() { - - /** - * Properties of a Consensus. - * @memberof tendermint.version - * @interface IConsensus - * @property {Long|null} [block] Consensus block - * @property {Long|null} [app] Consensus app - */ - - /** - * Constructs a new Consensus. - * @memberof tendermint.version - * @classdesc Represents a Consensus. - * @implements IConsensus - * @constructor - * @param {tendermint.version.IConsensus=} [properties] Properties to set - */ - function Consensus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Consensus block. - * @member {Long} block - * @memberof tendermint.version.Consensus - * @instance - */ - Consensus.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Consensus app. - * @member {Long} app - * @memberof tendermint.version.Consensus - * @instance - */ - Consensus.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Consensus message. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @function encode - * @memberof tendermint.version.Consensus - * @static - * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Consensus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.block); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.app); - return writer; - }; - - /** - * Encodes the specified Consensus message, length delimited. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.version.Consensus - * @static - * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Consensus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Consensus message from the specified reader or buffer. - * @function decode - * @memberof tendermint.version.Consensus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.version.Consensus} Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Consensus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.Consensus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = reader.uint64(); - break; - case 2: - message.app = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Consensus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.version.Consensus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.version.Consensus} Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Consensus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Consensus message. - * @function verify - * @memberof tendermint.version.Consensus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Consensus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block != null && message.hasOwnProperty("block")) - if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) - return "block: integer|Long expected"; - if (message.app != null && message.hasOwnProperty("app")) - if (!$util.isInteger(message.app) && !(message.app && $util.isInteger(message.app.low) && $util.isInteger(message.app.high))) - return "app: integer|Long expected"; - return null; - }; - - /** - * Creates a Consensus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.version.Consensus - * @static - * @param {Object.} object Plain object - * @returns {tendermint.version.Consensus} Consensus - */ - Consensus.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.version.Consensus) - return object; - var message = new $root.tendermint.version.Consensus(); - if (object.block != null) - if ($util.Long) - (message.block = $util.Long.fromValue(object.block)).unsigned = true; - else if (typeof object.block === "string") - message.block = parseInt(object.block, 10); - else if (typeof object.block === "number") - message.block = object.block; - else if (typeof object.block === "object") - message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); - if (object.app != null) - if ($util.Long) - (message.app = $util.Long.fromValue(object.app)).unsigned = true; - else if (typeof object.app === "string") - message.app = parseInt(object.app, 10); - else if (typeof object.app === "number") - message.app = object.app; - else if (typeof object.app === "object") - message.app = new $util.LongBits(object.app.low >>> 0, object.app.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Consensus message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.version.Consensus - * @static - * @param {tendermint.version.Consensus} message Consensus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Consensus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.app = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.app = options.longs === String ? "0" : 0; - } - if (message.block != null && message.hasOwnProperty("block")) - if (typeof message.block === "number") - object.block = options.longs === String ? String(message.block) : message.block; - else - object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; - if (message.app != null && message.hasOwnProperty("app")) - if (typeof message.app === "number") - object.app = options.longs === String ? String(message.app) : message.app; - else - object.app = options.longs === String ? $util.Long.prototype.toString.call(message.app) : options.longs === Number ? new $util.LongBits(message.app.low >>> 0, message.app.high >>> 0).toNumber(true) : message.app; - return object; - }; - - /** - * Converts this Consensus to JSON. - * @function toJSON - * @memberof tendermint.version.Consensus - * @instance - * @returns {Object.} JSON object - */ - Consensus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Consensus; - })(); - - return version; - })(); - - tendermint.libs = (function() { - - /** - * Namespace libs. - * @memberof tendermint - * @namespace - */ - var libs = {}; - - libs.bits = (function() { - - /** - * Namespace bits. - * @memberof tendermint.libs - * @namespace - */ - var bits = {}; - - bits.BitArray = (function() { - - /** - * Properties of a BitArray. - * @memberof tendermint.libs.bits - * @interface IBitArray - * @property {Long|null} [bits] BitArray bits - * @property {Array.|null} [elems] BitArray elems - */ - - /** - * Constructs a new BitArray. - * @memberof tendermint.libs.bits - * @classdesc Represents a BitArray. - * @implements IBitArray - * @constructor - * @param {tendermint.libs.bits.IBitArray=} [properties] Properties to set - */ - function BitArray(properties) { - this.elems = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BitArray bits. - * @member {Long} bits - * @memberof tendermint.libs.bits.BitArray - * @instance - */ - BitArray.prototype.bits = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BitArray elems. - * @member {Array.} elems - * @memberof tendermint.libs.bits.BitArray - * @instance - */ - BitArray.prototype.elems = $util.emptyArray; - - /** - * Encodes the specified BitArray message. Does not implicitly {@link tendermint.libs.bits.BitArray.verify|verify} messages. - * @function encode - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {tendermint.libs.bits.IBitArray} message BitArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BitArray.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bits != null && Object.hasOwnProperty.call(message, "bits")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.bits); - if (message.elems != null && message.elems.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.elems.length; ++i) - writer.uint64(message.elems[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified BitArray message, length delimited. Does not implicitly {@link tendermint.libs.bits.BitArray.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {tendermint.libs.bits.IBitArray} message BitArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BitArray.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BitArray message from the specified reader or buffer. - * @function decode - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.libs.bits.BitArray} BitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BitArray.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.libs.bits.BitArray(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.bits = reader.int64(); - break; - case 2: - if (!(message.elems && message.elems.length)) - message.elems = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.elems.push(reader.uint64()); - } else - message.elems.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BitArray message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.libs.bits.BitArray} BitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BitArray.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BitArray message. - * @function verify - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BitArray.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bits != null && message.hasOwnProperty("bits")) - if (!$util.isInteger(message.bits) && !(message.bits && $util.isInteger(message.bits.low) && $util.isInteger(message.bits.high))) - return "bits: integer|Long expected"; - if (message.elems != null && message.hasOwnProperty("elems")) { - if (!Array.isArray(message.elems)) - return "elems: array expected"; - for (var i = 0; i < message.elems.length; ++i) - if (!$util.isInteger(message.elems[i]) && !(message.elems[i] && $util.isInteger(message.elems[i].low) && $util.isInteger(message.elems[i].high))) - return "elems: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a BitArray message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {Object.} object Plain object - * @returns {tendermint.libs.bits.BitArray} BitArray - */ - BitArray.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.libs.bits.BitArray) - return object; - var message = new $root.tendermint.libs.bits.BitArray(); - if (object.bits != null) - if ($util.Long) - (message.bits = $util.Long.fromValue(object.bits)).unsigned = false; - else if (typeof object.bits === "string") - message.bits = parseInt(object.bits, 10); - else if (typeof object.bits === "number") - message.bits = object.bits; - else if (typeof object.bits === "object") - message.bits = new $util.LongBits(object.bits.low >>> 0, object.bits.high >>> 0).toNumber(); - if (object.elems) { - if (!Array.isArray(object.elems)) - throw TypeError(".tendermint.libs.bits.BitArray.elems: array expected"); - message.elems = []; - for (var i = 0; i < object.elems.length; ++i) - if ($util.Long) - (message.elems[i] = $util.Long.fromValue(object.elems[i])).unsigned = true; - else if (typeof object.elems[i] === "string") - message.elems[i] = parseInt(object.elems[i], 10); - else if (typeof object.elems[i] === "number") - message.elems[i] = object.elems[i]; - else if (typeof object.elems[i] === "object") - message.elems[i] = new $util.LongBits(object.elems[i].low >>> 0, object.elems[i].high >>> 0).toNumber(true); - } - return message; - }; - - /** - * Creates a plain object from a BitArray message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {tendermint.libs.bits.BitArray} message BitArray - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BitArray.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.elems = []; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bits = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bits = options.longs === String ? "0" : 0; - if (message.bits != null && message.hasOwnProperty("bits")) - if (typeof message.bits === "number") - object.bits = options.longs === String ? String(message.bits) : message.bits; - else - object.bits = options.longs === String ? $util.Long.prototype.toString.call(message.bits) : options.longs === Number ? new $util.LongBits(message.bits.low >>> 0, message.bits.high >>> 0).toNumber() : message.bits; - if (message.elems && message.elems.length) { - object.elems = []; - for (var j = 0; j < message.elems.length; ++j) - if (typeof message.elems[j] === "number") - object.elems[j] = options.longs === String ? String(message.elems[j]) : message.elems[j]; - else - object.elems[j] = options.longs === String ? $util.Long.prototype.toString.call(message.elems[j]) : options.longs === Number ? new $util.LongBits(message.elems[j].low >>> 0, message.elems[j].high >>> 0).toNumber(true) : message.elems[j]; - } - return object; - }; - - /** - * Converts this BitArray to JSON. - * @function toJSON - * @memberof tendermint.libs.bits.BitArray - * @instance - * @returns {Object.} JSON object - */ - BitArray.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BitArray; - })(); - - return bits; - })(); - - return libs; - })(); - - return tendermint; - })(); - - return $root; -}); diff --git a/src/generated/ibc/proto.d.ts b/src/generated/ibc/proto.d.ts deleted file mode 100644 index 9881e4df..00000000 --- a/src/generated/ibc/proto.d.ts +++ /dev/null @@ -1,33604 +0,0 @@ -import * as $protobuf from "protobufjs"; -/** Namespace cosmos. */ -export namespace cosmos { - - /** Namespace adminmodule. */ - namespace adminmodule { - - /** Namespace adminmodule. */ - namespace adminmodule { - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls DeleteAdmin. - * @param request MsgDeleteAdmin message or plain object - * @param callback Node-style callback called with the error, if any, and MsgDeleteAdminResponse - */ - public deleteAdmin(request: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin, callback: cosmos.adminmodule.adminmodule.Msg.DeleteAdminCallback): void; - - /** - * Calls DeleteAdmin. - * @param request MsgDeleteAdmin message or plain object - * @returns Promise - */ - public deleteAdmin(request: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin): Promise; - - /** - * Calls AddAdmin. - * @param request MsgAddAdmin message or plain object - * @param callback Node-style callback called with the error, if any, and MsgAddAdminResponse - */ - public addAdmin(request: cosmos.adminmodule.adminmodule.IMsgAddAdmin, callback: cosmos.adminmodule.adminmodule.Msg.AddAdminCallback): void; - - /** - * Calls AddAdmin. - * @param request MsgAddAdmin message or plain object - * @returns Promise - */ - public addAdmin(request: cosmos.adminmodule.adminmodule.IMsgAddAdmin): Promise; - - /** - * Calls SubmitProposal. - * @param request MsgSubmitProposal message or plain object - * @param callback Node-style callback called with the error, if any, and MsgSubmitProposalResponse - */ - public submitProposal(request: cosmos.adminmodule.adminmodule.IMsgSubmitProposal, callback: cosmos.adminmodule.adminmodule.Msg.SubmitProposalCallback): void; - - /** - * Calls SubmitProposal. - * @param request MsgSubmitProposal message or plain object - * @returns Promise - */ - public submitProposal(request: cosmos.adminmodule.adminmodule.IMsgSubmitProposal): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#deleteAdmin}. - * @param error Error, if any - * @param [response] MsgDeleteAdminResponse - */ - type DeleteAdminCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse) => void; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#addAdmin}. - * @param error Error, if any - * @param [response] MsgAddAdminResponse - */ - type AddAdminCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.MsgAddAdminResponse) => void; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#submitProposal}. - * @param error Error, if any - * @param [response] MsgSubmitProposalResponse - */ - type SubmitProposalCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse) => void; - } - - /** Properties of a MsgDeleteAdmin. */ - interface IMsgDeleteAdmin { - - /** MsgDeleteAdmin creator */ - creator?: (string|null); - - /** MsgDeleteAdmin admin */ - admin?: (string|null); - } - - /** Represents a MsgDeleteAdmin. */ - class MsgDeleteAdmin implements IMsgDeleteAdmin { - - /** - * Constructs a new MsgDeleteAdmin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin); - - /** MsgDeleteAdmin creator. */ - public creator: string; - - /** MsgDeleteAdmin admin. */ - public admin: string; - - /** - * Encodes the specified MsgDeleteAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @param message MsgDeleteAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgDeleteAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @param message MsgDeleteAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgDeleteAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgDeleteAdmin; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgDeleteAdmin; - - /** - * Verifies a MsgDeleteAdmin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgDeleteAdmin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgDeleteAdmin - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgDeleteAdmin; - - /** - * Creates a plain object from a MsgDeleteAdmin message. Also converts values to other types if specified. - * @param message MsgDeleteAdmin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgDeleteAdmin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgDeleteAdmin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgDeleteAdminResponse. */ - interface IMsgDeleteAdminResponse { - } - - /** Represents a MsgDeleteAdminResponse. */ - class MsgDeleteAdminResponse implements IMsgDeleteAdminResponse { - - /** - * Constructs a new MsgDeleteAdminResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse); - - /** - * Encodes the specified MsgDeleteAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @param message MsgDeleteAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgDeleteAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @param message MsgDeleteAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse; - - /** - * Verifies a MsgDeleteAdminResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgDeleteAdminResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgDeleteAdminResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse; - - /** - * Creates a plain object from a MsgDeleteAdminResponse message. Also converts values to other types if specified. - * @param message MsgDeleteAdminResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgDeleteAdminResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgAddAdmin. */ - interface IMsgAddAdmin { - - /** MsgAddAdmin creator */ - creator?: (string|null); - - /** MsgAddAdmin admin */ - admin?: (string|null); - } - - /** Represents a MsgAddAdmin. */ - class MsgAddAdmin implements IMsgAddAdmin { - - /** - * Constructs a new MsgAddAdmin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgAddAdmin); - - /** MsgAddAdmin creator. */ - public creator: string; - - /** MsgAddAdmin admin. */ - public admin: string; - - /** - * Encodes the specified MsgAddAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @param message MsgAddAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgAddAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgAddAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @param message MsgAddAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgAddAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgAddAdmin; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgAddAdmin; - - /** - * Verifies a MsgAddAdmin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgAddAdmin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgAddAdmin - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgAddAdmin; - - /** - * Creates a plain object from a MsgAddAdmin message. Also converts values to other types if specified. - * @param message MsgAddAdmin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgAddAdmin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgAddAdmin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgAddAdminResponse. */ - interface IMsgAddAdminResponse { - } - - /** Represents a MsgAddAdminResponse. */ - class MsgAddAdminResponse implements IMsgAddAdminResponse { - - /** - * Constructs a new MsgAddAdminResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgAddAdminResponse); - - /** - * Encodes the specified MsgAddAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @param message MsgAddAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgAddAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgAddAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @param message MsgAddAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgAddAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgAddAdminResponse; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgAddAdminResponse; - - /** - * Verifies a MsgAddAdminResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgAddAdminResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgAddAdminResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgAddAdminResponse; - - /** - * Creates a plain object from a MsgAddAdminResponse message. Also converts values to other types if specified. - * @param message MsgAddAdminResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgAddAdminResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgAddAdminResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitProposal. */ - interface IMsgSubmitProposal { - - /** MsgSubmitProposal content */ - content?: (google.protobuf.IAny|null); - - /** MsgSubmitProposal proposer */ - proposer?: (string|null); - } - - /** Represents a MsgSubmitProposal. */ - class MsgSubmitProposal implements IMsgSubmitProposal { - - /** - * Constructs a new MsgSubmitProposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgSubmitProposal); - - /** MsgSubmitProposal content. */ - public content?: (google.protobuf.IAny|null); - - /** MsgSubmitProposal proposer. */ - public proposer: string; - - /** - * Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @param message MsgSubmitProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgSubmitProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @param message MsgSubmitProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgSubmitProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgSubmitProposal; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgSubmitProposal; - - /** - * Verifies a MsgSubmitProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitProposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgSubmitProposal; - - /** - * Creates a plain object from a MsgSubmitProposal message. Also converts values to other types if specified. - * @param message MsgSubmitProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgSubmitProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitProposalResponse. */ - interface IMsgSubmitProposalResponse { - - /** MsgSubmitProposalResponse proposal_id */ - proposal_id?: (Long|null); - } - - /** Represents a MsgSubmitProposalResponse. */ - class MsgSubmitProposalResponse implements IMsgSubmitProposalResponse { - - /** - * Constructs a new MsgSubmitProposalResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse); - - /** MsgSubmitProposalResponse proposal_id. */ - public proposal_id: Long; - - /** - * Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @param message MsgSubmitProposalResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @param message MsgSubmitProposalResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse; - - /** - * Verifies a MsgSubmitProposalResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitProposalResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitProposalResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse; - - /** - * Creates a plain object from a MsgSubmitProposalResponse message. Also converts values to other types if specified. - * @param message MsgSubmitProposalResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitProposalResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Admins. - * @param request QueryAdminsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryAdminsResponse - */ - public admins(request: cosmos.adminmodule.adminmodule.IQueryAdminsRequest, callback: cosmos.adminmodule.adminmodule.Query.AdminsCallback): void; - - /** - * Calls Admins. - * @param request QueryAdminsRequest message or plain object - * @returns Promise - */ - public admins(request: cosmos.adminmodule.adminmodule.IQueryAdminsRequest): Promise; - - /** - * Calls ArchivedProposals. - * @param request QueryArchivedProposalsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryArchivedProposalsResponse - */ - public archivedProposals(request: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest, callback: cosmos.adminmodule.adminmodule.Query.ArchivedProposalsCallback): void; - - /** - * Calls ArchivedProposals. - * @param request QueryArchivedProposalsRequest message or plain object - * @returns Promise - */ - public archivedProposals(request: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#admins}. - * @param error Error, if any - * @param [response] QueryAdminsResponse - */ - type AdminsCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.QueryAdminsResponse) => void; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#archivedProposals}. - * @param error Error, if any - * @param [response] QueryArchivedProposalsResponse - */ - type ArchivedProposalsCallback = (error: (Error|null), response?: cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse) => void; - } - - /** Properties of a QueryAdminsRequest. */ - interface IQueryAdminsRequest { - } - - /** Represents a QueryAdminsRequest. */ - class QueryAdminsRequest implements IQueryAdminsRequest { - - /** - * Constructs a new QueryAdminsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IQueryAdminsRequest); - - /** - * Encodes the specified QueryAdminsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @param message QueryAdminsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IQueryAdminsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryAdminsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @param message QueryAdminsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IQueryAdminsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.QueryAdminsRequest; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.QueryAdminsRequest; - - /** - * Verifies a QueryAdminsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryAdminsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryAdminsRequest - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.QueryAdminsRequest; - - /** - * Creates a plain object from a QueryAdminsRequest message. Also converts values to other types if specified. - * @param message QueryAdminsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.QueryAdminsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryAdminsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryAdminsResponse. */ - interface IQueryAdminsResponse { - - /** QueryAdminsResponse admins */ - admins?: (string[]|null); - } - - /** Represents a QueryAdminsResponse. */ - class QueryAdminsResponse implements IQueryAdminsResponse { - - /** - * Constructs a new QueryAdminsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IQueryAdminsResponse); - - /** QueryAdminsResponse admins. */ - public admins: string[]; - - /** - * Encodes the specified QueryAdminsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @param message QueryAdminsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IQueryAdminsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryAdminsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @param message QueryAdminsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IQueryAdminsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.QueryAdminsResponse; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.QueryAdminsResponse; - - /** - * Verifies a QueryAdminsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryAdminsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryAdminsResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.QueryAdminsResponse; - - /** - * Creates a plain object from a QueryAdminsResponse message. Also converts values to other types if specified. - * @param message QueryAdminsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.QueryAdminsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryAdminsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryArchivedProposalsRequest. */ - interface IQueryArchivedProposalsRequest { - } - - /** Represents a QueryArchivedProposalsRequest. */ - class QueryArchivedProposalsRequest implements IQueryArchivedProposalsRequest { - - /** - * Constructs a new QueryArchivedProposalsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest); - - /** - * Encodes the specified QueryArchivedProposalsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @param message QueryArchivedProposalsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryArchivedProposalsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @param message QueryArchivedProposalsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest; - - /** - * Verifies a QueryArchivedProposalsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryArchivedProposalsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryArchivedProposalsRequest - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest; - - /** - * Creates a plain object from a QueryArchivedProposalsRequest message. Also converts values to other types if specified. - * @param message QueryArchivedProposalsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryArchivedProposalsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryArchivedProposalsResponse. */ - interface IQueryArchivedProposalsResponse { - - /** QueryArchivedProposalsResponse proposals */ - proposals?: (cosmos.gov.v1beta1.IProposal[]|null); - } - - /** Represents a QueryArchivedProposalsResponse. */ - class QueryArchivedProposalsResponse implements IQueryArchivedProposalsResponse { - - /** - * Constructs a new QueryArchivedProposalsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse); - - /** QueryArchivedProposalsResponse proposals. */ - public proposals: cosmos.gov.v1beta1.IProposal[]; - - /** - * Encodes the specified QueryArchivedProposalsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @param message QueryArchivedProposalsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryArchivedProposalsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @param message QueryArchivedProposalsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse; - - /** - * Verifies a QueryArchivedProposalsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryArchivedProposalsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryArchivedProposalsResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse; - - /** - * Creates a plain object from a QueryArchivedProposalsResponse message. Also converts values to other types if specified. - * @param message QueryArchivedProposalsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryArchivedProposalsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState admins */ - admins?: (string[]|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.adminmodule.adminmodule.IGenesisState); - - /** GenesisState admins. */ - public admins: string[]; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.adminmodule.adminmodule.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.adminmodule.adminmodule.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.adminmodule.adminmodule.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.adminmodule.adminmodule.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): cosmos.adminmodule.adminmodule.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.adminmodule.adminmodule.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace gov. */ - namespace gov { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** VoteOption enum. */ - enum VoteOption { - VOTE_OPTION_UNSPECIFIED = 0, - VOTE_OPTION_YES = 1, - VOTE_OPTION_ABSTAIN = 2, - VOTE_OPTION_NO = 3, - VOTE_OPTION_NO_WITH_VETO = 4 - } - - /** Properties of a WeightedVoteOption. */ - interface IWeightedVoteOption { - - /** WeightedVoteOption option */ - option?: (cosmos.gov.v1beta1.VoteOption|null); - - /** WeightedVoteOption weight */ - weight?: (string|null); - } - - /** Represents a WeightedVoteOption. */ - class WeightedVoteOption implements IWeightedVoteOption { - - /** - * Constructs a new WeightedVoteOption. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IWeightedVoteOption); - - /** WeightedVoteOption option. */ - public option: cosmos.gov.v1beta1.VoteOption; - - /** WeightedVoteOption weight. */ - public weight: string; - - /** - * Encodes the specified WeightedVoteOption message. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @param message WeightedVoteOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IWeightedVoteOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WeightedVoteOption message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @param message WeightedVoteOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IWeightedVoteOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.WeightedVoteOption; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.WeightedVoteOption; - - /** - * Verifies a WeightedVoteOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WeightedVoteOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WeightedVoteOption - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.WeightedVoteOption; - - /** - * Creates a plain object from a WeightedVoteOption message. Also converts values to other types if specified. - * @param message WeightedVoteOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.WeightedVoteOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WeightedVoteOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TextProposal. */ - interface ITextProposal { - - /** TextProposal title */ - title?: (string|null); - - /** TextProposal description */ - description?: (string|null); - } - - /** Represents a TextProposal. */ - class TextProposal implements ITextProposal { - - /** - * Constructs a new TextProposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.ITextProposal); - - /** TextProposal title. */ - public title: string; - - /** TextProposal description. */ - public description: string; - - /** - * Encodes the specified TextProposal message. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @param message TextProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.ITextProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @param message TextProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.ITextProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.TextProposal; - - /** - * Decodes a TextProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.TextProposal; - - /** - * Verifies a TextProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TextProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextProposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.TextProposal; - - /** - * Creates a plain object from a TextProposal message. Also converts values to other types if specified. - * @param message TextProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.TextProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Deposit. */ - interface IDeposit { - - /** Deposit proposal_id */ - proposal_id?: (Long|null); - - /** Deposit depositor */ - depositor?: (string|null); - - /** Deposit amount */ - amount?: (cosmos.base.v1beta1.ICoin[]|null); - } - - /** Represents a Deposit. */ - class Deposit implements IDeposit { - - /** - * Constructs a new Deposit. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IDeposit); - - /** Deposit proposal_id. */ - public proposal_id: Long; - - /** Deposit depositor. */ - public depositor: string; - - /** Deposit amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** - * Encodes the specified Deposit message. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @param message Deposit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IDeposit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Deposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @param message Deposit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IDeposit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Deposit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.Deposit; - - /** - * Decodes a Deposit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.Deposit; - - /** - * Verifies a Deposit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Deposit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Deposit - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.Deposit; - - /** - * Creates a plain object from a Deposit message. Also converts values to other types if specified. - * @param message Deposit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.Deposit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Deposit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Proposal. */ - interface IProposal { - - /** Proposal proposal_id */ - proposal_id?: (Long|null); - - /** Proposal content */ - content?: (google.protobuf.IAny|null); - - /** Proposal status */ - status?: (cosmos.gov.v1beta1.ProposalStatus|null); - - /** Proposal final_tally_result */ - final_tally_result?: (cosmos.gov.v1beta1.ITallyResult|null); - - /** Proposal submit_time */ - submit_time?: (google.protobuf.ITimestamp|null); - - /** Proposal deposit_end_time */ - deposit_end_time?: (google.protobuf.ITimestamp|null); - - /** Proposal total_deposit */ - total_deposit?: (cosmos.base.v1beta1.ICoin[]|null); - - /** Proposal voting_start_time */ - voting_start_time?: (google.protobuf.ITimestamp|null); - - /** Proposal voting_end_time */ - voting_end_time?: (google.protobuf.ITimestamp|null); - } - - /** Represents a Proposal. */ - class Proposal implements IProposal { - - /** - * Constructs a new Proposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IProposal); - - /** Proposal proposal_id. */ - public proposal_id: Long; - - /** Proposal content. */ - public content?: (google.protobuf.IAny|null); - - /** Proposal status. */ - public status: cosmos.gov.v1beta1.ProposalStatus; - - /** Proposal final_tally_result. */ - public final_tally_result?: (cosmos.gov.v1beta1.ITallyResult|null); - - /** Proposal submit_time. */ - public submit_time?: (google.protobuf.ITimestamp|null); - - /** Proposal deposit_end_time. */ - public deposit_end_time?: (google.protobuf.ITimestamp|null); - - /** Proposal total_deposit. */ - public total_deposit: cosmos.base.v1beta1.ICoin[]; - - /** Proposal voting_start_time. */ - public voting_start_time?: (google.protobuf.ITimestamp|null); - - /** Proposal voting_end_time. */ - public voting_end_time?: (google.protobuf.ITimestamp|null); - - /** - * Encodes the specified Proposal message. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @param message Proposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @param message Proposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.Proposal; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.Proposal; - - /** - * Verifies a Proposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Proposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.Proposal; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @param message Proposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.Proposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Proposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** ProposalStatus enum. */ - enum ProposalStatus { - PROPOSAL_STATUS_UNSPECIFIED = 0, - PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, - PROPOSAL_STATUS_VOTING_PERIOD = 2, - PROPOSAL_STATUS_PASSED = 3, - PROPOSAL_STATUS_REJECTED = 4, - PROPOSAL_STATUS_FAILED = 5 - } - - /** Properties of a TallyResult. */ - interface ITallyResult { - - /** TallyResult yes */ - yes?: (string|null); - - /** TallyResult abstain */ - abstain?: (string|null); - - /** TallyResult no */ - no?: (string|null); - - /** TallyResult no_with_veto */ - no_with_veto?: (string|null); - } - - /** Represents a TallyResult. */ - class TallyResult implements ITallyResult { - - /** - * Constructs a new TallyResult. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.ITallyResult); - - /** TallyResult yes. */ - public yes: string; - - /** TallyResult abstain. */ - public abstain: string; - - /** TallyResult no. */ - public no: string; - - /** TallyResult no_with_veto. */ - public no_with_veto: string; - - /** - * Encodes the specified TallyResult message. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @param message TallyResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.ITallyResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TallyResult message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @param message TallyResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.ITallyResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TallyResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.TallyResult; - - /** - * Decodes a TallyResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.TallyResult; - - /** - * Verifies a TallyResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TallyResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TallyResult - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.TallyResult; - - /** - * Creates a plain object from a TallyResult message. Also converts values to other types if specified. - * @param message TallyResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.TallyResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TallyResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Vote. */ - interface IVote { - - /** Vote proposal_id */ - proposal_id?: (Long|null); - - /** Vote voter */ - voter?: (string|null); - - /** Vote option */ - option?: (cosmos.gov.v1beta1.VoteOption|null); - - /** Vote options */ - options?: (cosmos.gov.v1beta1.IWeightedVoteOption[]|null); - } - - /** Represents a Vote. */ - class Vote implements IVote { - - /** - * Constructs a new Vote. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IVote); - - /** Vote proposal_id. */ - public proposal_id: Long; - - /** Vote voter. */ - public voter: string; - - /** Vote option. */ - public option: cosmos.gov.v1beta1.VoteOption; - - /** Vote options. */ - public options: cosmos.gov.v1beta1.IWeightedVoteOption[]; - - /** - * Encodes the specified Vote message. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @param message Vote message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IVote, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @param message Vote message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IVote, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.Vote; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.Vote; - - /** - * Verifies a Vote message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Vote - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.Vote; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @param message Vote - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.Vote, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Vote to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DepositParams. */ - interface IDepositParams { - - /** DepositParams min_deposit */ - min_deposit?: (cosmos.base.v1beta1.ICoin[]|null); - - /** DepositParams max_deposit_period */ - max_deposit_period?: (google.protobuf.IDuration|null); - } - - /** Represents a DepositParams. */ - class DepositParams implements IDepositParams { - - /** - * Constructs a new DepositParams. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IDepositParams); - - /** DepositParams min_deposit. */ - public min_deposit: cosmos.base.v1beta1.ICoin[]; - - /** DepositParams max_deposit_period. */ - public max_deposit_period?: (google.protobuf.IDuration|null); - - /** - * Encodes the specified DepositParams message. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @param message DepositParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IDepositParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DepositParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @param message DepositParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IDepositParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DepositParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.DepositParams; - - /** - * Decodes a DepositParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.DepositParams; - - /** - * Verifies a DepositParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DepositParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DepositParams - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.DepositParams; - - /** - * Creates a plain object from a DepositParams message. Also converts values to other types if specified. - * @param message DepositParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.DepositParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DepositParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a VotingParams. */ - interface IVotingParams { - - /** VotingParams voting_period */ - voting_period?: (google.protobuf.IDuration|null); - } - - /** Represents a VotingParams. */ - class VotingParams implements IVotingParams { - - /** - * Constructs a new VotingParams. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.IVotingParams); - - /** VotingParams voting_period. */ - public voting_period?: (google.protobuf.IDuration|null); - - /** - * Encodes the specified VotingParams message. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @param message VotingParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.IVotingParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VotingParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @param message VotingParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.IVotingParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VotingParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.VotingParams; - - /** - * Decodes a VotingParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.VotingParams; - - /** - * Verifies a VotingParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VotingParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VotingParams - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.VotingParams; - - /** - * Creates a plain object from a VotingParams message. Also converts values to other types if specified. - * @param message VotingParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.VotingParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VotingParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TallyParams. */ - interface ITallyParams { - - /** TallyParams quorum */ - quorum?: (Uint8Array|null); - - /** TallyParams threshold */ - threshold?: (Uint8Array|null); - - /** TallyParams veto_threshold */ - veto_threshold?: (Uint8Array|null); - } - - /** Represents a TallyParams. */ - class TallyParams implements ITallyParams { - - /** - * Constructs a new TallyParams. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.gov.v1beta1.ITallyParams); - - /** TallyParams quorum. */ - public quorum: Uint8Array; - - /** TallyParams threshold. */ - public threshold: Uint8Array; - - /** TallyParams veto_threshold. */ - public veto_threshold: Uint8Array; - - /** - * Encodes the specified TallyParams message. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @param message TallyParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.gov.v1beta1.ITallyParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TallyParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @param message TallyParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.gov.v1beta1.ITallyParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TallyParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.gov.v1beta1.TallyParams; - - /** - * Decodes a TallyParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.gov.v1beta1.TallyParams; - - /** - * Verifies a TallyParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TallyParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TallyParams - */ - public static fromObject(object: { [k: string]: any }): cosmos.gov.v1beta1.TallyParams; - - /** - * Creates a plain object from a TallyParams message. Also converts values to other types if specified. - * @param message TallyParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.gov.v1beta1.TallyParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TallyParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace base. */ - namespace base { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a Coin. */ - interface ICoin { - - /** Coin denom */ - denom?: (string|null); - - /** Coin amount */ - amount?: (string|null); - } - - /** Represents a Coin. */ - class Coin implements ICoin { - - /** - * Constructs a new Coin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.ICoin); - - /** Coin denom. */ - public denom: string; - - /** Coin amount. */ - public amount: string; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.Coin; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.Coin; - - /** - * Verifies a Coin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Coin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.Coin; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @param message Coin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Coin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecCoin. */ - interface IDecCoin { - - /** DecCoin denom */ - denom?: (string|null); - - /** DecCoin amount */ - amount?: (string|null); - } - - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - - /** - * Constructs a new DecCoin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecCoin; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecCoin; - - /** - * Verifies a DecCoin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecCoin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecCoin; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @param message DecCoin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecCoin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecCoin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IntProto. */ - interface IIntProto { - - /** IntProto int */ - int?: (string|null); - } - - /** Represents an IntProto. */ - class IntProto implements IIntProto { - - /** - * Constructs a new IntProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.IntProto; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.IntProto; - - /** - * Verifies an IntProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.IntProto; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @param message IntProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.IntProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecProto. */ - interface IDecProto { - - /** DecProto dec */ - dec?: (string|null); - } - - /** Represents a DecProto. */ - class DecProto implements IDecProto { - - /** - * Constructs a new DecProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecProto; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecProto; - - /** - * Verifies a DecProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecProto; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @param message DecProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace query. */ - namespace query { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a PageRequest. */ - interface IPageRequest { - - /** PageRequest key */ - key?: (Uint8Array|null); - - /** PageRequest offset */ - offset?: (Long|null); - - /** PageRequest limit */ - limit?: (Long|null); - - /** PageRequest count_total */ - count_total?: (boolean|null); - } - - /** Represents a PageRequest. */ - class PageRequest implements IPageRequest { - - /** - * Constructs a new PageRequest. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.query.v1beta1.IPageRequest); - - /** PageRequest key. */ - public key: Uint8Array; - - /** PageRequest offset. */ - public offset: Long; - - /** PageRequest limit. */ - public limit: Long; - - /** PageRequest count_total. */ - public count_total: boolean; - - /** - * Encodes the specified PageRequest message. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @param message PageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.query.v1beta1.IPageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PageRequest message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @param message PageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.query.v1beta1.IPageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PageRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.query.v1beta1.PageRequest; - - /** - * Decodes a PageRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.query.v1beta1.PageRequest; - - /** - * Verifies a PageRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PageRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PageRequest - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.query.v1beta1.PageRequest; - - /** - * Creates a plain object from a PageRequest message. Also converts values to other types if specified. - * @param message PageRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.query.v1beta1.PageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PageRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PageResponse. */ - interface IPageResponse { - - /** PageResponse next_key */ - next_key?: (Uint8Array|null); - - /** PageResponse total */ - total?: (Long|null); - } - - /** Represents a PageResponse. */ - class PageResponse implements IPageResponse { - - /** - * Constructs a new PageResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.query.v1beta1.IPageResponse); - - /** PageResponse next_key. */ - public next_key: Uint8Array; - - /** PageResponse total. */ - public total: Long; - - /** - * Encodes the specified PageResponse message. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @param message PageResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.query.v1beta1.IPageResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PageResponse message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @param message PageResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.query.v1beta1.IPageResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PageResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.query.v1beta1.PageResponse; - - /** - * Decodes a PageResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.query.v1beta1.PageResponse; - - /** - * Verifies a PageResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PageResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PageResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.query.v1beta1.PageResponse; - - /** - * Creates a plain object from a PageResponse message. Also converts values to other types if specified. - * @param message PageResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.query.v1beta1.PageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PageResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } - - /** Namespace upgrade. */ - namespace upgrade { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a Plan. */ - interface IPlan { - - /** Plan name */ - name?: (string|null); - - /** Plan time */ - time?: (google.protobuf.ITimestamp|null); - - /** Plan height */ - height?: (Long|null); - - /** Plan info */ - info?: (string|null); - } - - /** Represents a Plan. */ - class Plan implements IPlan { - - /** - * Constructs a new Plan. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.upgrade.v1beta1.IPlan); - - /** Plan name. */ - public name: string; - - /** Plan time. */ - public time?: (google.protobuf.ITimestamp|null); - - /** Plan height. */ - public height: Long; - - /** Plan info. */ - public info: string; - - /** - * Encodes the specified Plan message. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @param message Plan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.upgrade.v1beta1.IPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Plan message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @param message Plan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.upgrade.v1beta1.IPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Plan message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.upgrade.v1beta1.Plan; - - /** - * Decodes a Plan message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.upgrade.v1beta1.Plan; - - /** - * Verifies a Plan message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Plan message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Plan - */ - public static fromObject(object: { [k: string]: any }): cosmos.upgrade.v1beta1.Plan; - - /** - * Creates a plain object from a Plan message. Also converts values to other types if specified. - * @param message Plan - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.upgrade.v1beta1.Plan, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Plan to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SoftwareUpgradeProposal. */ - interface ISoftwareUpgradeProposal { - - /** SoftwareUpgradeProposal title */ - title?: (string|null); - - /** SoftwareUpgradeProposal description */ - description?: (string|null); - - /** SoftwareUpgradeProposal plan */ - plan?: (cosmos.upgrade.v1beta1.IPlan|null); - } - - /** Represents a SoftwareUpgradeProposal. */ - class SoftwareUpgradeProposal implements ISoftwareUpgradeProposal { - - /** - * Constructs a new SoftwareUpgradeProposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal); - - /** SoftwareUpgradeProposal title. */ - public title: string; - - /** SoftwareUpgradeProposal description. */ - public description: string; - - /** SoftwareUpgradeProposal plan. */ - public plan?: (cosmos.upgrade.v1beta1.IPlan|null); - - /** - * Encodes the specified SoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @param message SoftwareUpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @param message SoftwareUpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.upgrade.v1beta1.SoftwareUpgradeProposal; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.upgrade.v1beta1.SoftwareUpgradeProposal; - - /** - * Verifies a SoftwareUpgradeProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SoftwareUpgradeProposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.upgrade.v1beta1.SoftwareUpgradeProposal; - - /** - * Creates a plain object from a SoftwareUpgradeProposal message. Also converts values to other types if specified. - * @param message SoftwareUpgradeProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.upgrade.v1beta1.SoftwareUpgradeProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SoftwareUpgradeProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CancelSoftwareUpgradeProposal. */ - interface ICancelSoftwareUpgradeProposal { - - /** CancelSoftwareUpgradeProposal title */ - title?: (string|null); - - /** CancelSoftwareUpgradeProposal description */ - description?: (string|null); - } - - /** Represents a CancelSoftwareUpgradeProposal. */ - class CancelSoftwareUpgradeProposal implements ICancelSoftwareUpgradeProposal { - - /** - * Constructs a new CancelSoftwareUpgradeProposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal); - - /** CancelSoftwareUpgradeProposal title. */ - public title: string; - - /** CancelSoftwareUpgradeProposal description. */ - public description: string; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @param message CancelSoftwareUpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @param message CancelSoftwareUpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal; - - /** - * Verifies a CancelSoftwareUpgradeProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelSoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelSoftwareUpgradeProposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal; - - /** - * Creates a plain object from a CancelSoftwareUpgradeProposal message. Also converts values to other types if specified. - * @param message CancelSoftwareUpgradeProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelSoftwareUpgradeProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace auth. */ - namespace auth { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a BaseAccount. */ - interface IBaseAccount { - - /** BaseAccount address */ - address?: (string|null); - - /** BaseAccount pub_key */ - pub_key?: (google.protobuf.IAny|null); - - /** BaseAccount account_number */ - account_number?: (Long|null); - - /** BaseAccount sequence */ - sequence?: (Long|null); - } - - /** Represents a BaseAccount. */ - class BaseAccount implements IBaseAccount { - - /** - * Constructs a new BaseAccount. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.auth.v1beta1.IBaseAccount); - - /** BaseAccount address. */ - public address: string; - - /** BaseAccount pub_key. */ - public pub_key?: (google.protobuf.IAny|null); - - /** BaseAccount account_number. */ - public account_number: Long; - - /** BaseAccount sequence. */ - public sequence: Long; - - /** - * Encodes the specified BaseAccount message. Does not implicitly {@link cosmos.auth.v1beta1.BaseAccount.verify|verify} messages. - * @param message BaseAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.auth.v1beta1.IBaseAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BaseAccount message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.BaseAccount.verify|verify} messages. - * @param message BaseAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.auth.v1beta1.IBaseAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BaseAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BaseAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.auth.v1beta1.BaseAccount; - - /** - * Decodes a BaseAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BaseAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.auth.v1beta1.BaseAccount; - - /** - * Verifies a BaseAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BaseAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BaseAccount - */ - public static fromObject(object: { [k: string]: any }): cosmos.auth.v1beta1.BaseAccount; - - /** - * Creates a plain object from a BaseAccount message. Also converts values to other types if specified. - * @param message BaseAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.auth.v1beta1.BaseAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BaseAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ModuleAccount. */ - interface IModuleAccount { - - /** ModuleAccount base_account */ - base_account?: (cosmos.auth.v1beta1.IBaseAccount|null); - - /** ModuleAccount name */ - name?: (string|null); - - /** ModuleAccount permissions */ - permissions?: (string[]|null); - } - - /** Represents a ModuleAccount. */ - class ModuleAccount implements IModuleAccount { - - /** - * Constructs a new ModuleAccount. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.auth.v1beta1.IModuleAccount); - - /** ModuleAccount base_account. */ - public base_account?: (cosmos.auth.v1beta1.IBaseAccount|null); - - /** ModuleAccount name. */ - public name: string; - - /** ModuleAccount permissions. */ - public permissions: string[]; - - /** - * Encodes the specified ModuleAccount message. Does not implicitly {@link cosmos.auth.v1beta1.ModuleAccount.verify|verify} messages. - * @param message ModuleAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.auth.v1beta1.IModuleAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModuleAccount message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.ModuleAccount.verify|verify} messages. - * @param message ModuleAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.auth.v1beta1.IModuleAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModuleAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModuleAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.auth.v1beta1.ModuleAccount; - - /** - * Decodes a ModuleAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModuleAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.auth.v1beta1.ModuleAccount; - - /** - * Verifies a ModuleAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModuleAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModuleAccount - */ - public static fromObject(object: { [k: string]: any }): cosmos.auth.v1beta1.ModuleAccount; - - /** - * Creates a plain object from a ModuleAccount message. Also converts values to other types if specified. - * @param message ModuleAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.auth.v1beta1.ModuleAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModuleAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params max_memo_characters */ - max_memo_characters?: (Long|null); - - /** Params tx_sig_limit */ - tx_sig_limit?: (Long|null); - - /** Params tx_size_cost_per_byte */ - tx_size_cost_per_byte?: (Long|null); - - /** Params sig_verify_cost_ed25519 */ - sig_verify_cost_ed25519?: (Long|null); - - /** Params sig_verify_cost_secp256k1 */ - sig_verify_cost_secp256k1?: (Long|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.auth.v1beta1.IParams); - - /** Params max_memo_characters. */ - public max_memo_characters: Long; - - /** Params tx_sig_limit. */ - public tx_sig_limit: Long; - - /** Params tx_size_cost_per_byte. */ - public tx_size_cost_per_byte: Long; - - /** Params sig_verify_cost_ed25519. */ - public sig_verify_cost_ed25519: Long; - - /** Params sig_verify_cost_secp256k1. */ - public sig_verify_cost_secp256k1: Long; - - /** - * Encodes the specified Params message. Does not implicitly {@link cosmos.auth.v1beta1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.auth.v1beta1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.auth.v1beta1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.auth.v1beta1.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.auth.v1beta1.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): cosmos.auth.v1beta1.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.auth.v1beta1.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } -} - -/** Namespace google. */ -export namespace google { - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto public_dependency */ - public_dependency?: (number[]|null); - - /** FileDescriptorProto weak_dependency */ - weak_dependency?: (number[]|null); - - /** FileDescriptorProto message_type */ - message_type?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enum_type */ - enum_type?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto source_code_info */ - source_code_info?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto public_dependency. */ - public public_dependency: number[]; - - /** FileDescriptorProto weak_dependency. */ - public weak_dependency: number[]; - - /** FileDescriptorProto message_type. */ - public message_type: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enum_type. */ - public enum_type: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto source_code_info. */ - public source_code_info?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nested_type */ - nested_type?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enum_type */ - enum_type?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extension_range */ - extension_range?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneof_decl */ - oneof_decl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reserved_range */ - reserved_range?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reserved_name */ - reserved_name?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nested_type. */ - public nested_type: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enum_type. */ - public enum_type: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extension_range. */ - public extension_range: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneof_decl. */ - public oneof_decl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reserved_range. */ - public reserved_range: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reserved_name. */ - public reserved_name: string[]; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto type_name */ - type_name?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto default_value */ - default_value?: (string|null); - - /** FieldDescriptorProto oneof_index */ - oneof_index?: (number|null); - - /** FieldDescriptorProto json_name */ - json_name?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; - - /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; - - /** FieldDescriptorProto type_name. */ - public type_name: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto default_value. */ - public default_value: string; - - /** FieldDescriptorProto oneof_index. */ - public oneof_index: number; - - /** FieldDescriptorProto json_name. */ - public json_name: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto input_type */ - input_type?: (string|null); - - /** MethodDescriptorProto output_type */ - output_type?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto client_streaming */ - client_streaming?: (boolean|null); - - /** MethodDescriptorProto server_streaming */ - server_streaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto input_type. */ - public input_type: string; - - /** MethodDescriptorProto output_type. */ - public output_type: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto client_streaming. */ - public client_streaming: boolean; - - /** MethodDescriptorProto server_streaming. */ - public server_streaming: boolean; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions java_package */ - java_package?: (string|null); - - /** FileOptions java_outer_classname */ - java_outer_classname?: (string|null); - - /** FileOptions java_multiple_files */ - java_multiple_files?: (boolean|null); - - /** FileOptions java_generate_equals_and_hash */ - java_generate_equals_and_hash?: (boolean|null); - - /** FileOptions java_string_check_utf8 */ - java_string_check_utf8?: (boolean|null); - - /** FileOptions optimize_for */ - optimize_for?: (google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions go_package */ - go_package?: (string|null); - - /** FileOptions cc_generic_services */ - cc_generic_services?: (boolean|null); - - /** FileOptions java_generic_services */ - java_generic_services?: (boolean|null); - - /** FileOptions py_generic_services */ - py_generic_services?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions cc_enable_arenas */ - cc_enable_arenas?: (boolean|null); - - /** FileOptions objc_class_prefix */ - objc_class_prefix?: (string|null); - - /** FileOptions csharp_namespace */ - csharp_namespace?: (string|null); - - /** FileOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .gogoproto.goproto_getters_all */ - ".gogoproto.goproto_getters_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_enum_prefix_all */ - ".gogoproto.goproto_enum_prefix_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_stringer_all */ - ".gogoproto.goproto_stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.verbose_equal_all */ - ".gogoproto.verbose_equal_all"?: (boolean|null); - - /** FileOptions .gogoproto.face_all */ - ".gogoproto.face_all"?: (boolean|null); - - /** FileOptions .gogoproto.gostring_all */ - ".gogoproto.gostring_all"?: (boolean|null); - - /** FileOptions .gogoproto.populate_all */ - ".gogoproto.populate_all"?: (boolean|null); - - /** FileOptions .gogoproto.stringer_all */ - ".gogoproto.stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.onlyone_all */ - ".gogoproto.onlyone_all"?: (boolean|null); - - /** FileOptions .gogoproto.equal_all */ - ".gogoproto.equal_all"?: (boolean|null); - - /** FileOptions .gogoproto.description_all */ - ".gogoproto.description_all"?: (boolean|null); - - /** FileOptions .gogoproto.testgen_all */ - ".gogoproto.testgen_all"?: (boolean|null); - - /** FileOptions .gogoproto.benchgen_all */ - ".gogoproto.benchgen_all"?: (boolean|null); - - /** FileOptions .gogoproto.marshaler_all */ - ".gogoproto.marshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.unmarshaler_all */ - ".gogoproto.unmarshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.stable_marshaler_all */ - ".gogoproto.stable_marshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.sizer_all */ - ".gogoproto.sizer_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_enum_stringer_all */ - ".gogoproto.goproto_enum_stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.enum_stringer_all */ - ".gogoproto.enum_stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.unsafe_marshaler_all */ - ".gogoproto.unsafe_marshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.unsafe_unmarshaler_all */ - ".gogoproto.unsafe_unmarshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_extensions_map_all */ - ".gogoproto.goproto_extensions_map_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_unrecognized_all */ - ".gogoproto.goproto_unrecognized_all"?: (boolean|null); - - /** FileOptions .gogoproto.gogoproto_import */ - ".gogoproto.gogoproto_import"?: (boolean|null); - - /** FileOptions .gogoproto.protosizer_all */ - ".gogoproto.protosizer_all"?: (boolean|null); - - /** FileOptions .gogoproto.compare_all */ - ".gogoproto.compare_all"?: (boolean|null); - - /** FileOptions .gogoproto.typedecl_all */ - ".gogoproto.typedecl_all"?: (boolean|null); - - /** FileOptions .gogoproto.enumdecl_all */ - ".gogoproto.enumdecl_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_registration */ - ".gogoproto.goproto_registration"?: (boolean|null); - - /** FileOptions .gogoproto.messagename_all */ - ".gogoproto.messagename_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_sizecache_all */ - ".gogoproto.goproto_sizecache_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_unkeyed_all */ - ".gogoproto.goproto_unkeyed_all"?: (boolean|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions java_package. */ - public java_package: string; - - /** FileOptions java_outer_classname. */ - public java_outer_classname: string; - - /** FileOptions java_multiple_files. */ - public java_multiple_files: boolean; - - /** FileOptions java_generate_equals_and_hash. */ - public java_generate_equals_and_hash: boolean; - - /** FileOptions java_string_check_utf8. */ - public java_string_check_utf8: boolean; - - /** FileOptions optimize_for. */ - public optimize_for: google.protobuf.FileOptions.OptimizeMode; - - /** FileOptions go_package. */ - public go_package: string; - - /** FileOptions cc_generic_services. */ - public cc_generic_services: boolean; - - /** FileOptions java_generic_services. */ - public java_generic_services: boolean; - - /** FileOptions py_generic_services. */ - public py_generic_services: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions cc_enable_arenas. */ - public cc_enable_arenas: boolean; - - /** FileOptions objc_class_prefix. */ - public objc_class_prefix: string; - - /** FileOptions csharp_namespace. */ - public csharp_namespace: string; - - /** FileOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions message_set_wire_format */ - message_set_wire_format?: (boolean|null); - - /** MessageOptions no_standard_descriptor_accessor */ - no_standard_descriptor_accessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions map_entry */ - map_entry?: (boolean|null); - - /** MessageOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .gogoproto.goproto_getters */ - ".gogoproto.goproto_getters"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_stringer */ - ".gogoproto.goproto_stringer"?: (boolean|null); - - /** MessageOptions .gogoproto.verbose_equal */ - ".gogoproto.verbose_equal"?: (boolean|null); - - /** MessageOptions .gogoproto.face */ - ".gogoproto.face"?: (boolean|null); - - /** MessageOptions .gogoproto.gostring */ - ".gogoproto.gostring"?: (boolean|null); - - /** MessageOptions .gogoproto.populate */ - ".gogoproto.populate"?: (boolean|null); - - /** MessageOptions .gogoproto.stringer */ - ".gogoproto.stringer"?: (boolean|null); - - /** MessageOptions .gogoproto.onlyone */ - ".gogoproto.onlyone"?: (boolean|null); - - /** MessageOptions .gogoproto.equal */ - ".gogoproto.equal"?: (boolean|null); - - /** MessageOptions .gogoproto.description */ - ".gogoproto.description"?: (boolean|null); - - /** MessageOptions .gogoproto.testgen */ - ".gogoproto.testgen"?: (boolean|null); - - /** MessageOptions .gogoproto.benchgen */ - ".gogoproto.benchgen"?: (boolean|null); - - /** MessageOptions .gogoproto.marshaler */ - ".gogoproto.marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.unmarshaler */ - ".gogoproto.unmarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.stable_marshaler */ - ".gogoproto.stable_marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.sizer */ - ".gogoproto.sizer"?: (boolean|null); - - /** MessageOptions .gogoproto.unsafe_marshaler */ - ".gogoproto.unsafe_marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.unsafe_unmarshaler */ - ".gogoproto.unsafe_unmarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_extensions_map */ - ".gogoproto.goproto_extensions_map"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_unrecognized */ - ".gogoproto.goproto_unrecognized"?: (boolean|null); - - /** MessageOptions .gogoproto.protosizer */ - ".gogoproto.protosizer"?: (boolean|null); - - /** MessageOptions .gogoproto.compare */ - ".gogoproto.compare"?: (boolean|null); - - /** MessageOptions .gogoproto.typedecl */ - ".gogoproto.typedecl"?: (boolean|null); - - /** MessageOptions .gogoproto.messagename */ - ".gogoproto.messagename"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_sizecache */ - ".gogoproto.goproto_sizecache"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_unkeyed */ - ".gogoproto.goproto_unkeyed"?: (boolean|null); - - /** MessageOptions .cosmos_proto.interface_type */ - ".cosmos_proto.interface_type"?: (string|null); - - /** MessageOptions .cosmos_proto.implements_interface */ - ".cosmos_proto.implements_interface"?: (string|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions message_set_wire_format. */ - public message_set_wire_format: boolean; - - /** MessageOptions no_standard_descriptor_accessor. */ - public no_standard_descriptor_accessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions map_entry. */ - public map_entry: boolean; - - /** MessageOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .gogoproto.nullable */ - ".gogoproto.nullable"?: (boolean|null); - - /** FieldOptions .gogoproto.embed */ - ".gogoproto.embed"?: (boolean|null); - - /** FieldOptions .gogoproto.customtype */ - ".gogoproto.customtype"?: (string|null); - - /** FieldOptions .gogoproto.customname */ - ".gogoproto.customname"?: (string|null); - - /** FieldOptions .gogoproto.jsontag */ - ".gogoproto.jsontag"?: (string|null); - - /** FieldOptions .gogoproto.moretags */ - ".gogoproto.moretags"?: (string|null); - - /** FieldOptions .gogoproto.casttype */ - ".gogoproto.casttype"?: (string|null); - - /** FieldOptions .gogoproto.castkey */ - ".gogoproto.castkey"?: (string|null); - - /** FieldOptions .gogoproto.castvalue */ - ".gogoproto.castvalue"?: (string|null); - - /** FieldOptions .gogoproto.stdtime */ - ".gogoproto.stdtime"?: (boolean|null); - - /** FieldOptions .gogoproto.stdduration */ - ".gogoproto.stdduration"?: (boolean|null); - - /** FieldOptions .gogoproto.wktpointer */ - ".gogoproto.wktpointer"?: (boolean|null); - - /** FieldOptions .gogoproto.castrepeated */ - ".gogoproto.castrepeated"?: (string|null); - - /** FieldOptions .cosmos_proto.accepts_interface */ - ".cosmos_proto.accepts_interface"?: (string|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allow_alias */ - allow_alias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** EnumOptions .gogoproto.goproto_enum_prefix */ - ".gogoproto.goproto_enum_prefix"?: (boolean|null); - - /** EnumOptions .gogoproto.goproto_enum_stringer */ - ".gogoproto.goproto_enum_stringer"?: (boolean|null); - - /** EnumOptions .gogoproto.enum_stringer */ - ".gogoproto.enum_stringer"?: (boolean|null); - - /** EnumOptions .gogoproto.enum_customname */ - ".gogoproto.enum_customname"?: (string|null); - - /** EnumOptions .gogoproto.enumdecl */ - ".gogoproto.enumdecl"?: (boolean|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allow_alias. */ - public allow_alias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** EnumValueOptions .gogoproto.enumvalue_customname */ - ".gogoproto.enumvalue_customname"?: (string|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifier_value */ - identifier_value?: (string|null); - - /** UninterpretedOption positive_int_value */ - positive_int_value?: (Long|null); - - /** UninterpretedOption negative_int_value */ - negative_int_value?: (Long|null); - - /** UninterpretedOption double_value */ - double_value?: (number|null); - - /** UninterpretedOption string_value */ - string_value?: (Uint8Array|null); - - /** UninterpretedOption aggregate_value */ - aggregate_value?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifier_value. */ - public identifier_value: string; - - /** UninterpretedOption positive_int_value. */ - public positive_int_value: Long; - - /** UninterpretedOption negative_int_value. */ - public negative_int_value: Long; - - /** UninterpretedOption double_value. */ - public double_value: number; - - /** UninterpretedOption string_value. */ - public string_value: Uint8Array; - - /** UninterpretedOption aggregate_value. */ - public aggregate_value: string; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart name_part */ - name_part: string; - - /** NamePart is_extension */ - is_extension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart name_part. */ - public name_part: string; - - /** NamePart is_extension. */ - public is_extension: boolean; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leading_comments */ - leading_comments?: (string|null); - - /** Location trailing_comments */ - trailing_comments?: (string|null); - - /** Location leading_detached_comments */ - leading_detached_comments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leading_comments. */ - public leading_comments: string; - - /** Location trailing_comments. */ - public trailing_comments: string; - - /** Location leading_detached_comments. */ - public leading_detached_comments: string[]; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation source_file */ - source_file?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation source_file. */ - public source_file: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (Long|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: Long; - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (Long|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: Long; - - /** Duration nanos. */ - public nanos: number; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fully_decode_reserved_expansion */ - fully_decode_reserved_expansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fully_decode_reserved_expansion. */ - public fully_decode_reserved_expansion: boolean; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule response_body */ - response_body?: (string|null); - - /** HttpRule additional_bindings */ - additional_bindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule response_body. */ - public response_body: string; - - /** HttpRule additional_bindings. */ - public additional_bindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } -} - -/** Namespace ibc. */ -export namespace ibc { - - /** Namespace applications. */ - namespace applications { - - /** Namespace fee. */ - namespace fee { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls RegisterPayee. - * @param request MsgRegisterPayee message or plain object - * @param callback Node-style callback called with the error, if any, and MsgRegisterPayeeResponse - */ - public registerPayee(request: ibc.applications.fee.v1.IMsgRegisterPayee, callback: ibc.applications.fee.v1.Msg.RegisterPayeeCallback): void; - - /** - * Calls RegisterPayee. - * @param request MsgRegisterPayee message or plain object - * @returns Promise - */ - public registerPayee(request: ibc.applications.fee.v1.IMsgRegisterPayee): Promise; - - /** - * Calls RegisterCounterpartyPayee. - * @param request MsgRegisterCounterpartyPayee message or plain object - * @param callback Node-style callback called with the error, if any, and MsgRegisterCounterpartyPayeeResponse - */ - public registerCounterpartyPayee(request: ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee, callback: ibc.applications.fee.v1.Msg.RegisterCounterpartyPayeeCallback): void; - - /** - * Calls RegisterCounterpartyPayee. - * @param request MsgRegisterCounterpartyPayee message or plain object - * @returns Promise - */ - public registerCounterpartyPayee(request: ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee): Promise; - - /** - * Calls PayPacketFee. - * @param request MsgPayPacketFee message or plain object - * @param callback Node-style callback called with the error, if any, and MsgPayPacketFeeResponse - */ - public payPacketFee(request: ibc.applications.fee.v1.IMsgPayPacketFee, callback: ibc.applications.fee.v1.Msg.PayPacketFeeCallback): void; - - /** - * Calls PayPacketFee. - * @param request MsgPayPacketFee message or plain object - * @returns Promise - */ - public payPacketFee(request: ibc.applications.fee.v1.IMsgPayPacketFee): Promise; - - /** - * Calls PayPacketFeeAsync. - * @param request MsgPayPacketFeeAsync message or plain object - * @param callback Node-style callback called with the error, if any, and MsgPayPacketFeeAsyncResponse - */ - public payPacketFeeAsync(request: ibc.applications.fee.v1.IMsgPayPacketFeeAsync, callback: ibc.applications.fee.v1.Msg.PayPacketFeeAsyncCallback): void; - - /** - * Calls PayPacketFeeAsync. - * @param request MsgPayPacketFeeAsync message or plain object - * @returns Promise - */ - public payPacketFeeAsync(request: ibc.applications.fee.v1.IMsgPayPacketFeeAsync): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#registerPayee}. - * @param error Error, if any - * @param [response] MsgRegisterPayeeResponse - */ - type RegisterPayeeCallback = (error: (Error|null), response?: ibc.applications.fee.v1.MsgRegisterPayeeResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#registerCounterpartyPayee}. - * @param error Error, if any - * @param [response] MsgRegisterCounterpartyPayeeResponse - */ - type RegisterCounterpartyPayeeCallback = (error: (Error|null), response?: ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#payPacketFee}. - * @param error Error, if any - * @param [response] MsgPayPacketFeeResponse - */ - type PayPacketFeeCallback = (error: (Error|null), response?: ibc.applications.fee.v1.MsgPayPacketFeeResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#payPacketFeeAsync}. - * @param error Error, if any - * @param [response] MsgPayPacketFeeAsyncResponse - */ - type PayPacketFeeAsyncCallback = (error: (Error|null), response?: ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse) => void; - } - - /** Properties of a MsgRegisterPayee. */ - interface IMsgRegisterPayee { - - /** MsgRegisterPayee port_id */ - port_id?: (string|null); - - /** MsgRegisterPayee channel_id */ - channel_id?: (string|null); - - /** MsgRegisterPayee relayer */ - relayer?: (string|null); - - /** MsgRegisterPayee payee */ - payee?: (string|null); - } - - /** Represents a MsgRegisterPayee. */ - class MsgRegisterPayee implements IMsgRegisterPayee { - - /** - * Constructs a new MsgRegisterPayee. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IMsgRegisterPayee); - - /** MsgRegisterPayee port_id. */ - public port_id: string; - - /** MsgRegisterPayee channel_id. */ - public channel_id: string; - - /** MsgRegisterPayee relayer. */ - public relayer: string; - - /** MsgRegisterPayee payee. */ - public payee: string; - - /** - * Encodes the specified MsgRegisterPayee message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayee.verify|verify} messages. - * @param message MsgRegisterPayee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IMsgRegisterPayee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRegisterPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayee.verify|verify} messages. - * @param message MsgRegisterPayee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IMsgRegisterPayee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRegisterPayee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRegisterPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.MsgRegisterPayee; - - /** - * Decodes a MsgRegisterPayee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRegisterPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.MsgRegisterPayee; - - /** - * Verifies a MsgRegisterPayee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRegisterPayee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRegisterPayee - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.MsgRegisterPayee; - - /** - * Creates a plain object from a MsgRegisterPayee message. Also converts values to other types if specified. - * @param message MsgRegisterPayee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.MsgRegisterPayee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRegisterPayee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgRegisterPayeeResponse. */ - interface IMsgRegisterPayeeResponse { - } - - /** Represents a MsgRegisterPayeeResponse. */ - class MsgRegisterPayeeResponse implements IMsgRegisterPayeeResponse { - - /** - * Constructs a new MsgRegisterPayeeResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IMsgRegisterPayeeResponse); - - /** - * Encodes the specified MsgRegisterPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayeeResponse.verify|verify} messages. - * @param message MsgRegisterPayeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IMsgRegisterPayeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRegisterPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayeeResponse.verify|verify} messages. - * @param message MsgRegisterPayeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IMsgRegisterPayeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRegisterPayeeResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRegisterPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.MsgRegisterPayeeResponse; - - /** - * Decodes a MsgRegisterPayeeResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRegisterPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.MsgRegisterPayeeResponse; - - /** - * Verifies a MsgRegisterPayeeResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRegisterPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRegisterPayeeResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.MsgRegisterPayeeResponse; - - /** - * Creates a plain object from a MsgRegisterPayeeResponse message. Also converts values to other types if specified. - * @param message MsgRegisterPayeeResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.MsgRegisterPayeeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRegisterPayeeResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgRegisterCounterpartyPayee. */ - interface IMsgRegisterCounterpartyPayee { - - /** MsgRegisterCounterpartyPayee port_id */ - port_id?: (string|null); - - /** MsgRegisterCounterpartyPayee channel_id */ - channel_id?: (string|null); - - /** MsgRegisterCounterpartyPayee relayer */ - relayer?: (string|null); - - /** MsgRegisterCounterpartyPayee counterparty_payee */ - counterparty_payee?: (string|null); - } - - /** Represents a MsgRegisterCounterpartyPayee. */ - class MsgRegisterCounterpartyPayee implements IMsgRegisterCounterpartyPayee { - - /** - * Constructs a new MsgRegisterCounterpartyPayee. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee); - - /** MsgRegisterCounterpartyPayee port_id. */ - public port_id: string; - - /** MsgRegisterCounterpartyPayee channel_id. */ - public channel_id: string; - - /** MsgRegisterCounterpartyPayee relayer. */ - public relayer: string; - - /** MsgRegisterCounterpartyPayee counterparty_payee. */ - public counterparty_payee: string; - - /** - * Encodes the specified MsgRegisterCounterpartyPayee message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayee.verify|verify} messages. - * @param message MsgRegisterCounterpartyPayee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRegisterCounterpartyPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayee.verify|verify} messages. - * @param message MsgRegisterCounterpartyPayee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRegisterCounterpartyPayee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRegisterCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.MsgRegisterCounterpartyPayee; - - /** - * Decodes a MsgRegisterCounterpartyPayee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRegisterCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.MsgRegisterCounterpartyPayee; - - /** - * Verifies a MsgRegisterCounterpartyPayee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRegisterCounterpartyPayee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRegisterCounterpartyPayee - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.MsgRegisterCounterpartyPayee; - - /** - * Creates a plain object from a MsgRegisterCounterpartyPayee message. Also converts values to other types if specified. - * @param message MsgRegisterCounterpartyPayee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.MsgRegisterCounterpartyPayee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRegisterCounterpartyPayee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgRegisterCounterpartyPayeeResponse. */ - interface IMsgRegisterCounterpartyPayeeResponse { - } - - /** Represents a MsgRegisterCounterpartyPayeeResponse. */ - class MsgRegisterCounterpartyPayeeResponse implements IMsgRegisterCounterpartyPayeeResponse { - - /** - * Constructs a new MsgRegisterCounterpartyPayeeResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IMsgRegisterCounterpartyPayeeResponse); - - /** - * Encodes the specified MsgRegisterCounterpartyPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse.verify|verify} messages. - * @param message MsgRegisterCounterpartyPayeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IMsgRegisterCounterpartyPayeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRegisterCounterpartyPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse.verify|verify} messages. - * @param message MsgRegisterCounterpartyPayeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IMsgRegisterCounterpartyPayeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRegisterCounterpartyPayeeResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRegisterCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse; - - /** - * Decodes a MsgRegisterCounterpartyPayeeResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRegisterCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse; - - /** - * Verifies a MsgRegisterCounterpartyPayeeResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRegisterCounterpartyPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRegisterCounterpartyPayeeResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse; - - /** - * Creates a plain object from a MsgRegisterCounterpartyPayeeResponse message. Also converts values to other types if specified. - * @param message MsgRegisterCounterpartyPayeeResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRegisterCounterpartyPayeeResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgPayPacketFee. */ - interface IMsgPayPacketFee { - - /** MsgPayPacketFee fee */ - fee?: (ibc.applications.fee.v1.IFee|null); - - /** MsgPayPacketFee source_port_id */ - source_port_id?: (string|null); - - /** MsgPayPacketFee source_channel_id */ - source_channel_id?: (string|null); - - /** MsgPayPacketFee signer */ - signer?: (string|null); - - /** MsgPayPacketFee relayers */ - relayers?: (string[]|null); - } - - /** Represents a MsgPayPacketFee. */ - class MsgPayPacketFee implements IMsgPayPacketFee { - - /** - * Constructs a new MsgPayPacketFee. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IMsgPayPacketFee); - - /** MsgPayPacketFee fee. */ - public fee?: (ibc.applications.fee.v1.IFee|null); - - /** MsgPayPacketFee source_port_id. */ - public source_port_id: string; - - /** MsgPayPacketFee source_channel_id. */ - public source_channel_id: string; - - /** MsgPayPacketFee signer. */ - public signer: string; - - /** MsgPayPacketFee relayers. */ - public relayers: string[]; - - /** - * Encodes the specified MsgPayPacketFee message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFee.verify|verify} messages. - * @param message MsgPayPacketFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IMsgPayPacketFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgPayPacketFee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFee.verify|verify} messages. - * @param message MsgPayPacketFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IMsgPayPacketFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgPayPacketFee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgPayPacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.MsgPayPacketFee; - - /** - * Decodes a MsgPayPacketFee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgPayPacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.MsgPayPacketFee; - - /** - * Verifies a MsgPayPacketFee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgPayPacketFee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgPayPacketFee - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.MsgPayPacketFee; - - /** - * Creates a plain object from a MsgPayPacketFee message. Also converts values to other types if specified. - * @param message MsgPayPacketFee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.MsgPayPacketFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgPayPacketFee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgPayPacketFeeResponse. */ - interface IMsgPayPacketFeeResponse { - } - - /** Represents a MsgPayPacketFeeResponse. */ - class MsgPayPacketFeeResponse implements IMsgPayPacketFeeResponse { - - /** - * Constructs a new MsgPayPacketFeeResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IMsgPayPacketFeeResponse); - - /** - * Encodes the specified MsgPayPacketFeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeResponse.verify|verify} messages. - * @param message MsgPayPacketFeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IMsgPayPacketFeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgPayPacketFeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeResponse.verify|verify} messages. - * @param message MsgPayPacketFeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IMsgPayPacketFeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgPayPacketFeeResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgPayPacketFeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.MsgPayPacketFeeResponse; - - /** - * Decodes a MsgPayPacketFeeResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgPayPacketFeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.MsgPayPacketFeeResponse; - - /** - * Verifies a MsgPayPacketFeeResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgPayPacketFeeResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgPayPacketFeeResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.MsgPayPacketFeeResponse; - - /** - * Creates a plain object from a MsgPayPacketFeeResponse message. Also converts values to other types if specified. - * @param message MsgPayPacketFeeResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.MsgPayPacketFeeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgPayPacketFeeResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgPayPacketFeeAsync. */ - interface IMsgPayPacketFeeAsync { - - /** MsgPayPacketFeeAsync packet_id */ - packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** MsgPayPacketFeeAsync packet_fee */ - packet_fee?: (ibc.applications.fee.v1.IPacketFee|null); - } - - /** Represents a MsgPayPacketFeeAsync. */ - class MsgPayPacketFeeAsync implements IMsgPayPacketFeeAsync { - - /** - * Constructs a new MsgPayPacketFeeAsync. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IMsgPayPacketFeeAsync); - - /** MsgPayPacketFeeAsync packet_id. */ - public packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** MsgPayPacketFeeAsync packet_fee. */ - public packet_fee?: (ibc.applications.fee.v1.IPacketFee|null); - - /** - * Encodes the specified MsgPayPacketFeeAsync message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsync.verify|verify} messages. - * @param message MsgPayPacketFeeAsync message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IMsgPayPacketFeeAsync, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgPayPacketFeeAsync message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsync.verify|verify} messages. - * @param message MsgPayPacketFeeAsync message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IMsgPayPacketFeeAsync, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgPayPacketFeeAsync message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgPayPacketFeeAsync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.MsgPayPacketFeeAsync; - - /** - * Decodes a MsgPayPacketFeeAsync message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgPayPacketFeeAsync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.MsgPayPacketFeeAsync; - - /** - * Verifies a MsgPayPacketFeeAsync message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgPayPacketFeeAsync message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgPayPacketFeeAsync - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.MsgPayPacketFeeAsync; - - /** - * Creates a plain object from a MsgPayPacketFeeAsync message. Also converts values to other types if specified. - * @param message MsgPayPacketFeeAsync - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.MsgPayPacketFeeAsync, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgPayPacketFeeAsync to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgPayPacketFeeAsyncResponse. */ - interface IMsgPayPacketFeeAsyncResponse { - } - - /** Represents a MsgPayPacketFeeAsyncResponse. */ - class MsgPayPacketFeeAsyncResponse implements IMsgPayPacketFeeAsyncResponse { - - /** - * Constructs a new MsgPayPacketFeeAsyncResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IMsgPayPacketFeeAsyncResponse); - - /** - * Encodes the specified MsgPayPacketFeeAsyncResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse.verify|verify} messages. - * @param message MsgPayPacketFeeAsyncResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IMsgPayPacketFeeAsyncResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgPayPacketFeeAsyncResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse.verify|verify} messages. - * @param message MsgPayPacketFeeAsyncResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IMsgPayPacketFeeAsyncResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgPayPacketFeeAsyncResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgPayPacketFeeAsyncResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse; - - /** - * Decodes a MsgPayPacketFeeAsyncResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgPayPacketFeeAsyncResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse; - - /** - * Verifies a MsgPayPacketFeeAsyncResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgPayPacketFeeAsyncResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgPayPacketFeeAsyncResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse; - - /** - * Creates a plain object from a MsgPayPacketFeeAsyncResponse message. Also converts values to other types if specified. - * @param message MsgPayPacketFeeAsyncResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgPayPacketFeeAsyncResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Fee. */ - interface IFee { - - /** Fee recv_fee */ - recv_fee?: (cosmos.base.v1beta1.ICoin[]|null); - - /** Fee ack_fee */ - ack_fee?: (cosmos.base.v1beta1.ICoin[]|null); - - /** Fee timeout_fee */ - timeout_fee?: (cosmos.base.v1beta1.ICoin[]|null); - } - - /** Represents a Fee. */ - class Fee implements IFee { - - /** - * Constructs a new Fee. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IFee); - - /** Fee recv_fee. */ - public recv_fee: cosmos.base.v1beta1.ICoin[]; - - /** Fee ack_fee. */ - public ack_fee: cosmos.base.v1beta1.ICoin[]; - - /** Fee timeout_fee. */ - public timeout_fee: cosmos.base.v1beta1.ICoin[]; - - /** - * Encodes the specified Fee message. Does not implicitly {@link ibc.applications.fee.v1.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.Fee; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.Fee; - - /** - * Verifies a Fee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Fee - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.Fee; - - /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. - * @param message Fee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.Fee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Fee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketFee. */ - interface IPacketFee { - - /** PacketFee fee */ - fee?: (ibc.applications.fee.v1.IFee|null); - - /** PacketFee refund_address */ - refund_address?: (string|null); - - /** PacketFee relayers */ - relayers?: (string[]|null); - } - - /** Represents a PacketFee. */ - class PacketFee implements IPacketFee { - - /** - * Constructs a new PacketFee. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IPacketFee); - - /** PacketFee fee. */ - public fee?: (ibc.applications.fee.v1.IFee|null); - - /** PacketFee refund_address. */ - public refund_address: string; - - /** PacketFee relayers. */ - public relayers: string[]; - - /** - * Encodes the specified PacketFee message. Does not implicitly {@link ibc.applications.fee.v1.PacketFee.verify|verify} messages. - * @param message PacketFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IPacketFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketFee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.PacketFee.verify|verify} messages. - * @param message PacketFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IPacketFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketFee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.PacketFee; - - /** - * Decodes a PacketFee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.PacketFee; - - /** - * Verifies a PacketFee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketFee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketFee - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.PacketFee; - - /** - * Creates a plain object from a PacketFee message. Also converts values to other types if specified. - * @param message PacketFee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.PacketFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketFee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketFees. */ - interface IPacketFees { - - /** PacketFees packet_fees */ - packet_fees?: (ibc.applications.fee.v1.IPacketFee[]|null); - } - - /** Represents a PacketFees. */ - class PacketFees implements IPacketFees { - - /** - * Constructs a new PacketFees. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IPacketFees); - - /** PacketFees packet_fees. */ - public packet_fees: ibc.applications.fee.v1.IPacketFee[]; - - /** - * Encodes the specified PacketFees message. Does not implicitly {@link ibc.applications.fee.v1.PacketFees.verify|verify} messages. - * @param message PacketFees message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IPacketFees, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketFees message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.PacketFees.verify|verify} messages. - * @param message PacketFees message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IPacketFees, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketFees message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.PacketFees; - - /** - * Decodes a PacketFees message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.PacketFees; - - /** - * Verifies a PacketFees message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketFees message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketFees - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.PacketFees; - - /** - * Creates a plain object from a PacketFees message. Also converts values to other types if specified. - * @param message PacketFees - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.PacketFees, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketFees to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IdentifiedPacketFees. */ - interface IIdentifiedPacketFees { - - /** IdentifiedPacketFees packet_id */ - packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** IdentifiedPacketFees packet_fees */ - packet_fees?: (ibc.applications.fee.v1.IPacketFee[]|null); - } - - /** Represents an IdentifiedPacketFees. */ - class IdentifiedPacketFees implements IIdentifiedPacketFees { - - /** - * Constructs a new IdentifiedPacketFees. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IIdentifiedPacketFees); - - /** IdentifiedPacketFees packet_id. */ - public packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** IdentifiedPacketFees packet_fees. */ - public packet_fees: ibc.applications.fee.v1.IPacketFee[]; - - /** - * Encodes the specified IdentifiedPacketFees message. Does not implicitly {@link ibc.applications.fee.v1.IdentifiedPacketFees.verify|verify} messages. - * @param message IdentifiedPacketFees message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IIdentifiedPacketFees, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IdentifiedPacketFees message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.IdentifiedPacketFees.verify|verify} messages. - * @param message IdentifiedPacketFees message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IIdentifiedPacketFees, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IdentifiedPacketFees message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentifiedPacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.IdentifiedPacketFees; - - /** - * Decodes an IdentifiedPacketFees message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentifiedPacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.IdentifiedPacketFees; - - /** - * Verifies an IdentifiedPacketFees message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IdentifiedPacketFees message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentifiedPacketFees - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.IdentifiedPacketFees; - - /** - * Creates a plain object from an IdentifiedPacketFees message. Also converts values to other types if specified. - * @param message IdentifiedPacketFees - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.IdentifiedPacketFees, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IdentifiedPacketFees to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IncentivizedAcknowledgement. */ - interface IIncentivizedAcknowledgement { - - /** IncentivizedAcknowledgement app_acknowledgement */ - app_acknowledgement?: (Uint8Array|null); - - /** IncentivizedAcknowledgement forward_relayer_address */ - forward_relayer_address?: (string|null); - - /** IncentivizedAcknowledgement underlying_app_success */ - underlying_app_success?: (boolean|null); - } - - /** Represents an IncentivizedAcknowledgement. */ - class IncentivizedAcknowledgement implements IIncentivizedAcknowledgement { - - /** - * Constructs a new IncentivizedAcknowledgement. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IIncentivizedAcknowledgement); - - /** IncentivizedAcknowledgement app_acknowledgement. */ - public app_acknowledgement: Uint8Array; - - /** IncentivizedAcknowledgement forward_relayer_address. */ - public forward_relayer_address: string; - - /** IncentivizedAcknowledgement underlying_app_success. */ - public underlying_app_success: boolean; - - /** - * Encodes the specified IncentivizedAcknowledgement message. Does not implicitly {@link ibc.applications.fee.v1.IncentivizedAcknowledgement.verify|verify} messages. - * @param message IncentivizedAcknowledgement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IIncentivizedAcknowledgement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IncentivizedAcknowledgement message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.IncentivizedAcknowledgement.verify|verify} messages. - * @param message IncentivizedAcknowledgement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IIncentivizedAcknowledgement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IncentivizedAcknowledgement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IncentivizedAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.IncentivizedAcknowledgement; - - /** - * Decodes an IncentivizedAcknowledgement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IncentivizedAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.IncentivizedAcknowledgement; - - /** - * Verifies an IncentivizedAcknowledgement message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IncentivizedAcknowledgement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IncentivizedAcknowledgement - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.IncentivizedAcknowledgement; - - /** - * Creates a plain object from an IncentivizedAcknowledgement message. Also converts values to other types if specified. - * @param message IncentivizedAcknowledgement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.IncentivizedAcknowledgement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IncentivizedAcknowledgement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls IncentivizedPackets. - * @param request QueryIncentivizedPacketsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryIncentivizedPacketsResponse - */ - public incentivizedPackets(request: ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest, callback: ibc.applications.fee.v1.Query.IncentivizedPacketsCallback): void; - - /** - * Calls IncentivizedPackets. - * @param request QueryIncentivizedPacketsRequest message or plain object - * @returns Promise - */ - public incentivizedPackets(request: ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest): Promise; - - /** - * Calls IncentivizedPacket. - * @param request QueryIncentivizedPacketRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryIncentivizedPacketResponse - */ - public incentivizedPacket(request: ibc.applications.fee.v1.IQueryIncentivizedPacketRequest, callback: ibc.applications.fee.v1.Query.IncentivizedPacketCallback): void; - - /** - * Calls IncentivizedPacket. - * @param request QueryIncentivizedPacketRequest message or plain object - * @returns Promise - */ - public incentivizedPacket(request: ibc.applications.fee.v1.IQueryIncentivizedPacketRequest): Promise; - - /** - * Calls IncentivizedPacketsForChannel. - * @param request QueryIncentivizedPacketsForChannelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryIncentivizedPacketsForChannelResponse - */ - public incentivizedPacketsForChannel(request: ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest, callback: ibc.applications.fee.v1.Query.IncentivizedPacketsForChannelCallback): void; - - /** - * Calls IncentivizedPacketsForChannel. - * @param request QueryIncentivizedPacketsForChannelRequest message or plain object - * @returns Promise - */ - public incentivizedPacketsForChannel(request: ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest): Promise; - - /** - * Calls TotalRecvFees. - * @param request QueryTotalRecvFeesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryTotalRecvFeesResponse - */ - public totalRecvFees(request: ibc.applications.fee.v1.IQueryTotalRecvFeesRequest, callback: ibc.applications.fee.v1.Query.TotalRecvFeesCallback): void; - - /** - * Calls TotalRecvFees. - * @param request QueryTotalRecvFeesRequest message or plain object - * @returns Promise - */ - public totalRecvFees(request: ibc.applications.fee.v1.IQueryTotalRecvFeesRequest): Promise; - - /** - * Calls TotalAckFees. - * @param request QueryTotalAckFeesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryTotalAckFeesResponse - */ - public totalAckFees(request: ibc.applications.fee.v1.IQueryTotalAckFeesRequest, callback: ibc.applications.fee.v1.Query.TotalAckFeesCallback): void; - - /** - * Calls TotalAckFees. - * @param request QueryTotalAckFeesRequest message or plain object - * @returns Promise - */ - public totalAckFees(request: ibc.applications.fee.v1.IQueryTotalAckFeesRequest): Promise; - - /** - * Calls TotalTimeoutFees. - * @param request QueryTotalTimeoutFeesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryTotalTimeoutFeesResponse - */ - public totalTimeoutFees(request: ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest, callback: ibc.applications.fee.v1.Query.TotalTimeoutFeesCallback): void; - - /** - * Calls TotalTimeoutFees. - * @param request QueryTotalTimeoutFeesRequest message or plain object - * @returns Promise - */ - public totalTimeoutFees(request: ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest): Promise; - - /** - * Calls Payee. - * @param request QueryPayeeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPayeeResponse - */ - public payee(request: ibc.applications.fee.v1.IQueryPayeeRequest, callback: ibc.applications.fee.v1.Query.PayeeCallback): void; - - /** - * Calls Payee. - * @param request QueryPayeeRequest message or plain object - * @returns Promise - */ - public payee(request: ibc.applications.fee.v1.IQueryPayeeRequest): Promise; - - /** - * Calls CounterpartyPayee. - * @param request QueryCounterpartyPayeeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryCounterpartyPayeeResponse - */ - public counterpartyPayee(request: ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest, callback: ibc.applications.fee.v1.Query.CounterpartyPayeeCallback): void; - - /** - * Calls CounterpartyPayee. - * @param request QueryCounterpartyPayeeRequest message or plain object - * @returns Promise - */ - public counterpartyPayee(request: ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest): Promise; - - /** - * Calls FeeEnabledChannels. - * @param request QueryFeeEnabledChannelsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryFeeEnabledChannelsResponse - */ - public feeEnabledChannels(request: ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest, callback: ibc.applications.fee.v1.Query.FeeEnabledChannelsCallback): void; - - /** - * Calls FeeEnabledChannels. - * @param request QueryFeeEnabledChannelsRequest message or plain object - * @returns Promise - */ - public feeEnabledChannels(request: ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest): Promise; - - /** - * Calls FeeEnabledChannel. - * @param request QueryFeeEnabledChannelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryFeeEnabledChannelResponse - */ - public feeEnabledChannel(request: ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest, callback: ibc.applications.fee.v1.Query.FeeEnabledChannelCallback): void; - - /** - * Calls FeeEnabledChannel. - * @param request QueryFeeEnabledChannelRequest message or plain object - * @returns Promise - */ - public feeEnabledChannel(request: ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#incentivizedPackets}. - * @param error Error, if any - * @param [response] QueryIncentivizedPacketsResponse - */ - type IncentivizedPacketsCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryIncentivizedPacketsResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#incentivizedPacket}. - * @param error Error, if any - * @param [response] QueryIncentivizedPacketResponse - */ - type IncentivizedPacketCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryIncentivizedPacketResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#incentivizedPacketsForChannel}. - * @param error Error, if any - * @param [response] QueryIncentivizedPacketsForChannelResponse - */ - type IncentivizedPacketsForChannelCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#totalRecvFees}. - * @param error Error, if any - * @param [response] QueryTotalRecvFeesResponse - */ - type TotalRecvFeesCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryTotalRecvFeesResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#totalAckFees}. - * @param error Error, if any - * @param [response] QueryTotalAckFeesResponse - */ - type TotalAckFeesCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryTotalAckFeesResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#totalTimeoutFees}. - * @param error Error, if any - * @param [response] QueryTotalTimeoutFeesResponse - */ - type TotalTimeoutFeesCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#payee}. - * @param error Error, if any - * @param [response] QueryPayeeResponse - */ - type PayeeCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryPayeeResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#counterpartyPayee}. - * @param error Error, if any - * @param [response] QueryCounterpartyPayeeResponse - */ - type CounterpartyPayeeCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryCounterpartyPayeeResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#feeEnabledChannels}. - * @param error Error, if any - * @param [response] QueryFeeEnabledChannelsResponse - */ - type FeeEnabledChannelsCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse) => void; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#feeEnabledChannel}. - * @param error Error, if any - * @param [response] QueryFeeEnabledChannelResponse - */ - type FeeEnabledChannelCallback = (error: (Error|null), response?: ibc.applications.fee.v1.QueryFeeEnabledChannelResponse) => void; - } - - /** Properties of a QueryIncentivizedPacketsRequest. */ - interface IQueryIncentivizedPacketsRequest { - - /** QueryIncentivizedPacketsRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** QueryIncentivizedPacketsRequest query_height */ - query_height?: (Long|null); - } - - /** Represents a QueryIncentivizedPacketsRequest. */ - class QueryIncentivizedPacketsRequest implements IQueryIncentivizedPacketsRequest { - - /** - * Constructs a new QueryIncentivizedPacketsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest); - - /** QueryIncentivizedPacketsRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** QueryIncentivizedPacketsRequest query_height. */ - public query_height: Long; - - /** - * Encodes the specified QueryIncentivizedPacketsRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsRequest.verify|verify} messages. - * @param message QueryIncentivizedPacketsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryIncentivizedPacketsRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsRequest.verify|verify} messages. - * @param message QueryIncentivizedPacketsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryIncentivizedPacketsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryIncentivizedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryIncentivizedPacketsRequest; - - /** - * Decodes a QueryIncentivizedPacketsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryIncentivizedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryIncentivizedPacketsRequest; - - /** - * Verifies a QueryIncentivizedPacketsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryIncentivizedPacketsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryIncentivizedPacketsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryIncentivizedPacketsRequest; - - /** - * Creates a plain object from a QueryIncentivizedPacketsRequest message. Also converts values to other types if specified. - * @param message QueryIncentivizedPacketsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryIncentivizedPacketsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryIncentivizedPacketsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryIncentivizedPacketsResponse. */ - interface IQueryIncentivizedPacketsResponse { - - /** QueryIncentivizedPacketsResponse incentivized_packets */ - incentivized_packets?: (ibc.applications.fee.v1.IIdentifiedPacketFees[]|null); - } - - /** Represents a QueryIncentivizedPacketsResponse. */ - class QueryIncentivizedPacketsResponse implements IQueryIncentivizedPacketsResponse { - - /** - * Constructs a new QueryIncentivizedPacketsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryIncentivizedPacketsResponse); - - /** QueryIncentivizedPacketsResponse incentivized_packets. */ - public incentivized_packets: ibc.applications.fee.v1.IIdentifiedPacketFees[]; - - /** - * Encodes the specified QueryIncentivizedPacketsResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.verify|verify} messages. - * @param message QueryIncentivizedPacketsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryIncentivizedPacketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryIncentivizedPacketsResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.verify|verify} messages. - * @param message QueryIncentivizedPacketsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryIncentivizedPacketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryIncentivizedPacketsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryIncentivizedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryIncentivizedPacketsResponse; - - /** - * Decodes a QueryIncentivizedPacketsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryIncentivizedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryIncentivizedPacketsResponse; - - /** - * Verifies a QueryIncentivizedPacketsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryIncentivizedPacketsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryIncentivizedPacketsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryIncentivizedPacketsResponse; - - /** - * Creates a plain object from a QueryIncentivizedPacketsResponse message. Also converts values to other types if specified. - * @param message QueryIncentivizedPacketsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryIncentivizedPacketsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryIncentivizedPacketsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryIncentivizedPacketRequest. */ - interface IQueryIncentivizedPacketRequest { - - /** QueryIncentivizedPacketRequest packet_id */ - packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** QueryIncentivizedPacketRequest query_height */ - query_height?: (Long|null); - } - - /** Represents a QueryIncentivizedPacketRequest. */ - class QueryIncentivizedPacketRequest implements IQueryIncentivizedPacketRequest { - - /** - * Constructs a new QueryIncentivizedPacketRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryIncentivizedPacketRequest); - - /** QueryIncentivizedPacketRequest packet_id. */ - public packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** QueryIncentivizedPacketRequest query_height. */ - public query_height: Long; - - /** - * Encodes the specified QueryIncentivizedPacketRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketRequest.verify|verify} messages. - * @param message QueryIncentivizedPacketRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryIncentivizedPacketRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryIncentivizedPacketRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketRequest.verify|verify} messages. - * @param message QueryIncentivizedPacketRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryIncentivizedPacketRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryIncentivizedPacketRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryIncentivizedPacketRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryIncentivizedPacketRequest; - - /** - * Decodes a QueryIncentivizedPacketRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryIncentivizedPacketRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryIncentivizedPacketRequest; - - /** - * Verifies a QueryIncentivizedPacketRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryIncentivizedPacketRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryIncentivizedPacketRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryIncentivizedPacketRequest; - - /** - * Creates a plain object from a QueryIncentivizedPacketRequest message. Also converts values to other types if specified. - * @param message QueryIncentivizedPacketRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryIncentivizedPacketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryIncentivizedPacketRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryIncentivizedPacketResponse. */ - interface IQueryIncentivizedPacketResponse { - - /** QueryIncentivizedPacketResponse incentivized_packet */ - incentivized_packet?: (ibc.applications.fee.v1.IIdentifiedPacketFees|null); - } - - /** Represents a QueryIncentivizedPacketResponse. */ - class QueryIncentivizedPacketResponse implements IQueryIncentivizedPacketResponse { - - /** - * Constructs a new QueryIncentivizedPacketResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryIncentivizedPacketResponse); - - /** QueryIncentivizedPacketResponse incentivized_packet. */ - public incentivized_packet?: (ibc.applications.fee.v1.IIdentifiedPacketFees|null); - - /** - * Encodes the specified QueryIncentivizedPacketResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketResponse.verify|verify} messages. - * @param message QueryIncentivizedPacketResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryIncentivizedPacketResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryIncentivizedPacketResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketResponse.verify|verify} messages. - * @param message QueryIncentivizedPacketResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryIncentivizedPacketResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryIncentivizedPacketResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryIncentivizedPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryIncentivizedPacketResponse; - - /** - * Decodes a QueryIncentivizedPacketResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryIncentivizedPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryIncentivizedPacketResponse; - - /** - * Verifies a QueryIncentivizedPacketResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryIncentivizedPacketResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryIncentivizedPacketResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryIncentivizedPacketResponse; - - /** - * Creates a plain object from a QueryIncentivizedPacketResponse message. Also converts values to other types if specified. - * @param message QueryIncentivizedPacketResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryIncentivizedPacketResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryIncentivizedPacketResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryIncentivizedPacketsForChannelRequest. */ - interface IQueryIncentivizedPacketsForChannelRequest { - - /** QueryIncentivizedPacketsForChannelRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** QueryIncentivizedPacketsForChannelRequest port_id */ - port_id?: (string|null); - - /** QueryIncentivizedPacketsForChannelRequest channel_id */ - channel_id?: (string|null); - - /** QueryIncentivizedPacketsForChannelRequest query_height */ - query_height?: (Long|null); - } - - /** Represents a QueryIncentivizedPacketsForChannelRequest. */ - class QueryIncentivizedPacketsForChannelRequest implements IQueryIncentivizedPacketsForChannelRequest { - - /** - * Constructs a new QueryIncentivizedPacketsForChannelRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest); - - /** QueryIncentivizedPacketsForChannelRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** QueryIncentivizedPacketsForChannelRequest port_id. */ - public port_id: string; - - /** QueryIncentivizedPacketsForChannelRequest channel_id. */ - public channel_id: string; - - /** QueryIncentivizedPacketsForChannelRequest query_height. */ - public query_height: Long; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest.verify|verify} messages. - * @param message QueryIncentivizedPacketsForChannelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest.verify|verify} messages. - * @param message QueryIncentivizedPacketsForChannelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryIncentivizedPacketsForChannelRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryIncentivizedPacketsForChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest; - - /** - * Decodes a QueryIncentivizedPacketsForChannelRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryIncentivizedPacketsForChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest; - - /** - * Verifies a QueryIncentivizedPacketsForChannelRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryIncentivizedPacketsForChannelRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryIncentivizedPacketsForChannelRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest; - - /** - * Creates a plain object from a QueryIncentivizedPacketsForChannelRequest message. Also converts values to other types if specified. - * @param message QueryIncentivizedPacketsForChannelRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryIncentivizedPacketsForChannelRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryIncentivizedPacketsForChannelResponse. */ - interface IQueryIncentivizedPacketsForChannelResponse { - - /** QueryIncentivizedPacketsForChannelResponse incentivized_packets */ - incentivized_packets?: (ibc.applications.fee.v1.IIdentifiedPacketFees[]|null); - } - - /** Represents a QueryIncentivizedPacketsForChannelResponse. */ - class QueryIncentivizedPacketsForChannelResponse implements IQueryIncentivizedPacketsForChannelResponse { - - /** - * Constructs a new QueryIncentivizedPacketsForChannelResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelResponse); - - /** QueryIncentivizedPacketsForChannelResponse incentivized_packets. */ - public incentivized_packets: ibc.applications.fee.v1.IIdentifiedPacketFees[]; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.verify|verify} messages. - * @param message QueryIncentivizedPacketsForChannelResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.verify|verify} messages. - * @param message QueryIncentivizedPacketsForChannelResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryIncentivizedPacketsForChannelResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryIncentivizedPacketsForChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse; - - /** - * Decodes a QueryIncentivizedPacketsForChannelResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryIncentivizedPacketsForChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse; - - /** - * Verifies a QueryIncentivizedPacketsForChannelResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryIncentivizedPacketsForChannelResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryIncentivizedPacketsForChannelResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse; - - /** - * Creates a plain object from a QueryIncentivizedPacketsForChannelResponse message. Also converts values to other types if specified. - * @param message QueryIncentivizedPacketsForChannelResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryIncentivizedPacketsForChannelResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTotalRecvFeesRequest. */ - interface IQueryTotalRecvFeesRequest { - - /** QueryTotalRecvFeesRequest packet_id */ - packet_id?: (ibc.core.channel.v1.IPacketId|null); - } - - /** Represents a QueryTotalRecvFeesRequest. */ - class QueryTotalRecvFeesRequest implements IQueryTotalRecvFeesRequest { - - /** - * Constructs a new QueryTotalRecvFeesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryTotalRecvFeesRequest); - - /** QueryTotalRecvFeesRequest packet_id. */ - public packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** - * Encodes the specified QueryTotalRecvFeesRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesRequest.verify|verify} messages. - * @param message QueryTotalRecvFeesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryTotalRecvFeesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryTotalRecvFeesRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesRequest.verify|verify} messages. - * @param message QueryTotalRecvFeesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryTotalRecvFeesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryTotalRecvFeesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTotalRecvFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryTotalRecvFeesRequest; - - /** - * Decodes a QueryTotalRecvFeesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTotalRecvFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryTotalRecvFeesRequest; - - /** - * Verifies a QueryTotalRecvFeesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryTotalRecvFeesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTotalRecvFeesRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryTotalRecvFeesRequest; - - /** - * Creates a plain object from a QueryTotalRecvFeesRequest message. Also converts values to other types if specified. - * @param message QueryTotalRecvFeesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryTotalRecvFeesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTotalRecvFeesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTotalRecvFeesResponse. */ - interface IQueryTotalRecvFeesResponse { - - /** QueryTotalRecvFeesResponse recv_fees */ - recv_fees?: (cosmos.base.v1beta1.ICoin[]|null); - } - - /** Represents a QueryTotalRecvFeesResponse. */ - class QueryTotalRecvFeesResponse implements IQueryTotalRecvFeesResponse { - - /** - * Constructs a new QueryTotalRecvFeesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryTotalRecvFeesResponse); - - /** QueryTotalRecvFeesResponse recv_fees. */ - public recv_fees: cosmos.base.v1beta1.ICoin[]; - - /** - * Encodes the specified QueryTotalRecvFeesResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesResponse.verify|verify} messages. - * @param message QueryTotalRecvFeesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryTotalRecvFeesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryTotalRecvFeesResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesResponse.verify|verify} messages. - * @param message QueryTotalRecvFeesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryTotalRecvFeesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryTotalRecvFeesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTotalRecvFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryTotalRecvFeesResponse; - - /** - * Decodes a QueryTotalRecvFeesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTotalRecvFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryTotalRecvFeesResponse; - - /** - * Verifies a QueryTotalRecvFeesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryTotalRecvFeesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTotalRecvFeesResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryTotalRecvFeesResponse; - - /** - * Creates a plain object from a QueryTotalRecvFeesResponse message. Also converts values to other types if specified. - * @param message QueryTotalRecvFeesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryTotalRecvFeesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTotalRecvFeesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTotalAckFeesRequest. */ - interface IQueryTotalAckFeesRequest { - - /** QueryTotalAckFeesRequest packet_id */ - packet_id?: (ibc.core.channel.v1.IPacketId|null); - } - - /** Represents a QueryTotalAckFeesRequest. */ - class QueryTotalAckFeesRequest implements IQueryTotalAckFeesRequest { - - /** - * Constructs a new QueryTotalAckFeesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryTotalAckFeesRequest); - - /** QueryTotalAckFeesRequest packet_id. */ - public packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** - * Encodes the specified QueryTotalAckFeesRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesRequest.verify|verify} messages. - * @param message QueryTotalAckFeesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryTotalAckFeesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryTotalAckFeesRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesRequest.verify|verify} messages. - * @param message QueryTotalAckFeesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryTotalAckFeesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryTotalAckFeesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTotalAckFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryTotalAckFeesRequest; - - /** - * Decodes a QueryTotalAckFeesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTotalAckFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryTotalAckFeesRequest; - - /** - * Verifies a QueryTotalAckFeesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryTotalAckFeesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTotalAckFeesRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryTotalAckFeesRequest; - - /** - * Creates a plain object from a QueryTotalAckFeesRequest message. Also converts values to other types if specified. - * @param message QueryTotalAckFeesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryTotalAckFeesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTotalAckFeesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTotalAckFeesResponse. */ - interface IQueryTotalAckFeesResponse { - - /** QueryTotalAckFeesResponse ack_fees */ - ack_fees?: (cosmos.base.v1beta1.ICoin[]|null); - } - - /** Represents a QueryTotalAckFeesResponse. */ - class QueryTotalAckFeesResponse implements IQueryTotalAckFeesResponse { - - /** - * Constructs a new QueryTotalAckFeesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryTotalAckFeesResponse); - - /** QueryTotalAckFeesResponse ack_fees. */ - public ack_fees: cosmos.base.v1beta1.ICoin[]; - - /** - * Encodes the specified QueryTotalAckFeesResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesResponse.verify|verify} messages. - * @param message QueryTotalAckFeesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryTotalAckFeesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryTotalAckFeesResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesResponse.verify|verify} messages. - * @param message QueryTotalAckFeesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryTotalAckFeesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryTotalAckFeesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTotalAckFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryTotalAckFeesResponse; - - /** - * Decodes a QueryTotalAckFeesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTotalAckFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryTotalAckFeesResponse; - - /** - * Verifies a QueryTotalAckFeesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryTotalAckFeesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTotalAckFeesResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryTotalAckFeesResponse; - - /** - * Creates a plain object from a QueryTotalAckFeesResponse message. Also converts values to other types if specified. - * @param message QueryTotalAckFeesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryTotalAckFeesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTotalAckFeesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTotalTimeoutFeesRequest. */ - interface IQueryTotalTimeoutFeesRequest { - - /** QueryTotalTimeoutFeesRequest packet_id */ - packet_id?: (ibc.core.channel.v1.IPacketId|null); - } - - /** Represents a QueryTotalTimeoutFeesRequest. */ - class QueryTotalTimeoutFeesRequest implements IQueryTotalTimeoutFeesRequest { - - /** - * Constructs a new QueryTotalTimeoutFeesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest); - - /** QueryTotalTimeoutFeesRequest packet_id. */ - public packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** - * Encodes the specified QueryTotalTimeoutFeesRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest.verify|verify} messages. - * @param message QueryTotalTimeoutFeesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryTotalTimeoutFeesRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest.verify|verify} messages. - * @param message QueryTotalTimeoutFeesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryTotalTimeoutFeesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTotalTimeoutFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest; - - /** - * Decodes a QueryTotalTimeoutFeesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTotalTimeoutFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest; - - /** - * Verifies a QueryTotalTimeoutFeesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryTotalTimeoutFeesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTotalTimeoutFeesRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest; - - /** - * Creates a plain object from a QueryTotalTimeoutFeesRequest message. Also converts values to other types if specified. - * @param message QueryTotalTimeoutFeesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTotalTimeoutFeesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTotalTimeoutFeesResponse. */ - interface IQueryTotalTimeoutFeesResponse { - - /** QueryTotalTimeoutFeesResponse timeout_fees */ - timeout_fees?: (cosmos.base.v1beta1.ICoin[]|null); - } - - /** Represents a QueryTotalTimeoutFeesResponse. */ - class QueryTotalTimeoutFeesResponse implements IQueryTotalTimeoutFeesResponse { - - /** - * Constructs a new QueryTotalTimeoutFeesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryTotalTimeoutFeesResponse); - - /** QueryTotalTimeoutFeesResponse timeout_fees. */ - public timeout_fees: cosmos.base.v1beta1.ICoin[]; - - /** - * Encodes the specified QueryTotalTimeoutFeesResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.verify|verify} messages. - * @param message QueryTotalTimeoutFeesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryTotalTimeoutFeesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryTotalTimeoutFeesResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.verify|verify} messages. - * @param message QueryTotalTimeoutFeesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryTotalTimeoutFeesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryTotalTimeoutFeesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTotalTimeoutFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse; - - /** - * Decodes a QueryTotalTimeoutFeesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTotalTimeoutFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse; - - /** - * Verifies a QueryTotalTimeoutFeesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryTotalTimeoutFeesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTotalTimeoutFeesResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse; - - /** - * Creates a plain object from a QueryTotalTimeoutFeesResponse message. Also converts values to other types if specified. - * @param message QueryTotalTimeoutFeesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTotalTimeoutFeesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPayeeRequest. */ - interface IQueryPayeeRequest { - - /** QueryPayeeRequest channel_id */ - channel_id?: (string|null); - - /** QueryPayeeRequest relayer */ - relayer?: (string|null); - } - - /** Represents a QueryPayeeRequest. */ - class QueryPayeeRequest implements IQueryPayeeRequest { - - /** - * Constructs a new QueryPayeeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryPayeeRequest); - - /** QueryPayeeRequest channel_id. */ - public channel_id: string; - - /** QueryPayeeRequest relayer. */ - public relayer: string; - - /** - * Encodes the specified QueryPayeeRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeRequest.verify|verify} messages. - * @param message QueryPayeeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryPayeeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPayeeRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeRequest.verify|verify} messages. - * @param message QueryPayeeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryPayeeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPayeeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryPayeeRequest; - - /** - * Decodes a QueryPayeeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryPayeeRequest; - - /** - * Verifies a QueryPayeeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPayeeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPayeeRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryPayeeRequest; - - /** - * Creates a plain object from a QueryPayeeRequest message. Also converts values to other types if specified. - * @param message QueryPayeeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryPayeeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPayeeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPayeeResponse. */ - interface IQueryPayeeResponse { - - /** QueryPayeeResponse payee_address */ - payee_address?: (string|null); - } - - /** Represents a QueryPayeeResponse. */ - class QueryPayeeResponse implements IQueryPayeeResponse { - - /** - * Constructs a new QueryPayeeResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryPayeeResponse); - - /** QueryPayeeResponse payee_address. */ - public payee_address: string; - - /** - * Encodes the specified QueryPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeResponse.verify|verify} messages. - * @param message QueryPayeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryPayeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeResponse.verify|verify} messages. - * @param message QueryPayeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryPayeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPayeeResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryPayeeResponse; - - /** - * Decodes a QueryPayeeResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryPayeeResponse; - - /** - * Verifies a QueryPayeeResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPayeeResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryPayeeResponse; - - /** - * Creates a plain object from a QueryPayeeResponse message. Also converts values to other types if specified. - * @param message QueryPayeeResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryPayeeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPayeeResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryCounterpartyPayeeRequest. */ - interface IQueryCounterpartyPayeeRequest { - - /** QueryCounterpartyPayeeRequest channel_id */ - channel_id?: (string|null); - - /** QueryCounterpartyPayeeRequest relayer */ - relayer?: (string|null); - } - - /** Represents a QueryCounterpartyPayeeRequest. */ - class QueryCounterpartyPayeeRequest implements IQueryCounterpartyPayeeRequest { - - /** - * Constructs a new QueryCounterpartyPayeeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest); - - /** QueryCounterpartyPayeeRequest channel_id. */ - public channel_id: string; - - /** QueryCounterpartyPayeeRequest relayer. */ - public relayer: string; - - /** - * Encodes the specified QueryCounterpartyPayeeRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeRequest.verify|verify} messages. - * @param message QueryCounterpartyPayeeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryCounterpartyPayeeRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeRequest.verify|verify} messages. - * @param message QueryCounterpartyPayeeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryCounterpartyPayeeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryCounterpartyPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryCounterpartyPayeeRequest; - - /** - * Decodes a QueryCounterpartyPayeeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryCounterpartyPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryCounterpartyPayeeRequest; - - /** - * Verifies a QueryCounterpartyPayeeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryCounterpartyPayeeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryCounterpartyPayeeRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryCounterpartyPayeeRequest; - - /** - * Creates a plain object from a QueryCounterpartyPayeeRequest message. Also converts values to other types if specified. - * @param message QueryCounterpartyPayeeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryCounterpartyPayeeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryCounterpartyPayeeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryCounterpartyPayeeResponse. */ - interface IQueryCounterpartyPayeeResponse { - - /** QueryCounterpartyPayeeResponse counterparty_payee */ - counterparty_payee?: (string|null); - } - - /** Represents a QueryCounterpartyPayeeResponse. */ - class QueryCounterpartyPayeeResponse implements IQueryCounterpartyPayeeResponse { - - /** - * Constructs a new QueryCounterpartyPayeeResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryCounterpartyPayeeResponse); - - /** QueryCounterpartyPayeeResponse counterparty_payee. */ - public counterparty_payee: string; - - /** - * Encodes the specified QueryCounterpartyPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeResponse.verify|verify} messages. - * @param message QueryCounterpartyPayeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryCounterpartyPayeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryCounterpartyPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeResponse.verify|verify} messages. - * @param message QueryCounterpartyPayeeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryCounterpartyPayeeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryCounterpartyPayeeResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryCounterpartyPayeeResponse; - - /** - * Decodes a QueryCounterpartyPayeeResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryCounterpartyPayeeResponse; - - /** - * Verifies a QueryCounterpartyPayeeResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryCounterpartyPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryCounterpartyPayeeResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryCounterpartyPayeeResponse; - - /** - * Creates a plain object from a QueryCounterpartyPayeeResponse message. Also converts values to other types if specified. - * @param message QueryCounterpartyPayeeResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryCounterpartyPayeeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryCounterpartyPayeeResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryFeeEnabledChannelsRequest. */ - interface IQueryFeeEnabledChannelsRequest { - - /** QueryFeeEnabledChannelsRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** QueryFeeEnabledChannelsRequest query_height */ - query_height?: (Long|null); - } - - /** Represents a QueryFeeEnabledChannelsRequest. */ - class QueryFeeEnabledChannelsRequest implements IQueryFeeEnabledChannelsRequest { - - /** - * Constructs a new QueryFeeEnabledChannelsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest); - - /** QueryFeeEnabledChannelsRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** QueryFeeEnabledChannelsRequest query_height. */ - public query_height: Long; - - /** - * Encodes the specified QueryFeeEnabledChannelsRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest.verify|verify} messages. - * @param message QueryFeeEnabledChannelsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryFeeEnabledChannelsRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest.verify|verify} messages. - * @param message QueryFeeEnabledChannelsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryFeeEnabledChannelsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryFeeEnabledChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest; - - /** - * Decodes a QueryFeeEnabledChannelsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryFeeEnabledChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest; - - /** - * Verifies a QueryFeeEnabledChannelsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryFeeEnabledChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryFeeEnabledChannelsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest; - - /** - * Creates a plain object from a QueryFeeEnabledChannelsRequest message. Also converts values to other types if specified. - * @param message QueryFeeEnabledChannelsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryFeeEnabledChannelsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryFeeEnabledChannelsResponse. */ - interface IQueryFeeEnabledChannelsResponse { - - /** QueryFeeEnabledChannelsResponse fee_enabled_channels */ - fee_enabled_channels?: (ibc.applications.fee.v1.IFeeEnabledChannel[]|null); - } - - /** Represents a QueryFeeEnabledChannelsResponse. */ - class QueryFeeEnabledChannelsResponse implements IQueryFeeEnabledChannelsResponse { - - /** - * Constructs a new QueryFeeEnabledChannelsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryFeeEnabledChannelsResponse); - - /** QueryFeeEnabledChannelsResponse fee_enabled_channels. */ - public fee_enabled_channels: ibc.applications.fee.v1.IFeeEnabledChannel[]; - - /** - * Encodes the specified QueryFeeEnabledChannelsResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.verify|verify} messages. - * @param message QueryFeeEnabledChannelsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryFeeEnabledChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryFeeEnabledChannelsResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.verify|verify} messages. - * @param message QueryFeeEnabledChannelsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryFeeEnabledChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryFeeEnabledChannelsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryFeeEnabledChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse; - - /** - * Decodes a QueryFeeEnabledChannelsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryFeeEnabledChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse; - - /** - * Verifies a QueryFeeEnabledChannelsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryFeeEnabledChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryFeeEnabledChannelsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse; - - /** - * Creates a plain object from a QueryFeeEnabledChannelsResponse message. Also converts values to other types if specified. - * @param message QueryFeeEnabledChannelsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryFeeEnabledChannelsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryFeeEnabledChannelRequest. */ - interface IQueryFeeEnabledChannelRequest { - - /** QueryFeeEnabledChannelRequest port_id */ - port_id?: (string|null); - - /** QueryFeeEnabledChannelRequest channel_id */ - channel_id?: (string|null); - } - - /** Represents a QueryFeeEnabledChannelRequest. */ - class QueryFeeEnabledChannelRequest implements IQueryFeeEnabledChannelRequest { - - /** - * Constructs a new QueryFeeEnabledChannelRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest); - - /** QueryFeeEnabledChannelRequest port_id. */ - public port_id: string; - - /** QueryFeeEnabledChannelRequest channel_id. */ - public channel_id: string; - - /** - * Encodes the specified QueryFeeEnabledChannelRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelRequest.verify|verify} messages. - * @param message QueryFeeEnabledChannelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryFeeEnabledChannelRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelRequest.verify|verify} messages. - * @param message QueryFeeEnabledChannelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryFeeEnabledChannelRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryFeeEnabledChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryFeeEnabledChannelRequest; - - /** - * Decodes a QueryFeeEnabledChannelRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryFeeEnabledChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryFeeEnabledChannelRequest; - - /** - * Verifies a QueryFeeEnabledChannelRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryFeeEnabledChannelRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryFeeEnabledChannelRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryFeeEnabledChannelRequest; - - /** - * Creates a plain object from a QueryFeeEnabledChannelRequest message. Also converts values to other types if specified. - * @param message QueryFeeEnabledChannelRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryFeeEnabledChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryFeeEnabledChannelRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryFeeEnabledChannelResponse. */ - interface IQueryFeeEnabledChannelResponse { - - /** QueryFeeEnabledChannelResponse fee_enabled */ - fee_enabled?: (boolean|null); - } - - /** Represents a QueryFeeEnabledChannelResponse. */ - class QueryFeeEnabledChannelResponse implements IQueryFeeEnabledChannelResponse { - - /** - * Constructs a new QueryFeeEnabledChannelResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IQueryFeeEnabledChannelResponse); - - /** QueryFeeEnabledChannelResponse fee_enabled. */ - public fee_enabled: boolean; - - /** - * Encodes the specified QueryFeeEnabledChannelResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelResponse.verify|verify} messages. - * @param message QueryFeeEnabledChannelResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IQueryFeeEnabledChannelResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryFeeEnabledChannelResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelResponse.verify|verify} messages. - * @param message QueryFeeEnabledChannelResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IQueryFeeEnabledChannelResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryFeeEnabledChannelResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryFeeEnabledChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.QueryFeeEnabledChannelResponse; - - /** - * Decodes a QueryFeeEnabledChannelResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryFeeEnabledChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.QueryFeeEnabledChannelResponse; - - /** - * Verifies a QueryFeeEnabledChannelResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryFeeEnabledChannelResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryFeeEnabledChannelResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.QueryFeeEnabledChannelResponse; - - /** - * Creates a plain object from a QueryFeeEnabledChannelResponse message. Also converts values to other types if specified. - * @param message QueryFeeEnabledChannelResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.QueryFeeEnabledChannelResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryFeeEnabledChannelResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState identified_fees */ - identified_fees?: (ibc.applications.fee.v1.IIdentifiedPacketFees[]|null); - - /** GenesisState fee_enabled_channels */ - fee_enabled_channels?: (ibc.applications.fee.v1.IFeeEnabledChannel[]|null); - - /** GenesisState registered_payees */ - registered_payees?: (ibc.applications.fee.v1.IRegisteredPayee[]|null); - - /** GenesisState registered_counterparty_payees */ - registered_counterparty_payees?: (ibc.applications.fee.v1.IRegisteredCounterpartyPayee[]|null); - - /** GenesisState forward_relayers */ - forward_relayers?: (ibc.applications.fee.v1.IForwardRelayerAddress[]|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IGenesisState); - - /** GenesisState identified_fees. */ - public identified_fees: ibc.applications.fee.v1.IIdentifiedPacketFees[]; - - /** GenesisState fee_enabled_channels. */ - public fee_enabled_channels: ibc.applications.fee.v1.IFeeEnabledChannel[]; - - /** GenesisState registered_payees. */ - public registered_payees: ibc.applications.fee.v1.IRegisteredPayee[]; - - /** GenesisState registered_counterparty_payees. */ - public registered_counterparty_payees: ibc.applications.fee.v1.IRegisteredCounterpartyPayee[]; - - /** GenesisState forward_relayers. */ - public forward_relayers: ibc.applications.fee.v1.IForwardRelayerAddress[]; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.fee.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FeeEnabledChannel. */ - interface IFeeEnabledChannel { - - /** FeeEnabledChannel port_id */ - port_id?: (string|null); - - /** FeeEnabledChannel channel_id */ - channel_id?: (string|null); - } - - /** Represents a FeeEnabledChannel. */ - class FeeEnabledChannel implements IFeeEnabledChannel { - - /** - * Constructs a new FeeEnabledChannel. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IFeeEnabledChannel); - - /** FeeEnabledChannel port_id. */ - public port_id: string; - - /** FeeEnabledChannel channel_id. */ - public channel_id: string; - - /** - * Encodes the specified FeeEnabledChannel message. Does not implicitly {@link ibc.applications.fee.v1.FeeEnabledChannel.verify|verify} messages. - * @param message FeeEnabledChannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IFeeEnabledChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeeEnabledChannel message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.FeeEnabledChannel.verify|verify} messages. - * @param message FeeEnabledChannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IFeeEnabledChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeeEnabledChannel message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeeEnabledChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.FeeEnabledChannel; - - /** - * Decodes a FeeEnabledChannel message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeeEnabledChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.FeeEnabledChannel; - - /** - * Verifies a FeeEnabledChannel message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeeEnabledChannel message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeeEnabledChannel - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.FeeEnabledChannel; - - /** - * Creates a plain object from a FeeEnabledChannel message. Also converts values to other types if specified. - * @param message FeeEnabledChannel - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.FeeEnabledChannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeeEnabledChannel to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RegisteredPayee. */ - interface IRegisteredPayee { - - /** RegisteredPayee channel_id */ - channel_id?: (string|null); - - /** RegisteredPayee relayer */ - relayer?: (string|null); - - /** RegisteredPayee payee */ - payee?: (string|null); - } - - /** Represents a RegisteredPayee. */ - class RegisteredPayee implements IRegisteredPayee { - - /** - * Constructs a new RegisteredPayee. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IRegisteredPayee); - - /** RegisteredPayee channel_id. */ - public channel_id: string; - - /** RegisteredPayee relayer. */ - public relayer: string; - - /** RegisteredPayee payee. */ - public payee: string; - - /** - * Encodes the specified RegisteredPayee message. Does not implicitly {@link ibc.applications.fee.v1.RegisteredPayee.verify|verify} messages. - * @param message RegisteredPayee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IRegisteredPayee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RegisteredPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.RegisteredPayee.verify|verify} messages. - * @param message RegisteredPayee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IRegisteredPayee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RegisteredPayee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RegisteredPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.RegisteredPayee; - - /** - * Decodes a RegisteredPayee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RegisteredPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.RegisteredPayee; - - /** - * Verifies a RegisteredPayee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RegisteredPayee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RegisteredPayee - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.RegisteredPayee; - - /** - * Creates a plain object from a RegisteredPayee message. Also converts values to other types if specified. - * @param message RegisteredPayee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.RegisteredPayee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RegisteredPayee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RegisteredCounterpartyPayee. */ - interface IRegisteredCounterpartyPayee { - - /** RegisteredCounterpartyPayee channel_id */ - channel_id?: (string|null); - - /** RegisteredCounterpartyPayee relayer */ - relayer?: (string|null); - - /** RegisteredCounterpartyPayee counterparty_payee */ - counterparty_payee?: (string|null); - } - - /** Represents a RegisteredCounterpartyPayee. */ - class RegisteredCounterpartyPayee implements IRegisteredCounterpartyPayee { - - /** - * Constructs a new RegisteredCounterpartyPayee. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IRegisteredCounterpartyPayee); - - /** RegisteredCounterpartyPayee channel_id. */ - public channel_id: string; - - /** RegisteredCounterpartyPayee relayer. */ - public relayer: string; - - /** RegisteredCounterpartyPayee counterparty_payee. */ - public counterparty_payee: string; - - /** - * Encodes the specified RegisteredCounterpartyPayee message. Does not implicitly {@link ibc.applications.fee.v1.RegisteredCounterpartyPayee.verify|verify} messages. - * @param message RegisteredCounterpartyPayee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IRegisteredCounterpartyPayee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RegisteredCounterpartyPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.RegisteredCounterpartyPayee.verify|verify} messages. - * @param message RegisteredCounterpartyPayee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IRegisteredCounterpartyPayee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RegisteredCounterpartyPayee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RegisteredCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.RegisteredCounterpartyPayee; - - /** - * Decodes a RegisteredCounterpartyPayee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RegisteredCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.RegisteredCounterpartyPayee; - - /** - * Verifies a RegisteredCounterpartyPayee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RegisteredCounterpartyPayee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RegisteredCounterpartyPayee - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.RegisteredCounterpartyPayee; - - /** - * Creates a plain object from a RegisteredCounterpartyPayee message. Also converts values to other types if specified. - * @param message RegisteredCounterpartyPayee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.RegisteredCounterpartyPayee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RegisteredCounterpartyPayee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ForwardRelayerAddress. */ - interface IForwardRelayerAddress { - - /** ForwardRelayerAddress address */ - address?: (string|null); - - /** ForwardRelayerAddress packet_id */ - packet_id?: (ibc.core.channel.v1.IPacketId|null); - } - - /** Represents a ForwardRelayerAddress. */ - class ForwardRelayerAddress implements IForwardRelayerAddress { - - /** - * Constructs a new ForwardRelayerAddress. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IForwardRelayerAddress); - - /** ForwardRelayerAddress address. */ - public address: string; - - /** ForwardRelayerAddress packet_id. */ - public packet_id?: (ibc.core.channel.v1.IPacketId|null); - - /** - * Encodes the specified ForwardRelayerAddress message. Does not implicitly {@link ibc.applications.fee.v1.ForwardRelayerAddress.verify|verify} messages. - * @param message ForwardRelayerAddress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IForwardRelayerAddress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ForwardRelayerAddress message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.ForwardRelayerAddress.verify|verify} messages. - * @param message ForwardRelayerAddress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IForwardRelayerAddress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ForwardRelayerAddress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ForwardRelayerAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.ForwardRelayerAddress; - - /** - * Decodes a ForwardRelayerAddress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ForwardRelayerAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.ForwardRelayerAddress; - - /** - * Verifies a ForwardRelayerAddress message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ForwardRelayerAddress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ForwardRelayerAddress - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.ForwardRelayerAddress; - - /** - * Creates a plain object from a ForwardRelayerAddress message. Also converts values to other types if specified. - * @param message ForwardRelayerAddress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.ForwardRelayerAddress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ForwardRelayerAddress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Metadata. */ - interface IMetadata { - - /** Metadata fee_version */ - fee_version?: (string|null); - - /** Metadata app_version */ - app_version?: (string|null); - } - - /** Represents a Metadata. */ - class Metadata implements IMetadata { - - /** - * Constructs a new Metadata. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.fee.v1.IMetadata); - - /** Metadata fee_version. */ - public fee_version: string; - - /** Metadata app_version. */ - public app_version: string; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link ibc.applications.fee.v1.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.fee.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.fee.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.fee.v1.Metadata; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.fee.v1.Metadata; - - /** - * Verifies a Metadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Metadata - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.fee.v1.Metadata; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @param message Metadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.fee.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Metadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace interchain_accounts. */ - namespace interchain_accounts { - - /** Namespace controller. */ - namespace controller { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls InterchainAccount. - * @param request QueryInterchainAccountRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryInterchainAccountResponse - */ - public interchainAccount(request: ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest, callback: ibc.applications.interchain_accounts.controller.v1.Query.InterchainAccountCallback): void; - - /** - * Calls InterchainAccount. - * @param request QueryInterchainAccountRequest message or plain object - * @returns Promise - */ - public interchainAccount(request: ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest): Promise; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest, callback: ibc.applications.interchain_accounts.controller.v1.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link ibc.applications.interchain_accounts.controller.v1.Query#interchainAccount}. - * @param error Error, if any - * @param [response] QueryInterchainAccountResponse - */ - type InterchainAccountCallback = (error: (Error|null), response?: ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse) => void; - - /** - * Callback as used by {@link ibc.applications.interchain_accounts.controller.v1.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse) => void; - } - - /** Properties of a QueryInterchainAccountRequest. */ - interface IQueryInterchainAccountRequest { - - /** QueryInterchainAccountRequest owner */ - owner?: (string|null); - - /** QueryInterchainAccountRequest connection_id */ - connection_id?: (string|null); - } - - /** Represents a QueryInterchainAccountRequest. */ - class QueryInterchainAccountRequest implements IQueryInterchainAccountRequest { - - /** - * Constructs a new QueryInterchainAccountRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest); - - /** QueryInterchainAccountRequest owner. */ - public owner: string; - - /** QueryInterchainAccountRequest connection_id. */ - public connection_id: string; - - /** - * Encodes the specified QueryInterchainAccountRequest message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest.verify|verify} messages. - * @param message QueryInterchainAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryInterchainAccountRequest message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest.verify|verify} messages. - * @param message QueryInterchainAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryInterchainAccountRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryInterchainAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest; - - /** - * Decodes a QueryInterchainAccountRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryInterchainAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest; - - /** - * Verifies a QueryInterchainAccountRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryInterchainAccountRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryInterchainAccountRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest; - - /** - * Creates a plain object from a QueryInterchainAccountRequest message. Also converts values to other types if specified. - * @param message QueryInterchainAccountRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryInterchainAccountRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryInterchainAccountResponse. */ - interface IQueryInterchainAccountResponse { - - /** QueryInterchainAccountResponse address */ - address?: (string|null); - } - - /** Represents a QueryInterchainAccountResponse. */ - class QueryInterchainAccountResponse implements IQueryInterchainAccountResponse { - - /** - * Constructs a new QueryInterchainAccountResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountResponse); - - /** QueryInterchainAccountResponse address. */ - public address: string; - - /** - * Encodes the specified QueryInterchainAccountResponse message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse.verify|verify} messages. - * @param message QueryInterchainAccountResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryInterchainAccountResponse message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse.verify|verify} messages. - * @param message QueryInterchainAccountResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryInterchainAccountResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse; - - /** - * Decodes a QueryInterchainAccountResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse; - - /** - * Verifies a QueryInterchainAccountResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryInterchainAccountResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryInterchainAccountResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse; - - /** - * Creates a plain object from a QueryInterchainAccountResponse message. Also converts values to other types if specified. - * @param message QueryInterchainAccountResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryInterchainAccountResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (ibc.applications.interchain_accounts.controller.v1.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.controller.v1.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (ibc.applications.interchain_accounts.controller.v1.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.controller.v1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.controller.v1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params controller_enabled */ - controller_enabled?: (boolean|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.controller.v1.IParams); - - /** Params controller_enabled. */ - public controller_enabled: boolean; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.controller.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.controller.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.controller.v1.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.controller.v1.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.controller.v1.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.controller.v1.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace host. */ - namespace host { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a Params. */ - interface IParams { - - /** Params host_enabled */ - host_enabled?: (boolean|null); - - /** Params allow_messages */ - allow_messages?: (string[]|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.host.v1.IParams); - - /** Params host_enabled. */ - public host_enabled: boolean; - - /** Params allow_messages. */ - public allow_messages: string[]; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.host.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.host.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.host.v1.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.host.v1.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.host.v1.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.host.v1.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest, callback: ibc.applications.interchain_accounts.host.v1.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link ibc.applications.interchain_accounts.host.v1.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: ibc.applications.interchain_accounts.host.v1.QueryParamsResponse) => void; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.host.v1.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.host.v1.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.host.v1.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.host.v1.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (ibc.applications.interchain_accounts.host.v1.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.host.v1.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (ibc.applications.interchain_accounts.host.v1.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.host.v1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.host.v1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.host.v1.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.host.v1.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.host.v1.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.host.v1.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace v1. */ - namespace v1 { - - /** Properties of an InterchainAccount. */ - interface IInterchainAccount { - - /** InterchainAccount base_account */ - base_account?: (cosmos.auth.v1beta1.IBaseAccount|null); - - /** InterchainAccount account_owner */ - account_owner?: (string|null); - } - - /** Represents an InterchainAccount. */ - class InterchainAccount implements IInterchainAccount { - - /** - * Constructs a new InterchainAccount. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.v1.IInterchainAccount); - - /** InterchainAccount base_account. */ - public base_account?: (cosmos.auth.v1beta1.IBaseAccount|null); - - /** InterchainAccount account_owner. */ - public account_owner: string; - - /** - * Encodes the specified InterchainAccount message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccount.verify|verify} messages. - * @param message InterchainAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.v1.IInterchainAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InterchainAccount message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccount.verify|verify} messages. - * @param message InterchainAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.v1.IInterchainAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InterchainAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.v1.InterchainAccount; - - /** - * Decodes an InterchainAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.v1.InterchainAccount; - - /** - * Verifies an InterchainAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InterchainAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InterchainAccount - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.v1.InterchainAccount; - - /** - * Creates a plain object from an InterchainAccount message. Also converts values to other types if specified. - * @param message InterchainAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.v1.InterchainAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InterchainAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - TYPE_EXECUTE_TX = 1 - } - - /** Properties of an InterchainAccountPacketData. */ - interface IInterchainAccountPacketData { - - /** InterchainAccountPacketData type */ - type?: (ibc.applications.interchain_accounts.v1.Type|null); - - /** InterchainAccountPacketData data */ - data?: (Uint8Array|null); - - /** InterchainAccountPacketData memo */ - memo?: (string|null); - } - - /** Represents an InterchainAccountPacketData. */ - class InterchainAccountPacketData implements IInterchainAccountPacketData { - - /** - * Constructs a new InterchainAccountPacketData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.v1.IInterchainAccountPacketData); - - /** InterchainAccountPacketData type. */ - public type: ibc.applications.interchain_accounts.v1.Type; - - /** InterchainAccountPacketData data. */ - public data: Uint8Array; - - /** InterchainAccountPacketData memo. */ - public memo: string; - - /** - * Encodes the specified InterchainAccountPacketData message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccountPacketData.verify|verify} messages. - * @param message InterchainAccountPacketData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.v1.IInterchainAccountPacketData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InterchainAccountPacketData message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccountPacketData.verify|verify} messages. - * @param message InterchainAccountPacketData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.v1.IInterchainAccountPacketData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InterchainAccountPacketData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InterchainAccountPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.v1.InterchainAccountPacketData; - - /** - * Decodes an InterchainAccountPacketData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InterchainAccountPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.v1.InterchainAccountPacketData; - - /** - * Verifies an InterchainAccountPacketData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InterchainAccountPacketData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InterchainAccountPacketData - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.v1.InterchainAccountPacketData; - - /** - * Creates a plain object from an InterchainAccountPacketData message. Also converts values to other types if specified. - * @param message InterchainAccountPacketData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.v1.InterchainAccountPacketData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InterchainAccountPacketData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CosmosTx. */ - interface ICosmosTx { - - /** CosmosTx messages */ - messages?: (google.protobuf.IAny[]|null); - } - - /** Represents a CosmosTx. */ - class CosmosTx implements ICosmosTx { - - /** - * Constructs a new CosmosTx. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.v1.ICosmosTx); - - /** CosmosTx messages. */ - public messages: google.protobuf.IAny[]; - - /** - * Encodes the specified CosmosTx message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.CosmosTx.verify|verify} messages. - * @param message CosmosTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.v1.ICosmosTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CosmosTx message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.CosmosTx.verify|verify} messages. - * @param message CosmosTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.v1.ICosmosTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CosmosTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CosmosTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.v1.CosmosTx; - - /** - * Decodes a CosmosTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CosmosTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.v1.CosmosTx; - - /** - * Verifies a CosmosTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CosmosTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CosmosTx - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.v1.CosmosTx; - - /** - * Creates a plain object from a CosmosTx message. Also converts values to other types if specified. - * @param message CosmosTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.v1.CosmosTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CosmosTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Metadata. */ - interface IMetadata { - - /** Metadata version */ - version?: (string|null); - - /** Metadata controller_connection_id */ - controller_connection_id?: (string|null); - - /** Metadata host_connection_id */ - host_connection_id?: (string|null); - - /** Metadata address */ - address?: (string|null); - - /** Metadata encoding */ - encoding?: (string|null); - - /** Metadata tx_type */ - tx_type?: (string|null); - } - - /** Represents a Metadata. */ - class Metadata implements IMetadata { - - /** - * Constructs a new Metadata. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.v1.IMetadata); - - /** Metadata version. */ - public version: string; - - /** Metadata controller_connection_id. */ - public controller_connection_id: string; - - /** Metadata host_connection_id. */ - public host_connection_id: string; - - /** Metadata address. */ - public address: string; - - /** Metadata encoding. */ - public encoding: string; - - /** Metadata tx_type. */ - public tx_type: string; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.v1.Metadata; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.v1.Metadata; - - /** - * Verifies a Metadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Metadata - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.v1.Metadata; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @param message Metadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Metadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState controller_genesis_state */ - controller_genesis_state?: (ibc.applications.interchain_accounts.v1.IControllerGenesisState|null); - - /** GenesisState host_genesis_state */ - host_genesis_state?: (ibc.applications.interchain_accounts.v1.IHostGenesisState|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.v1.IGenesisState); - - /** GenesisState controller_genesis_state. */ - public controller_genesis_state?: (ibc.applications.interchain_accounts.v1.IControllerGenesisState|null); - - /** GenesisState host_genesis_state. */ - public host_genesis_state?: (ibc.applications.interchain_accounts.v1.IHostGenesisState|null); - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.v1.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.v1.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.v1.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.v1.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ControllerGenesisState. */ - interface IControllerGenesisState { - - /** ControllerGenesisState active_channels */ - active_channels?: (ibc.applications.interchain_accounts.v1.IActiveChannel[]|null); - - /** ControllerGenesisState interchain_accounts */ - interchain_accounts?: (ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount[]|null); - - /** ControllerGenesisState ports */ - ports?: (string[]|null); - - /** ControllerGenesisState params */ - params?: (ibc.applications.interchain_accounts.controller.v1.IParams|null); - } - - /** Represents a ControllerGenesisState. */ - class ControllerGenesisState implements IControllerGenesisState { - - /** - * Constructs a new ControllerGenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.v1.IControllerGenesisState); - - /** ControllerGenesisState active_channels. */ - public active_channels: ibc.applications.interchain_accounts.v1.IActiveChannel[]; - - /** ControllerGenesisState interchain_accounts. */ - public interchain_accounts: ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount[]; - - /** ControllerGenesisState ports. */ - public ports: string[]; - - /** ControllerGenesisState params. */ - public params?: (ibc.applications.interchain_accounts.controller.v1.IParams|null); - - /** - * Encodes the specified ControllerGenesisState message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ControllerGenesisState.verify|verify} messages. - * @param message ControllerGenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.v1.IControllerGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ControllerGenesisState message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ControllerGenesisState.verify|verify} messages. - * @param message ControllerGenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.v1.IControllerGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ControllerGenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ControllerGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.v1.ControllerGenesisState; - - /** - * Decodes a ControllerGenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ControllerGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.v1.ControllerGenesisState; - - /** - * Verifies a ControllerGenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ControllerGenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ControllerGenesisState - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.v1.ControllerGenesisState; - - /** - * Creates a plain object from a ControllerGenesisState message. Also converts values to other types if specified. - * @param message ControllerGenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.v1.ControllerGenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ControllerGenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a HostGenesisState. */ - interface IHostGenesisState { - - /** HostGenesisState active_channels */ - active_channels?: (ibc.applications.interchain_accounts.v1.IActiveChannel[]|null); - - /** HostGenesisState interchain_accounts */ - interchain_accounts?: (ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount[]|null); - - /** HostGenesisState port */ - port?: (string|null); - - /** HostGenesisState params */ - params?: (ibc.applications.interchain_accounts.host.v1.IParams|null); - } - - /** Represents a HostGenesisState. */ - class HostGenesisState implements IHostGenesisState { - - /** - * Constructs a new HostGenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.v1.IHostGenesisState); - - /** HostGenesisState active_channels. */ - public active_channels: ibc.applications.interchain_accounts.v1.IActiveChannel[]; - - /** HostGenesisState interchain_accounts. */ - public interchain_accounts: ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount[]; - - /** HostGenesisState port. */ - public port: string; - - /** HostGenesisState params. */ - public params?: (ibc.applications.interchain_accounts.host.v1.IParams|null); - - /** - * Encodes the specified HostGenesisState message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.HostGenesisState.verify|verify} messages. - * @param message HostGenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.v1.IHostGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HostGenesisState message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.HostGenesisState.verify|verify} messages. - * @param message HostGenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.v1.IHostGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HostGenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HostGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.v1.HostGenesisState; - - /** - * Decodes a HostGenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HostGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.v1.HostGenesisState; - - /** - * Verifies a HostGenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HostGenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HostGenesisState - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.v1.HostGenesisState; - - /** - * Creates a plain object from a HostGenesisState message. Also converts values to other types if specified. - * @param message HostGenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.v1.HostGenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HostGenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ActiveChannel. */ - interface IActiveChannel { - - /** ActiveChannel connection_id */ - connection_id?: (string|null); - - /** ActiveChannel port_id */ - port_id?: (string|null); - - /** ActiveChannel channel_id */ - channel_id?: (string|null); - } - - /** Represents an ActiveChannel. */ - class ActiveChannel implements IActiveChannel { - - /** - * Constructs a new ActiveChannel. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.v1.IActiveChannel); - - /** ActiveChannel connection_id. */ - public connection_id: string; - - /** ActiveChannel port_id. */ - public port_id: string; - - /** ActiveChannel channel_id. */ - public channel_id: string; - - /** - * Encodes the specified ActiveChannel message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ActiveChannel.verify|verify} messages. - * @param message ActiveChannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.v1.IActiveChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActiveChannel message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ActiveChannel.verify|verify} messages. - * @param message ActiveChannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.v1.IActiveChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActiveChannel message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActiveChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.v1.ActiveChannel; - - /** - * Decodes an ActiveChannel message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActiveChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.v1.ActiveChannel; - - /** - * Verifies an ActiveChannel message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ActiveChannel message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActiveChannel - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.v1.ActiveChannel; - - /** - * Creates a plain object from an ActiveChannel message. Also converts values to other types if specified. - * @param message ActiveChannel - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.v1.ActiveChannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActiveChannel to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RegisteredInterchainAccount. */ - interface IRegisteredInterchainAccount { - - /** RegisteredInterchainAccount connection_id */ - connection_id?: (string|null); - - /** RegisteredInterchainAccount port_id */ - port_id?: (string|null); - - /** RegisteredInterchainAccount account_address */ - account_address?: (string|null); - } - - /** Represents a RegisteredInterchainAccount. */ - class RegisteredInterchainAccount implements IRegisteredInterchainAccount { - - /** - * Constructs a new RegisteredInterchainAccount. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount); - - /** RegisteredInterchainAccount connection_id. */ - public connection_id: string; - - /** RegisteredInterchainAccount port_id. */ - public port_id: string; - - /** RegisteredInterchainAccount account_address. */ - public account_address: string; - - /** - * Encodes the specified RegisteredInterchainAccount message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify|verify} messages. - * @param message RegisteredInterchainAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RegisteredInterchainAccount message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify|verify} messages. - * @param message RegisteredInterchainAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RegisteredInterchainAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RegisteredInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount; - - /** - * Decodes a RegisteredInterchainAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RegisteredInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount; - - /** - * Verifies a RegisteredInterchainAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RegisteredInterchainAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RegisteredInterchainAccount - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount; - - /** - * Creates a plain object from a RegisteredInterchainAccount message. Also converts values to other types if specified. - * @param message RegisteredInterchainAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RegisteredInterchainAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace transfer. */ - namespace transfer { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Transfer. - * @param request MsgTransfer message or plain object - * @param callback Node-style callback called with the error, if any, and MsgTransferResponse - */ - public transfer(request: ibc.applications.transfer.v1.IMsgTransfer, callback: ibc.applications.transfer.v1.Msg.TransferCallback): void; - - /** - * Calls Transfer. - * @param request MsgTransfer message or plain object - * @returns Promise - */ - public transfer(request: ibc.applications.transfer.v1.IMsgTransfer): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Msg#transfer}. - * @param error Error, if any - * @param [response] MsgTransferResponse - */ - type TransferCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.MsgTransferResponse) => void; - } - - /** Properties of a MsgTransfer. */ - interface IMsgTransfer { - - /** MsgTransfer source_port */ - source_port?: (string|null); - - /** MsgTransfer source_channel */ - source_channel?: (string|null); - - /** MsgTransfer token */ - token?: (cosmos.base.v1beta1.ICoin|null); - - /** MsgTransfer sender */ - sender?: (string|null); - - /** MsgTransfer receiver */ - receiver?: (string|null); - - /** MsgTransfer timeout_height */ - timeout_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgTransfer timeout_timestamp */ - timeout_timestamp?: (Long|null); - - /** MsgTransfer memo */ - memo?: (string|null); - } - - /** Represents a MsgTransfer. */ - class MsgTransfer implements IMsgTransfer { - - /** - * Constructs a new MsgTransfer. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IMsgTransfer); - - /** MsgTransfer source_port. */ - public source_port: string; - - /** MsgTransfer source_channel. */ - public source_channel: string; - - /** MsgTransfer token. */ - public token?: (cosmos.base.v1beta1.ICoin|null); - - /** MsgTransfer sender. */ - public sender: string; - - /** MsgTransfer receiver. */ - public receiver: string; - - /** MsgTransfer timeout_height. */ - public timeout_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgTransfer timeout_timestamp. */ - public timeout_timestamp: Long; - - /** MsgTransfer memo. */ - public memo: string; - - /** - * Encodes the specified MsgTransfer message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. - * @param message MsgTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IMsgTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgTransfer message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. - * @param message MsgTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IMsgTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.MsgTransfer; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.MsgTransfer; - - /** - * Verifies a MsgTransfer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgTransfer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgTransfer - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.MsgTransfer; - - /** - * Creates a plain object from a MsgTransfer message. Also converts values to other types if specified. - * @param message MsgTransfer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.MsgTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgTransfer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgTransferResponse. */ - interface IMsgTransferResponse { - - /** MsgTransferResponse sequence */ - sequence?: (Long|null); - } - - /** Represents a MsgTransferResponse. */ - class MsgTransferResponse implements IMsgTransferResponse { - - /** - * Constructs a new MsgTransferResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IMsgTransferResponse); - - /** MsgTransferResponse sequence. */ - public sequence: Long; - - /** - * Encodes the specified MsgTransferResponse message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. - * @param message MsgTransferResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IMsgTransferResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgTransferResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. - * @param message MsgTransferResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IMsgTransferResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.MsgTransferResponse; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.MsgTransferResponse; - - /** - * Verifies a MsgTransferResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgTransferResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgTransferResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.MsgTransferResponse; - - /** - * Creates a plain object from a MsgTransferResponse message. Also converts values to other types if specified. - * @param message MsgTransferResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.MsgTransferResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgTransferResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DenomTrace. */ - interface IDenomTrace { - - /** DenomTrace path */ - path?: (string|null); - - /** DenomTrace base_denom */ - base_denom?: (string|null); - } - - /** Represents a DenomTrace. */ - class DenomTrace implements IDenomTrace { - - /** - * Constructs a new DenomTrace. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IDenomTrace); - - /** DenomTrace path. */ - public path: string; - - /** DenomTrace base_denom. */ - public base_denom: string; - - /** - * Encodes the specified DenomTrace message. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @param message DenomTrace message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IDenomTrace, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DenomTrace message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @param message DenomTrace message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IDenomTrace, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DenomTrace message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.DenomTrace; - - /** - * Decodes a DenomTrace message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.DenomTrace; - - /** - * Verifies a DenomTrace message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DenomTrace message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DenomTrace - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.DenomTrace; - - /** - * Creates a plain object from a DenomTrace message. Also converts values to other types if specified. - * @param message DenomTrace - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.DenomTrace, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DenomTrace to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params send_enabled */ - send_enabled?: (boolean|null); - - /** Params receive_enabled */ - receive_enabled?: (boolean|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IParams); - - /** Params send_enabled. */ - public send_enabled: boolean; - - /** Params receive_enabled. */ - public receive_enabled: boolean; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls DenomTrace. - * @param request QueryDenomTraceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomTraceResponse - */ - public denomTrace(request: ibc.applications.transfer.v1.IQueryDenomTraceRequest, callback: ibc.applications.transfer.v1.Query.DenomTraceCallback): void; - - /** - * Calls DenomTrace. - * @param request QueryDenomTraceRequest message or plain object - * @returns Promise - */ - public denomTrace(request: ibc.applications.transfer.v1.IQueryDenomTraceRequest): Promise; - - /** - * Calls DenomTraces. - * @param request QueryDenomTracesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomTracesResponse - */ - public denomTraces(request: ibc.applications.transfer.v1.IQueryDenomTracesRequest, callback: ibc.applications.transfer.v1.Query.DenomTracesCallback): void; - - /** - * Calls DenomTraces. - * @param request QueryDenomTracesRequest message or plain object - * @returns Promise - */ - public denomTraces(request: ibc.applications.transfer.v1.IQueryDenomTracesRequest): Promise; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: ibc.applications.transfer.v1.IQueryParamsRequest, callback: ibc.applications.transfer.v1.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: ibc.applications.transfer.v1.IQueryParamsRequest): Promise; - - /** - * Calls DenomHash. - * @param request QueryDenomHashRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomHashResponse - */ - public denomHash(request: ibc.applications.transfer.v1.IQueryDenomHashRequest, callback: ibc.applications.transfer.v1.Query.DenomHashCallback): void; - - /** - * Calls DenomHash. - * @param request QueryDenomHashRequest message or plain object - * @returns Promise - */ - public denomHash(request: ibc.applications.transfer.v1.IQueryDenomHashRequest): Promise; - - /** - * Calls EscrowAddress. - * @param request QueryEscrowAddressRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryEscrowAddressResponse - */ - public escrowAddress(request: ibc.applications.transfer.v1.IQueryEscrowAddressRequest, callback: ibc.applications.transfer.v1.Query.EscrowAddressCallback): void; - - /** - * Calls EscrowAddress. - * @param request QueryEscrowAddressRequest message or plain object - * @returns Promise - */ - public escrowAddress(request: ibc.applications.transfer.v1.IQueryEscrowAddressRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTrace}. - * @param error Error, if any - * @param [response] QueryDenomTraceResponse - */ - type DenomTraceCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryDenomTraceResponse) => void; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTraces}. - * @param error Error, if any - * @param [response] QueryDenomTracesResponse - */ - type DenomTracesCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryDenomTracesResponse) => void; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryParamsResponse) => void; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomHash}. - * @param error Error, if any - * @param [response] QueryDenomHashResponse - */ - type DenomHashCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryDenomHashResponse) => void; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#escrowAddress}. - * @param error Error, if any - * @param [response] QueryEscrowAddressResponse - */ - type EscrowAddressCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryEscrowAddressResponse) => void; - } - - /** Properties of a QueryDenomTraceRequest. */ - interface IQueryDenomTraceRequest { - - /** QueryDenomTraceRequest hash */ - hash?: (string|null); - } - - /** Represents a QueryDenomTraceRequest. */ - class QueryDenomTraceRequest implements IQueryDenomTraceRequest { - - /** - * Constructs a new QueryDenomTraceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomTraceRequest); - - /** QueryDenomTraceRequest hash. */ - public hash: string; - - /** - * Encodes the specified QueryDenomTraceRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @param message QueryDenomTraceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomTraceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomTraceRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @param message QueryDenomTraceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomTraceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomTraceRequest; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomTraceRequest; - - /** - * Verifies a QueryDenomTraceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomTraceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomTraceRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomTraceRequest; - - /** - * Creates a plain object from a QueryDenomTraceRequest message. Also converts values to other types if specified. - * @param message QueryDenomTraceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomTraceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomTraceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomTraceResponse. */ - interface IQueryDenomTraceResponse { - - /** QueryDenomTraceResponse denom_trace */ - denom_trace?: (ibc.applications.transfer.v1.IDenomTrace|null); - } - - /** Represents a QueryDenomTraceResponse. */ - class QueryDenomTraceResponse implements IQueryDenomTraceResponse { - - /** - * Constructs a new QueryDenomTraceResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomTraceResponse); - - /** QueryDenomTraceResponse denom_trace. */ - public denom_trace?: (ibc.applications.transfer.v1.IDenomTrace|null); - - /** - * Encodes the specified QueryDenomTraceResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @param message QueryDenomTraceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomTraceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomTraceResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @param message QueryDenomTraceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomTraceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomTraceResponse; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomTraceResponse; - - /** - * Verifies a QueryDenomTraceResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomTraceResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomTraceResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomTraceResponse; - - /** - * Creates a plain object from a QueryDenomTraceResponse message. Also converts values to other types if specified. - * @param message QueryDenomTraceResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomTraceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomTraceResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomTracesRequest. */ - interface IQueryDenomTracesRequest { - - /** QueryDenomTracesRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryDenomTracesRequest. */ - class QueryDenomTracesRequest implements IQueryDenomTracesRequest { - - /** - * Constructs a new QueryDenomTracesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomTracesRequest); - - /** QueryDenomTracesRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryDenomTracesRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @param message QueryDenomTracesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomTracesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomTracesRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @param message QueryDenomTracesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomTracesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomTracesRequest; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomTracesRequest; - - /** - * Verifies a QueryDenomTracesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomTracesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomTracesRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomTracesRequest; - - /** - * Creates a plain object from a QueryDenomTracesRequest message. Also converts values to other types if specified. - * @param message QueryDenomTracesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomTracesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomTracesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomTracesResponse. */ - interface IQueryDenomTracesResponse { - - /** QueryDenomTracesResponse denom_traces */ - denom_traces?: (ibc.applications.transfer.v1.IDenomTrace[]|null); - - /** QueryDenomTracesResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - } - - /** Represents a QueryDenomTracesResponse. */ - class QueryDenomTracesResponse implements IQueryDenomTracesResponse { - - /** - * Constructs a new QueryDenomTracesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomTracesResponse); - - /** QueryDenomTracesResponse denom_traces. */ - public denom_traces: ibc.applications.transfer.v1.IDenomTrace[]; - - /** QueryDenomTracesResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** - * Encodes the specified QueryDenomTracesResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @param message QueryDenomTracesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomTracesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomTracesResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @param message QueryDenomTracesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomTracesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomTracesResponse; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomTracesResponse; - - /** - * Verifies a QueryDenomTracesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomTracesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomTracesResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomTracesResponse; - - /** - * Creates a plain object from a QueryDenomTracesResponse message. Also converts values to other types if specified. - * @param message QueryDenomTracesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomTracesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomTracesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (ibc.applications.transfer.v1.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (ibc.applications.transfer.v1.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomHashRequest. */ - interface IQueryDenomHashRequest { - - /** QueryDenomHashRequest trace */ - trace?: (string|null); - } - - /** Represents a QueryDenomHashRequest. */ - class QueryDenomHashRequest implements IQueryDenomHashRequest { - - /** - * Constructs a new QueryDenomHashRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomHashRequest); - - /** QueryDenomHashRequest trace. */ - public trace: string; - - /** - * Encodes the specified QueryDenomHashRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @param message QueryDenomHashRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomHashRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomHashRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @param message QueryDenomHashRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomHashRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomHashRequest; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomHashRequest; - - /** - * Verifies a QueryDenomHashRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomHashRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomHashRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomHashRequest; - - /** - * Creates a plain object from a QueryDenomHashRequest message. Also converts values to other types if specified. - * @param message QueryDenomHashRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomHashRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomHashRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomHashResponse. */ - interface IQueryDenomHashResponse { - - /** QueryDenomHashResponse hash */ - hash?: (string|null); - } - - /** Represents a QueryDenomHashResponse. */ - class QueryDenomHashResponse implements IQueryDenomHashResponse { - - /** - * Constructs a new QueryDenomHashResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomHashResponse); - - /** QueryDenomHashResponse hash. */ - public hash: string; - - /** - * Encodes the specified QueryDenomHashResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @param message QueryDenomHashResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomHashResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomHashResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @param message QueryDenomHashResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomHashResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomHashResponse; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomHashResponse; - - /** - * Verifies a QueryDenomHashResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomHashResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomHashResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomHashResponse; - - /** - * Creates a plain object from a QueryDenomHashResponse message. Also converts values to other types if specified. - * @param message QueryDenomHashResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomHashResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomHashResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryEscrowAddressRequest. */ - interface IQueryEscrowAddressRequest { - - /** QueryEscrowAddressRequest port_id */ - port_id?: (string|null); - - /** QueryEscrowAddressRequest channel_id */ - channel_id?: (string|null); - } - - /** Represents a QueryEscrowAddressRequest. */ - class QueryEscrowAddressRequest implements IQueryEscrowAddressRequest { - - /** - * Constructs a new QueryEscrowAddressRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryEscrowAddressRequest); - - /** QueryEscrowAddressRequest port_id. */ - public port_id: string; - - /** QueryEscrowAddressRequest channel_id. */ - public channel_id: string; - - /** - * Encodes the specified QueryEscrowAddressRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @param message QueryEscrowAddressRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryEscrowAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryEscrowAddressRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @param message QueryEscrowAddressRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryEscrowAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryEscrowAddressRequest; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryEscrowAddressRequest; - - /** - * Verifies a QueryEscrowAddressRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryEscrowAddressRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryEscrowAddressRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryEscrowAddressRequest; - - /** - * Creates a plain object from a QueryEscrowAddressRequest message. Also converts values to other types if specified. - * @param message QueryEscrowAddressRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryEscrowAddressRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryEscrowAddressRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryEscrowAddressResponse. */ - interface IQueryEscrowAddressResponse { - - /** QueryEscrowAddressResponse escrow_address */ - escrow_address?: (string|null); - } - - /** Represents a QueryEscrowAddressResponse. */ - class QueryEscrowAddressResponse implements IQueryEscrowAddressResponse { - - /** - * Constructs a new QueryEscrowAddressResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryEscrowAddressResponse); - - /** QueryEscrowAddressResponse escrow_address. */ - public escrow_address: string; - - /** - * Encodes the specified QueryEscrowAddressResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @param message QueryEscrowAddressResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryEscrowAddressResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryEscrowAddressResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @param message QueryEscrowAddressResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryEscrowAddressResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryEscrowAddressResponse; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryEscrowAddressResponse; - - /** - * Verifies a QueryEscrowAddressResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryEscrowAddressResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryEscrowAddressResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryEscrowAddressResponse; - - /** - * Creates a plain object from a QueryEscrowAddressResponse message. Also converts values to other types if specified. - * @param message QueryEscrowAddressResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryEscrowAddressResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryEscrowAddressResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState port_id */ - port_id?: (string|null); - - /** GenesisState denom_traces */ - denom_traces?: (ibc.applications.transfer.v1.IDenomTrace[]|null); - - /** GenesisState params */ - params?: (ibc.applications.transfer.v1.IParams|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IGenesisState); - - /** GenesisState port_id. */ - public port_id: string; - - /** GenesisState denom_traces. */ - public denom_traces: ibc.applications.transfer.v1.IDenomTrace[]; - - /** GenesisState params. */ - public params?: (ibc.applications.transfer.v1.IParams|null); - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.transfer.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace v2. */ - namespace v2 { - - /** Properties of a FungibleTokenPacketData. */ - interface IFungibleTokenPacketData { - - /** FungibleTokenPacketData denom */ - denom?: (string|null); - - /** FungibleTokenPacketData amount */ - amount?: (string|null); - - /** FungibleTokenPacketData sender */ - sender?: (string|null); - - /** FungibleTokenPacketData receiver */ - receiver?: (string|null); - - /** FungibleTokenPacketData memo */ - memo?: (string|null); - } - - /** Represents a FungibleTokenPacketData. */ - class FungibleTokenPacketData implements IFungibleTokenPacketData { - - /** - * Constructs a new FungibleTokenPacketData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v2.IFungibleTokenPacketData); - - /** FungibleTokenPacketData denom. */ - public denom: string; - - /** FungibleTokenPacketData amount. */ - public amount: string; - - /** FungibleTokenPacketData sender. */ - public sender: string; - - /** FungibleTokenPacketData receiver. */ - public receiver: string; - - /** FungibleTokenPacketData memo. */ - public memo: string; - - /** - * Encodes the specified FungibleTokenPacketData message. Does not implicitly {@link ibc.applications.transfer.v2.FungibleTokenPacketData.verify|verify} messages. - * @param message FungibleTokenPacketData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v2.IFungibleTokenPacketData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FungibleTokenPacketData message, length delimited. Does not implicitly {@link ibc.applications.transfer.v2.FungibleTokenPacketData.verify|verify} messages. - * @param message FungibleTokenPacketData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v2.IFungibleTokenPacketData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FungibleTokenPacketData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FungibleTokenPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v2.FungibleTokenPacketData; - - /** - * Decodes a FungibleTokenPacketData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FungibleTokenPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v2.FungibleTokenPacketData; - - /** - * Verifies a FungibleTokenPacketData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FungibleTokenPacketData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FungibleTokenPacketData - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v2.FungibleTokenPacketData; - - /** - * Creates a plain object from a FungibleTokenPacketData message. Also converts values to other types if specified. - * @param message FungibleTokenPacketData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v2.FungibleTokenPacketData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FungibleTokenPacketData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } - - /** Namespace core. */ - namespace core { - - /** Namespace channel. */ - namespace channel { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a Channel. */ - interface IChannel { - - /** Channel state */ - state?: (ibc.core.channel.v1.State|null); - - /** Channel ordering */ - ordering?: (ibc.core.channel.v1.Order|null); - - /** Channel counterparty */ - counterparty?: (ibc.core.channel.v1.ICounterparty|null); - - /** Channel connection_hops */ - connection_hops?: (string[]|null); - - /** Channel version */ - version?: (string|null); - } - - /** Represents a Channel. */ - class Channel implements IChannel { - - /** - * Constructs a new Channel. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IChannel); - - /** Channel state. */ - public state: ibc.core.channel.v1.State; - - /** Channel ordering. */ - public ordering: ibc.core.channel.v1.Order; - - /** Channel counterparty. */ - public counterparty?: (ibc.core.channel.v1.ICounterparty|null); - - /** Channel connection_hops. */ - public connection_hops: string[]; - - /** Channel version. */ - public version: string; - - /** - * Encodes the specified Channel message. Does not implicitly {@link ibc.core.channel.v1.Channel.verify|verify} messages. - * @param message Channel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Channel message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Channel.verify|verify} messages. - * @param message Channel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Channel message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Channel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.Channel; - - /** - * Decodes a Channel message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Channel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.Channel; - - /** - * Verifies a Channel message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Channel message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Channel - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.Channel; - - /** - * Creates a plain object from a Channel message. Also converts values to other types if specified. - * @param message Channel - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.Channel, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Channel to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IdentifiedChannel. */ - interface IIdentifiedChannel { - - /** IdentifiedChannel state */ - state?: (ibc.core.channel.v1.State|null); - - /** IdentifiedChannel ordering */ - ordering?: (ibc.core.channel.v1.Order|null); - - /** IdentifiedChannel counterparty */ - counterparty?: (ibc.core.channel.v1.ICounterparty|null); - - /** IdentifiedChannel connection_hops */ - connection_hops?: (string[]|null); - - /** IdentifiedChannel version */ - version?: (string|null); - - /** IdentifiedChannel port_id */ - port_id?: (string|null); - - /** IdentifiedChannel channel_id */ - channel_id?: (string|null); - } - - /** Represents an IdentifiedChannel. */ - class IdentifiedChannel implements IIdentifiedChannel { - - /** - * Constructs a new IdentifiedChannel. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IIdentifiedChannel); - - /** IdentifiedChannel state. */ - public state: ibc.core.channel.v1.State; - - /** IdentifiedChannel ordering. */ - public ordering: ibc.core.channel.v1.Order; - - /** IdentifiedChannel counterparty. */ - public counterparty?: (ibc.core.channel.v1.ICounterparty|null); - - /** IdentifiedChannel connection_hops. */ - public connection_hops: string[]; - - /** IdentifiedChannel version. */ - public version: string; - - /** IdentifiedChannel port_id. */ - public port_id: string; - - /** IdentifiedChannel channel_id. */ - public channel_id: string; - - /** - * Encodes the specified IdentifiedChannel message. Does not implicitly {@link ibc.core.channel.v1.IdentifiedChannel.verify|verify} messages. - * @param message IdentifiedChannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IIdentifiedChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IdentifiedChannel message, length delimited. Does not implicitly {@link ibc.core.channel.v1.IdentifiedChannel.verify|verify} messages. - * @param message IdentifiedChannel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IIdentifiedChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IdentifiedChannel message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentifiedChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.IdentifiedChannel; - - /** - * Decodes an IdentifiedChannel message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentifiedChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.IdentifiedChannel; - - /** - * Verifies an IdentifiedChannel message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IdentifiedChannel message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentifiedChannel - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.IdentifiedChannel; - - /** - * Creates a plain object from an IdentifiedChannel message. Also converts values to other types if specified. - * @param message IdentifiedChannel - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.IdentifiedChannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IdentifiedChannel to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** State enum. */ - enum State { - STATE_UNINITIALIZED_UNSPECIFIED = 0, - STATE_INIT = 1, - STATE_TRYOPEN = 2, - STATE_OPEN = 3, - STATE_CLOSED = 4 - } - - /** Order enum. */ - enum Order { - ORDER_NONE_UNSPECIFIED = 0, - ORDER_UNORDERED = 1, - ORDER_ORDERED = 2 - } - - /** Properties of a Counterparty. */ - interface ICounterparty { - - /** Counterparty port_id */ - port_id?: (string|null); - - /** Counterparty channel_id */ - channel_id?: (string|null); - } - - /** Represents a Counterparty. */ - class Counterparty implements ICounterparty { - - /** - * Constructs a new Counterparty. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.ICounterparty); - - /** Counterparty port_id. */ - public port_id: string; - - /** Counterparty channel_id. */ - public channel_id: string; - - /** - * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.channel.v1.Counterparty.verify|verify} messages. - * @param message Counterparty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.ICounterparty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Counterparty message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Counterparty.verify|verify} messages. - * @param message Counterparty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.ICounterparty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Counterparty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.Counterparty; - - /** - * Decodes a Counterparty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.Counterparty; - - /** - * Verifies a Counterparty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Counterparty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Counterparty - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.Counterparty; - - /** - * Creates a plain object from a Counterparty message. Also converts values to other types if specified. - * @param message Counterparty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.Counterparty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Counterparty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Packet. */ - interface IPacket { - - /** Packet sequence */ - sequence?: (Long|null); - - /** Packet source_port */ - source_port?: (string|null); - - /** Packet source_channel */ - source_channel?: (string|null); - - /** Packet destination_port */ - destination_port?: (string|null); - - /** Packet destination_channel */ - destination_channel?: (string|null); - - /** Packet data */ - data?: (Uint8Array|null); - - /** Packet timeout_height */ - timeout_height?: (ibc.core.client.v1.IHeight|null); - - /** Packet timeout_timestamp */ - timeout_timestamp?: (Long|null); - } - - /** Represents a Packet. */ - class Packet implements IPacket { - - /** - * Constructs a new Packet. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IPacket); - - /** Packet sequence. */ - public sequence: Long; - - /** Packet source_port. */ - public source_port: string; - - /** Packet source_channel. */ - public source_channel: string; - - /** Packet destination_port. */ - public destination_port: string; - - /** Packet destination_channel. */ - public destination_channel: string; - - /** Packet data. */ - public data: Uint8Array; - - /** Packet timeout_height. */ - public timeout_height?: (ibc.core.client.v1.IHeight|null); - - /** Packet timeout_timestamp. */ - public timeout_timestamp: Long; - - /** - * Encodes the specified Packet message. Does not implicitly {@link ibc.core.channel.v1.Packet.verify|verify} messages. - * @param message Packet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IPacket, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Packet message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Packet.verify|verify} messages. - * @param message Packet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IPacket, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Packet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Packet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.Packet; - - /** - * Decodes a Packet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Packet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.Packet; - - /** - * Verifies a Packet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Packet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Packet - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.Packet; - - /** - * Creates a plain object from a Packet message. Also converts values to other types if specified. - * @param message Packet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.Packet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Packet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketState. */ - interface IPacketState { - - /** PacketState port_id */ - port_id?: (string|null); - - /** PacketState channel_id */ - channel_id?: (string|null); - - /** PacketState sequence */ - sequence?: (Long|null); - - /** PacketState data */ - data?: (Uint8Array|null); - } - - /** Represents a PacketState. */ - class PacketState implements IPacketState { - - /** - * Constructs a new PacketState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IPacketState); - - /** PacketState port_id. */ - public port_id: string; - - /** PacketState channel_id. */ - public channel_id: string; - - /** PacketState sequence. */ - public sequence: Long; - - /** PacketState data. */ - public data: Uint8Array; - - /** - * Encodes the specified PacketState message. Does not implicitly {@link ibc.core.channel.v1.PacketState.verify|verify} messages. - * @param message PacketState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IPacketState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketState message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketState.verify|verify} messages. - * @param message PacketState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IPacketState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.PacketState; - - /** - * Decodes a PacketState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.PacketState; - - /** - * Verifies a PacketState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketState - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.PacketState; - - /** - * Creates a plain object from a PacketState message. Also converts values to other types if specified. - * @param message PacketState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.PacketState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketId. */ - interface IPacketId { - - /** PacketId port_id */ - port_id?: (string|null); - - /** PacketId channel_id */ - channel_id?: (string|null); - - /** PacketId sequence */ - sequence?: (Long|null); - } - - /** Represents a PacketId. */ - class PacketId implements IPacketId { - - /** - * Constructs a new PacketId. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IPacketId); - - /** PacketId port_id. */ - public port_id: string; - - /** PacketId channel_id. */ - public channel_id: string; - - /** PacketId sequence. */ - public sequence: Long; - - /** - * Encodes the specified PacketId message. Does not implicitly {@link ibc.core.channel.v1.PacketId.verify|verify} messages. - * @param message PacketId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IPacketId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketId message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketId.verify|verify} messages. - * @param message PacketId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IPacketId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketId message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.PacketId; - - /** - * Decodes a PacketId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.PacketId; - - /** - * Verifies a PacketId message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketId - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.PacketId; - - /** - * Creates a plain object from a PacketId message. Also converts values to other types if specified. - * @param message PacketId - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.PacketId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Acknowledgement. */ - interface IAcknowledgement { - - /** Acknowledgement result */ - result?: (Uint8Array|null); - - /** Acknowledgement error */ - error?: (string|null); - } - - /** Represents an Acknowledgement. */ - class Acknowledgement implements IAcknowledgement { - - /** - * Constructs a new Acknowledgement. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IAcknowledgement); - - /** Acknowledgement result. */ - public result?: (Uint8Array|null); - - /** Acknowledgement error. */ - public error?: (string|null); - - /** Acknowledgement response. */ - public response?: ("result"|"error"); - - /** - * Encodes the specified Acknowledgement message. Does not implicitly {@link ibc.core.channel.v1.Acknowledgement.verify|verify} messages. - * @param message Acknowledgement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IAcknowledgement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Acknowledgement message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Acknowledgement.verify|verify} messages. - * @param message Acknowledgement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IAcknowledgement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Acknowledgement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Acknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.Acknowledgement; - - /** - * Decodes an Acknowledgement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Acknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.Acknowledgement; - - /** - * Verifies an Acknowledgement message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Acknowledgement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Acknowledgement - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.Acknowledgement; - - /** - * Creates a plain object from an Acknowledgement message. Also converts values to other types if specified. - * @param message Acknowledgement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.Acknowledgement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Acknowledgement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls ChannelOpenInit. - * @param request MsgChannelOpenInit message or plain object - * @param callback Node-style callback called with the error, if any, and MsgChannelOpenInitResponse - */ - public channelOpenInit(request: ibc.core.channel.v1.IMsgChannelOpenInit, callback: ibc.core.channel.v1.Msg.ChannelOpenInitCallback): void; - - /** - * Calls ChannelOpenInit. - * @param request MsgChannelOpenInit message or plain object - * @returns Promise - */ - public channelOpenInit(request: ibc.core.channel.v1.IMsgChannelOpenInit): Promise; - - /** - * Calls ChannelOpenTry. - * @param request MsgChannelOpenTry message or plain object - * @param callback Node-style callback called with the error, if any, and MsgChannelOpenTryResponse - */ - public channelOpenTry(request: ibc.core.channel.v1.IMsgChannelOpenTry, callback: ibc.core.channel.v1.Msg.ChannelOpenTryCallback): void; - - /** - * Calls ChannelOpenTry. - * @param request MsgChannelOpenTry message or plain object - * @returns Promise - */ - public channelOpenTry(request: ibc.core.channel.v1.IMsgChannelOpenTry): Promise; - - /** - * Calls ChannelOpenAck. - * @param request MsgChannelOpenAck message or plain object - * @param callback Node-style callback called with the error, if any, and MsgChannelOpenAckResponse - */ - public channelOpenAck(request: ibc.core.channel.v1.IMsgChannelOpenAck, callback: ibc.core.channel.v1.Msg.ChannelOpenAckCallback): void; - - /** - * Calls ChannelOpenAck. - * @param request MsgChannelOpenAck message or plain object - * @returns Promise - */ - public channelOpenAck(request: ibc.core.channel.v1.IMsgChannelOpenAck): Promise; - - /** - * Calls ChannelOpenConfirm. - * @param request MsgChannelOpenConfirm message or plain object - * @param callback Node-style callback called with the error, if any, and MsgChannelOpenConfirmResponse - */ - public channelOpenConfirm(request: ibc.core.channel.v1.IMsgChannelOpenConfirm, callback: ibc.core.channel.v1.Msg.ChannelOpenConfirmCallback): void; - - /** - * Calls ChannelOpenConfirm. - * @param request MsgChannelOpenConfirm message or plain object - * @returns Promise - */ - public channelOpenConfirm(request: ibc.core.channel.v1.IMsgChannelOpenConfirm): Promise; - - /** - * Calls ChannelCloseInit. - * @param request MsgChannelCloseInit message or plain object - * @param callback Node-style callback called with the error, if any, and MsgChannelCloseInitResponse - */ - public channelCloseInit(request: ibc.core.channel.v1.IMsgChannelCloseInit, callback: ibc.core.channel.v1.Msg.ChannelCloseInitCallback): void; - - /** - * Calls ChannelCloseInit. - * @param request MsgChannelCloseInit message or plain object - * @returns Promise - */ - public channelCloseInit(request: ibc.core.channel.v1.IMsgChannelCloseInit): Promise; - - /** - * Calls ChannelCloseConfirm. - * @param request MsgChannelCloseConfirm message or plain object - * @param callback Node-style callback called with the error, if any, and MsgChannelCloseConfirmResponse - */ - public channelCloseConfirm(request: ibc.core.channel.v1.IMsgChannelCloseConfirm, callback: ibc.core.channel.v1.Msg.ChannelCloseConfirmCallback): void; - - /** - * Calls ChannelCloseConfirm. - * @param request MsgChannelCloseConfirm message or plain object - * @returns Promise - */ - public channelCloseConfirm(request: ibc.core.channel.v1.IMsgChannelCloseConfirm): Promise; - - /** - * Calls RecvPacket. - * @param request MsgRecvPacket message or plain object - * @param callback Node-style callback called with the error, if any, and MsgRecvPacketResponse - */ - public recvPacket(request: ibc.core.channel.v1.IMsgRecvPacket, callback: ibc.core.channel.v1.Msg.RecvPacketCallback): void; - - /** - * Calls RecvPacket. - * @param request MsgRecvPacket message or plain object - * @returns Promise - */ - public recvPacket(request: ibc.core.channel.v1.IMsgRecvPacket): Promise; - - /** - * Calls Timeout. - * @param request MsgTimeout message or plain object - * @param callback Node-style callback called with the error, if any, and MsgTimeoutResponse - */ - public timeout(request: ibc.core.channel.v1.IMsgTimeout, callback: ibc.core.channel.v1.Msg.TimeoutCallback): void; - - /** - * Calls Timeout. - * @param request MsgTimeout message or plain object - * @returns Promise - */ - public timeout(request: ibc.core.channel.v1.IMsgTimeout): Promise; - - /** - * Calls TimeoutOnClose. - * @param request MsgTimeoutOnClose message or plain object - * @param callback Node-style callback called with the error, if any, and MsgTimeoutOnCloseResponse - */ - public timeoutOnClose(request: ibc.core.channel.v1.IMsgTimeoutOnClose, callback: ibc.core.channel.v1.Msg.TimeoutOnCloseCallback): void; - - /** - * Calls TimeoutOnClose. - * @param request MsgTimeoutOnClose message or plain object - * @returns Promise - */ - public timeoutOnClose(request: ibc.core.channel.v1.IMsgTimeoutOnClose): Promise; - - /** - * Calls Acknowledgement. - * @param request MsgAcknowledgement message or plain object - * @param callback Node-style callback called with the error, if any, and MsgAcknowledgementResponse - */ - public acknowledgement(request: ibc.core.channel.v1.IMsgAcknowledgement, callback: ibc.core.channel.v1.Msg.AcknowledgementCallback): void; - - /** - * Calls Acknowledgement. - * @param request MsgAcknowledgement message or plain object - * @returns Promise - */ - public acknowledgement(request: ibc.core.channel.v1.IMsgAcknowledgement): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenInit}. - * @param error Error, if any - * @param [response] MsgChannelOpenInitResponse - */ - type ChannelOpenInitCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgChannelOpenInitResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenTry}. - * @param error Error, if any - * @param [response] MsgChannelOpenTryResponse - */ - type ChannelOpenTryCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgChannelOpenTryResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenAck}. - * @param error Error, if any - * @param [response] MsgChannelOpenAckResponse - */ - type ChannelOpenAckCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgChannelOpenAckResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenConfirm}. - * @param error Error, if any - * @param [response] MsgChannelOpenConfirmResponse - */ - type ChannelOpenConfirmCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgChannelOpenConfirmResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelCloseInit}. - * @param error Error, if any - * @param [response] MsgChannelCloseInitResponse - */ - type ChannelCloseInitCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgChannelCloseInitResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelCloseConfirm}. - * @param error Error, if any - * @param [response] MsgChannelCloseConfirmResponse - */ - type ChannelCloseConfirmCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgChannelCloseConfirmResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#recvPacket}. - * @param error Error, if any - * @param [response] MsgRecvPacketResponse - */ - type RecvPacketCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgRecvPacketResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#timeout}. - * @param error Error, if any - * @param [response] MsgTimeoutResponse - */ - type TimeoutCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgTimeoutResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#timeoutOnClose}. - * @param error Error, if any - * @param [response] MsgTimeoutOnCloseResponse - */ - type TimeoutOnCloseCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgTimeoutOnCloseResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#acknowledgement}. - * @param error Error, if any - * @param [response] MsgAcknowledgementResponse - */ - type AcknowledgementCallback = (error: (Error|null), response?: ibc.core.channel.v1.MsgAcknowledgementResponse) => void; - } - - /** ResponseResultType enum. */ - enum ResponseResultType { - RESPONSE_RESULT_TYPE_UNSPECIFIED = 0, - RESPONSE_RESULT_TYPE_NOOP = 1, - RESPONSE_RESULT_TYPE_SUCCESS = 2 - } - - /** Properties of a MsgChannelOpenInit. */ - interface IMsgChannelOpenInit { - - /** MsgChannelOpenInit port_id */ - port_id?: (string|null); - - /** MsgChannelOpenInit channel */ - channel?: (ibc.core.channel.v1.IChannel|null); - - /** MsgChannelOpenInit signer */ - signer?: (string|null); - } - - /** Represents a MsgChannelOpenInit. */ - class MsgChannelOpenInit implements IMsgChannelOpenInit { - - /** - * Constructs a new MsgChannelOpenInit. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelOpenInit); - - /** MsgChannelOpenInit port_id. */ - public port_id: string; - - /** MsgChannelOpenInit channel. */ - public channel?: (ibc.core.channel.v1.IChannel|null); - - /** MsgChannelOpenInit signer. */ - public signer: string; - - /** - * Encodes the specified MsgChannelOpenInit message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInit.verify|verify} messages. - * @param message MsgChannelOpenInit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelOpenInit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelOpenInit message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInit.verify|verify} messages. - * @param message MsgChannelOpenInit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelOpenInit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelOpenInit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelOpenInit; - - /** - * Decodes a MsgChannelOpenInit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelOpenInit; - - /** - * Verifies a MsgChannelOpenInit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelOpenInit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelOpenInit - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelOpenInit; - - /** - * Creates a plain object from a MsgChannelOpenInit message. Also converts values to other types if specified. - * @param message MsgChannelOpenInit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelOpenInit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelOpenInit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelOpenInitResponse. */ - interface IMsgChannelOpenInitResponse { - - /** MsgChannelOpenInitResponse channel_id */ - channel_id?: (string|null); - - /** MsgChannelOpenInitResponse version */ - version?: (string|null); - } - - /** Represents a MsgChannelOpenInitResponse. */ - class MsgChannelOpenInitResponse implements IMsgChannelOpenInitResponse { - - /** - * Constructs a new MsgChannelOpenInitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelOpenInitResponse); - - /** MsgChannelOpenInitResponse channel_id. */ - public channel_id: string; - - /** MsgChannelOpenInitResponse version. */ - public version: string; - - /** - * Encodes the specified MsgChannelOpenInitResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInitResponse.verify|verify} messages. - * @param message MsgChannelOpenInitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelOpenInitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelOpenInitResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInitResponse.verify|verify} messages. - * @param message MsgChannelOpenInitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelOpenInitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelOpenInitResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelOpenInitResponse; - - /** - * Decodes a MsgChannelOpenInitResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelOpenInitResponse; - - /** - * Verifies a MsgChannelOpenInitResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelOpenInitResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelOpenInitResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelOpenInitResponse; - - /** - * Creates a plain object from a MsgChannelOpenInitResponse message. Also converts values to other types if specified. - * @param message MsgChannelOpenInitResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelOpenInitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelOpenInitResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelOpenTry. */ - interface IMsgChannelOpenTry { - - /** MsgChannelOpenTry port_id */ - port_id?: (string|null); - - /** MsgChannelOpenTry previous_channel_id */ - previous_channel_id?: (string|null); - - /** MsgChannelOpenTry channel */ - channel?: (ibc.core.channel.v1.IChannel|null); - - /** MsgChannelOpenTry counterparty_version */ - counterparty_version?: (string|null); - - /** MsgChannelOpenTry proof_init */ - proof_init?: (Uint8Array|null); - - /** MsgChannelOpenTry proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgChannelOpenTry signer */ - signer?: (string|null); - } - - /** Represents a MsgChannelOpenTry. */ - class MsgChannelOpenTry implements IMsgChannelOpenTry { - - /** - * Constructs a new MsgChannelOpenTry. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelOpenTry); - - /** MsgChannelOpenTry port_id. */ - public port_id: string; - - /** MsgChannelOpenTry previous_channel_id. */ - public previous_channel_id: string; - - /** MsgChannelOpenTry channel. */ - public channel?: (ibc.core.channel.v1.IChannel|null); - - /** MsgChannelOpenTry counterparty_version. */ - public counterparty_version: string; - - /** MsgChannelOpenTry proof_init. */ - public proof_init: Uint8Array; - - /** MsgChannelOpenTry proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgChannelOpenTry signer. */ - public signer: string; - - /** - * Encodes the specified MsgChannelOpenTry message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTry.verify|verify} messages. - * @param message MsgChannelOpenTry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelOpenTry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelOpenTry message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTry.verify|verify} messages. - * @param message MsgChannelOpenTry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelOpenTry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelOpenTry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelOpenTry; - - /** - * Decodes a MsgChannelOpenTry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelOpenTry; - - /** - * Verifies a MsgChannelOpenTry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelOpenTry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelOpenTry - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelOpenTry; - - /** - * Creates a plain object from a MsgChannelOpenTry message. Also converts values to other types if specified. - * @param message MsgChannelOpenTry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelOpenTry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelOpenTry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelOpenTryResponse. */ - interface IMsgChannelOpenTryResponse { - - /** MsgChannelOpenTryResponse version */ - version?: (string|null); - } - - /** Represents a MsgChannelOpenTryResponse. */ - class MsgChannelOpenTryResponse implements IMsgChannelOpenTryResponse { - - /** - * Constructs a new MsgChannelOpenTryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelOpenTryResponse); - - /** MsgChannelOpenTryResponse version. */ - public version: string; - - /** - * Encodes the specified MsgChannelOpenTryResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTryResponse.verify|verify} messages. - * @param message MsgChannelOpenTryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelOpenTryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelOpenTryResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTryResponse.verify|verify} messages. - * @param message MsgChannelOpenTryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelOpenTryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelOpenTryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelOpenTryResponse; - - /** - * Decodes a MsgChannelOpenTryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelOpenTryResponse; - - /** - * Verifies a MsgChannelOpenTryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelOpenTryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelOpenTryResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelOpenTryResponse; - - /** - * Creates a plain object from a MsgChannelOpenTryResponse message. Also converts values to other types if specified. - * @param message MsgChannelOpenTryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelOpenTryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelOpenTryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelOpenAck. */ - interface IMsgChannelOpenAck { - - /** MsgChannelOpenAck port_id */ - port_id?: (string|null); - - /** MsgChannelOpenAck channel_id */ - channel_id?: (string|null); - - /** MsgChannelOpenAck counterparty_channel_id */ - counterparty_channel_id?: (string|null); - - /** MsgChannelOpenAck counterparty_version */ - counterparty_version?: (string|null); - - /** MsgChannelOpenAck proof_try */ - proof_try?: (Uint8Array|null); - - /** MsgChannelOpenAck proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgChannelOpenAck signer */ - signer?: (string|null); - } - - /** Represents a MsgChannelOpenAck. */ - class MsgChannelOpenAck implements IMsgChannelOpenAck { - - /** - * Constructs a new MsgChannelOpenAck. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelOpenAck); - - /** MsgChannelOpenAck port_id. */ - public port_id: string; - - /** MsgChannelOpenAck channel_id. */ - public channel_id: string; - - /** MsgChannelOpenAck counterparty_channel_id. */ - public counterparty_channel_id: string; - - /** MsgChannelOpenAck counterparty_version. */ - public counterparty_version: string; - - /** MsgChannelOpenAck proof_try. */ - public proof_try: Uint8Array; - - /** MsgChannelOpenAck proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgChannelOpenAck signer. */ - public signer: string; - - /** - * Encodes the specified MsgChannelOpenAck message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAck.verify|verify} messages. - * @param message MsgChannelOpenAck message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelOpenAck, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelOpenAck message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAck.verify|verify} messages. - * @param message MsgChannelOpenAck message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelOpenAck, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelOpenAck message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelOpenAck; - - /** - * Decodes a MsgChannelOpenAck message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelOpenAck; - - /** - * Verifies a MsgChannelOpenAck message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelOpenAck message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelOpenAck - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelOpenAck; - - /** - * Creates a plain object from a MsgChannelOpenAck message. Also converts values to other types if specified. - * @param message MsgChannelOpenAck - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelOpenAck, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelOpenAck to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelOpenAckResponse. */ - interface IMsgChannelOpenAckResponse { - } - - /** Represents a MsgChannelOpenAckResponse. */ - class MsgChannelOpenAckResponse implements IMsgChannelOpenAckResponse { - - /** - * Constructs a new MsgChannelOpenAckResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelOpenAckResponse); - - /** - * Encodes the specified MsgChannelOpenAckResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAckResponse.verify|verify} messages. - * @param message MsgChannelOpenAckResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelOpenAckResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelOpenAckResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAckResponse.verify|verify} messages. - * @param message MsgChannelOpenAckResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelOpenAckResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelOpenAckResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelOpenAckResponse; - - /** - * Decodes a MsgChannelOpenAckResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelOpenAckResponse; - - /** - * Verifies a MsgChannelOpenAckResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelOpenAckResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelOpenAckResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelOpenAckResponse; - - /** - * Creates a plain object from a MsgChannelOpenAckResponse message. Also converts values to other types if specified. - * @param message MsgChannelOpenAckResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelOpenAckResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelOpenAckResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelOpenConfirm. */ - interface IMsgChannelOpenConfirm { - - /** MsgChannelOpenConfirm port_id */ - port_id?: (string|null); - - /** MsgChannelOpenConfirm channel_id */ - channel_id?: (string|null); - - /** MsgChannelOpenConfirm proof_ack */ - proof_ack?: (Uint8Array|null); - - /** MsgChannelOpenConfirm proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgChannelOpenConfirm signer */ - signer?: (string|null); - } - - /** Represents a MsgChannelOpenConfirm. */ - class MsgChannelOpenConfirm implements IMsgChannelOpenConfirm { - - /** - * Constructs a new MsgChannelOpenConfirm. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelOpenConfirm); - - /** MsgChannelOpenConfirm port_id. */ - public port_id: string; - - /** MsgChannelOpenConfirm channel_id. */ - public channel_id: string; - - /** MsgChannelOpenConfirm proof_ack. */ - public proof_ack: Uint8Array; - - /** MsgChannelOpenConfirm proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgChannelOpenConfirm signer. */ - public signer: string; - - /** - * Encodes the specified MsgChannelOpenConfirm message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirm.verify|verify} messages. - * @param message MsgChannelOpenConfirm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelOpenConfirm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelOpenConfirm message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirm.verify|verify} messages. - * @param message MsgChannelOpenConfirm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelOpenConfirm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelOpenConfirm message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelOpenConfirm; - - /** - * Decodes a MsgChannelOpenConfirm message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelOpenConfirm; - - /** - * Verifies a MsgChannelOpenConfirm message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelOpenConfirm message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelOpenConfirm - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelOpenConfirm; - - /** - * Creates a plain object from a MsgChannelOpenConfirm message. Also converts values to other types if specified. - * @param message MsgChannelOpenConfirm - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelOpenConfirm, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelOpenConfirm to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelOpenConfirmResponse. */ - interface IMsgChannelOpenConfirmResponse { - } - - /** Represents a MsgChannelOpenConfirmResponse. */ - class MsgChannelOpenConfirmResponse implements IMsgChannelOpenConfirmResponse { - - /** - * Constructs a new MsgChannelOpenConfirmResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelOpenConfirmResponse); - - /** - * Encodes the specified MsgChannelOpenConfirmResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirmResponse.verify|verify} messages. - * @param message MsgChannelOpenConfirmResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelOpenConfirmResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelOpenConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirmResponse.verify|verify} messages. - * @param message MsgChannelOpenConfirmResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelOpenConfirmResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelOpenConfirmResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelOpenConfirmResponse; - - /** - * Decodes a MsgChannelOpenConfirmResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelOpenConfirmResponse; - - /** - * Verifies a MsgChannelOpenConfirmResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelOpenConfirmResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelOpenConfirmResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelOpenConfirmResponse; - - /** - * Creates a plain object from a MsgChannelOpenConfirmResponse message. Also converts values to other types if specified. - * @param message MsgChannelOpenConfirmResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelOpenConfirmResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelOpenConfirmResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelCloseInit. */ - interface IMsgChannelCloseInit { - - /** MsgChannelCloseInit port_id */ - port_id?: (string|null); - - /** MsgChannelCloseInit channel_id */ - channel_id?: (string|null); - - /** MsgChannelCloseInit signer */ - signer?: (string|null); - } - - /** Represents a MsgChannelCloseInit. */ - class MsgChannelCloseInit implements IMsgChannelCloseInit { - - /** - * Constructs a new MsgChannelCloseInit. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelCloseInit); - - /** MsgChannelCloseInit port_id. */ - public port_id: string; - - /** MsgChannelCloseInit channel_id. */ - public channel_id: string; - - /** MsgChannelCloseInit signer. */ - public signer: string; - - /** - * Encodes the specified MsgChannelCloseInit message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInit.verify|verify} messages. - * @param message MsgChannelCloseInit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelCloseInit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelCloseInit message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInit.verify|verify} messages. - * @param message MsgChannelCloseInit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelCloseInit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelCloseInit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelCloseInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelCloseInit; - - /** - * Decodes a MsgChannelCloseInit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelCloseInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelCloseInit; - - /** - * Verifies a MsgChannelCloseInit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelCloseInit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelCloseInit - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelCloseInit; - - /** - * Creates a plain object from a MsgChannelCloseInit message. Also converts values to other types if specified. - * @param message MsgChannelCloseInit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelCloseInit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelCloseInit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelCloseInitResponse. */ - interface IMsgChannelCloseInitResponse { - } - - /** Represents a MsgChannelCloseInitResponse. */ - class MsgChannelCloseInitResponse implements IMsgChannelCloseInitResponse { - - /** - * Constructs a new MsgChannelCloseInitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelCloseInitResponse); - - /** - * Encodes the specified MsgChannelCloseInitResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInitResponse.verify|verify} messages. - * @param message MsgChannelCloseInitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelCloseInitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelCloseInitResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInitResponse.verify|verify} messages. - * @param message MsgChannelCloseInitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelCloseInitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelCloseInitResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelCloseInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelCloseInitResponse; - - /** - * Decodes a MsgChannelCloseInitResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelCloseInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelCloseInitResponse; - - /** - * Verifies a MsgChannelCloseInitResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelCloseInitResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelCloseInitResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelCloseInitResponse; - - /** - * Creates a plain object from a MsgChannelCloseInitResponse message. Also converts values to other types if specified. - * @param message MsgChannelCloseInitResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelCloseInitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelCloseInitResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelCloseConfirm. */ - interface IMsgChannelCloseConfirm { - - /** MsgChannelCloseConfirm port_id */ - port_id?: (string|null); - - /** MsgChannelCloseConfirm channel_id */ - channel_id?: (string|null); - - /** MsgChannelCloseConfirm proof_init */ - proof_init?: (Uint8Array|null); - - /** MsgChannelCloseConfirm proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgChannelCloseConfirm signer */ - signer?: (string|null); - } - - /** Represents a MsgChannelCloseConfirm. */ - class MsgChannelCloseConfirm implements IMsgChannelCloseConfirm { - - /** - * Constructs a new MsgChannelCloseConfirm. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelCloseConfirm); - - /** MsgChannelCloseConfirm port_id. */ - public port_id: string; - - /** MsgChannelCloseConfirm channel_id. */ - public channel_id: string; - - /** MsgChannelCloseConfirm proof_init. */ - public proof_init: Uint8Array; - - /** MsgChannelCloseConfirm proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgChannelCloseConfirm signer. */ - public signer: string; - - /** - * Encodes the specified MsgChannelCloseConfirm message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirm.verify|verify} messages. - * @param message MsgChannelCloseConfirm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelCloseConfirm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelCloseConfirm message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirm.verify|verify} messages. - * @param message MsgChannelCloseConfirm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelCloseConfirm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelCloseConfirm message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelCloseConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelCloseConfirm; - - /** - * Decodes a MsgChannelCloseConfirm message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelCloseConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelCloseConfirm; - - /** - * Verifies a MsgChannelCloseConfirm message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelCloseConfirm message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelCloseConfirm - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelCloseConfirm; - - /** - * Creates a plain object from a MsgChannelCloseConfirm message. Also converts values to other types if specified. - * @param message MsgChannelCloseConfirm - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelCloseConfirm, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelCloseConfirm to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChannelCloseConfirmResponse. */ - interface IMsgChannelCloseConfirmResponse { - } - - /** Represents a MsgChannelCloseConfirmResponse. */ - class MsgChannelCloseConfirmResponse implements IMsgChannelCloseConfirmResponse { - - /** - * Constructs a new MsgChannelCloseConfirmResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgChannelCloseConfirmResponse); - - /** - * Encodes the specified MsgChannelCloseConfirmResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirmResponse.verify|verify} messages. - * @param message MsgChannelCloseConfirmResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgChannelCloseConfirmResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChannelCloseConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirmResponse.verify|verify} messages. - * @param message MsgChannelCloseConfirmResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgChannelCloseConfirmResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChannelCloseConfirmResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChannelCloseConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgChannelCloseConfirmResponse; - - /** - * Decodes a MsgChannelCloseConfirmResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChannelCloseConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgChannelCloseConfirmResponse; - - /** - * Verifies a MsgChannelCloseConfirmResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChannelCloseConfirmResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChannelCloseConfirmResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgChannelCloseConfirmResponse; - - /** - * Creates a plain object from a MsgChannelCloseConfirmResponse message. Also converts values to other types if specified. - * @param message MsgChannelCloseConfirmResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgChannelCloseConfirmResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChannelCloseConfirmResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgRecvPacket. */ - interface IMsgRecvPacket { - - /** MsgRecvPacket packet */ - packet?: (ibc.core.channel.v1.IPacket|null); - - /** MsgRecvPacket proof_commitment */ - proof_commitment?: (Uint8Array|null); - - /** MsgRecvPacket proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgRecvPacket signer */ - signer?: (string|null); - } - - /** Represents a MsgRecvPacket. */ - class MsgRecvPacket implements IMsgRecvPacket { - - /** - * Constructs a new MsgRecvPacket. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgRecvPacket); - - /** MsgRecvPacket packet. */ - public packet?: (ibc.core.channel.v1.IPacket|null); - - /** MsgRecvPacket proof_commitment. */ - public proof_commitment: Uint8Array; - - /** MsgRecvPacket proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgRecvPacket signer. */ - public signer: string; - - /** - * Encodes the specified MsgRecvPacket message. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacket.verify|verify} messages. - * @param message MsgRecvPacket message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgRecvPacket, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRecvPacket message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacket.verify|verify} messages. - * @param message MsgRecvPacket message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgRecvPacket, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRecvPacket message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRecvPacket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgRecvPacket; - - /** - * Decodes a MsgRecvPacket message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRecvPacket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgRecvPacket; - - /** - * Verifies a MsgRecvPacket message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRecvPacket message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRecvPacket - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgRecvPacket; - - /** - * Creates a plain object from a MsgRecvPacket message. Also converts values to other types if specified. - * @param message MsgRecvPacket - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgRecvPacket, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRecvPacket to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgRecvPacketResponse. */ - interface IMsgRecvPacketResponse { - - /** MsgRecvPacketResponse result */ - result?: (ibc.core.channel.v1.ResponseResultType|null); - } - - /** Represents a MsgRecvPacketResponse. */ - class MsgRecvPacketResponse implements IMsgRecvPacketResponse { - - /** - * Constructs a new MsgRecvPacketResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgRecvPacketResponse); - - /** MsgRecvPacketResponse result. */ - public result: ibc.core.channel.v1.ResponseResultType; - - /** - * Encodes the specified MsgRecvPacketResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacketResponse.verify|verify} messages. - * @param message MsgRecvPacketResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgRecvPacketResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRecvPacketResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacketResponse.verify|verify} messages. - * @param message MsgRecvPacketResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgRecvPacketResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRecvPacketResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRecvPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgRecvPacketResponse; - - /** - * Decodes a MsgRecvPacketResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRecvPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgRecvPacketResponse; - - /** - * Verifies a MsgRecvPacketResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRecvPacketResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRecvPacketResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgRecvPacketResponse; - - /** - * Creates a plain object from a MsgRecvPacketResponse message. Also converts values to other types if specified. - * @param message MsgRecvPacketResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgRecvPacketResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRecvPacketResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgTimeout. */ - interface IMsgTimeout { - - /** MsgTimeout packet */ - packet?: (ibc.core.channel.v1.IPacket|null); - - /** MsgTimeout proof_unreceived */ - proof_unreceived?: (Uint8Array|null); - - /** MsgTimeout proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgTimeout next_sequence_recv */ - next_sequence_recv?: (Long|null); - - /** MsgTimeout signer */ - signer?: (string|null); - } - - /** Represents a MsgTimeout. */ - class MsgTimeout implements IMsgTimeout { - - /** - * Constructs a new MsgTimeout. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgTimeout); - - /** MsgTimeout packet. */ - public packet?: (ibc.core.channel.v1.IPacket|null); - - /** MsgTimeout proof_unreceived. */ - public proof_unreceived: Uint8Array; - - /** MsgTimeout proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgTimeout next_sequence_recv. */ - public next_sequence_recv: Long; - - /** MsgTimeout signer. */ - public signer: string; - - /** - * Encodes the specified MsgTimeout message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeout.verify|verify} messages. - * @param message MsgTimeout message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgTimeout, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgTimeout message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeout.verify|verify} messages. - * @param message MsgTimeout message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgTimeout, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgTimeout message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgTimeout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgTimeout; - - /** - * Decodes a MsgTimeout message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgTimeout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgTimeout; - - /** - * Verifies a MsgTimeout message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgTimeout message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgTimeout - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgTimeout; - - /** - * Creates a plain object from a MsgTimeout message. Also converts values to other types if specified. - * @param message MsgTimeout - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgTimeout, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgTimeout to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgTimeoutResponse. */ - interface IMsgTimeoutResponse { - - /** MsgTimeoutResponse result */ - result?: (ibc.core.channel.v1.ResponseResultType|null); - } - - /** Represents a MsgTimeoutResponse. */ - class MsgTimeoutResponse implements IMsgTimeoutResponse { - - /** - * Constructs a new MsgTimeoutResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgTimeoutResponse); - - /** MsgTimeoutResponse result. */ - public result: ibc.core.channel.v1.ResponseResultType; - - /** - * Encodes the specified MsgTimeoutResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutResponse.verify|verify} messages. - * @param message MsgTimeoutResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgTimeoutResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgTimeoutResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutResponse.verify|verify} messages. - * @param message MsgTimeoutResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgTimeoutResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgTimeoutResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgTimeoutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgTimeoutResponse; - - /** - * Decodes a MsgTimeoutResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgTimeoutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgTimeoutResponse; - - /** - * Verifies a MsgTimeoutResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgTimeoutResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgTimeoutResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgTimeoutResponse; - - /** - * Creates a plain object from a MsgTimeoutResponse message. Also converts values to other types if specified. - * @param message MsgTimeoutResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgTimeoutResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgTimeoutResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgTimeoutOnClose. */ - interface IMsgTimeoutOnClose { - - /** MsgTimeoutOnClose packet */ - packet?: (ibc.core.channel.v1.IPacket|null); - - /** MsgTimeoutOnClose proof_unreceived */ - proof_unreceived?: (Uint8Array|null); - - /** MsgTimeoutOnClose proof_close */ - proof_close?: (Uint8Array|null); - - /** MsgTimeoutOnClose proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgTimeoutOnClose next_sequence_recv */ - next_sequence_recv?: (Long|null); - - /** MsgTimeoutOnClose signer */ - signer?: (string|null); - } - - /** Represents a MsgTimeoutOnClose. */ - class MsgTimeoutOnClose implements IMsgTimeoutOnClose { - - /** - * Constructs a new MsgTimeoutOnClose. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgTimeoutOnClose); - - /** MsgTimeoutOnClose packet. */ - public packet?: (ibc.core.channel.v1.IPacket|null); - - /** MsgTimeoutOnClose proof_unreceived. */ - public proof_unreceived: Uint8Array; - - /** MsgTimeoutOnClose proof_close. */ - public proof_close: Uint8Array; - - /** MsgTimeoutOnClose proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgTimeoutOnClose next_sequence_recv. */ - public next_sequence_recv: Long; - - /** MsgTimeoutOnClose signer. */ - public signer: string; - - /** - * Encodes the specified MsgTimeoutOnClose message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnClose.verify|verify} messages. - * @param message MsgTimeoutOnClose message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgTimeoutOnClose, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgTimeoutOnClose message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnClose.verify|verify} messages. - * @param message MsgTimeoutOnClose message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgTimeoutOnClose, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgTimeoutOnClose message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgTimeoutOnClose - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgTimeoutOnClose; - - /** - * Decodes a MsgTimeoutOnClose message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgTimeoutOnClose - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgTimeoutOnClose; - - /** - * Verifies a MsgTimeoutOnClose message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgTimeoutOnClose message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgTimeoutOnClose - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgTimeoutOnClose; - - /** - * Creates a plain object from a MsgTimeoutOnClose message. Also converts values to other types if specified. - * @param message MsgTimeoutOnClose - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgTimeoutOnClose, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgTimeoutOnClose to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgTimeoutOnCloseResponse. */ - interface IMsgTimeoutOnCloseResponse { - - /** MsgTimeoutOnCloseResponse result */ - result?: (ibc.core.channel.v1.ResponseResultType|null); - } - - /** Represents a MsgTimeoutOnCloseResponse. */ - class MsgTimeoutOnCloseResponse implements IMsgTimeoutOnCloseResponse { - - /** - * Constructs a new MsgTimeoutOnCloseResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgTimeoutOnCloseResponse); - - /** MsgTimeoutOnCloseResponse result. */ - public result: ibc.core.channel.v1.ResponseResultType; - - /** - * Encodes the specified MsgTimeoutOnCloseResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnCloseResponse.verify|verify} messages. - * @param message MsgTimeoutOnCloseResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgTimeoutOnCloseResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgTimeoutOnCloseResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnCloseResponse.verify|verify} messages. - * @param message MsgTimeoutOnCloseResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgTimeoutOnCloseResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgTimeoutOnCloseResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgTimeoutOnCloseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgTimeoutOnCloseResponse; - - /** - * Decodes a MsgTimeoutOnCloseResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgTimeoutOnCloseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgTimeoutOnCloseResponse; - - /** - * Verifies a MsgTimeoutOnCloseResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgTimeoutOnCloseResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgTimeoutOnCloseResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgTimeoutOnCloseResponse; - - /** - * Creates a plain object from a MsgTimeoutOnCloseResponse message. Also converts values to other types if specified. - * @param message MsgTimeoutOnCloseResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgTimeoutOnCloseResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgTimeoutOnCloseResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgAcknowledgement. */ - interface IMsgAcknowledgement { - - /** MsgAcknowledgement packet */ - packet?: (ibc.core.channel.v1.IPacket|null); - - /** MsgAcknowledgement acknowledgement */ - acknowledgement?: (Uint8Array|null); - - /** MsgAcknowledgement proof_acked */ - proof_acked?: (Uint8Array|null); - - /** MsgAcknowledgement proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgAcknowledgement signer */ - signer?: (string|null); - } - - /** Represents a MsgAcknowledgement. */ - class MsgAcknowledgement implements IMsgAcknowledgement { - - /** - * Constructs a new MsgAcknowledgement. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgAcknowledgement); - - /** MsgAcknowledgement packet. */ - public packet?: (ibc.core.channel.v1.IPacket|null); - - /** MsgAcknowledgement acknowledgement. */ - public acknowledgement: Uint8Array; - - /** MsgAcknowledgement proof_acked. */ - public proof_acked: Uint8Array; - - /** MsgAcknowledgement proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgAcknowledgement signer. */ - public signer: string; - - /** - * Encodes the specified MsgAcknowledgement message. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgement.verify|verify} messages. - * @param message MsgAcknowledgement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgAcknowledgement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgAcknowledgement message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgement.verify|verify} messages. - * @param message MsgAcknowledgement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgAcknowledgement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgAcknowledgement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgAcknowledgement; - - /** - * Decodes a MsgAcknowledgement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgAcknowledgement; - - /** - * Verifies a MsgAcknowledgement message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgAcknowledgement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgAcknowledgement - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgAcknowledgement; - - /** - * Creates a plain object from a MsgAcknowledgement message. Also converts values to other types if specified. - * @param message MsgAcknowledgement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgAcknowledgement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgAcknowledgement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgAcknowledgementResponse. */ - interface IMsgAcknowledgementResponse { - - /** MsgAcknowledgementResponse result */ - result?: (ibc.core.channel.v1.ResponseResultType|null); - } - - /** Represents a MsgAcknowledgementResponse. */ - class MsgAcknowledgementResponse implements IMsgAcknowledgementResponse { - - /** - * Constructs a new MsgAcknowledgementResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IMsgAcknowledgementResponse); - - /** MsgAcknowledgementResponse result. */ - public result: ibc.core.channel.v1.ResponseResultType; - - /** - * Encodes the specified MsgAcknowledgementResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgementResponse.verify|verify} messages. - * @param message MsgAcknowledgementResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IMsgAcknowledgementResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgAcknowledgementResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgementResponse.verify|verify} messages. - * @param message MsgAcknowledgementResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IMsgAcknowledgementResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgAcknowledgementResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.MsgAcknowledgementResponse; - - /** - * Decodes a MsgAcknowledgementResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.MsgAcknowledgementResponse; - - /** - * Verifies a MsgAcknowledgementResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgAcknowledgementResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgAcknowledgementResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.MsgAcknowledgementResponse; - - /** - * Creates a plain object from a MsgAcknowledgementResponse message. Also converts values to other types if specified. - * @param message MsgAcknowledgementResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.MsgAcknowledgementResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgAcknowledgementResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Channel. - * @param request QueryChannelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryChannelResponse - */ - public channel(request: ibc.core.channel.v1.IQueryChannelRequest, callback: ibc.core.channel.v1.Query.ChannelCallback): void; - - /** - * Calls Channel. - * @param request QueryChannelRequest message or plain object - * @returns Promise - */ - public channel(request: ibc.core.channel.v1.IQueryChannelRequest): Promise; - - /** - * Calls Channels. - * @param request QueryChannelsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryChannelsResponse - */ - public channels(request: ibc.core.channel.v1.IQueryChannelsRequest, callback: ibc.core.channel.v1.Query.ChannelsCallback): void; - - /** - * Calls Channels. - * @param request QueryChannelsRequest message or plain object - * @returns Promise - */ - public channels(request: ibc.core.channel.v1.IQueryChannelsRequest): Promise; - - /** - * Calls ConnectionChannels. - * @param request QueryConnectionChannelsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionChannelsResponse - */ - public connectionChannels(request: ibc.core.channel.v1.IQueryConnectionChannelsRequest, callback: ibc.core.channel.v1.Query.ConnectionChannelsCallback): void; - - /** - * Calls ConnectionChannels. - * @param request QueryConnectionChannelsRequest message or plain object - * @returns Promise - */ - public connectionChannels(request: ibc.core.channel.v1.IQueryConnectionChannelsRequest): Promise; - - /** - * Calls ChannelClientState. - * @param request QueryChannelClientStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryChannelClientStateResponse - */ - public channelClientState(request: ibc.core.channel.v1.IQueryChannelClientStateRequest, callback: ibc.core.channel.v1.Query.ChannelClientStateCallback): void; - - /** - * Calls ChannelClientState. - * @param request QueryChannelClientStateRequest message or plain object - * @returns Promise - */ - public channelClientState(request: ibc.core.channel.v1.IQueryChannelClientStateRequest): Promise; - - /** - * Calls ChannelConsensusState. - * @param request QueryChannelConsensusStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryChannelConsensusStateResponse - */ - public channelConsensusState(request: ibc.core.channel.v1.IQueryChannelConsensusStateRequest, callback: ibc.core.channel.v1.Query.ChannelConsensusStateCallback): void; - - /** - * Calls ChannelConsensusState. - * @param request QueryChannelConsensusStateRequest message or plain object - * @returns Promise - */ - public channelConsensusState(request: ibc.core.channel.v1.IQueryChannelConsensusStateRequest): Promise; - - /** - * Calls PacketCommitment. - * @param request QueryPacketCommitmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketCommitmentResponse - */ - public packetCommitment(request: ibc.core.channel.v1.IQueryPacketCommitmentRequest, callback: ibc.core.channel.v1.Query.PacketCommitmentCallback): void; - - /** - * Calls PacketCommitment. - * @param request QueryPacketCommitmentRequest message or plain object - * @returns Promise - */ - public packetCommitment(request: ibc.core.channel.v1.IQueryPacketCommitmentRequest): Promise; - - /** - * Calls PacketCommitments. - * @param request QueryPacketCommitmentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketCommitmentsResponse - */ - public packetCommitments(request: ibc.core.channel.v1.IQueryPacketCommitmentsRequest, callback: ibc.core.channel.v1.Query.PacketCommitmentsCallback): void; - - /** - * Calls PacketCommitments. - * @param request QueryPacketCommitmentsRequest message or plain object - * @returns Promise - */ - public packetCommitments(request: ibc.core.channel.v1.IQueryPacketCommitmentsRequest): Promise; - - /** - * Calls PacketReceipt. - * @param request QueryPacketReceiptRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketReceiptResponse - */ - public packetReceipt(request: ibc.core.channel.v1.IQueryPacketReceiptRequest, callback: ibc.core.channel.v1.Query.PacketReceiptCallback): void; - - /** - * Calls PacketReceipt. - * @param request QueryPacketReceiptRequest message or plain object - * @returns Promise - */ - public packetReceipt(request: ibc.core.channel.v1.IQueryPacketReceiptRequest): Promise; - - /** - * Calls PacketAcknowledgement. - * @param request QueryPacketAcknowledgementRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementResponse - */ - public packetAcknowledgement(request: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest, callback: ibc.core.channel.v1.Query.PacketAcknowledgementCallback): void; - - /** - * Calls PacketAcknowledgement. - * @param request QueryPacketAcknowledgementRequest message or plain object - * @returns Promise - */ - public packetAcknowledgement(request: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest): Promise; - - /** - * Calls PacketAcknowledgements. - * @param request QueryPacketAcknowledgementsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementsResponse - */ - public packetAcknowledgements(request: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest, callback: ibc.core.channel.v1.Query.PacketAcknowledgementsCallback): void; - - /** - * Calls PacketAcknowledgements. - * @param request QueryPacketAcknowledgementsRequest message or plain object - * @returns Promise - */ - public packetAcknowledgements(request: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest): Promise; - - /** - * Calls UnreceivedPackets. - * @param request QueryUnreceivedPacketsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryUnreceivedPacketsResponse - */ - public unreceivedPackets(request: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest, callback: ibc.core.channel.v1.Query.UnreceivedPacketsCallback): void; - - /** - * Calls UnreceivedPackets. - * @param request QueryUnreceivedPacketsRequest message or plain object - * @returns Promise - */ - public unreceivedPackets(request: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest): Promise; - - /** - * Calls UnreceivedAcks. - * @param request QueryUnreceivedAcksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryUnreceivedAcksResponse - */ - public unreceivedAcks(request: ibc.core.channel.v1.IQueryUnreceivedAcksRequest, callback: ibc.core.channel.v1.Query.UnreceivedAcksCallback): void; - - /** - * Calls UnreceivedAcks. - * @param request QueryUnreceivedAcksRequest message or plain object - * @returns Promise - */ - public unreceivedAcks(request: ibc.core.channel.v1.IQueryUnreceivedAcksRequest): Promise; - - /** - * Calls NextSequenceReceive. - * @param request QueryNextSequenceReceiveRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryNextSequenceReceiveResponse - */ - public nextSequenceReceive(request: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest, callback: ibc.core.channel.v1.Query.NextSequenceReceiveCallback): void; - - /** - * Calls NextSequenceReceive. - * @param request QueryNextSequenceReceiveRequest message or plain object - * @returns Promise - */ - public nextSequenceReceive(request: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channel}. - * @param error Error, if any - * @param [response] QueryChannelResponse - */ - type ChannelCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryChannelResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channels}. - * @param error Error, if any - * @param [response] QueryChannelsResponse - */ - type ChannelsCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryChannelsResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#connectionChannels}. - * @param error Error, if any - * @param [response] QueryConnectionChannelsResponse - */ - type ConnectionChannelsCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryConnectionChannelsResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channelClientState}. - * @param error Error, if any - * @param [response] QueryChannelClientStateResponse - */ - type ChannelClientStateCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryChannelClientStateResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channelConsensusState}. - * @param error Error, if any - * @param [response] QueryChannelConsensusStateResponse - */ - type ChannelConsensusStateCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryChannelConsensusStateResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitment}. - * @param error Error, if any - * @param [response] QueryPacketCommitmentResponse - */ - type PacketCommitmentCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryPacketCommitmentResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitments}. - * @param error Error, if any - * @param [response] QueryPacketCommitmentsResponse - */ - type PacketCommitmentsCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryPacketCommitmentsResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetReceipt}. - * @param error Error, if any - * @param [response] QueryPacketReceiptResponse - */ - type PacketReceiptCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryPacketReceiptResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgement}. - * @param error Error, if any - * @param [response] QueryPacketAcknowledgementResponse - */ - type PacketAcknowledgementCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryPacketAcknowledgementResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgements}. - * @param error Error, if any - * @param [response] QueryPacketAcknowledgementsResponse - */ - type PacketAcknowledgementsCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryPacketAcknowledgementsResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedPackets}. - * @param error Error, if any - * @param [response] QueryUnreceivedPacketsResponse - */ - type UnreceivedPacketsCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryUnreceivedPacketsResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedAcks}. - * @param error Error, if any - * @param [response] QueryUnreceivedAcksResponse - */ - type UnreceivedAcksCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryUnreceivedAcksResponse) => void; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#nextSequenceReceive}. - * @param error Error, if any - * @param [response] QueryNextSequenceReceiveResponse - */ - type NextSequenceReceiveCallback = (error: (Error|null), response?: ibc.core.channel.v1.QueryNextSequenceReceiveResponse) => void; - } - - /** Properties of a QueryChannelRequest. */ - interface IQueryChannelRequest { - - /** QueryChannelRequest port_id */ - port_id?: (string|null); - - /** QueryChannelRequest channel_id */ - channel_id?: (string|null); - } - - /** Represents a QueryChannelRequest. */ - class QueryChannelRequest implements IQueryChannelRequest { - - /** - * Constructs a new QueryChannelRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryChannelRequest); - - /** QueryChannelRequest port_id. */ - public port_id: string; - - /** QueryChannelRequest channel_id. */ - public channel_id: string; - - /** - * Encodes the specified QueryChannelRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelRequest.verify|verify} messages. - * @param message QueryChannelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryChannelRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelRequest.verify|verify} messages. - * @param message QueryChannelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryChannelRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryChannelRequest; - - /** - * Decodes a QueryChannelRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryChannelRequest; - - /** - * Verifies a QueryChannelRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryChannelRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryChannelRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryChannelRequest; - - /** - * Creates a plain object from a QueryChannelRequest message. Also converts values to other types if specified. - * @param message QueryChannelRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryChannelRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryChannelResponse. */ - interface IQueryChannelResponse { - - /** QueryChannelResponse channel */ - channel?: (ibc.core.channel.v1.IChannel|null); - - /** QueryChannelResponse proof */ - proof?: (Uint8Array|null); - - /** QueryChannelResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryChannelResponse. */ - class QueryChannelResponse implements IQueryChannelResponse { - - /** - * Constructs a new QueryChannelResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryChannelResponse); - - /** QueryChannelResponse channel. */ - public channel?: (ibc.core.channel.v1.IChannel|null); - - /** QueryChannelResponse proof. */ - public proof: Uint8Array; - - /** QueryChannelResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryChannelResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelResponse.verify|verify} messages. - * @param message QueryChannelResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryChannelResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryChannelResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelResponse.verify|verify} messages. - * @param message QueryChannelResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryChannelResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryChannelResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryChannelResponse; - - /** - * Decodes a QueryChannelResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryChannelResponse; - - /** - * Verifies a QueryChannelResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryChannelResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryChannelResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryChannelResponse; - - /** - * Creates a plain object from a QueryChannelResponse message. Also converts values to other types if specified. - * @param message QueryChannelResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryChannelResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryChannelResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryChannelsRequest. */ - interface IQueryChannelsRequest { - - /** QueryChannelsRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryChannelsRequest. */ - class QueryChannelsRequest implements IQueryChannelsRequest { - - /** - * Constructs a new QueryChannelsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryChannelsRequest); - - /** QueryChannelsRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsRequest.verify|verify} messages. - * @param message QueryChannelsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryChannelsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsRequest.verify|verify} messages. - * @param message QueryChannelsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryChannelsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryChannelsRequest; - - /** - * Decodes a QueryChannelsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryChannelsRequest; - - /** - * Verifies a QueryChannelsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryChannelsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryChannelsRequest; - - /** - * Creates a plain object from a QueryChannelsRequest message. Also converts values to other types if specified. - * @param message QueryChannelsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryChannelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryChannelsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryChannelsResponse. */ - interface IQueryChannelsResponse { - - /** QueryChannelsResponse channels */ - channels?: (ibc.core.channel.v1.IIdentifiedChannel[]|null); - - /** QueryChannelsResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryChannelsResponse height */ - height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryChannelsResponse. */ - class QueryChannelsResponse implements IQueryChannelsResponse { - - /** - * Constructs a new QueryChannelsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryChannelsResponse); - - /** QueryChannelsResponse channels. */ - public channels: ibc.core.channel.v1.IIdentifiedChannel[]; - - /** QueryChannelsResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryChannelsResponse height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsResponse.verify|verify} messages. - * @param message QueryChannelsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryChannelsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsResponse.verify|verify} messages. - * @param message QueryChannelsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryChannelsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryChannelsResponse; - - /** - * Decodes a QueryChannelsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryChannelsResponse; - - /** - * Verifies a QueryChannelsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryChannelsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryChannelsResponse; - - /** - * Creates a plain object from a QueryChannelsResponse message. Also converts values to other types if specified. - * @param message QueryChannelsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryChannelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryChannelsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConnectionChannelsRequest. */ - interface IQueryConnectionChannelsRequest { - - /** QueryConnectionChannelsRequest connection */ - connection?: (string|null); - - /** QueryConnectionChannelsRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryConnectionChannelsRequest. */ - class QueryConnectionChannelsRequest implements IQueryConnectionChannelsRequest { - - /** - * Constructs a new QueryConnectionChannelsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryConnectionChannelsRequest); - - /** QueryConnectionChannelsRequest connection. */ - public connection: string; - - /** QueryConnectionChannelsRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryConnectionChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsRequest.verify|verify} messages. - * @param message QueryConnectionChannelsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryConnectionChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionChannelsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsRequest.verify|verify} messages. - * @param message QueryConnectionChannelsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryConnectionChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionChannelsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryConnectionChannelsRequest; - - /** - * Decodes a QueryConnectionChannelsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryConnectionChannelsRequest; - - /** - * Verifies a QueryConnectionChannelsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionChannelsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryConnectionChannelsRequest; - - /** - * Creates a plain object from a QueryConnectionChannelsRequest message. Also converts values to other types if specified. - * @param message QueryConnectionChannelsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryConnectionChannelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionChannelsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConnectionChannelsResponse. */ - interface IQueryConnectionChannelsResponse { - - /** QueryConnectionChannelsResponse channels */ - channels?: (ibc.core.channel.v1.IIdentifiedChannel[]|null); - - /** QueryConnectionChannelsResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryConnectionChannelsResponse height */ - height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryConnectionChannelsResponse. */ - class QueryConnectionChannelsResponse implements IQueryConnectionChannelsResponse { - - /** - * Constructs a new QueryConnectionChannelsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryConnectionChannelsResponse); - - /** QueryConnectionChannelsResponse channels. */ - public channels: ibc.core.channel.v1.IIdentifiedChannel[]; - - /** QueryConnectionChannelsResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryConnectionChannelsResponse height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryConnectionChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsResponse.verify|verify} messages. - * @param message QueryConnectionChannelsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryConnectionChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionChannelsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsResponse.verify|verify} messages. - * @param message QueryConnectionChannelsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryConnectionChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionChannelsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryConnectionChannelsResponse; - - /** - * Decodes a QueryConnectionChannelsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryConnectionChannelsResponse; - - /** - * Verifies a QueryConnectionChannelsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionChannelsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryConnectionChannelsResponse; - - /** - * Creates a plain object from a QueryConnectionChannelsResponse message. Also converts values to other types if specified. - * @param message QueryConnectionChannelsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryConnectionChannelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionChannelsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryChannelClientStateRequest. */ - interface IQueryChannelClientStateRequest { - - /** QueryChannelClientStateRequest port_id */ - port_id?: (string|null); - - /** QueryChannelClientStateRequest channel_id */ - channel_id?: (string|null); - } - - /** Represents a QueryChannelClientStateRequest. */ - class QueryChannelClientStateRequest implements IQueryChannelClientStateRequest { - - /** - * Constructs a new QueryChannelClientStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryChannelClientStateRequest); - - /** QueryChannelClientStateRequest port_id. */ - public port_id: string; - - /** QueryChannelClientStateRequest channel_id. */ - public channel_id: string; - - /** - * Encodes the specified QueryChannelClientStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateRequest.verify|verify} messages. - * @param message QueryChannelClientStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryChannelClientStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryChannelClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateRequest.verify|verify} messages. - * @param message QueryChannelClientStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryChannelClientStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryChannelClientStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryChannelClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryChannelClientStateRequest; - - /** - * Decodes a QueryChannelClientStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryChannelClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryChannelClientStateRequest; - - /** - * Verifies a QueryChannelClientStateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryChannelClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryChannelClientStateRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryChannelClientStateRequest; - - /** - * Creates a plain object from a QueryChannelClientStateRequest message. Also converts values to other types if specified. - * @param message QueryChannelClientStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryChannelClientStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryChannelClientStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryChannelClientStateResponse. */ - interface IQueryChannelClientStateResponse { - - /** QueryChannelClientStateResponse identified_client_state */ - identified_client_state?: (ibc.core.client.v1.IIdentifiedClientState|null); - - /** QueryChannelClientStateResponse proof */ - proof?: (Uint8Array|null); - - /** QueryChannelClientStateResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryChannelClientStateResponse. */ - class QueryChannelClientStateResponse implements IQueryChannelClientStateResponse { - - /** - * Constructs a new QueryChannelClientStateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryChannelClientStateResponse); - - /** QueryChannelClientStateResponse identified_client_state. */ - public identified_client_state?: (ibc.core.client.v1.IIdentifiedClientState|null); - - /** QueryChannelClientStateResponse proof. */ - public proof: Uint8Array; - - /** QueryChannelClientStateResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryChannelClientStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateResponse.verify|verify} messages. - * @param message QueryChannelClientStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryChannelClientStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryChannelClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateResponse.verify|verify} messages. - * @param message QueryChannelClientStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryChannelClientStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryChannelClientStateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryChannelClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryChannelClientStateResponse; - - /** - * Decodes a QueryChannelClientStateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryChannelClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryChannelClientStateResponse; - - /** - * Verifies a QueryChannelClientStateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryChannelClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryChannelClientStateResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryChannelClientStateResponse; - - /** - * Creates a plain object from a QueryChannelClientStateResponse message. Also converts values to other types if specified. - * @param message QueryChannelClientStateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryChannelClientStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryChannelClientStateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryChannelConsensusStateRequest. */ - interface IQueryChannelConsensusStateRequest { - - /** QueryChannelConsensusStateRequest port_id */ - port_id?: (string|null); - - /** QueryChannelConsensusStateRequest channel_id */ - channel_id?: (string|null); - - /** QueryChannelConsensusStateRequest revision_number */ - revision_number?: (Long|null); - - /** QueryChannelConsensusStateRequest revision_height */ - revision_height?: (Long|null); - } - - /** Represents a QueryChannelConsensusStateRequest. */ - class QueryChannelConsensusStateRequest implements IQueryChannelConsensusStateRequest { - - /** - * Constructs a new QueryChannelConsensusStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryChannelConsensusStateRequest); - - /** QueryChannelConsensusStateRequest port_id. */ - public port_id: string; - - /** QueryChannelConsensusStateRequest channel_id. */ - public channel_id: string; - - /** QueryChannelConsensusStateRequest revision_number. */ - public revision_number: Long; - - /** QueryChannelConsensusStateRequest revision_height. */ - public revision_height: Long; - - /** - * Encodes the specified QueryChannelConsensusStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateRequest.verify|verify} messages. - * @param message QueryChannelConsensusStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryChannelConsensusStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryChannelConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateRequest.verify|verify} messages. - * @param message QueryChannelConsensusStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryChannelConsensusStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryChannelConsensusStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryChannelConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryChannelConsensusStateRequest; - - /** - * Decodes a QueryChannelConsensusStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryChannelConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryChannelConsensusStateRequest; - - /** - * Verifies a QueryChannelConsensusStateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryChannelConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryChannelConsensusStateRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryChannelConsensusStateRequest; - - /** - * Creates a plain object from a QueryChannelConsensusStateRequest message. Also converts values to other types if specified. - * @param message QueryChannelConsensusStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryChannelConsensusStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryChannelConsensusStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryChannelConsensusStateResponse. */ - interface IQueryChannelConsensusStateResponse { - - /** QueryChannelConsensusStateResponse consensus_state */ - consensus_state?: (google.protobuf.IAny|null); - - /** QueryChannelConsensusStateResponse client_id */ - client_id?: (string|null); - - /** QueryChannelConsensusStateResponse proof */ - proof?: (Uint8Array|null); - - /** QueryChannelConsensusStateResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryChannelConsensusStateResponse. */ - class QueryChannelConsensusStateResponse implements IQueryChannelConsensusStateResponse { - - /** - * Constructs a new QueryChannelConsensusStateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryChannelConsensusStateResponse); - - /** QueryChannelConsensusStateResponse consensus_state. */ - public consensus_state?: (google.protobuf.IAny|null); - - /** QueryChannelConsensusStateResponse client_id. */ - public client_id: string; - - /** QueryChannelConsensusStateResponse proof. */ - public proof: Uint8Array; - - /** QueryChannelConsensusStateResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryChannelConsensusStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateResponse.verify|verify} messages. - * @param message QueryChannelConsensusStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryChannelConsensusStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryChannelConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateResponse.verify|verify} messages. - * @param message QueryChannelConsensusStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryChannelConsensusStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryChannelConsensusStateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryChannelConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryChannelConsensusStateResponse; - - /** - * Decodes a QueryChannelConsensusStateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryChannelConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryChannelConsensusStateResponse; - - /** - * Verifies a QueryChannelConsensusStateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryChannelConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryChannelConsensusStateResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryChannelConsensusStateResponse; - - /** - * Creates a plain object from a QueryChannelConsensusStateResponse message. Also converts values to other types if specified. - * @param message QueryChannelConsensusStateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryChannelConsensusStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryChannelConsensusStateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketCommitmentRequest. */ - interface IQueryPacketCommitmentRequest { - - /** QueryPacketCommitmentRequest port_id */ - port_id?: (string|null); - - /** QueryPacketCommitmentRequest channel_id */ - channel_id?: (string|null); - - /** QueryPacketCommitmentRequest sequence */ - sequence?: (Long|null); - } - - /** Represents a QueryPacketCommitmentRequest. */ - class QueryPacketCommitmentRequest implements IQueryPacketCommitmentRequest { - - /** - * Constructs a new QueryPacketCommitmentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketCommitmentRequest); - - /** QueryPacketCommitmentRequest port_id. */ - public port_id: string; - - /** QueryPacketCommitmentRequest channel_id. */ - public channel_id: string; - - /** QueryPacketCommitmentRequest sequence. */ - public sequence: Long; - - /** - * Encodes the specified QueryPacketCommitmentRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentRequest.verify|verify} messages. - * @param message QueryPacketCommitmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketCommitmentRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentRequest.verify|verify} messages. - * @param message QueryPacketCommitmentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketCommitmentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketCommitmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketCommitmentRequest; - - /** - * Decodes a QueryPacketCommitmentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketCommitmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketCommitmentRequest; - - /** - * Verifies a QueryPacketCommitmentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketCommitmentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketCommitmentRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketCommitmentRequest; - - /** - * Creates a plain object from a QueryPacketCommitmentRequest message. Also converts values to other types if specified. - * @param message QueryPacketCommitmentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketCommitmentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketCommitmentResponse. */ - interface IQueryPacketCommitmentResponse { - - /** QueryPacketCommitmentResponse commitment */ - commitment?: (Uint8Array|null); - - /** QueryPacketCommitmentResponse proof */ - proof?: (Uint8Array|null); - - /** QueryPacketCommitmentResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryPacketCommitmentResponse. */ - class QueryPacketCommitmentResponse implements IQueryPacketCommitmentResponse { - - /** - * Constructs a new QueryPacketCommitmentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketCommitmentResponse); - - /** QueryPacketCommitmentResponse commitment. */ - public commitment: Uint8Array; - - /** QueryPacketCommitmentResponse proof. */ - public proof: Uint8Array; - - /** QueryPacketCommitmentResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryPacketCommitmentResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentResponse.verify|verify} messages. - * @param message QueryPacketCommitmentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketCommitmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketCommitmentResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentResponse.verify|verify} messages. - * @param message QueryPacketCommitmentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketCommitmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketCommitmentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketCommitmentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketCommitmentResponse; - - /** - * Decodes a QueryPacketCommitmentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketCommitmentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketCommitmentResponse; - - /** - * Verifies a QueryPacketCommitmentResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketCommitmentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketCommitmentResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketCommitmentResponse; - - /** - * Creates a plain object from a QueryPacketCommitmentResponse message. Also converts values to other types if specified. - * @param message QueryPacketCommitmentResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketCommitmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketCommitmentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketCommitmentsRequest. */ - interface IQueryPacketCommitmentsRequest { - - /** QueryPacketCommitmentsRequest port_id */ - port_id?: (string|null); - - /** QueryPacketCommitmentsRequest channel_id */ - channel_id?: (string|null); - - /** QueryPacketCommitmentsRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryPacketCommitmentsRequest. */ - class QueryPacketCommitmentsRequest implements IQueryPacketCommitmentsRequest { - - /** - * Constructs a new QueryPacketCommitmentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketCommitmentsRequest); - - /** QueryPacketCommitmentsRequest port_id. */ - public port_id: string; - - /** QueryPacketCommitmentsRequest channel_id. */ - public channel_id: string; - - /** QueryPacketCommitmentsRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryPacketCommitmentsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsRequest.verify|verify} messages. - * @param message QueryPacketCommitmentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketCommitmentsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsRequest.verify|verify} messages. - * @param message QueryPacketCommitmentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketCommitmentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketCommitmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketCommitmentsRequest; - - /** - * Decodes a QueryPacketCommitmentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketCommitmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketCommitmentsRequest; - - /** - * Verifies a QueryPacketCommitmentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketCommitmentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketCommitmentsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketCommitmentsRequest; - - /** - * Creates a plain object from a QueryPacketCommitmentsRequest message. Also converts values to other types if specified. - * @param message QueryPacketCommitmentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketCommitmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketCommitmentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketCommitmentsResponse. */ - interface IQueryPacketCommitmentsResponse { - - /** QueryPacketCommitmentsResponse commitments */ - commitments?: (ibc.core.channel.v1.IPacketState[]|null); - - /** QueryPacketCommitmentsResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryPacketCommitmentsResponse height */ - height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryPacketCommitmentsResponse. */ - class QueryPacketCommitmentsResponse implements IQueryPacketCommitmentsResponse { - - /** - * Constructs a new QueryPacketCommitmentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketCommitmentsResponse); - - /** QueryPacketCommitmentsResponse commitments. */ - public commitments: ibc.core.channel.v1.IPacketState[]; - - /** QueryPacketCommitmentsResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryPacketCommitmentsResponse height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryPacketCommitmentsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsResponse.verify|verify} messages. - * @param message QueryPacketCommitmentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketCommitmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketCommitmentsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsResponse.verify|verify} messages. - * @param message QueryPacketCommitmentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketCommitmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketCommitmentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketCommitmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketCommitmentsResponse; - - /** - * Decodes a QueryPacketCommitmentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketCommitmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketCommitmentsResponse; - - /** - * Verifies a QueryPacketCommitmentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketCommitmentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketCommitmentsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketCommitmentsResponse; - - /** - * Creates a plain object from a QueryPacketCommitmentsResponse message. Also converts values to other types if specified. - * @param message QueryPacketCommitmentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketCommitmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketCommitmentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketReceiptRequest. */ - interface IQueryPacketReceiptRequest { - - /** QueryPacketReceiptRequest port_id */ - port_id?: (string|null); - - /** QueryPacketReceiptRequest channel_id */ - channel_id?: (string|null); - - /** QueryPacketReceiptRequest sequence */ - sequence?: (Long|null); - } - - /** Represents a QueryPacketReceiptRequest. */ - class QueryPacketReceiptRequest implements IQueryPacketReceiptRequest { - - /** - * Constructs a new QueryPacketReceiptRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketReceiptRequest); - - /** QueryPacketReceiptRequest port_id. */ - public port_id: string; - - /** QueryPacketReceiptRequest channel_id. */ - public channel_id: string; - - /** QueryPacketReceiptRequest sequence. */ - public sequence: Long; - - /** - * Encodes the specified QueryPacketReceiptRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptRequest.verify|verify} messages. - * @param message QueryPacketReceiptRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketReceiptRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketReceiptRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptRequest.verify|verify} messages. - * @param message QueryPacketReceiptRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketReceiptRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketReceiptRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketReceiptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketReceiptRequest; - - /** - * Decodes a QueryPacketReceiptRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketReceiptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketReceiptRequest; - - /** - * Verifies a QueryPacketReceiptRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketReceiptRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketReceiptRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketReceiptRequest; - - /** - * Creates a plain object from a QueryPacketReceiptRequest message. Also converts values to other types if specified. - * @param message QueryPacketReceiptRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketReceiptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketReceiptRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketReceiptResponse. */ - interface IQueryPacketReceiptResponse { - - /** QueryPacketReceiptResponse received */ - received?: (boolean|null); - - /** QueryPacketReceiptResponse proof */ - proof?: (Uint8Array|null); - - /** QueryPacketReceiptResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryPacketReceiptResponse. */ - class QueryPacketReceiptResponse implements IQueryPacketReceiptResponse { - - /** - * Constructs a new QueryPacketReceiptResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketReceiptResponse); - - /** QueryPacketReceiptResponse received. */ - public received: boolean; - - /** QueryPacketReceiptResponse proof. */ - public proof: Uint8Array; - - /** QueryPacketReceiptResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryPacketReceiptResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptResponse.verify|verify} messages. - * @param message QueryPacketReceiptResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketReceiptResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketReceiptResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptResponse.verify|verify} messages. - * @param message QueryPacketReceiptResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketReceiptResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketReceiptResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketReceiptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketReceiptResponse; - - /** - * Decodes a QueryPacketReceiptResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketReceiptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketReceiptResponse; - - /** - * Verifies a QueryPacketReceiptResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketReceiptResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketReceiptResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketReceiptResponse; - - /** - * Creates a plain object from a QueryPacketReceiptResponse message. Also converts values to other types if specified. - * @param message QueryPacketReceiptResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketReceiptResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketReceiptResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketAcknowledgementRequest. */ - interface IQueryPacketAcknowledgementRequest { - - /** QueryPacketAcknowledgementRequest port_id */ - port_id?: (string|null); - - /** QueryPacketAcknowledgementRequest channel_id */ - channel_id?: (string|null); - - /** QueryPacketAcknowledgementRequest sequence */ - sequence?: (Long|null); - } - - /** Represents a QueryPacketAcknowledgementRequest. */ - class QueryPacketAcknowledgementRequest implements IQueryPacketAcknowledgementRequest { - - /** - * Constructs a new QueryPacketAcknowledgementRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest); - - /** QueryPacketAcknowledgementRequest port_id. */ - public port_id: string; - - /** QueryPacketAcknowledgementRequest channel_id. */ - public channel_id: string; - - /** QueryPacketAcknowledgementRequest sequence. */ - public sequence: Long; - - /** - * Encodes the specified QueryPacketAcknowledgementRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementRequest.verify|verify} messages. - * @param message QueryPacketAcknowledgementRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketAcknowledgementRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementRequest.verify|verify} messages. - * @param message QueryPacketAcknowledgementRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketAcknowledgementRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketAcknowledgementRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketAcknowledgementRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketAcknowledgementRequest; - - /** - * Decodes a QueryPacketAcknowledgementRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketAcknowledgementRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketAcknowledgementRequest; - - /** - * Verifies a QueryPacketAcknowledgementRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketAcknowledgementRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketAcknowledgementRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketAcknowledgementRequest; - - /** - * Creates a plain object from a QueryPacketAcknowledgementRequest message. Also converts values to other types if specified. - * @param message QueryPacketAcknowledgementRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketAcknowledgementRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketAcknowledgementRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketAcknowledgementResponse. */ - interface IQueryPacketAcknowledgementResponse { - - /** QueryPacketAcknowledgementResponse acknowledgement */ - acknowledgement?: (Uint8Array|null); - - /** QueryPacketAcknowledgementResponse proof */ - proof?: (Uint8Array|null); - - /** QueryPacketAcknowledgementResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryPacketAcknowledgementResponse. */ - class QueryPacketAcknowledgementResponse implements IQueryPacketAcknowledgementResponse { - - /** - * Constructs a new QueryPacketAcknowledgementResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketAcknowledgementResponse); - - /** QueryPacketAcknowledgementResponse acknowledgement. */ - public acknowledgement: Uint8Array; - - /** QueryPacketAcknowledgementResponse proof. */ - public proof: Uint8Array; - - /** QueryPacketAcknowledgementResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryPacketAcknowledgementResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementResponse.verify|verify} messages. - * @param message QueryPacketAcknowledgementResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketAcknowledgementResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketAcknowledgementResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementResponse.verify|verify} messages. - * @param message QueryPacketAcknowledgementResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketAcknowledgementResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketAcknowledgementResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketAcknowledgementResponse; - - /** - * Decodes a QueryPacketAcknowledgementResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketAcknowledgementResponse; - - /** - * Verifies a QueryPacketAcknowledgementResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketAcknowledgementResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketAcknowledgementResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketAcknowledgementResponse; - - /** - * Creates a plain object from a QueryPacketAcknowledgementResponse message. Also converts values to other types if specified. - * @param message QueryPacketAcknowledgementResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketAcknowledgementResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketAcknowledgementResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketAcknowledgementsRequest. */ - interface IQueryPacketAcknowledgementsRequest { - - /** QueryPacketAcknowledgementsRequest port_id */ - port_id?: (string|null); - - /** QueryPacketAcknowledgementsRequest channel_id */ - channel_id?: (string|null); - - /** QueryPacketAcknowledgementsRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** QueryPacketAcknowledgementsRequest packet_commitment_sequences */ - packet_commitment_sequences?: (Long[]|null); - } - - /** Represents a QueryPacketAcknowledgementsRequest. */ - class QueryPacketAcknowledgementsRequest implements IQueryPacketAcknowledgementsRequest { - - /** - * Constructs a new QueryPacketAcknowledgementsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest); - - /** QueryPacketAcknowledgementsRequest port_id. */ - public port_id: string; - - /** QueryPacketAcknowledgementsRequest channel_id. */ - public channel_id: string; - - /** QueryPacketAcknowledgementsRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** QueryPacketAcknowledgementsRequest packet_commitment_sequences. */ - public packet_commitment_sequences: Long[]; - - /** - * Encodes the specified QueryPacketAcknowledgementsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.verify|verify} messages. - * @param message QueryPacketAcknowledgementsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketAcknowledgementsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.verify|verify} messages. - * @param message QueryPacketAcknowledgementsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketAcknowledgementsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketAcknowledgementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketAcknowledgementsRequest; - - /** - * Decodes a QueryPacketAcknowledgementsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketAcknowledgementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketAcknowledgementsRequest; - - /** - * Verifies a QueryPacketAcknowledgementsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketAcknowledgementsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketAcknowledgementsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketAcknowledgementsRequest; - - /** - * Creates a plain object from a QueryPacketAcknowledgementsRequest message. Also converts values to other types if specified. - * @param message QueryPacketAcknowledgementsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketAcknowledgementsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketAcknowledgementsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryPacketAcknowledgementsResponse. */ - interface IQueryPacketAcknowledgementsResponse { - - /** QueryPacketAcknowledgementsResponse acknowledgements */ - acknowledgements?: (ibc.core.channel.v1.IPacketState[]|null); - - /** QueryPacketAcknowledgementsResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryPacketAcknowledgementsResponse height */ - height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryPacketAcknowledgementsResponse. */ - class QueryPacketAcknowledgementsResponse implements IQueryPacketAcknowledgementsResponse { - - /** - * Constructs a new QueryPacketAcknowledgementsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse); - - /** QueryPacketAcknowledgementsResponse acknowledgements. */ - public acknowledgements: ibc.core.channel.v1.IPacketState[]; - - /** QueryPacketAcknowledgementsResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryPacketAcknowledgementsResponse height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryPacketAcknowledgementsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.verify|verify} messages. - * @param message QueryPacketAcknowledgementsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryPacketAcknowledgementsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.verify|verify} messages. - * @param message QueryPacketAcknowledgementsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryPacketAcknowledgementsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryPacketAcknowledgementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryPacketAcknowledgementsResponse; - - /** - * Decodes a QueryPacketAcknowledgementsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryPacketAcknowledgementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryPacketAcknowledgementsResponse; - - /** - * Verifies a QueryPacketAcknowledgementsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryPacketAcknowledgementsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryPacketAcknowledgementsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryPacketAcknowledgementsResponse; - - /** - * Creates a plain object from a QueryPacketAcknowledgementsResponse message. Also converts values to other types if specified. - * @param message QueryPacketAcknowledgementsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryPacketAcknowledgementsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryPacketAcknowledgementsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryUnreceivedPacketsRequest. */ - interface IQueryUnreceivedPacketsRequest { - - /** QueryUnreceivedPacketsRequest port_id */ - port_id?: (string|null); - - /** QueryUnreceivedPacketsRequest channel_id */ - channel_id?: (string|null); - - /** QueryUnreceivedPacketsRequest packet_commitment_sequences */ - packet_commitment_sequences?: (Long[]|null); - } - - /** Represents a QueryUnreceivedPacketsRequest. */ - class QueryUnreceivedPacketsRequest implements IQueryUnreceivedPacketsRequest { - - /** - * Constructs a new QueryUnreceivedPacketsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest); - - /** QueryUnreceivedPacketsRequest port_id. */ - public port_id: string; - - /** QueryUnreceivedPacketsRequest channel_id. */ - public channel_id: string; - - /** QueryUnreceivedPacketsRequest packet_commitment_sequences. */ - public packet_commitment_sequences: Long[]; - - /** - * Encodes the specified QueryUnreceivedPacketsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsRequest.verify|verify} messages. - * @param message QueryUnreceivedPacketsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryUnreceivedPacketsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsRequest.verify|verify} messages. - * @param message QueryUnreceivedPacketsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryUnreceivedPacketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryUnreceivedPacketsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryUnreceivedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryUnreceivedPacketsRequest; - - /** - * Decodes a QueryUnreceivedPacketsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryUnreceivedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryUnreceivedPacketsRequest; - - /** - * Verifies a QueryUnreceivedPacketsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryUnreceivedPacketsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryUnreceivedPacketsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryUnreceivedPacketsRequest; - - /** - * Creates a plain object from a QueryUnreceivedPacketsRequest message. Also converts values to other types if specified. - * @param message QueryUnreceivedPacketsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryUnreceivedPacketsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryUnreceivedPacketsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryUnreceivedPacketsResponse. */ - interface IQueryUnreceivedPacketsResponse { - - /** QueryUnreceivedPacketsResponse sequences */ - sequences?: (Long[]|null); - - /** QueryUnreceivedPacketsResponse height */ - height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryUnreceivedPacketsResponse. */ - class QueryUnreceivedPacketsResponse implements IQueryUnreceivedPacketsResponse { - - /** - * Constructs a new QueryUnreceivedPacketsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryUnreceivedPacketsResponse); - - /** QueryUnreceivedPacketsResponse sequences. */ - public sequences: Long[]; - - /** QueryUnreceivedPacketsResponse height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryUnreceivedPacketsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsResponse.verify|verify} messages. - * @param message QueryUnreceivedPacketsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryUnreceivedPacketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryUnreceivedPacketsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsResponse.verify|verify} messages. - * @param message QueryUnreceivedPacketsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryUnreceivedPacketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryUnreceivedPacketsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryUnreceivedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryUnreceivedPacketsResponse; - - /** - * Decodes a QueryUnreceivedPacketsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryUnreceivedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryUnreceivedPacketsResponse; - - /** - * Verifies a QueryUnreceivedPacketsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryUnreceivedPacketsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryUnreceivedPacketsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryUnreceivedPacketsResponse; - - /** - * Creates a plain object from a QueryUnreceivedPacketsResponse message. Also converts values to other types if specified. - * @param message QueryUnreceivedPacketsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryUnreceivedPacketsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryUnreceivedPacketsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryUnreceivedAcksRequest. */ - interface IQueryUnreceivedAcksRequest { - - /** QueryUnreceivedAcksRequest port_id */ - port_id?: (string|null); - - /** QueryUnreceivedAcksRequest channel_id */ - channel_id?: (string|null); - - /** QueryUnreceivedAcksRequest packet_ack_sequences */ - packet_ack_sequences?: (Long[]|null); - } - - /** Represents a QueryUnreceivedAcksRequest. */ - class QueryUnreceivedAcksRequest implements IQueryUnreceivedAcksRequest { - - /** - * Constructs a new QueryUnreceivedAcksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryUnreceivedAcksRequest); - - /** QueryUnreceivedAcksRequest port_id. */ - public port_id: string; - - /** QueryUnreceivedAcksRequest channel_id. */ - public channel_id: string; - - /** QueryUnreceivedAcksRequest packet_ack_sequences. */ - public packet_ack_sequences: Long[]; - - /** - * Encodes the specified QueryUnreceivedAcksRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksRequest.verify|verify} messages. - * @param message QueryUnreceivedAcksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryUnreceivedAcksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryUnreceivedAcksRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksRequest.verify|verify} messages. - * @param message QueryUnreceivedAcksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryUnreceivedAcksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryUnreceivedAcksRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryUnreceivedAcksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryUnreceivedAcksRequest; - - /** - * Decodes a QueryUnreceivedAcksRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryUnreceivedAcksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryUnreceivedAcksRequest; - - /** - * Verifies a QueryUnreceivedAcksRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryUnreceivedAcksRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryUnreceivedAcksRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryUnreceivedAcksRequest; - - /** - * Creates a plain object from a QueryUnreceivedAcksRequest message. Also converts values to other types if specified. - * @param message QueryUnreceivedAcksRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryUnreceivedAcksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryUnreceivedAcksRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryUnreceivedAcksResponse. */ - interface IQueryUnreceivedAcksResponse { - - /** QueryUnreceivedAcksResponse sequences */ - sequences?: (Long[]|null); - - /** QueryUnreceivedAcksResponse height */ - height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryUnreceivedAcksResponse. */ - class QueryUnreceivedAcksResponse implements IQueryUnreceivedAcksResponse { - - /** - * Constructs a new QueryUnreceivedAcksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryUnreceivedAcksResponse); - - /** QueryUnreceivedAcksResponse sequences. */ - public sequences: Long[]; - - /** QueryUnreceivedAcksResponse height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryUnreceivedAcksResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksResponse.verify|verify} messages. - * @param message QueryUnreceivedAcksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryUnreceivedAcksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryUnreceivedAcksResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksResponse.verify|verify} messages. - * @param message QueryUnreceivedAcksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryUnreceivedAcksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryUnreceivedAcksResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryUnreceivedAcksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryUnreceivedAcksResponse; - - /** - * Decodes a QueryUnreceivedAcksResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryUnreceivedAcksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryUnreceivedAcksResponse; - - /** - * Verifies a QueryUnreceivedAcksResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryUnreceivedAcksResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryUnreceivedAcksResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryUnreceivedAcksResponse; - - /** - * Creates a plain object from a QueryUnreceivedAcksResponse message. Also converts values to other types if specified. - * @param message QueryUnreceivedAcksResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryUnreceivedAcksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryUnreceivedAcksResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryNextSequenceReceiveRequest. */ - interface IQueryNextSequenceReceiveRequest { - - /** QueryNextSequenceReceiveRequest port_id */ - port_id?: (string|null); - - /** QueryNextSequenceReceiveRequest channel_id */ - channel_id?: (string|null); - } - - /** Represents a QueryNextSequenceReceiveRequest. */ - class QueryNextSequenceReceiveRequest implements IQueryNextSequenceReceiveRequest { - - /** - * Constructs a new QueryNextSequenceReceiveRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest); - - /** QueryNextSequenceReceiveRequest port_id. */ - public port_id: string; - - /** QueryNextSequenceReceiveRequest channel_id. */ - public channel_id: string; - - /** - * Encodes the specified QueryNextSequenceReceiveRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveRequest.verify|verify} messages. - * @param message QueryNextSequenceReceiveRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryNextSequenceReceiveRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveRequest.verify|verify} messages. - * @param message QueryNextSequenceReceiveRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryNextSequenceReceiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryNextSequenceReceiveRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryNextSequenceReceiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryNextSequenceReceiveRequest; - - /** - * Decodes a QueryNextSequenceReceiveRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryNextSequenceReceiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryNextSequenceReceiveRequest; - - /** - * Verifies a QueryNextSequenceReceiveRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryNextSequenceReceiveRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryNextSequenceReceiveRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryNextSequenceReceiveRequest; - - /** - * Creates a plain object from a QueryNextSequenceReceiveRequest message. Also converts values to other types if specified. - * @param message QueryNextSequenceReceiveRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryNextSequenceReceiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryNextSequenceReceiveRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryNextSequenceReceiveResponse. */ - interface IQueryNextSequenceReceiveResponse { - - /** QueryNextSequenceReceiveResponse next_sequence_receive */ - next_sequence_receive?: (Long|null); - - /** QueryNextSequenceReceiveResponse proof */ - proof?: (Uint8Array|null); - - /** QueryNextSequenceReceiveResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryNextSequenceReceiveResponse. */ - class QueryNextSequenceReceiveResponse implements IQueryNextSequenceReceiveResponse { - - /** - * Constructs a new QueryNextSequenceReceiveResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IQueryNextSequenceReceiveResponse); - - /** QueryNextSequenceReceiveResponse next_sequence_receive. */ - public next_sequence_receive: Long; - - /** QueryNextSequenceReceiveResponse proof. */ - public proof: Uint8Array; - - /** QueryNextSequenceReceiveResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryNextSequenceReceiveResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveResponse.verify|verify} messages. - * @param message QueryNextSequenceReceiveResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IQueryNextSequenceReceiveResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryNextSequenceReceiveResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveResponse.verify|verify} messages. - * @param message QueryNextSequenceReceiveResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IQueryNextSequenceReceiveResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryNextSequenceReceiveResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryNextSequenceReceiveResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.QueryNextSequenceReceiveResponse; - - /** - * Decodes a QueryNextSequenceReceiveResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryNextSequenceReceiveResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.QueryNextSequenceReceiveResponse; - - /** - * Verifies a QueryNextSequenceReceiveResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryNextSequenceReceiveResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryNextSequenceReceiveResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.QueryNextSequenceReceiveResponse; - - /** - * Creates a plain object from a QueryNextSequenceReceiveResponse message. Also converts values to other types if specified. - * @param message QueryNextSequenceReceiveResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.QueryNextSequenceReceiveResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryNextSequenceReceiveResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState channels */ - channels?: (ibc.core.channel.v1.IIdentifiedChannel[]|null); - - /** GenesisState acknowledgements */ - acknowledgements?: (ibc.core.channel.v1.IPacketState[]|null); - - /** GenesisState commitments */ - commitments?: (ibc.core.channel.v1.IPacketState[]|null); - - /** GenesisState receipts */ - receipts?: (ibc.core.channel.v1.IPacketState[]|null); - - /** GenesisState send_sequences */ - send_sequences?: (ibc.core.channel.v1.IPacketSequence[]|null); - - /** GenesisState recv_sequences */ - recv_sequences?: (ibc.core.channel.v1.IPacketSequence[]|null); - - /** GenesisState ack_sequences */ - ack_sequences?: (ibc.core.channel.v1.IPacketSequence[]|null); - - /** GenesisState next_channel_sequence */ - next_channel_sequence?: (Long|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IGenesisState); - - /** GenesisState channels. */ - public channels: ibc.core.channel.v1.IIdentifiedChannel[]; - - /** GenesisState acknowledgements. */ - public acknowledgements: ibc.core.channel.v1.IPacketState[]; - - /** GenesisState commitments. */ - public commitments: ibc.core.channel.v1.IPacketState[]; - - /** GenesisState receipts. */ - public receipts: ibc.core.channel.v1.IPacketState[]; - - /** GenesisState send_sequences. */ - public send_sequences: ibc.core.channel.v1.IPacketSequence[]; - - /** GenesisState recv_sequences. */ - public recv_sequences: ibc.core.channel.v1.IPacketSequence[]; - - /** GenesisState ack_sequences. */ - public ack_sequences: ibc.core.channel.v1.IPacketSequence[]; - - /** GenesisState next_channel_sequence. */ - public next_channel_sequence: Long; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.channel.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.channel.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketSequence. */ - interface IPacketSequence { - - /** PacketSequence port_id */ - port_id?: (string|null); - - /** PacketSequence channel_id */ - channel_id?: (string|null); - - /** PacketSequence sequence */ - sequence?: (Long|null); - } - - /** Represents a PacketSequence. */ - class PacketSequence implements IPacketSequence { - - /** - * Constructs a new PacketSequence. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.channel.v1.IPacketSequence); - - /** PacketSequence port_id. */ - public port_id: string; - - /** PacketSequence channel_id. */ - public channel_id: string; - - /** PacketSequence sequence. */ - public sequence: Long; - - /** - * Encodes the specified PacketSequence message. Does not implicitly {@link ibc.core.channel.v1.PacketSequence.verify|verify} messages. - * @param message PacketSequence message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.channel.v1.IPacketSequence, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketSequence message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketSequence.verify|verify} messages. - * @param message PacketSequence message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.channel.v1.IPacketSequence, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketSequence message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketSequence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.channel.v1.PacketSequence; - - /** - * Decodes a PacketSequence message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketSequence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.channel.v1.PacketSequence; - - /** - * Verifies a PacketSequence message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketSequence message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketSequence - */ - public static fromObject(object: { [k: string]: any }): ibc.core.channel.v1.PacketSequence; - - /** - * Creates a plain object from a PacketSequence message. Also converts values to other types if specified. - * @param message PacketSequence - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.channel.v1.PacketSequence, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketSequence to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace client. */ - namespace client { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of an IdentifiedClientState. */ - interface IIdentifiedClientState { - - /** IdentifiedClientState client_id */ - client_id?: (string|null); - - /** IdentifiedClientState client_state */ - client_state?: (google.protobuf.IAny|null); - } - - /** Represents an IdentifiedClientState. */ - class IdentifiedClientState implements IIdentifiedClientState { - - /** - * Constructs a new IdentifiedClientState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IIdentifiedClientState); - - /** IdentifiedClientState client_id. */ - public client_id: string; - - /** IdentifiedClientState client_state. */ - public client_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified IdentifiedClientState message. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @param message IdentifiedClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IIdentifiedClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IdentifiedClientState message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @param message IdentifiedClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IIdentifiedClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.IdentifiedClientState; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.IdentifiedClientState; - - /** - * Verifies an IdentifiedClientState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IdentifiedClientState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentifiedClientState - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.IdentifiedClientState; - - /** - * Creates a plain object from an IdentifiedClientState message. Also converts values to other types if specified. - * @param message IdentifiedClientState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.IdentifiedClientState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IdentifiedClientState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConsensusStateWithHeight. */ - interface IConsensusStateWithHeight { - - /** ConsensusStateWithHeight height */ - height?: (ibc.core.client.v1.IHeight|null); - - /** ConsensusStateWithHeight consensus_state */ - consensus_state?: (google.protobuf.IAny|null); - } - - /** Represents a ConsensusStateWithHeight. */ - class ConsensusStateWithHeight implements IConsensusStateWithHeight { - - /** - * Constructs a new ConsensusStateWithHeight. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IConsensusStateWithHeight); - - /** ConsensusStateWithHeight height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** ConsensusStateWithHeight consensus_state. */ - public consensus_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified ConsensusStateWithHeight message. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @param message ConsensusStateWithHeight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IConsensusStateWithHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsensusStateWithHeight message, length delimited. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @param message ConsensusStateWithHeight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IConsensusStateWithHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.ConsensusStateWithHeight; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.ConsensusStateWithHeight; - - /** - * Verifies a ConsensusStateWithHeight message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsensusStateWithHeight message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsensusStateWithHeight - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.ConsensusStateWithHeight; - - /** - * Creates a plain object from a ConsensusStateWithHeight message. Also converts values to other types if specified. - * @param message ConsensusStateWithHeight - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.ConsensusStateWithHeight, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsensusStateWithHeight to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ClientConsensusStates. */ - interface IClientConsensusStates { - - /** ClientConsensusStates client_id */ - client_id?: (string|null); - - /** ClientConsensusStates consensus_states */ - consensus_states?: (ibc.core.client.v1.IConsensusStateWithHeight[]|null); - } - - /** Represents a ClientConsensusStates. */ - class ClientConsensusStates implements IClientConsensusStates { - - /** - * Constructs a new ClientConsensusStates. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IClientConsensusStates); - - /** ClientConsensusStates client_id. */ - public client_id: string; - - /** ClientConsensusStates consensus_states. */ - public consensus_states: ibc.core.client.v1.IConsensusStateWithHeight[]; - - /** - * Encodes the specified ClientConsensusStates message. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @param message ClientConsensusStates message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IClientConsensusStates, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientConsensusStates message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @param message ClientConsensusStates message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IClientConsensusStates, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.ClientConsensusStates; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.ClientConsensusStates; - - /** - * Verifies a ClientConsensusStates message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientConsensusStates message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientConsensusStates - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.ClientConsensusStates; - - /** - * Creates a plain object from a ClientConsensusStates message. Also converts values to other types if specified. - * @param message ClientConsensusStates - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.ClientConsensusStates, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientConsensusStates to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ClientUpdateProposal. */ - interface IClientUpdateProposal { - - /** ClientUpdateProposal title */ - title?: (string|null); - - /** ClientUpdateProposal description */ - description?: (string|null); - - /** ClientUpdateProposal subject_client_id */ - subject_client_id?: (string|null); - - /** ClientUpdateProposal substitute_client_id */ - substitute_client_id?: (string|null); - } - - /** Represents a ClientUpdateProposal. */ - class ClientUpdateProposal implements IClientUpdateProposal { - - /** - * Constructs a new ClientUpdateProposal. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IClientUpdateProposal); - - /** ClientUpdateProposal title. */ - public title: string; - - /** ClientUpdateProposal description. */ - public description: string; - - /** ClientUpdateProposal subject_client_id. */ - public subject_client_id: string; - - /** ClientUpdateProposal substitute_client_id. */ - public substitute_client_id: string; - - /** - * Encodes the specified ClientUpdateProposal message. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @param message ClientUpdateProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IClientUpdateProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientUpdateProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @param message ClientUpdateProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IClientUpdateProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.ClientUpdateProposal; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.ClientUpdateProposal; - - /** - * Verifies a ClientUpdateProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientUpdateProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientUpdateProposal - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.ClientUpdateProposal; - - /** - * Creates a plain object from a ClientUpdateProposal message. Also converts values to other types if specified. - * @param message ClientUpdateProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.ClientUpdateProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientUpdateProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpgradeProposal. */ - interface IUpgradeProposal { - - /** UpgradeProposal title */ - title?: (string|null); - - /** UpgradeProposal description */ - description?: (string|null); - - /** UpgradeProposal plan */ - plan?: (cosmos.upgrade.v1beta1.IPlan|null); - - /** UpgradeProposal upgraded_client_state */ - upgraded_client_state?: (google.protobuf.IAny|null); - } - - /** Represents an UpgradeProposal. */ - class UpgradeProposal implements IUpgradeProposal { - - /** - * Constructs a new UpgradeProposal. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IUpgradeProposal); - - /** UpgradeProposal title. */ - public title: string; - - /** UpgradeProposal description. */ - public description: string; - - /** UpgradeProposal plan. */ - public plan?: (cosmos.upgrade.v1beta1.IPlan|null); - - /** UpgradeProposal upgraded_client_state. */ - public upgraded_client_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified UpgradeProposal message. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @param message UpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @param message UpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.UpgradeProposal; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.UpgradeProposal; - - /** - * Verifies an UpgradeProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeProposal - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.UpgradeProposal; - - /** - * Creates a plain object from an UpgradeProposal message. Also converts values to other types if specified. - * @param message UpgradeProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.UpgradeProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Height. */ - interface IHeight { - - /** Height revision_number */ - revision_number?: (Long|null); - - /** Height revision_height */ - revision_height?: (Long|null); - } - - /** Represents an Height. */ - class Height implements IHeight { - - /** - * Constructs a new Height. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IHeight); - - /** Height revision_number. */ - public revision_number: Long; - - /** Height revision_height. */ - public revision_height: Long; - - /** - * Encodes the specified Height message. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @param message Height message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Height message, length delimited. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @param message Height message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Height message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.Height; - - /** - * Decodes an Height message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.Height; - - /** - * Verifies an Height message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Height message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Height - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.Height; - - /** - * Creates a plain object from an Height message. Also converts values to other types if specified. - * @param message Height - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.Height, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Height to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params allowed_clients */ - allowed_clients?: (string[]|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IParams); - - /** Params allowed_clients. */ - public allowed_clients: string[]; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls CreateClient. - * @param request MsgCreateClient message or plain object - * @param callback Node-style callback called with the error, if any, and MsgCreateClientResponse - */ - public createClient(request: ibc.core.client.v1.IMsgCreateClient, callback: ibc.core.client.v1.Msg.CreateClientCallback): void; - - /** - * Calls CreateClient. - * @param request MsgCreateClient message or plain object - * @returns Promise - */ - public createClient(request: ibc.core.client.v1.IMsgCreateClient): Promise; - - /** - * Calls UpdateClient. - * @param request MsgUpdateClient message or plain object - * @param callback Node-style callback called with the error, if any, and MsgUpdateClientResponse - */ - public updateClient(request: ibc.core.client.v1.IMsgUpdateClient, callback: ibc.core.client.v1.Msg.UpdateClientCallback): void; - - /** - * Calls UpdateClient. - * @param request MsgUpdateClient message or plain object - * @returns Promise - */ - public updateClient(request: ibc.core.client.v1.IMsgUpdateClient): Promise; - - /** - * Calls UpgradeClient. - * @param request MsgUpgradeClient message or plain object - * @param callback Node-style callback called with the error, if any, and MsgUpgradeClientResponse - */ - public upgradeClient(request: ibc.core.client.v1.IMsgUpgradeClient, callback: ibc.core.client.v1.Msg.UpgradeClientCallback): void; - - /** - * Calls UpgradeClient. - * @param request MsgUpgradeClient message or plain object - * @returns Promise - */ - public upgradeClient(request: ibc.core.client.v1.IMsgUpgradeClient): Promise; - - /** - * Calls SubmitMisbehaviour. - * @param request MsgSubmitMisbehaviour message or plain object - * @param callback Node-style callback called with the error, if any, and MsgSubmitMisbehaviourResponse - */ - public submitMisbehaviour(request: ibc.core.client.v1.IMsgSubmitMisbehaviour, callback: ibc.core.client.v1.Msg.SubmitMisbehaviourCallback): void; - - /** - * Calls SubmitMisbehaviour. - * @param request MsgSubmitMisbehaviour message or plain object - * @returns Promise - */ - public submitMisbehaviour(request: ibc.core.client.v1.IMsgSubmitMisbehaviour): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#createClient}. - * @param error Error, if any - * @param [response] MsgCreateClientResponse - */ - type CreateClientCallback = (error: (Error|null), response?: ibc.core.client.v1.MsgCreateClientResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#updateClient}. - * @param error Error, if any - * @param [response] MsgUpdateClientResponse - */ - type UpdateClientCallback = (error: (Error|null), response?: ibc.core.client.v1.MsgUpdateClientResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#upgradeClient}. - * @param error Error, if any - * @param [response] MsgUpgradeClientResponse - */ - type UpgradeClientCallback = (error: (Error|null), response?: ibc.core.client.v1.MsgUpgradeClientResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#submitMisbehaviour}. - * @param error Error, if any - * @param [response] MsgSubmitMisbehaviourResponse - */ - type SubmitMisbehaviourCallback = (error: (Error|null), response?: ibc.core.client.v1.MsgSubmitMisbehaviourResponse) => void; - } - - /** Properties of a MsgCreateClient. */ - interface IMsgCreateClient { - - /** MsgCreateClient client_state */ - client_state?: (google.protobuf.IAny|null); - - /** MsgCreateClient consensus_state */ - consensus_state?: (google.protobuf.IAny|null); - - /** MsgCreateClient signer */ - signer?: (string|null); - } - - /** Represents a MsgCreateClient. */ - class MsgCreateClient implements IMsgCreateClient { - - /** - * Constructs a new MsgCreateClient. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IMsgCreateClient); - - /** MsgCreateClient client_state. */ - public client_state?: (google.protobuf.IAny|null); - - /** MsgCreateClient consensus_state. */ - public consensus_state?: (google.protobuf.IAny|null); - - /** MsgCreateClient signer. */ - public signer: string; - - /** - * Encodes the specified MsgCreateClient message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. - * @param message MsgCreateClient message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IMsgCreateClient, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgCreateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. - * @param message MsgCreateClient message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IMsgCreateClient, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgCreateClient message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgCreateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.MsgCreateClient; - - /** - * Decodes a MsgCreateClient message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgCreateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.MsgCreateClient; - - /** - * Verifies a MsgCreateClient message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgCreateClient message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgCreateClient - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.MsgCreateClient; - - /** - * Creates a plain object from a MsgCreateClient message. Also converts values to other types if specified. - * @param message MsgCreateClient - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.MsgCreateClient, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgCreateClient to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgCreateClientResponse. */ - interface IMsgCreateClientResponse { - } - - /** Represents a MsgCreateClientResponse. */ - class MsgCreateClientResponse implements IMsgCreateClientResponse { - - /** - * Constructs a new MsgCreateClientResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IMsgCreateClientResponse); - - /** - * Encodes the specified MsgCreateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. - * @param message MsgCreateClientResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IMsgCreateClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgCreateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. - * @param message MsgCreateClientResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IMsgCreateClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgCreateClientResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgCreateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.MsgCreateClientResponse; - - /** - * Decodes a MsgCreateClientResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgCreateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.MsgCreateClientResponse; - - /** - * Verifies a MsgCreateClientResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgCreateClientResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgCreateClientResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.MsgCreateClientResponse; - - /** - * Creates a plain object from a MsgCreateClientResponse message. Also converts values to other types if specified. - * @param message MsgCreateClientResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.MsgCreateClientResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgCreateClientResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgUpdateClient. */ - interface IMsgUpdateClient { - - /** MsgUpdateClient client_id */ - client_id?: (string|null); - - /** MsgUpdateClient header */ - header?: (google.protobuf.IAny|null); - - /** MsgUpdateClient signer */ - signer?: (string|null); - } - - /** Represents a MsgUpdateClient. */ - class MsgUpdateClient implements IMsgUpdateClient { - - /** - * Constructs a new MsgUpdateClient. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IMsgUpdateClient); - - /** MsgUpdateClient client_id. */ - public client_id: string; - - /** MsgUpdateClient header. */ - public header?: (google.protobuf.IAny|null); - - /** MsgUpdateClient signer. */ - public signer: string; - - /** - * Encodes the specified MsgUpdateClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. - * @param message MsgUpdateClient message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IMsgUpdateClient, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgUpdateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. - * @param message MsgUpdateClient message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IMsgUpdateClient, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgUpdateClient message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgUpdateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.MsgUpdateClient; - - /** - * Decodes a MsgUpdateClient message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgUpdateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.MsgUpdateClient; - - /** - * Verifies a MsgUpdateClient message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgUpdateClient message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgUpdateClient - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.MsgUpdateClient; - - /** - * Creates a plain object from a MsgUpdateClient message. Also converts values to other types if specified. - * @param message MsgUpdateClient - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.MsgUpdateClient, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgUpdateClient to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgUpdateClientResponse. */ - interface IMsgUpdateClientResponse { - } - - /** Represents a MsgUpdateClientResponse. */ - class MsgUpdateClientResponse implements IMsgUpdateClientResponse { - - /** - * Constructs a new MsgUpdateClientResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IMsgUpdateClientResponse); - - /** - * Encodes the specified MsgUpdateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. - * @param message MsgUpdateClientResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IMsgUpdateClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgUpdateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. - * @param message MsgUpdateClientResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IMsgUpdateClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgUpdateClientResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgUpdateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.MsgUpdateClientResponse; - - /** - * Decodes a MsgUpdateClientResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgUpdateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.MsgUpdateClientResponse; - - /** - * Verifies a MsgUpdateClientResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgUpdateClientResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgUpdateClientResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.MsgUpdateClientResponse; - - /** - * Creates a plain object from a MsgUpdateClientResponse message. Also converts values to other types if specified. - * @param message MsgUpdateClientResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.MsgUpdateClientResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgUpdateClientResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgUpgradeClient. */ - interface IMsgUpgradeClient { - - /** MsgUpgradeClient client_id */ - client_id?: (string|null); - - /** MsgUpgradeClient client_state */ - client_state?: (google.protobuf.IAny|null); - - /** MsgUpgradeClient consensus_state */ - consensus_state?: (google.protobuf.IAny|null); - - /** MsgUpgradeClient proof_upgrade_client */ - proof_upgrade_client?: (Uint8Array|null); - - /** MsgUpgradeClient proof_upgrade_consensus_state */ - proof_upgrade_consensus_state?: (Uint8Array|null); - - /** MsgUpgradeClient signer */ - signer?: (string|null); - } - - /** Represents a MsgUpgradeClient. */ - class MsgUpgradeClient implements IMsgUpgradeClient { - - /** - * Constructs a new MsgUpgradeClient. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IMsgUpgradeClient); - - /** MsgUpgradeClient client_id. */ - public client_id: string; - - /** MsgUpgradeClient client_state. */ - public client_state?: (google.protobuf.IAny|null); - - /** MsgUpgradeClient consensus_state. */ - public consensus_state?: (google.protobuf.IAny|null); - - /** MsgUpgradeClient proof_upgrade_client. */ - public proof_upgrade_client: Uint8Array; - - /** MsgUpgradeClient proof_upgrade_consensus_state. */ - public proof_upgrade_consensus_state: Uint8Array; - - /** MsgUpgradeClient signer. */ - public signer: string; - - /** - * Encodes the specified MsgUpgradeClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. - * @param message MsgUpgradeClient message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IMsgUpgradeClient, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgUpgradeClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. - * @param message MsgUpgradeClient message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IMsgUpgradeClient, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgUpgradeClient message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgUpgradeClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.MsgUpgradeClient; - - /** - * Decodes a MsgUpgradeClient message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgUpgradeClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.MsgUpgradeClient; - - /** - * Verifies a MsgUpgradeClient message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgUpgradeClient message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgUpgradeClient - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.MsgUpgradeClient; - - /** - * Creates a plain object from a MsgUpgradeClient message. Also converts values to other types if specified. - * @param message MsgUpgradeClient - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.MsgUpgradeClient, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgUpgradeClient to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgUpgradeClientResponse. */ - interface IMsgUpgradeClientResponse { - } - - /** Represents a MsgUpgradeClientResponse. */ - class MsgUpgradeClientResponse implements IMsgUpgradeClientResponse { - - /** - * Constructs a new MsgUpgradeClientResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IMsgUpgradeClientResponse); - - /** - * Encodes the specified MsgUpgradeClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. - * @param message MsgUpgradeClientResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IMsgUpgradeClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgUpgradeClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. - * @param message MsgUpgradeClientResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IMsgUpgradeClientResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgUpgradeClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.MsgUpgradeClientResponse; - - /** - * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgUpgradeClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.MsgUpgradeClientResponse; - - /** - * Verifies a MsgUpgradeClientResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgUpgradeClientResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgUpgradeClientResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.MsgUpgradeClientResponse; - - /** - * Creates a plain object from a MsgUpgradeClientResponse message. Also converts values to other types if specified. - * @param message MsgUpgradeClientResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.MsgUpgradeClientResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgUpgradeClientResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitMisbehaviour. */ - interface IMsgSubmitMisbehaviour { - - /** MsgSubmitMisbehaviour client_id */ - client_id?: (string|null); - - /** MsgSubmitMisbehaviour misbehaviour */ - misbehaviour?: (google.protobuf.IAny|null); - - /** MsgSubmitMisbehaviour signer */ - signer?: (string|null); - } - - /** Represents a MsgSubmitMisbehaviour. */ - class MsgSubmitMisbehaviour implements IMsgSubmitMisbehaviour { - - /** - * Constructs a new MsgSubmitMisbehaviour. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IMsgSubmitMisbehaviour); - - /** MsgSubmitMisbehaviour client_id. */ - public client_id: string; - - /** MsgSubmitMisbehaviour misbehaviour. */ - public misbehaviour?: (google.protobuf.IAny|null); - - /** MsgSubmitMisbehaviour signer. */ - public signer: string; - - /** - * Encodes the specified MsgSubmitMisbehaviour message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. - * @param message MsgSubmitMisbehaviour message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IMsgSubmitMisbehaviour, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitMisbehaviour message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. - * @param message MsgSubmitMisbehaviour message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IMsgSubmitMisbehaviour, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitMisbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.MsgSubmitMisbehaviour; - - /** - * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitMisbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.MsgSubmitMisbehaviour; - - /** - * Verifies a MsgSubmitMisbehaviour message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitMisbehaviour message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitMisbehaviour - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.MsgSubmitMisbehaviour; - - /** - * Creates a plain object from a MsgSubmitMisbehaviour message. Also converts values to other types if specified. - * @param message MsgSubmitMisbehaviour - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.MsgSubmitMisbehaviour, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitMisbehaviour to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitMisbehaviourResponse. */ - interface IMsgSubmitMisbehaviourResponse { - } - - /** Represents a MsgSubmitMisbehaviourResponse. */ - class MsgSubmitMisbehaviourResponse implements IMsgSubmitMisbehaviourResponse { - - /** - * Constructs a new MsgSubmitMisbehaviourResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IMsgSubmitMisbehaviourResponse); - - /** - * Encodes the specified MsgSubmitMisbehaviourResponse message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. - * @param message MsgSubmitMisbehaviourResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IMsgSubmitMisbehaviourResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitMisbehaviourResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. - * @param message MsgSubmitMisbehaviourResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IMsgSubmitMisbehaviourResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitMisbehaviourResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.MsgSubmitMisbehaviourResponse; - - /** - * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitMisbehaviourResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.MsgSubmitMisbehaviourResponse; - - /** - * Verifies a MsgSubmitMisbehaviourResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitMisbehaviourResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitMisbehaviourResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.MsgSubmitMisbehaviourResponse; - - /** - * Creates a plain object from a MsgSubmitMisbehaviourResponse message. Also converts values to other types if specified. - * @param message MsgSubmitMisbehaviourResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.MsgSubmitMisbehaviourResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitMisbehaviourResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls ClientState. - * @param request QueryClientStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryClientStateResponse - */ - public clientState(request: ibc.core.client.v1.IQueryClientStateRequest, callback: ibc.core.client.v1.Query.ClientStateCallback): void; - - /** - * Calls ClientState. - * @param request QueryClientStateRequest message or plain object - * @returns Promise - */ - public clientState(request: ibc.core.client.v1.IQueryClientStateRequest): Promise; - - /** - * Calls ClientStates. - * @param request QueryClientStatesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryClientStatesResponse - */ - public clientStates(request: ibc.core.client.v1.IQueryClientStatesRequest, callback: ibc.core.client.v1.Query.ClientStatesCallback): void; - - /** - * Calls ClientStates. - * @param request QueryClientStatesRequest message or plain object - * @returns Promise - */ - public clientStates(request: ibc.core.client.v1.IQueryClientStatesRequest): Promise; - - /** - * Calls ConsensusState. - * @param request QueryConsensusStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConsensusStateResponse - */ - public consensusState(request: ibc.core.client.v1.IQueryConsensusStateRequest, callback: ibc.core.client.v1.Query.ConsensusStateCallback): void; - - /** - * Calls ConsensusState. - * @param request QueryConsensusStateRequest message or plain object - * @returns Promise - */ - public consensusState(request: ibc.core.client.v1.IQueryConsensusStateRequest): Promise; - - /** - * Calls ConsensusStates. - * @param request QueryConsensusStatesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConsensusStatesResponse - */ - public consensusStates(request: ibc.core.client.v1.IQueryConsensusStatesRequest, callback: ibc.core.client.v1.Query.ConsensusStatesCallback): void; - - /** - * Calls ConsensusStates. - * @param request QueryConsensusStatesRequest message or plain object - * @returns Promise - */ - public consensusStates(request: ibc.core.client.v1.IQueryConsensusStatesRequest): Promise; - - /** - * Calls ConsensusStateHeights. - * @param request QueryConsensusStateHeightsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConsensusStateHeightsResponse - */ - public consensusStateHeights(request: ibc.core.client.v1.IQueryConsensusStateHeightsRequest, callback: ibc.core.client.v1.Query.ConsensusStateHeightsCallback): void; - - /** - * Calls ConsensusStateHeights. - * @param request QueryConsensusStateHeightsRequest message or plain object - * @returns Promise - */ - public consensusStateHeights(request: ibc.core.client.v1.IQueryConsensusStateHeightsRequest): Promise; - - /** - * Calls ClientStatus. - * @param request QueryClientStatusRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryClientStatusResponse - */ - public clientStatus(request: ibc.core.client.v1.IQueryClientStatusRequest, callback: ibc.core.client.v1.Query.ClientStatusCallback): void; - - /** - * Calls ClientStatus. - * @param request QueryClientStatusRequest message or plain object - * @returns Promise - */ - public clientStatus(request: ibc.core.client.v1.IQueryClientStatusRequest): Promise; - - /** - * Calls ClientParams. - * @param request QueryClientParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryClientParamsResponse - */ - public clientParams(request: ibc.core.client.v1.IQueryClientParamsRequest, callback: ibc.core.client.v1.Query.ClientParamsCallback): void; - - /** - * Calls ClientParams. - * @param request QueryClientParamsRequest message or plain object - * @returns Promise - */ - public clientParams(request: ibc.core.client.v1.IQueryClientParamsRequest): Promise; - - /** - * Calls UpgradedClientState. - * @param request QueryUpgradedClientStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryUpgradedClientStateResponse - */ - public upgradedClientState(request: ibc.core.client.v1.IQueryUpgradedClientStateRequest, callback: ibc.core.client.v1.Query.UpgradedClientStateCallback): void; - - /** - * Calls UpgradedClientState. - * @param request QueryUpgradedClientStateRequest message or plain object - * @returns Promise - */ - public upgradedClientState(request: ibc.core.client.v1.IQueryUpgradedClientStateRequest): Promise; - - /** - * Calls UpgradedConsensusState. - * @param request QueryUpgradedConsensusStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryUpgradedConsensusStateResponse - */ - public upgradedConsensusState(request: ibc.core.client.v1.IQueryUpgradedConsensusStateRequest, callback: ibc.core.client.v1.Query.UpgradedConsensusStateCallback): void; - - /** - * Calls UpgradedConsensusState. - * @param request QueryUpgradedConsensusStateRequest message or plain object - * @returns Promise - */ - public upgradedConsensusState(request: ibc.core.client.v1.IQueryUpgradedConsensusStateRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientState}. - * @param error Error, if any - * @param [response] QueryClientStateResponse - */ - type ClientStateCallback = (error: (Error|null), response?: ibc.core.client.v1.QueryClientStateResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientStates}. - * @param error Error, if any - * @param [response] QueryClientStatesResponse - */ - type ClientStatesCallback = (error: (Error|null), response?: ibc.core.client.v1.QueryClientStatesResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#consensusState}. - * @param error Error, if any - * @param [response] QueryConsensusStateResponse - */ - type ConsensusStateCallback = (error: (Error|null), response?: ibc.core.client.v1.QueryConsensusStateResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#consensusStates}. - * @param error Error, if any - * @param [response] QueryConsensusStatesResponse - */ - type ConsensusStatesCallback = (error: (Error|null), response?: ibc.core.client.v1.QueryConsensusStatesResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#consensusStateHeights}. - * @param error Error, if any - * @param [response] QueryConsensusStateHeightsResponse - */ - type ConsensusStateHeightsCallback = (error: (Error|null), response?: ibc.core.client.v1.QueryConsensusStateHeightsResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientStatus}. - * @param error Error, if any - * @param [response] QueryClientStatusResponse - */ - type ClientStatusCallback = (error: (Error|null), response?: ibc.core.client.v1.QueryClientStatusResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientParams}. - * @param error Error, if any - * @param [response] QueryClientParamsResponse - */ - type ClientParamsCallback = (error: (Error|null), response?: ibc.core.client.v1.QueryClientParamsResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#upgradedClientState}. - * @param error Error, if any - * @param [response] QueryUpgradedClientStateResponse - */ - type UpgradedClientStateCallback = (error: (Error|null), response?: ibc.core.client.v1.QueryUpgradedClientStateResponse) => void; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#upgradedConsensusState}. - * @param error Error, if any - * @param [response] QueryUpgradedConsensusStateResponse - */ - type UpgradedConsensusStateCallback = (error: (Error|null), response?: ibc.core.client.v1.QueryUpgradedConsensusStateResponse) => void; - } - - /** Properties of a QueryClientStateRequest. */ - interface IQueryClientStateRequest { - - /** QueryClientStateRequest client_id */ - client_id?: (string|null); - } - - /** Represents a QueryClientStateRequest. */ - class QueryClientStateRequest implements IQueryClientStateRequest { - - /** - * Constructs a new QueryClientStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryClientStateRequest); - - /** QueryClientStateRequest client_id. */ - public client_id: string; - - /** - * Encodes the specified QueryClientStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. - * @param message QueryClientStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryClientStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. - * @param message QueryClientStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryClientStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryClientStateRequest; - - /** - * Decodes a QueryClientStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryClientStateRequest; - - /** - * Verifies a QueryClientStateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientStateRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryClientStateRequest; - - /** - * Creates a plain object from a QueryClientStateRequest message. Also converts values to other types if specified. - * @param message QueryClientStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryClientStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryClientStateResponse. */ - interface IQueryClientStateResponse { - - /** QueryClientStateResponse client_state */ - client_state?: (google.protobuf.IAny|null); - - /** QueryClientStateResponse proof */ - proof?: (Uint8Array|null); - - /** QueryClientStateResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryClientStateResponse. */ - class QueryClientStateResponse implements IQueryClientStateResponse { - - /** - * Constructs a new QueryClientStateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryClientStateResponse); - - /** QueryClientStateResponse client_state. */ - public client_state?: (google.protobuf.IAny|null); - - /** QueryClientStateResponse proof. */ - public proof: Uint8Array; - - /** QueryClientStateResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryClientStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. - * @param message QueryClientStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryClientStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. - * @param message QueryClientStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryClientStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientStateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryClientStateResponse; - - /** - * Decodes a QueryClientStateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryClientStateResponse; - - /** - * Verifies a QueryClientStateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientStateResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryClientStateResponse; - - /** - * Creates a plain object from a QueryClientStateResponse message. Also converts values to other types if specified. - * @param message QueryClientStateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryClientStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientStateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryClientStatesRequest. */ - interface IQueryClientStatesRequest { - - /** QueryClientStatesRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryClientStatesRequest. */ - class QueryClientStatesRequest implements IQueryClientStatesRequest { - - /** - * Constructs a new QueryClientStatesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryClientStatesRequest); - - /** QueryClientStatesRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryClientStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. - * @param message QueryClientStatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryClientStatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. - * @param message QueryClientStatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryClientStatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientStatesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryClientStatesRequest; - - /** - * Decodes a QueryClientStatesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryClientStatesRequest; - - /** - * Verifies a QueryClientStatesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientStatesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientStatesRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryClientStatesRequest; - - /** - * Creates a plain object from a QueryClientStatesRequest message. Also converts values to other types if specified. - * @param message QueryClientStatesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryClientStatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientStatesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryClientStatesResponse. */ - interface IQueryClientStatesResponse { - - /** QueryClientStatesResponse client_states */ - client_states?: (ibc.core.client.v1.IIdentifiedClientState[]|null); - - /** QueryClientStatesResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - } - - /** Represents a QueryClientStatesResponse. */ - class QueryClientStatesResponse implements IQueryClientStatesResponse { - - /** - * Constructs a new QueryClientStatesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryClientStatesResponse); - - /** QueryClientStatesResponse client_states. */ - public client_states: ibc.core.client.v1.IIdentifiedClientState[]; - - /** QueryClientStatesResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** - * Encodes the specified QueryClientStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. - * @param message QueryClientStatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryClientStatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. - * @param message QueryClientStatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryClientStatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientStatesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryClientStatesResponse; - - /** - * Decodes a QueryClientStatesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryClientStatesResponse; - - /** - * Verifies a QueryClientStatesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientStatesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientStatesResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryClientStatesResponse; - - /** - * Creates a plain object from a QueryClientStatesResponse message. Also converts values to other types if specified. - * @param message QueryClientStatesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryClientStatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientStatesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConsensusStateRequest. */ - interface IQueryConsensusStateRequest { - - /** QueryConsensusStateRequest client_id */ - client_id?: (string|null); - - /** QueryConsensusStateRequest revision_number */ - revision_number?: (Long|null); - - /** QueryConsensusStateRequest revision_height */ - revision_height?: (Long|null); - - /** QueryConsensusStateRequest latest_height */ - latest_height?: (boolean|null); - } - - /** Represents a QueryConsensusStateRequest. */ - class QueryConsensusStateRequest implements IQueryConsensusStateRequest { - - /** - * Constructs a new QueryConsensusStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryConsensusStateRequest); - - /** QueryConsensusStateRequest client_id. */ - public client_id: string; - - /** QueryConsensusStateRequest revision_number. */ - public revision_number: Long; - - /** QueryConsensusStateRequest revision_height. */ - public revision_height: Long; - - /** QueryConsensusStateRequest latest_height. */ - public latest_height: boolean; - - /** - * Encodes the specified QueryConsensusStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. - * @param message QueryConsensusStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryConsensusStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. - * @param message QueryConsensusStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryConsensusStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConsensusStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryConsensusStateRequest; - - /** - * Decodes a QueryConsensusStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryConsensusStateRequest; - - /** - * Verifies a QueryConsensusStateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConsensusStateRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryConsensusStateRequest; - - /** - * Creates a plain object from a QueryConsensusStateRequest message. Also converts values to other types if specified. - * @param message QueryConsensusStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryConsensusStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConsensusStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConsensusStateResponse. */ - interface IQueryConsensusStateResponse { - - /** QueryConsensusStateResponse consensus_state */ - consensus_state?: (google.protobuf.IAny|null); - - /** QueryConsensusStateResponse proof */ - proof?: (Uint8Array|null); - - /** QueryConsensusStateResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryConsensusStateResponse. */ - class QueryConsensusStateResponse implements IQueryConsensusStateResponse { - - /** - * Constructs a new QueryConsensusStateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryConsensusStateResponse); - - /** QueryConsensusStateResponse consensus_state. */ - public consensus_state?: (google.protobuf.IAny|null); - - /** QueryConsensusStateResponse proof. */ - public proof: Uint8Array; - - /** QueryConsensusStateResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryConsensusStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. - * @param message QueryConsensusStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryConsensusStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. - * @param message QueryConsensusStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryConsensusStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConsensusStateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryConsensusStateResponse; - - /** - * Decodes a QueryConsensusStateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryConsensusStateResponse; - - /** - * Verifies a QueryConsensusStateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConsensusStateResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryConsensusStateResponse; - - /** - * Creates a plain object from a QueryConsensusStateResponse message. Also converts values to other types if specified. - * @param message QueryConsensusStateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryConsensusStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConsensusStateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConsensusStatesRequest. */ - interface IQueryConsensusStatesRequest { - - /** QueryConsensusStatesRequest client_id */ - client_id?: (string|null); - - /** QueryConsensusStatesRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryConsensusStatesRequest. */ - class QueryConsensusStatesRequest implements IQueryConsensusStatesRequest { - - /** - * Constructs a new QueryConsensusStatesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryConsensusStatesRequest); - - /** QueryConsensusStatesRequest client_id. */ - public client_id: string; - - /** QueryConsensusStatesRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryConsensusStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. - * @param message QueryConsensusStatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryConsensusStatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConsensusStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. - * @param message QueryConsensusStatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryConsensusStatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConsensusStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryConsensusStatesRequest; - - /** - * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConsensusStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryConsensusStatesRequest; - - /** - * Verifies a QueryConsensusStatesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConsensusStatesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConsensusStatesRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryConsensusStatesRequest; - - /** - * Creates a plain object from a QueryConsensusStatesRequest message. Also converts values to other types if specified. - * @param message QueryConsensusStatesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryConsensusStatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConsensusStatesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConsensusStatesResponse. */ - interface IQueryConsensusStatesResponse { - - /** QueryConsensusStatesResponse consensus_states */ - consensus_states?: (ibc.core.client.v1.IConsensusStateWithHeight[]|null); - - /** QueryConsensusStatesResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - } - - /** Represents a QueryConsensusStatesResponse. */ - class QueryConsensusStatesResponse implements IQueryConsensusStatesResponse { - - /** - * Constructs a new QueryConsensusStatesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryConsensusStatesResponse); - - /** QueryConsensusStatesResponse consensus_states. */ - public consensus_states: ibc.core.client.v1.IConsensusStateWithHeight[]; - - /** QueryConsensusStatesResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** - * Encodes the specified QueryConsensusStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. - * @param message QueryConsensusStatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryConsensusStatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConsensusStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. - * @param message QueryConsensusStatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryConsensusStatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConsensusStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryConsensusStatesResponse; - - /** - * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConsensusStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryConsensusStatesResponse; - - /** - * Verifies a QueryConsensusStatesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConsensusStatesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConsensusStatesResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryConsensusStatesResponse; - - /** - * Creates a plain object from a QueryConsensusStatesResponse message. Also converts values to other types if specified. - * @param message QueryConsensusStatesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryConsensusStatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConsensusStatesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConsensusStateHeightsRequest. */ - interface IQueryConsensusStateHeightsRequest { - - /** QueryConsensusStateHeightsRequest client_id */ - client_id?: (string|null); - - /** QueryConsensusStateHeightsRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryConsensusStateHeightsRequest. */ - class QueryConsensusStateHeightsRequest implements IQueryConsensusStateHeightsRequest { - - /** - * Constructs a new QueryConsensusStateHeightsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryConsensusStateHeightsRequest); - - /** QueryConsensusStateHeightsRequest client_id. */ - public client_id: string; - - /** QueryConsensusStateHeightsRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryConsensusStateHeightsRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsRequest.verify|verify} messages. - * @param message QueryConsensusStateHeightsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryConsensusStateHeightsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConsensusStateHeightsRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsRequest.verify|verify} messages. - * @param message QueryConsensusStateHeightsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryConsensusStateHeightsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConsensusStateHeightsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConsensusStateHeightsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryConsensusStateHeightsRequest; - - /** - * Decodes a QueryConsensusStateHeightsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConsensusStateHeightsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryConsensusStateHeightsRequest; - - /** - * Verifies a QueryConsensusStateHeightsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConsensusStateHeightsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConsensusStateHeightsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryConsensusStateHeightsRequest; - - /** - * Creates a plain object from a QueryConsensusStateHeightsRequest message. Also converts values to other types if specified. - * @param message QueryConsensusStateHeightsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryConsensusStateHeightsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConsensusStateHeightsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConsensusStateHeightsResponse. */ - interface IQueryConsensusStateHeightsResponse { - - /** QueryConsensusStateHeightsResponse consensus_state_heights */ - consensus_state_heights?: (ibc.core.client.v1.IHeight[]|null); - - /** QueryConsensusStateHeightsResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - } - - /** Represents a QueryConsensusStateHeightsResponse. */ - class QueryConsensusStateHeightsResponse implements IQueryConsensusStateHeightsResponse { - - /** - * Constructs a new QueryConsensusStateHeightsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryConsensusStateHeightsResponse); - - /** QueryConsensusStateHeightsResponse consensus_state_heights. */ - public consensus_state_heights: ibc.core.client.v1.IHeight[]; - - /** QueryConsensusStateHeightsResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** - * Encodes the specified QueryConsensusStateHeightsResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsResponse.verify|verify} messages. - * @param message QueryConsensusStateHeightsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryConsensusStateHeightsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConsensusStateHeightsResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsResponse.verify|verify} messages. - * @param message QueryConsensusStateHeightsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryConsensusStateHeightsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConsensusStateHeightsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConsensusStateHeightsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryConsensusStateHeightsResponse; - - /** - * Decodes a QueryConsensusStateHeightsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConsensusStateHeightsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryConsensusStateHeightsResponse; - - /** - * Verifies a QueryConsensusStateHeightsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConsensusStateHeightsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConsensusStateHeightsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryConsensusStateHeightsResponse; - - /** - * Creates a plain object from a QueryConsensusStateHeightsResponse message. Also converts values to other types if specified. - * @param message QueryConsensusStateHeightsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryConsensusStateHeightsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConsensusStateHeightsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryClientStatusRequest. */ - interface IQueryClientStatusRequest { - - /** QueryClientStatusRequest client_id */ - client_id?: (string|null); - } - - /** Represents a QueryClientStatusRequest. */ - class QueryClientStatusRequest implements IQueryClientStatusRequest { - - /** - * Constructs a new QueryClientStatusRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryClientStatusRequest); - - /** QueryClientStatusRequest client_id. */ - public client_id: string; - - /** - * Encodes the specified QueryClientStatusRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusRequest.verify|verify} messages. - * @param message QueryClientStatusRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryClientStatusRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientStatusRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusRequest.verify|verify} messages. - * @param message QueryClientStatusRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryClientStatusRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientStatusRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryClientStatusRequest; - - /** - * Decodes a QueryClientStatusRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryClientStatusRequest; - - /** - * Verifies a QueryClientStatusRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientStatusRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientStatusRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryClientStatusRequest; - - /** - * Creates a plain object from a QueryClientStatusRequest message. Also converts values to other types if specified. - * @param message QueryClientStatusRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryClientStatusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientStatusRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryClientStatusResponse. */ - interface IQueryClientStatusResponse { - - /** QueryClientStatusResponse status */ - status?: (string|null); - } - - /** Represents a QueryClientStatusResponse. */ - class QueryClientStatusResponse implements IQueryClientStatusResponse { - - /** - * Constructs a new QueryClientStatusResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryClientStatusResponse); - - /** QueryClientStatusResponse status. */ - public status: string; - - /** - * Encodes the specified QueryClientStatusResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusResponse.verify|verify} messages. - * @param message QueryClientStatusResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryClientStatusResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientStatusResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusResponse.verify|verify} messages. - * @param message QueryClientStatusResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryClientStatusResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientStatusResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryClientStatusResponse; - - /** - * Decodes a QueryClientStatusResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryClientStatusResponse; - - /** - * Verifies a QueryClientStatusResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientStatusResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientStatusResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryClientStatusResponse; - - /** - * Creates a plain object from a QueryClientStatusResponse message. Also converts values to other types if specified. - * @param message QueryClientStatusResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryClientStatusResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientStatusResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryClientParamsRequest. */ - interface IQueryClientParamsRequest { - } - - /** Represents a QueryClientParamsRequest. */ - class QueryClientParamsRequest implements IQueryClientParamsRequest { - - /** - * Constructs a new QueryClientParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryClientParamsRequest); - - /** - * Encodes the specified QueryClientParamsRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. - * @param message QueryClientParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryClientParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientParamsRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. - * @param message QueryClientParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryClientParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryClientParamsRequest; - - /** - * Decodes a QueryClientParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryClientParamsRequest; - - /** - * Verifies a QueryClientParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientParamsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryClientParamsRequest; - - /** - * Creates a plain object from a QueryClientParamsRequest message. Also converts values to other types if specified. - * @param message QueryClientParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryClientParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryClientParamsResponse. */ - interface IQueryClientParamsResponse { - - /** QueryClientParamsResponse params */ - params?: (ibc.core.client.v1.IParams|null); - } - - /** Represents a QueryClientParamsResponse. */ - class QueryClientParamsResponse implements IQueryClientParamsResponse { - - /** - * Constructs a new QueryClientParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryClientParamsResponse); - - /** QueryClientParamsResponse params. */ - public params?: (ibc.core.client.v1.IParams|null); - - /** - * Encodes the specified QueryClientParamsResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. - * @param message QueryClientParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryClientParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientParamsResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. - * @param message QueryClientParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryClientParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryClientParamsResponse; - - /** - * Decodes a QueryClientParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryClientParamsResponse; - - /** - * Verifies a QueryClientParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientParamsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryClientParamsResponse; - - /** - * Creates a plain object from a QueryClientParamsResponse message. Also converts values to other types if specified. - * @param message QueryClientParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryClientParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryUpgradedClientStateRequest. */ - interface IQueryUpgradedClientStateRequest { - } - - /** Represents a QueryUpgradedClientStateRequest. */ - class QueryUpgradedClientStateRequest implements IQueryUpgradedClientStateRequest { - - /** - * Constructs a new QueryUpgradedClientStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryUpgradedClientStateRequest); - - /** - * Encodes the specified QueryUpgradedClientStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateRequest.verify|verify} messages. - * @param message QueryUpgradedClientStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryUpgradedClientStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryUpgradedClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateRequest.verify|verify} messages. - * @param message QueryUpgradedClientStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryUpgradedClientStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryUpgradedClientStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryUpgradedClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryUpgradedClientStateRequest; - - /** - * Decodes a QueryUpgradedClientStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryUpgradedClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryUpgradedClientStateRequest; - - /** - * Verifies a QueryUpgradedClientStateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryUpgradedClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryUpgradedClientStateRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryUpgradedClientStateRequest; - - /** - * Creates a plain object from a QueryUpgradedClientStateRequest message. Also converts values to other types if specified. - * @param message QueryUpgradedClientStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryUpgradedClientStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryUpgradedClientStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryUpgradedClientStateResponse. */ - interface IQueryUpgradedClientStateResponse { - - /** QueryUpgradedClientStateResponse upgraded_client_state */ - upgraded_client_state?: (google.protobuf.IAny|null); - } - - /** Represents a QueryUpgradedClientStateResponse. */ - class QueryUpgradedClientStateResponse implements IQueryUpgradedClientStateResponse { - - /** - * Constructs a new QueryUpgradedClientStateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryUpgradedClientStateResponse); - - /** QueryUpgradedClientStateResponse upgraded_client_state. */ - public upgraded_client_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified QueryUpgradedClientStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateResponse.verify|verify} messages. - * @param message QueryUpgradedClientStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryUpgradedClientStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryUpgradedClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateResponse.verify|verify} messages. - * @param message QueryUpgradedClientStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryUpgradedClientStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryUpgradedClientStateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryUpgradedClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryUpgradedClientStateResponse; - - /** - * Decodes a QueryUpgradedClientStateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryUpgradedClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryUpgradedClientStateResponse; - - /** - * Verifies a QueryUpgradedClientStateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryUpgradedClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryUpgradedClientStateResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryUpgradedClientStateResponse; - - /** - * Creates a plain object from a QueryUpgradedClientStateResponse message. Also converts values to other types if specified. - * @param message QueryUpgradedClientStateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryUpgradedClientStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryUpgradedClientStateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryUpgradedConsensusStateRequest. */ - interface IQueryUpgradedConsensusStateRequest { - } - - /** Represents a QueryUpgradedConsensusStateRequest. */ - class QueryUpgradedConsensusStateRequest implements IQueryUpgradedConsensusStateRequest { - - /** - * Constructs a new QueryUpgradedConsensusStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryUpgradedConsensusStateRequest); - - /** - * Encodes the specified QueryUpgradedConsensusStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateRequest.verify|verify} messages. - * @param message QueryUpgradedConsensusStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryUpgradedConsensusStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryUpgradedConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateRequest.verify|verify} messages. - * @param message QueryUpgradedConsensusStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryUpgradedConsensusStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryUpgradedConsensusStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryUpgradedConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryUpgradedConsensusStateRequest; - - /** - * Decodes a QueryUpgradedConsensusStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryUpgradedConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryUpgradedConsensusStateRequest; - - /** - * Verifies a QueryUpgradedConsensusStateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryUpgradedConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryUpgradedConsensusStateRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryUpgradedConsensusStateRequest; - - /** - * Creates a plain object from a QueryUpgradedConsensusStateRequest message. Also converts values to other types if specified. - * @param message QueryUpgradedConsensusStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryUpgradedConsensusStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryUpgradedConsensusStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryUpgradedConsensusStateResponse. */ - interface IQueryUpgradedConsensusStateResponse { - - /** QueryUpgradedConsensusStateResponse upgraded_consensus_state */ - upgraded_consensus_state?: (google.protobuf.IAny|null); - } - - /** Represents a QueryUpgradedConsensusStateResponse. */ - class QueryUpgradedConsensusStateResponse implements IQueryUpgradedConsensusStateResponse { - - /** - * Constructs a new QueryUpgradedConsensusStateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IQueryUpgradedConsensusStateResponse); - - /** QueryUpgradedConsensusStateResponse upgraded_consensus_state. */ - public upgraded_consensus_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified QueryUpgradedConsensusStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateResponse.verify|verify} messages. - * @param message QueryUpgradedConsensusStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IQueryUpgradedConsensusStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryUpgradedConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateResponse.verify|verify} messages. - * @param message QueryUpgradedConsensusStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IQueryUpgradedConsensusStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryUpgradedConsensusStateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryUpgradedConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.QueryUpgradedConsensusStateResponse; - - /** - * Decodes a QueryUpgradedConsensusStateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryUpgradedConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.QueryUpgradedConsensusStateResponse; - - /** - * Verifies a QueryUpgradedConsensusStateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryUpgradedConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryUpgradedConsensusStateResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.QueryUpgradedConsensusStateResponse; - - /** - * Creates a plain object from a QueryUpgradedConsensusStateResponse message. Also converts values to other types if specified. - * @param message QueryUpgradedConsensusStateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.QueryUpgradedConsensusStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryUpgradedConsensusStateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState clients */ - clients?: (ibc.core.client.v1.IIdentifiedClientState[]|null); - - /** GenesisState clients_consensus */ - clients_consensus?: (ibc.core.client.v1.IClientConsensusStates[]|null); - - /** GenesisState clients_metadata */ - clients_metadata?: (ibc.core.client.v1.IIdentifiedGenesisMetadata[]|null); - - /** GenesisState params */ - params?: (ibc.core.client.v1.IParams|null); - - /** GenesisState create_localhost */ - create_localhost?: (boolean|null); - - /** GenesisState next_client_sequence */ - next_client_sequence?: (Long|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IGenesisState); - - /** GenesisState clients. */ - public clients: ibc.core.client.v1.IIdentifiedClientState[]; - - /** GenesisState clients_consensus. */ - public clients_consensus: ibc.core.client.v1.IClientConsensusStates[]; - - /** GenesisState clients_metadata. */ - public clients_metadata: ibc.core.client.v1.IIdentifiedGenesisMetadata[]; - - /** GenesisState params. */ - public params?: (ibc.core.client.v1.IParams|null); - - /** GenesisState create_localhost. */ - public create_localhost: boolean; - - /** GenesisState next_client_sequence. */ - public next_client_sequence: Long; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisMetadata. */ - interface IGenesisMetadata { - - /** GenesisMetadata key */ - key?: (Uint8Array|null); - - /** GenesisMetadata value */ - value?: (Uint8Array|null); - } - - /** Represents a GenesisMetadata. */ - class GenesisMetadata implements IGenesisMetadata { - - /** - * Constructs a new GenesisMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IGenesisMetadata); - - /** GenesisMetadata key. */ - public key: Uint8Array; - - /** GenesisMetadata value. */ - public value: Uint8Array; - - /** - * Encodes the specified GenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. - * @param message GenesisMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IGenesisMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. - * @param message GenesisMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IGenesisMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.GenesisMetadata; - - /** - * Decodes a GenesisMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.GenesisMetadata; - - /** - * Verifies a GenesisMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisMetadata - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.GenesisMetadata; - - /** - * Creates a plain object from a GenesisMetadata message. Also converts values to other types if specified. - * @param message GenesisMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.GenesisMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IdentifiedGenesisMetadata. */ - interface IIdentifiedGenesisMetadata { - - /** IdentifiedGenesisMetadata client_id */ - client_id?: (string|null); - - /** IdentifiedGenesisMetadata client_metadata */ - client_metadata?: (ibc.core.client.v1.IGenesisMetadata[]|null); - } - - /** Represents an IdentifiedGenesisMetadata. */ - class IdentifiedGenesisMetadata implements IIdentifiedGenesisMetadata { - - /** - * Constructs a new IdentifiedGenesisMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IIdentifiedGenesisMetadata); - - /** IdentifiedGenesisMetadata client_id. */ - public client_id: string; - - /** IdentifiedGenesisMetadata client_metadata. */ - public client_metadata: ibc.core.client.v1.IGenesisMetadata[]; - - /** - * Encodes the specified IdentifiedGenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. - * @param message IdentifiedGenesisMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IIdentifiedGenesisMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IdentifiedGenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. - * @param message IdentifiedGenesisMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IIdentifiedGenesisMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentifiedGenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.IdentifiedGenesisMetadata; - - /** - * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentifiedGenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.IdentifiedGenesisMetadata; - - /** - * Verifies an IdentifiedGenesisMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IdentifiedGenesisMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentifiedGenesisMetadata - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.IdentifiedGenesisMetadata; - - /** - * Creates a plain object from an IdentifiedGenesisMetadata message. Also converts values to other types if specified. - * @param message IdentifiedGenesisMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.IdentifiedGenesisMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IdentifiedGenesisMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace commitment. */ - namespace commitment { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a MerkleRoot. */ - interface IMerkleRoot { - - /** MerkleRoot hash */ - hash?: (Uint8Array|null); - } - - /** Represents a MerkleRoot. */ - class MerkleRoot implements IMerkleRoot { - - /** - * Constructs a new MerkleRoot. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.commitment.v1.IMerkleRoot); - - /** MerkleRoot hash. */ - public hash: Uint8Array; - - /** - * Encodes the specified MerkleRoot message. Does not implicitly {@link ibc.core.commitment.v1.MerkleRoot.verify|verify} messages. - * @param message MerkleRoot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.commitment.v1.IMerkleRoot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MerkleRoot message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerkleRoot.verify|verify} messages. - * @param message MerkleRoot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.commitment.v1.IMerkleRoot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MerkleRoot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MerkleRoot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.commitment.v1.MerkleRoot; - - /** - * Decodes a MerkleRoot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MerkleRoot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.commitment.v1.MerkleRoot; - - /** - * Verifies a MerkleRoot message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MerkleRoot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MerkleRoot - */ - public static fromObject(object: { [k: string]: any }): ibc.core.commitment.v1.MerkleRoot; - - /** - * Creates a plain object from a MerkleRoot message. Also converts values to other types if specified. - * @param message MerkleRoot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.commitment.v1.MerkleRoot, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MerkleRoot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MerklePrefix. */ - interface IMerklePrefix { - - /** MerklePrefix key_prefix */ - key_prefix?: (Uint8Array|null); - } - - /** Represents a MerklePrefix. */ - class MerklePrefix implements IMerklePrefix { - - /** - * Constructs a new MerklePrefix. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.commitment.v1.IMerklePrefix); - - /** MerklePrefix key_prefix. */ - public key_prefix: Uint8Array; - - /** - * Encodes the specified MerklePrefix message. Does not implicitly {@link ibc.core.commitment.v1.MerklePrefix.verify|verify} messages. - * @param message MerklePrefix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.commitment.v1.IMerklePrefix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MerklePrefix message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerklePrefix.verify|verify} messages. - * @param message MerklePrefix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.commitment.v1.IMerklePrefix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MerklePrefix message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MerklePrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.commitment.v1.MerklePrefix; - - /** - * Decodes a MerklePrefix message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MerklePrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.commitment.v1.MerklePrefix; - - /** - * Verifies a MerklePrefix message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MerklePrefix message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MerklePrefix - */ - public static fromObject(object: { [k: string]: any }): ibc.core.commitment.v1.MerklePrefix; - - /** - * Creates a plain object from a MerklePrefix message. Also converts values to other types if specified. - * @param message MerklePrefix - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.commitment.v1.MerklePrefix, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MerklePrefix to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MerklePath. */ - interface IMerklePath { - - /** MerklePath key_path */ - key_path?: (string[]|null); - } - - /** Represents a MerklePath. */ - class MerklePath implements IMerklePath { - - /** - * Constructs a new MerklePath. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.commitment.v1.IMerklePath); - - /** MerklePath key_path. */ - public key_path: string[]; - - /** - * Encodes the specified MerklePath message. Does not implicitly {@link ibc.core.commitment.v1.MerklePath.verify|verify} messages. - * @param message MerklePath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.commitment.v1.IMerklePath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MerklePath message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerklePath.verify|verify} messages. - * @param message MerklePath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.commitment.v1.IMerklePath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MerklePath message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MerklePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.commitment.v1.MerklePath; - - /** - * Decodes a MerklePath message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MerklePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.commitment.v1.MerklePath; - - /** - * Verifies a MerklePath message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MerklePath message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MerklePath - */ - public static fromObject(object: { [k: string]: any }): ibc.core.commitment.v1.MerklePath; - - /** - * Creates a plain object from a MerklePath message. Also converts values to other types if specified. - * @param message MerklePath - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.commitment.v1.MerklePath, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MerklePath to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MerkleProof. */ - interface IMerkleProof { - - /** MerkleProof proofs */ - proofs?: (ics23.ICommitmentProof[]|null); - } - - /** Represents a MerkleProof. */ - class MerkleProof implements IMerkleProof { - - /** - * Constructs a new MerkleProof. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.commitment.v1.IMerkleProof); - - /** MerkleProof proofs. */ - public proofs: ics23.ICommitmentProof[]; - - /** - * Encodes the specified MerkleProof message. Does not implicitly {@link ibc.core.commitment.v1.MerkleProof.verify|verify} messages. - * @param message MerkleProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.commitment.v1.IMerkleProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MerkleProof message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerkleProof.verify|verify} messages. - * @param message MerkleProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.commitment.v1.IMerkleProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MerkleProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MerkleProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.commitment.v1.MerkleProof; - - /** - * Decodes a MerkleProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MerkleProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.commitment.v1.MerkleProof; - - /** - * Verifies a MerkleProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MerkleProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MerkleProof - */ - public static fromObject(object: { [k: string]: any }): ibc.core.commitment.v1.MerkleProof; - - /** - * Creates a plain object from a MerkleProof message. Also converts values to other types if specified. - * @param message MerkleProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.commitment.v1.MerkleProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MerkleProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace connection. */ - namespace connection { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls ConnectionOpenInit. - * @param request MsgConnectionOpenInit message or plain object - * @param callback Node-style callback called with the error, if any, and MsgConnectionOpenInitResponse - */ - public connectionOpenInit(request: ibc.core.connection.v1.IMsgConnectionOpenInit, callback: ibc.core.connection.v1.Msg.ConnectionOpenInitCallback): void; - - /** - * Calls ConnectionOpenInit. - * @param request MsgConnectionOpenInit message or plain object - * @returns Promise - */ - public connectionOpenInit(request: ibc.core.connection.v1.IMsgConnectionOpenInit): Promise; - - /** - * Calls ConnectionOpenTry. - * @param request MsgConnectionOpenTry message or plain object - * @param callback Node-style callback called with the error, if any, and MsgConnectionOpenTryResponse - */ - public connectionOpenTry(request: ibc.core.connection.v1.IMsgConnectionOpenTry, callback: ibc.core.connection.v1.Msg.ConnectionOpenTryCallback): void; - - /** - * Calls ConnectionOpenTry. - * @param request MsgConnectionOpenTry message or plain object - * @returns Promise - */ - public connectionOpenTry(request: ibc.core.connection.v1.IMsgConnectionOpenTry): Promise; - - /** - * Calls ConnectionOpenAck. - * @param request MsgConnectionOpenAck message or plain object - * @param callback Node-style callback called with the error, if any, and MsgConnectionOpenAckResponse - */ - public connectionOpenAck(request: ibc.core.connection.v1.IMsgConnectionOpenAck, callback: ibc.core.connection.v1.Msg.ConnectionOpenAckCallback): void; - - /** - * Calls ConnectionOpenAck. - * @param request MsgConnectionOpenAck message or plain object - * @returns Promise - */ - public connectionOpenAck(request: ibc.core.connection.v1.IMsgConnectionOpenAck): Promise; - - /** - * Calls ConnectionOpenConfirm. - * @param request MsgConnectionOpenConfirm message or plain object - * @param callback Node-style callback called with the error, if any, and MsgConnectionOpenConfirmResponse - */ - public connectionOpenConfirm(request: ibc.core.connection.v1.IMsgConnectionOpenConfirm, callback: ibc.core.connection.v1.Msg.ConnectionOpenConfirmCallback): void; - - /** - * Calls ConnectionOpenConfirm. - * @param request MsgConnectionOpenConfirm message or plain object - * @returns Promise - */ - public connectionOpenConfirm(request: ibc.core.connection.v1.IMsgConnectionOpenConfirm): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenInit}. - * @param error Error, if any - * @param [response] MsgConnectionOpenInitResponse - */ - type ConnectionOpenInitCallback = (error: (Error|null), response?: ibc.core.connection.v1.MsgConnectionOpenInitResponse) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenTry}. - * @param error Error, if any - * @param [response] MsgConnectionOpenTryResponse - */ - type ConnectionOpenTryCallback = (error: (Error|null), response?: ibc.core.connection.v1.MsgConnectionOpenTryResponse) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenAck}. - * @param error Error, if any - * @param [response] MsgConnectionOpenAckResponse - */ - type ConnectionOpenAckCallback = (error: (Error|null), response?: ibc.core.connection.v1.MsgConnectionOpenAckResponse) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenConfirm}. - * @param error Error, if any - * @param [response] MsgConnectionOpenConfirmResponse - */ - type ConnectionOpenConfirmCallback = (error: (Error|null), response?: ibc.core.connection.v1.MsgConnectionOpenConfirmResponse) => void; - } - - /** Properties of a MsgConnectionOpenInit. */ - interface IMsgConnectionOpenInit { - - /** MsgConnectionOpenInit client_id */ - client_id?: (string|null); - - /** MsgConnectionOpenInit counterparty */ - counterparty?: (ibc.core.connection.v1.ICounterparty|null); - - /** MsgConnectionOpenInit version */ - version?: (ibc.core.connection.v1.IVersion|null); - - /** MsgConnectionOpenInit delay_period */ - delay_period?: (Long|null); - - /** MsgConnectionOpenInit signer */ - signer?: (string|null); - } - - /** Represents a MsgConnectionOpenInit. */ - class MsgConnectionOpenInit implements IMsgConnectionOpenInit { - - /** - * Constructs a new MsgConnectionOpenInit. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IMsgConnectionOpenInit); - - /** MsgConnectionOpenInit client_id. */ - public client_id: string; - - /** MsgConnectionOpenInit counterparty. */ - public counterparty?: (ibc.core.connection.v1.ICounterparty|null); - - /** MsgConnectionOpenInit version. */ - public version?: (ibc.core.connection.v1.IVersion|null); - - /** MsgConnectionOpenInit delay_period. */ - public delay_period: Long; - - /** MsgConnectionOpenInit signer. */ - public signer: string; - - /** - * Encodes the specified MsgConnectionOpenInit message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInit.verify|verify} messages. - * @param message MsgConnectionOpenInit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IMsgConnectionOpenInit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgConnectionOpenInit message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInit.verify|verify} messages. - * @param message MsgConnectionOpenInit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IMsgConnectionOpenInit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgConnectionOpenInit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgConnectionOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.MsgConnectionOpenInit; - - /** - * Decodes a MsgConnectionOpenInit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgConnectionOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.MsgConnectionOpenInit; - - /** - * Verifies a MsgConnectionOpenInit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgConnectionOpenInit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgConnectionOpenInit - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.MsgConnectionOpenInit; - - /** - * Creates a plain object from a MsgConnectionOpenInit message. Also converts values to other types if specified. - * @param message MsgConnectionOpenInit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.MsgConnectionOpenInit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgConnectionOpenInit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgConnectionOpenInitResponse. */ - interface IMsgConnectionOpenInitResponse { - } - - /** Represents a MsgConnectionOpenInitResponse. */ - class MsgConnectionOpenInitResponse implements IMsgConnectionOpenInitResponse { - - /** - * Constructs a new MsgConnectionOpenInitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IMsgConnectionOpenInitResponse); - - /** - * Encodes the specified MsgConnectionOpenInitResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInitResponse.verify|verify} messages. - * @param message MsgConnectionOpenInitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IMsgConnectionOpenInitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgConnectionOpenInitResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInitResponse.verify|verify} messages. - * @param message MsgConnectionOpenInitResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IMsgConnectionOpenInitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgConnectionOpenInitResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgConnectionOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.MsgConnectionOpenInitResponse; - - /** - * Decodes a MsgConnectionOpenInitResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgConnectionOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.MsgConnectionOpenInitResponse; - - /** - * Verifies a MsgConnectionOpenInitResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgConnectionOpenInitResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgConnectionOpenInitResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.MsgConnectionOpenInitResponse; - - /** - * Creates a plain object from a MsgConnectionOpenInitResponse message. Also converts values to other types if specified. - * @param message MsgConnectionOpenInitResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.MsgConnectionOpenInitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgConnectionOpenInitResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgConnectionOpenTry. */ - interface IMsgConnectionOpenTry { - - /** MsgConnectionOpenTry client_id */ - client_id?: (string|null); - - /** MsgConnectionOpenTry previous_connection_id */ - previous_connection_id?: (string|null); - - /** MsgConnectionOpenTry client_state */ - client_state?: (google.protobuf.IAny|null); - - /** MsgConnectionOpenTry counterparty */ - counterparty?: (ibc.core.connection.v1.ICounterparty|null); - - /** MsgConnectionOpenTry delay_period */ - delay_period?: (Long|null); - - /** MsgConnectionOpenTry counterparty_versions */ - counterparty_versions?: (ibc.core.connection.v1.IVersion[]|null); - - /** MsgConnectionOpenTry proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenTry proof_init */ - proof_init?: (Uint8Array|null); - - /** MsgConnectionOpenTry proof_client */ - proof_client?: (Uint8Array|null); - - /** MsgConnectionOpenTry proof_consensus */ - proof_consensus?: (Uint8Array|null); - - /** MsgConnectionOpenTry consensus_height */ - consensus_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenTry signer */ - signer?: (string|null); - } - - /** Represents a MsgConnectionOpenTry. */ - class MsgConnectionOpenTry implements IMsgConnectionOpenTry { - - /** - * Constructs a new MsgConnectionOpenTry. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IMsgConnectionOpenTry); - - /** MsgConnectionOpenTry client_id. */ - public client_id: string; - - /** MsgConnectionOpenTry previous_connection_id. */ - public previous_connection_id: string; - - /** MsgConnectionOpenTry client_state. */ - public client_state?: (google.protobuf.IAny|null); - - /** MsgConnectionOpenTry counterparty. */ - public counterparty?: (ibc.core.connection.v1.ICounterparty|null); - - /** MsgConnectionOpenTry delay_period. */ - public delay_period: Long; - - /** MsgConnectionOpenTry counterparty_versions. */ - public counterparty_versions: ibc.core.connection.v1.IVersion[]; - - /** MsgConnectionOpenTry proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenTry proof_init. */ - public proof_init: Uint8Array; - - /** MsgConnectionOpenTry proof_client. */ - public proof_client: Uint8Array; - - /** MsgConnectionOpenTry proof_consensus. */ - public proof_consensus: Uint8Array; - - /** MsgConnectionOpenTry consensus_height. */ - public consensus_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenTry signer. */ - public signer: string; - - /** - * Encodes the specified MsgConnectionOpenTry message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTry.verify|verify} messages. - * @param message MsgConnectionOpenTry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IMsgConnectionOpenTry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgConnectionOpenTry message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTry.verify|verify} messages. - * @param message MsgConnectionOpenTry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IMsgConnectionOpenTry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgConnectionOpenTry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgConnectionOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.MsgConnectionOpenTry; - - /** - * Decodes a MsgConnectionOpenTry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgConnectionOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.MsgConnectionOpenTry; - - /** - * Verifies a MsgConnectionOpenTry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgConnectionOpenTry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgConnectionOpenTry - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.MsgConnectionOpenTry; - - /** - * Creates a plain object from a MsgConnectionOpenTry message. Also converts values to other types if specified. - * @param message MsgConnectionOpenTry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.MsgConnectionOpenTry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgConnectionOpenTry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgConnectionOpenTryResponse. */ - interface IMsgConnectionOpenTryResponse { - } - - /** Represents a MsgConnectionOpenTryResponse. */ - class MsgConnectionOpenTryResponse implements IMsgConnectionOpenTryResponse { - - /** - * Constructs a new MsgConnectionOpenTryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IMsgConnectionOpenTryResponse); - - /** - * Encodes the specified MsgConnectionOpenTryResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTryResponse.verify|verify} messages. - * @param message MsgConnectionOpenTryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IMsgConnectionOpenTryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgConnectionOpenTryResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTryResponse.verify|verify} messages. - * @param message MsgConnectionOpenTryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IMsgConnectionOpenTryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgConnectionOpenTryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgConnectionOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.MsgConnectionOpenTryResponse; - - /** - * Decodes a MsgConnectionOpenTryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgConnectionOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.MsgConnectionOpenTryResponse; - - /** - * Verifies a MsgConnectionOpenTryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgConnectionOpenTryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgConnectionOpenTryResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.MsgConnectionOpenTryResponse; - - /** - * Creates a plain object from a MsgConnectionOpenTryResponse message. Also converts values to other types if specified. - * @param message MsgConnectionOpenTryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.MsgConnectionOpenTryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgConnectionOpenTryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgConnectionOpenAck. */ - interface IMsgConnectionOpenAck { - - /** MsgConnectionOpenAck connection_id */ - connection_id?: (string|null); - - /** MsgConnectionOpenAck counterparty_connection_id */ - counterparty_connection_id?: (string|null); - - /** MsgConnectionOpenAck version */ - version?: (ibc.core.connection.v1.IVersion|null); - - /** MsgConnectionOpenAck client_state */ - client_state?: (google.protobuf.IAny|null); - - /** MsgConnectionOpenAck proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenAck proof_try */ - proof_try?: (Uint8Array|null); - - /** MsgConnectionOpenAck proof_client */ - proof_client?: (Uint8Array|null); - - /** MsgConnectionOpenAck proof_consensus */ - proof_consensus?: (Uint8Array|null); - - /** MsgConnectionOpenAck consensus_height */ - consensus_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenAck signer */ - signer?: (string|null); - } - - /** Represents a MsgConnectionOpenAck. */ - class MsgConnectionOpenAck implements IMsgConnectionOpenAck { - - /** - * Constructs a new MsgConnectionOpenAck. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IMsgConnectionOpenAck); - - /** MsgConnectionOpenAck connection_id. */ - public connection_id: string; - - /** MsgConnectionOpenAck counterparty_connection_id. */ - public counterparty_connection_id: string; - - /** MsgConnectionOpenAck version. */ - public version?: (ibc.core.connection.v1.IVersion|null); - - /** MsgConnectionOpenAck client_state. */ - public client_state?: (google.protobuf.IAny|null); - - /** MsgConnectionOpenAck proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenAck proof_try. */ - public proof_try: Uint8Array; - - /** MsgConnectionOpenAck proof_client. */ - public proof_client: Uint8Array; - - /** MsgConnectionOpenAck proof_consensus. */ - public proof_consensus: Uint8Array; - - /** MsgConnectionOpenAck consensus_height. */ - public consensus_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenAck signer. */ - public signer: string; - - /** - * Encodes the specified MsgConnectionOpenAck message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAck.verify|verify} messages. - * @param message MsgConnectionOpenAck message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IMsgConnectionOpenAck, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgConnectionOpenAck message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAck.verify|verify} messages. - * @param message MsgConnectionOpenAck message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IMsgConnectionOpenAck, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgConnectionOpenAck message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgConnectionOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.MsgConnectionOpenAck; - - /** - * Decodes a MsgConnectionOpenAck message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgConnectionOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.MsgConnectionOpenAck; - - /** - * Verifies a MsgConnectionOpenAck message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgConnectionOpenAck message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgConnectionOpenAck - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.MsgConnectionOpenAck; - - /** - * Creates a plain object from a MsgConnectionOpenAck message. Also converts values to other types if specified. - * @param message MsgConnectionOpenAck - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.MsgConnectionOpenAck, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgConnectionOpenAck to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgConnectionOpenAckResponse. */ - interface IMsgConnectionOpenAckResponse { - } - - /** Represents a MsgConnectionOpenAckResponse. */ - class MsgConnectionOpenAckResponse implements IMsgConnectionOpenAckResponse { - - /** - * Constructs a new MsgConnectionOpenAckResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IMsgConnectionOpenAckResponse); - - /** - * Encodes the specified MsgConnectionOpenAckResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAckResponse.verify|verify} messages. - * @param message MsgConnectionOpenAckResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IMsgConnectionOpenAckResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgConnectionOpenAckResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAckResponse.verify|verify} messages. - * @param message MsgConnectionOpenAckResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IMsgConnectionOpenAckResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgConnectionOpenAckResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgConnectionOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.MsgConnectionOpenAckResponse; - - /** - * Decodes a MsgConnectionOpenAckResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgConnectionOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.MsgConnectionOpenAckResponse; - - /** - * Verifies a MsgConnectionOpenAckResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgConnectionOpenAckResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgConnectionOpenAckResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.MsgConnectionOpenAckResponse; - - /** - * Creates a plain object from a MsgConnectionOpenAckResponse message. Also converts values to other types if specified. - * @param message MsgConnectionOpenAckResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.MsgConnectionOpenAckResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgConnectionOpenAckResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgConnectionOpenConfirm. */ - interface IMsgConnectionOpenConfirm { - - /** MsgConnectionOpenConfirm connection_id */ - connection_id?: (string|null); - - /** MsgConnectionOpenConfirm proof_ack */ - proof_ack?: (Uint8Array|null); - - /** MsgConnectionOpenConfirm proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenConfirm signer */ - signer?: (string|null); - } - - /** Represents a MsgConnectionOpenConfirm. */ - class MsgConnectionOpenConfirm implements IMsgConnectionOpenConfirm { - - /** - * Constructs a new MsgConnectionOpenConfirm. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IMsgConnectionOpenConfirm); - - /** MsgConnectionOpenConfirm connection_id. */ - public connection_id: string; - - /** MsgConnectionOpenConfirm proof_ack. */ - public proof_ack: Uint8Array; - - /** MsgConnectionOpenConfirm proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgConnectionOpenConfirm signer. */ - public signer: string; - - /** - * Encodes the specified MsgConnectionOpenConfirm message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirm.verify|verify} messages. - * @param message MsgConnectionOpenConfirm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IMsgConnectionOpenConfirm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgConnectionOpenConfirm message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirm.verify|verify} messages. - * @param message MsgConnectionOpenConfirm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IMsgConnectionOpenConfirm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgConnectionOpenConfirm message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgConnectionOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.MsgConnectionOpenConfirm; - - /** - * Decodes a MsgConnectionOpenConfirm message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgConnectionOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.MsgConnectionOpenConfirm; - - /** - * Verifies a MsgConnectionOpenConfirm message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgConnectionOpenConfirm message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgConnectionOpenConfirm - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.MsgConnectionOpenConfirm; - - /** - * Creates a plain object from a MsgConnectionOpenConfirm message. Also converts values to other types if specified. - * @param message MsgConnectionOpenConfirm - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.MsgConnectionOpenConfirm, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgConnectionOpenConfirm to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgConnectionOpenConfirmResponse. */ - interface IMsgConnectionOpenConfirmResponse { - } - - /** Represents a MsgConnectionOpenConfirmResponse. */ - class MsgConnectionOpenConfirmResponse implements IMsgConnectionOpenConfirmResponse { - - /** - * Constructs a new MsgConnectionOpenConfirmResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse); - - /** - * Encodes the specified MsgConnectionOpenConfirmResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirmResponse.verify|verify} messages. - * @param message MsgConnectionOpenConfirmResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgConnectionOpenConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirmResponse.verify|verify} messages. - * @param message MsgConnectionOpenConfirmResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgConnectionOpenConfirmResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgConnectionOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.MsgConnectionOpenConfirmResponse; - - /** - * Decodes a MsgConnectionOpenConfirmResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgConnectionOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.MsgConnectionOpenConfirmResponse; - - /** - * Verifies a MsgConnectionOpenConfirmResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgConnectionOpenConfirmResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgConnectionOpenConfirmResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.MsgConnectionOpenConfirmResponse; - - /** - * Creates a plain object from a MsgConnectionOpenConfirmResponse message. Also converts values to other types if specified. - * @param message MsgConnectionOpenConfirmResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.MsgConnectionOpenConfirmResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgConnectionOpenConfirmResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConnectionEnd. */ - interface IConnectionEnd { - - /** ConnectionEnd client_id */ - client_id?: (string|null); - - /** ConnectionEnd versions */ - versions?: (ibc.core.connection.v1.IVersion[]|null); - - /** ConnectionEnd state */ - state?: (ibc.core.connection.v1.State|null); - - /** ConnectionEnd counterparty */ - counterparty?: (ibc.core.connection.v1.ICounterparty|null); - - /** ConnectionEnd delay_period */ - delay_period?: (Long|null); - } - - /** Represents a ConnectionEnd. */ - class ConnectionEnd implements IConnectionEnd { - - /** - * Constructs a new ConnectionEnd. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IConnectionEnd); - - /** ConnectionEnd client_id. */ - public client_id: string; - - /** ConnectionEnd versions. */ - public versions: ibc.core.connection.v1.IVersion[]; - - /** ConnectionEnd state. */ - public state: ibc.core.connection.v1.State; - - /** ConnectionEnd counterparty. */ - public counterparty?: (ibc.core.connection.v1.ICounterparty|null); - - /** ConnectionEnd delay_period. */ - public delay_period: Long; - - /** - * Encodes the specified ConnectionEnd message. Does not implicitly {@link ibc.core.connection.v1.ConnectionEnd.verify|verify} messages. - * @param message ConnectionEnd message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IConnectionEnd, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionEnd message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ConnectionEnd.verify|verify} messages. - * @param message ConnectionEnd message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IConnectionEnd, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionEnd message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionEnd - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.ConnectionEnd; - - /** - * Decodes a ConnectionEnd message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionEnd - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.ConnectionEnd; - - /** - * Verifies a ConnectionEnd message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionEnd message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionEnd - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.ConnectionEnd; - - /** - * Creates a plain object from a ConnectionEnd message. Also converts values to other types if specified. - * @param message ConnectionEnd - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.ConnectionEnd, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionEnd to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IdentifiedConnection. */ - interface IIdentifiedConnection { - - /** IdentifiedConnection id */ - id?: (string|null); - - /** IdentifiedConnection client_id */ - client_id?: (string|null); - - /** IdentifiedConnection versions */ - versions?: (ibc.core.connection.v1.IVersion[]|null); - - /** IdentifiedConnection state */ - state?: (ibc.core.connection.v1.State|null); - - /** IdentifiedConnection counterparty */ - counterparty?: (ibc.core.connection.v1.ICounterparty|null); - - /** IdentifiedConnection delay_period */ - delay_period?: (Long|null); - } - - /** Represents an IdentifiedConnection. */ - class IdentifiedConnection implements IIdentifiedConnection { - - /** - * Constructs a new IdentifiedConnection. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IIdentifiedConnection); - - /** IdentifiedConnection id. */ - public id: string; - - /** IdentifiedConnection client_id. */ - public client_id: string; - - /** IdentifiedConnection versions. */ - public versions: ibc.core.connection.v1.IVersion[]; - - /** IdentifiedConnection state. */ - public state: ibc.core.connection.v1.State; - - /** IdentifiedConnection counterparty. */ - public counterparty?: (ibc.core.connection.v1.ICounterparty|null); - - /** IdentifiedConnection delay_period. */ - public delay_period: Long; - - /** - * Encodes the specified IdentifiedConnection message. Does not implicitly {@link ibc.core.connection.v1.IdentifiedConnection.verify|verify} messages. - * @param message IdentifiedConnection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IIdentifiedConnection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IdentifiedConnection message, length delimited. Does not implicitly {@link ibc.core.connection.v1.IdentifiedConnection.verify|verify} messages. - * @param message IdentifiedConnection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IIdentifiedConnection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IdentifiedConnection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentifiedConnection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.IdentifiedConnection; - - /** - * Decodes an IdentifiedConnection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentifiedConnection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.IdentifiedConnection; - - /** - * Verifies an IdentifiedConnection message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IdentifiedConnection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentifiedConnection - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.IdentifiedConnection; - - /** - * Creates a plain object from an IdentifiedConnection message. Also converts values to other types if specified. - * @param message IdentifiedConnection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.IdentifiedConnection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IdentifiedConnection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** State enum. */ - enum State { - STATE_UNINITIALIZED_UNSPECIFIED = 0, - STATE_INIT = 1, - STATE_TRYOPEN = 2, - STATE_OPEN = 3 - } - - /** Properties of a Counterparty. */ - interface ICounterparty { - - /** Counterparty client_id */ - client_id?: (string|null); - - /** Counterparty connection_id */ - connection_id?: (string|null); - - /** Counterparty prefix */ - prefix?: (ibc.core.commitment.v1.IMerklePrefix|null); - } - - /** Represents a Counterparty. */ - class Counterparty implements ICounterparty { - - /** - * Constructs a new Counterparty. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.ICounterparty); - - /** Counterparty client_id. */ - public client_id: string; - - /** Counterparty connection_id. */ - public connection_id: string; - - /** Counterparty prefix. */ - public prefix?: (ibc.core.commitment.v1.IMerklePrefix|null); - - /** - * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.connection.v1.Counterparty.verify|verify} messages. - * @param message Counterparty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.ICounterparty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Counterparty message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Counterparty.verify|verify} messages. - * @param message Counterparty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.ICounterparty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Counterparty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.Counterparty; - - /** - * Decodes a Counterparty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.Counterparty; - - /** - * Verifies a Counterparty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Counterparty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Counterparty - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.Counterparty; - - /** - * Creates a plain object from a Counterparty message. Also converts values to other types if specified. - * @param message Counterparty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.Counterparty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Counterparty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ClientPaths. */ - interface IClientPaths { - - /** ClientPaths paths */ - paths?: (string[]|null); - } - - /** Represents a ClientPaths. */ - class ClientPaths implements IClientPaths { - - /** - * Constructs a new ClientPaths. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IClientPaths); - - /** ClientPaths paths. */ - public paths: string[]; - - /** - * Encodes the specified ClientPaths message. Does not implicitly {@link ibc.core.connection.v1.ClientPaths.verify|verify} messages. - * @param message ClientPaths message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IClientPaths, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientPaths message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ClientPaths.verify|verify} messages. - * @param message ClientPaths message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IClientPaths, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientPaths message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.ClientPaths; - - /** - * Decodes a ClientPaths message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.ClientPaths; - - /** - * Verifies a ClientPaths message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientPaths message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientPaths - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.ClientPaths; - - /** - * Creates a plain object from a ClientPaths message. Also converts values to other types if specified. - * @param message ClientPaths - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.ClientPaths, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientPaths to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConnectionPaths. */ - interface IConnectionPaths { - - /** ConnectionPaths client_id */ - client_id?: (string|null); - - /** ConnectionPaths paths */ - paths?: (string[]|null); - } - - /** Represents a ConnectionPaths. */ - class ConnectionPaths implements IConnectionPaths { - - /** - * Constructs a new ConnectionPaths. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IConnectionPaths); - - /** ConnectionPaths client_id. */ - public client_id: string; - - /** ConnectionPaths paths. */ - public paths: string[]; - - /** - * Encodes the specified ConnectionPaths message. Does not implicitly {@link ibc.core.connection.v1.ConnectionPaths.verify|verify} messages. - * @param message ConnectionPaths message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IConnectionPaths, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionPaths message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ConnectionPaths.verify|verify} messages. - * @param message ConnectionPaths message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IConnectionPaths, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionPaths message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.ConnectionPaths; - - /** - * Decodes a ConnectionPaths message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.ConnectionPaths; - - /** - * Verifies a ConnectionPaths message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionPaths message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionPaths - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.ConnectionPaths; - - /** - * Creates a plain object from a ConnectionPaths message. Also converts values to other types if specified. - * @param message ConnectionPaths - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.ConnectionPaths, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionPaths to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Version. */ - interface IVersion { - - /** Version identifier */ - identifier?: (string|null); - - /** Version features */ - features?: (string[]|null); - } - - /** Represents a Version. */ - class Version implements IVersion { - - /** - * Constructs a new Version. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IVersion); - - /** Version identifier. */ - public identifier: string; - - /** Version features. */ - public features: string[]; - - /** - * Encodes the specified Version message. Does not implicitly {@link ibc.core.connection.v1.Version.verify|verify} messages. - * @param message Version message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Version message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Version.verify|verify} messages. - * @param message Version message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Version message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.Version; - - /** - * Decodes a Version message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.Version; - - /** - * Verifies a Version message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Version message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Version - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.Version; - - /** - * Creates a plain object from a Version message. Also converts values to other types if specified. - * @param message Version - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.Version, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Version to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params max_expected_time_per_block */ - max_expected_time_per_block?: (Long|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IParams); - - /** Params max_expected_time_per_block. */ - public max_expected_time_per_block: Long; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.core.connection.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Connection. - * @param request QueryConnectionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionResponse - */ - public connection(request: ibc.core.connection.v1.IQueryConnectionRequest, callback: ibc.core.connection.v1.Query.ConnectionCallback): void; - - /** - * Calls Connection. - * @param request QueryConnectionRequest message or plain object - * @returns Promise - */ - public connection(request: ibc.core.connection.v1.IQueryConnectionRequest): Promise; - - /** - * Calls Connections. - * @param request QueryConnectionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionsResponse - */ - public connections(request: ibc.core.connection.v1.IQueryConnectionsRequest, callback: ibc.core.connection.v1.Query.ConnectionsCallback): void; - - /** - * Calls Connections. - * @param request QueryConnectionsRequest message or plain object - * @returns Promise - */ - public connections(request: ibc.core.connection.v1.IQueryConnectionsRequest): Promise; - - /** - * Calls ClientConnections. - * @param request QueryClientConnectionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryClientConnectionsResponse - */ - public clientConnections(request: ibc.core.connection.v1.IQueryClientConnectionsRequest, callback: ibc.core.connection.v1.Query.ClientConnectionsCallback): void; - - /** - * Calls ClientConnections. - * @param request QueryClientConnectionsRequest message or plain object - * @returns Promise - */ - public clientConnections(request: ibc.core.connection.v1.IQueryClientConnectionsRequest): Promise; - - /** - * Calls ConnectionClientState. - * @param request QueryConnectionClientStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionClientStateResponse - */ - public connectionClientState(request: ibc.core.connection.v1.IQueryConnectionClientStateRequest, callback: ibc.core.connection.v1.Query.ConnectionClientStateCallback): void; - - /** - * Calls ConnectionClientState. - * @param request QueryConnectionClientStateRequest message or plain object - * @returns Promise - */ - public connectionClientState(request: ibc.core.connection.v1.IQueryConnectionClientStateRequest): Promise; - - /** - * Calls ConnectionConsensusState. - * @param request QueryConnectionConsensusStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryConnectionConsensusStateResponse - */ - public connectionConsensusState(request: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest, callback: ibc.core.connection.v1.Query.ConnectionConsensusStateCallback): void; - - /** - * Calls ConnectionConsensusState. - * @param request QueryConnectionConsensusStateRequest message or plain object - * @returns Promise - */ - public connectionConsensusState(request: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connection}. - * @param error Error, if any - * @param [response] QueryConnectionResponse - */ - type ConnectionCallback = (error: (Error|null), response?: ibc.core.connection.v1.QueryConnectionResponse) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connections}. - * @param error Error, if any - * @param [response] QueryConnectionsResponse - */ - type ConnectionsCallback = (error: (Error|null), response?: ibc.core.connection.v1.QueryConnectionsResponse) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#clientConnections}. - * @param error Error, if any - * @param [response] QueryClientConnectionsResponse - */ - type ClientConnectionsCallback = (error: (Error|null), response?: ibc.core.connection.v1.QueryClientConnectionsResponse) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connectionClientState}. - * @param error Error, if any - * @param [response] QueryConnectionClientStateResponse - */ - type ConnectionClientStateCallback = (error: (Error|null), response?: ibc.core.connection.v1.QueryConnectionClientStateResponse) => void; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connectionConsensusState}. - * @param error Error, if any - * @param [response] QueryConnectionConsensusStateResponse - */ - type ConnectionConsensusStateCallback = (error: (Error|null), response?: ibc.core.connection.v1.QueryConnectionConsensusStateResponse) => void; - } - - /** Properties of a QueryConnectionRequest. */ - interface IQueryConnectionRequest { - - /** QueryConnectionRequest connection_id */ - connection_id?: (string|null); - } - - /** Represents a QueryConnectionRequest. */ - class QueryConnectionRequest implements IQueryConnectionRequest { - - /** - * Constructs a new QueryConnectionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryConnectionRequest); - - /** QueryConnectionRequest connection_id. */ - public connection_id: string; - - /** - * Encodes the specified QueryConnectionRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionRequest.verify|verify} messages. - * @param message QueryConnectionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionRequest.verify|verify} messages. - * @param message QueryConnectionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryConnectionRequest; - - /** - * Decodes a QueryConnectionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryConnectionRequest; - - /** - * Verifies a QueryConnectionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryConnectionRequest; - - /** - * Creates a plain object from a QueryConnectionRequest message. Also converts values to other types if specified. - * @param message QueryConnectionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConnectionResponse. */ - interface IQueryConnectionResponse { - - /** QueryConnectionResponse connection */ - connection?: (ibc.core.connection.v1.IConnectionEnd|null); - - /** QueryConnectionResponse proof */ - proof?: (Uint8Array|null); - - /** QueryConnectionResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryConnectionResponse. */ - class QueryConnectionResponse implements IQueryConnectionResponse { - - /** - * Constructs a new QueryConnectionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryConnectionResponse); - - /** QueryConnectionResponse connection. */ - public connection?: (ibc.core.connection.v1.IConnectionEnd|null); - - /** QueryConnectionResponse proof. */ - public proof: Uint8Array; - - /** QueryConnectionResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryConnectionResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionResponse.verify|verify} messages. - * @param message QueryConnectionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryConnectionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionResponse.verify|verify} messages. - * @param message QueryConnectionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryConnectionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryConnectionResponse; - - /** - * Decodes a QueryConnectionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryConnectionResponse; - - /** - * Verifies a QueryConnectionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryConnectionResponse; - - /** - * Creates a plain object from a QueryConnectionResponse message. Also converts values to other types if specified. - * @param message QueryConnectionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryConnectionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConnectionsRequest. */ - interface IQueryConnectionsRequest { - - /** QueryConnectionsRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryConnectionsRequest. */ - class QueryConnectionsRequest implements IQueryConnectionsRequest { - - /** - * Constructs a new QueryConnectionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryConnectionsRequest); - - /** QueryConnectionsRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsRequest.verify|verify} messages. - * @param message QueryConnectionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionsRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsRequest.verify|verify} messages. - * @param message QueryConnectionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryConnectionsRequest; - - /** - * Decodes a QueryConnectionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryConnectionsRequest; - - /** - * Verifies a QueryConnectionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryConnectionsRequest; - - /** - * Creates a plain object from a QueryConnectionsRequest message. Also converts values to other types if specified. - * @param message QueryConnectionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryConnectionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConnectionsResponse. */ - interface IQueryConnectionsResponse { - - /** QueryConnectionsResponse connections */ - connections?: (ibc.core.connection.v1.IIdentifiedConnection[]|null); - - /** QueryConnectionsResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryConnectionsResponse height */ - height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryConnectionsResponse. */ - class QueryConnectionsResponse implements IQueryConnectionsResponse { - - /** - * Constructs a new QueryConnectionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryConnectionsResponse); - - /** QueryConnectionsResponse connections. */ - public connections: ibc.core.connection.v1.IIdentifiedConnection[]; - - /** QueryConnectionsResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** QueryConnectionsResponse height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsResponse.verify|verify} messages. - * @param message QueryConnectionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionsResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsResponse.verify|verify} messages. - * @param message QueryConnectionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryConnectionsResponse; - - /** - * Decodes a QueryConnectionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryConnectionsResponse; - - /** - * Verifies a QueryConnectionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryConnectionsResponse; - - /** - * Creates a plain object from a QueryConnectionsResponse message. Also converts values to other types if specified. - * @param message QueryConnectionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryConnectionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryClientConnectionsRequest. */ - interface IQueryClientConnectionsRequest { - - /** QueryClientConnectionsRequest client_id */ - client_id?: (string|null); - } - - /** Represents a QueryClientConnectionsRequest. */ - class QueryClientConnectionsRequest implements IQueryClientConnectionsRequest { - - /** - * Constructs a new QueryClientConnectionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryClientConnectionsRequest); - - /** QueryClientConnectionsRequest client_id. */ - public client_id: string; - - /** - * Encodes the specified QueryClientConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsRequest.verify|verify} messages. - * @param message QueryClientConnectionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryClientConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientConnectionsRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsRequest.verify|verify} messages. - * @param message QueryClientConnectionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryClientConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientConnectionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryClientConnectionsRequest; - - /** - * Decodes a QueryClientConnectionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryClientConnectionsRequest; - - /** - * Verifies a QueryClientConnectionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientConnectionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientConnectionsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryClientConnectionsRequest; - - /** - * Creates a plain object from a QueryClientConnectionsRequest message. Also converts values to other types if specified. - * @param message QueryClientConnectionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryClientConnectionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientConnectionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryClientConnectionsResponse. */ - interface IQueryClientConnectionsResponse { - - /** QueryClientConnectionsResponse connection_paths */ - connection_paths?: (string[]|null); - - /** QueryClientConnectionsResponse proof */ - proof?: (Uint8Array|null); - - /** QueryClientConnectionsResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryClientConnectionsResponse. */ - class QueryClientConnectionsResponse implements IQueryClientConnectionsResponse { - - /** - * Constructs a new QueryClientConnectionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryClientConnectionsResponse); - - /** QueryClientConnectionsResponse connection_paths. */ - public connection_paths: string[]; - - /** QueryClientConnectionsResponse proof. */ - public proof: Uint8Array; - - /** QueryClientConnectionsResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryClientConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsResponse.verify|verify} messages. - * @param message QueryClientConnectionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryClientConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryClientConnectionsResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsResponse.verify|verify} messages. - * @param message QueryClientConnectionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryClientConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryClientConnectionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryClientConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryClientConnectionsResponse; - - /** - * Decodes a QueryClientConnectionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryClientConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryClientConnectionsResponse; - - /** - * Verifies a QueryClientConnectionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryClientConnectionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryClientConnectionsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryClientConnectionsResponse; - - /** - * Creates a plain object from a QueryClientConnectionsResponse message. Also converts values to other types if specified. - * @param message QueryClientConnectionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryClientConnectionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryClientConnectionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConnectionClientStateRequest. */ - interface IQueryConnectionClientStateRequest { - - /** QueryConnectionClientStateRequest connection_id */ - connection_id?: (string|null); - } - - /** Represents a QueryConnectionClientStateRequest. */ - class QueryConnectionClientStateRequest implements IQueryConnectionClientStateRequest { - - /** - * Constructs a new QueryConnectionClientStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryConnectionClientStateRequest); - - /** QueryConnectionClientStateRequest connection_id. */ - public connection_id: string; - - /** - * Encodes the specified QueryConnectionClientStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateRequest.verify|verify} messages. - * @param message QueryConnectionClientStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryConnectionClientStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateRequest.verify|verify} messages. - * @param message QueryConnectionClientStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryConnectionClientStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionClientStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryConnectionClientStateRequest; - - /** - * Decodes a QueryConnectionClientStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryConnectionClientStateRequest; - - /** - * Verifies a QueryConnectionClientStateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionClientStateRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryConnectionClientStateRequest; - - /** - * Creates a plain object from a QueryConnectionClientStateRequest message. Also converts values to other types if specified. - * @param message QueryConnectionClientStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryConnectionClientStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionClientStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConnectionClientStateResponse. */ - interface IQueryConnectionClientStateResponse { - - /** QueryConnectionClientStateResponse identified_client_state */ - identified_client_state?: (ibc.core.client.v1.IIdentifiedClientState|null); - - /** QueryConnectionClientStateResponse proof */ - proof?: (Uint8Array|null); - - /** QueryConnectionClientStateResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryConnectionClientStateResponse. */ - class QueryConnectionClientStateResponse implements IQueryConnectionClientStateResponse { - - /** - * Constructs a new QueryConnectionClientStateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryConnectionClientStateResponse); - - /** QueryConnectionClientStateResponse identified_client_state. */ - public identified_client_state?: (ibc.core.client.v1.IIdentifiedClientState|null); - - /** QueryConnectionClientStateResponse proof. */ - public proof: Uint8Array; - - /** QueryConnectionClientStateResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryConnectionClientStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateResponse.verify|verify} messages. - * @param message QueryConnectionClientStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryConnectionClientStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateResponse.verify|verify} messages. - * @param message QueryConnectionClientStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryConnectionClientStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionClientStateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryConnectionClientStateResponse; - - /** - * Decodes a QueryConnectionClientStateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryConnectionClientStateResponse; - - /** - * Verifies a QueryConnectionClientStateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionClientStateResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryConnectionClientStateResponse; - - /** - * Creates a plain object from a QueryConnectionClientStateResponse message. Also converts values to other types if specified. - * @param message QueryConnectionClientStateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryConnectionClientStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionClientStateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConnectionConsensusStateRequest. */ - interface IQueryConnectionConsensusStateRequest { - - /** QueryConnectionConsensusStateRequest connection_id */ - connection_id?: (string|null); - - /** QueryConnectionConsensusStateRequest revision_number */ - revision_number?: (Long|null); - - /** QueryConnectionConsensusStateRequest revision_height */ - revision_height?: (Long|null); - } - - /** Represents a QueryConnectionConsensusStateRequest. */ - class QueryConnectionConsensusStateRequest implements IQueryConnectionConsensusStateRequest { - - /** - * Constructs a new QueryConnectionConsensusStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest); - - /** QueryConnectionConsensusStateRequest connection_id. */ - public connection_id: string; - - /** QueryConnectionConsensusStateRequest revision_number. */ - public revision_number: Long; - - /** QueryConnectionConsensusStateRequest revision_height. */ - public revision_height: Long; - - /** - * Encodes the specified QueryConnectionConsensusStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateRequest.verify|verify} messages. - * @param message QueryConnectionConsensusStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateRequest.verify|verify} messages. - * @param message QueryConnectionConsensusStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryConnectionConsensusStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionConsensusStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryConnectionConsensusStateRequest; - - /** - * Decodes a QueryConnectionConsensusStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryConnectionConsensusStateRequest; - - /** - * Verifies a QueryConnectionConsensusStateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionConsensusStateRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryConnectionConsensusStateRequest; - - /** - * Creates a plain object from a QueryConnectionConsensusStateRequest message. Also converts values to other types if specified. - * @param message QueryConnectionConsensusStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryConnectionConsensusStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionConsensusStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryConnectionConsensusStateResponse. */ - interface IQueryConnectionConsensusStateResponse { - - /** QueryConnectionConsensusStateResponse consensus_state */ - consensus_state?: (google.protobuf.IAny|null); - - /** QueryConnectionConsensusStateResponse client_id */ - client_id?: (string|null); - - /** QueryConnectionConsensusStateResponse proof */ - proof?: (Uint8Array|null); - - /** QueryConnectionConsensusStateResponse proof_height */ - proof_height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a QueryConnectionConsensusStateResponse. */ - class QueryConnectionConsensusStateResponse implements IQueryConnectionConsensusStateResponse { - - /** - * Constructs a new QueryConnectionConsensusStateResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IQueryConnectionConsensusStateResponse); - - /** QueryConnectionConsensusStateResponse consensus_state. */ - public consensus_state?: (google.protobuf.IAny|null); - - /** QueryConnectionConsensusStateResponse client_id. */ - public client_id: string; - - /** QueryConnectionConsensusStateResponse proof. */ - public proof: Uint8Array; - - /** QueryConnectionConsensusStateResponse proof_height. */ - public proof_height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified QueryConnectionConsensusStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateResponse.verify|verify} messages. - * @param message QueryConnectionConsensusStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IQueryConnectionConsensusStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryConnectionConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateResponse.verify|verify} messages. - * @param message QueryConnectionConsensusStateResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IQueryConnectionConsensusStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryConnectionConsensusStateResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryConnectionConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.QueryConnectionConsensusStateResponse; - - /** - * Decodes a QueryConnectionConsensusStateResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryConnectionConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.QueryConnectionConsensusStateResponse; - - /** - * Verifies a QueryConnectionConsensusStateResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryConnectionConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryConnectionConsensusStateResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.QueryConnectionConsensusStateResponse; - - /** - * Creates a plain object from a QueryConnectionConsensusStateResponse message. Also converts values to other types if specified. - * @param message QueryConnectionConsensusStateResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.QueryConnectionConsensusStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryConnectionConsensusStateResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState connections */ - connections?: (ibc.core.connection.v1.IIdentifiedConnection[]|null); - - /** GenesisState client_connection_paths */ - client_connection_paths?: (ibc.core.connection.v1.IConnectionPaths[]|null); - - /** GenesisState next_connection_sequence */ - next_connection_sequence?: (Long|null); - - /** GenesisState params */ - params?: (ibc.core.connection.v1.IParams|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.connection.v1.IGenesisState); - - /** GenesisState connections. */ - public connections: ibc.core.connection.v1.IIdentifiedConnection[]; - - /** GenesisState client_connection_paths. */ - public client_connection_paths: ibc.core.connection.v1.IConnectionPaths[]; - - /** GenesisState next_connection_sequence. */ - public next_connection_sequence: Long; - - /** GenesisState params. */ - public params?: (ibc.core.connection.v1.IParams|null); - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.connection.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.connection.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.connection.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.connection.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.connection.v1.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.connection.v1.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): ibc.core.connection.v1.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.connection.v1.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace types. */ - namespace types { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState client_genesis */ - client_genesis?: (ibc.core.client.v1.IGenesisState|null); - - /** GenesisState connection_genesis */ - connection_genesis?: (ibc.core.connection.v1.IGenesisState|null); - - /** GenesisState channel_genesis */ - channel_genesis?: (ibc.core.channel.v1.IGenesisState|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.types.v1.IGenesisState); - - /** GenesisState client_genesis. */ - public client_genesis?: (ibc.core.client.v1.IGenesisState|null); - - /** GenesisState connection_genesis. */ - public connection_genesis?: (ibc.core.connection.v1.IGenesisState|null); - - /** GenesisState channel_genesis. */ - public channel_genesis?: (ibc.core.channel.v1.IGenesisState|null); - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.types.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.types.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.types.v1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.types.v1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.types.v1.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.types.v1.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): ibc.core.types.v1.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.types.v1.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } - - /** Namespace lightclients. */ - namespace lightclients { - - /** Namespace localhost. */ - namespace localhost { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a ClientState. */ - interface IClientState { - - /** ClientState chain_id */ - chain_id?: (string|null); - - /** ClientState height */ - height?: (ibc.core.client.v1.IHeight|null); - } - - /** Represents a ClientState. */ - class ClientState implements IClientState { - - /** - * Constructs a new ClientState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.localhost.v1.IClientState); - - /** ClientState chain_id. */ - public chain_id: string; - - /** ClientState height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.localhost.v1.ClientState.verify|verify} messages. - * @param message ClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.localhost.v1.IClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.localhost.v1.ClientState.verify|verify} messages. - * @param message ClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.localhost.v1.IClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.localhost.v1.ClientState; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.localhost.v1.ClientState; - - /** - * Verifies a ClientState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientState - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.localhost.v1.ClientState; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @param message ClientState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.localhost.v1.ClientState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace solomachine. */ - namespace solomachine { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a ClientState. */ - interface IClientState { - - /** ClientState sequence */ - sequence?: (Long|null); - - /** ClientState frozen_sequence */ - frozen_sequence?: (Long|null); - - /** ClientState consensus_state */ - consensus_state?: (ibc.lightclients.solomachine.v1.IConsensusState|null); - - /** ClientState allow_update_after_proposal */ - allow_update_after_proposal?: (boolean|null); - } - - /** Represents a ClientState. */ - class ClientState implements IClientState { - - /** - * Constructs a new ClientState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IClientState); - - /** ClientState sequence. */ - public sequence: Long; - - /** ClientState frozen_sequence. */ - public frozen_sequence: Long; - - /** ClientState consensus_state. */ - public consensus_state?: (ibc.lightclients.solomachine.v1.IConsensusState|null); - - /** ClientState allow_update_after_proposal. */ - public allow_update_after_proposal: boolean; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientState.verify|verify} messages. - * @param message ClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientState.verify|verify} messages. - * @param message ClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.ClientState; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.ClientState; - - /** - * Verifies a ClientState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientState - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.ClientState; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @param message ClientState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.ClientState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConsensusState. */ - interface IConsensusState { - - /** ConsensusState public_key */ - public_key?: (google.protobuf.IAny|null); - - /** ConsensusState diversifier */ - diversifier?: (string|null); - - /** ConsensusState timestamp */ - timestamp?: (Long|null); - } - - /** Represents a ConsensusState. */ - class ConsensusState implements IConsensusState { - - /** - * Constructs a new ConsensusState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IConsensusState); - - /** ConsensusState public_key. */ - public public_key?: (google.protobuf.IAny|null); - - /** ConsensusState diversifier. */ - public diversifier: string; - - /** ConsensusState timestamp. */ - public timestamp: Long; - - /** - * Encodes the specified ConsensusState message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusState.verify|verify} messages. - * @param message ConsensusState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IConsensusState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsensusState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusState.verify|verify} messages. - * @param message ConsensusState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IConsensusState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.ConsensusState; - - /** - * Decodes a ConsensusState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.ConsensusState; - - /** - * Verifies a ConsensusState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsensusState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsensusState - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.ConsensusState; - - /** - * Creates a plain object from a ConsensusState message. Also converts values to other types if specified. - * @param message ConsensusState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.ConsensusState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsensusState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Header. */ - interface IHeader { - - /** Header sequence */ - sequence?: (Long|null); - - /** Header timestamp */ - timestamp?: (Long|null); - - /** Header signature */ - signature?: (Uint8Array|null); - - /** Header new_public_key */ - new_public_key?: (google.protobuf.IAny|null); - - /** Header new_diversifier */ - new_diversifier?: (string|null); - } - - /** Represents a Header. */ - class Header implements IHeader { - - /** - * Constructs a new Header. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IHeader); - - /** Header sequence. */ - public sequence: Long; - - /** Header timestamp. */ - public timestamp: Long; - - /** Header signature. */ - public signature: Uint8Array; - - /** Header new_public_key. */ - public new_public_key?: (google.protobuf.IAny|null); - - /** Header new_diversifier. */ - public new_diversifier: string; - - /** - * Encodes the specified Header message. Does not implicitly {@link ibc.lightclients.solomachine.v1.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Header message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.Header; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.Header; - - /** - * Verifies a Header message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Header - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.Header; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @param message Header - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Header to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Misbehaviour. */ - interface IMisbehaviour { - - /** Misbehaviour client_id */ - client_id?: (string|null); - - /** Misbehaviour sequence */ - sequence?: (Long|null); - - /** Misbehaviour signature_one */ - signature_one?: (ibc.lightclients.solomachine.v1.ISignatureAndData|null); - - /** Misbehaviour signature_two */ - signature_two?: (ibc.lightclients.solomachine.v1.ISignatureAndData|null); - } - - /** Represents a Misbehaviour. */ - class Misbehaviour implements IMisbehaviour { - - /** - * Constructs a new Misbehaviour. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IMisbehaviour); - - /** Misbehaviour client_id. */ - public client_id: string; - - /** Misbehaviour sequence. */ - public sequence: Long; - - /** Misbehaviour signature_one. */ - public signature_one?: (ibc.lightclients.solomachine.v1.ISignatureAndData|null); - - /** Misbehaviour signature_two. */ - public signature_two?: (ibc.lightclients.solomachine.v1.ISignatureAndData|null); - - /** - * Encodes the specified Misbehaviour message. Does not implicitly {@link ibc.lightclients.solomachine.v1.Misbehaviour.verify|verify} messages. - * @param message Misbehaviour message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IMisbehaviour, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Misbehaviour message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.Misbehaviour.verify|verify} messages. - * @param message Misbehaviour message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IMisbehaviour, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.Misbehaviour; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.Misbehaviour; - - /** - * Verifies a Misbehaviour message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Misbehaviour message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Misbehaviour - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.Misbehaviour; - - /** - * Creates a plain object from a Misbehaviour message. Also converts values to other types if specified. - * @param message Misbehaviour - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.Misbehaviour, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Misbehaviour to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SignatureAndData. */ - interface ISignatureAndData { - - /** SignatureAndData signature */ - signature?: (Uint8Array|null); - - /** SignatureAndData data_type */ - data_type?: (ibc.lightclients.solomachine.v1.DataType|null); - - /** SignatureAndData data */ - data?: (Uint8Array|null); - - /** SignatureAndData timestamp */ - timestamp?: (Long|null); - } - - /** Represents a SignatureAndData. */ - class SignatureAndData implements ISignatureAndData { - - /** - * Constructs a new SignatureAndData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.ISignatureAndData); - - /** SignatureAndData signature. */ - public signature: Uint8Array; - - /** SignatureAndData data_type. */ - public data_type: ibc.lightclients.solomachine.v1.DataType; - - /** SignatureAndData data. */ - public data: Uint8Array; - - /** SignatureAndData timestamp. */ - public timestamp: Long; - - /** - * Encodes the specified SignatureAndData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignatureAndData.verify|verify} messages. - * @param message SignatureAndData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.ISignatureAndData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SignatureAndData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignatureAndData.verify|verify} messages. - * @param message SignatureAndData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.ISignatureAndData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.SignatureAndData; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.SignatureAndData; - - /** - * Verifies a SignatureAndData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SignatureAndData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SignatureAndData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.SignatureAndData; - - /** - * Creates a plain object from a SignatureAndData message. Also converts values to other types if specified. - * @param message SignatureAndData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.SignatureAndData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SignatureAndData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TimestampedSignatureData. */ - interface ITimestampedSignatureData { - - /** TimestampedSignatureData signature_data */ - signature_data?: (Uint8Array|null); - - /** TimestampedSignatureData timestamp */ - timestamp?: (Long|null); - } - - /** Represents a TimestampedSignatureData. */ - class TimestampedSignatureData implements ITimestampedSignatureData { - - /** - * Constructs a new TimestampedSignatureData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.ITimestampedSignatureData); - - /** TimestampedSignatureData signature_data. */ - public signature_data: Uint8Array; - - /** TimestampedSignatureData timestamp. */ - public timestamp: Long; - - /** - * Encodes the specified TimestampedSignatureData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.TimestampedSignatureData.verify|verify} messages. - * @param message TimestampedSignatureData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.ITimestampedSignatureData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimestampedSignatureData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.TimestampedSignatureData.verify|verify} messages. - * @param message TimestampedSignatureData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.ITimestampedSignatureData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.TimestampedSignatureData; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.TimestampedSignatureData; - - /** - * Verifies a TimestampedSignatureData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimestampedSignatureData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimestampedSignatureData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.TimestampedSignatureData; - - /** - * Creates a plain object from a TimestampedSignatureData message. Also converts values to other types if specified. - * @param message TimestampedSignatureData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.TimestampedSignatureData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimestampedSignatureData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SignBytes. */ - interface ISignBytes { - - /** SignBytes sequence */ - sequence?: (Long|null); - - /** SignBytes timestamp */ - timestamp?: (Long|null); - - /** SignBytes diversifier */ - diversifier?: (string|null); - - /** SignBytes data_type */ - data_type?: (ibc.lightclients.solomachine.v1.DataType|null); - - /** SignBytes data */ - data?: (Uint8Array|null); - } - - /** Represents a SignBytes. */ - class SignBytes implements ISignBytes { - - /** - * Constructs a new SignBytes. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.ISignBytes); - - /** SignBytes sequence. */ - public sequence: Long; - - /** SignBytes timestamp. */ - public timestamp: Long; - - /** SignBytes diversifier. */ - public diversifier: string; - - /** SignBytes data_type. */ - public data_type: ibc.lightclients.solomachine.v1.DataType; - - /** SignBytes data. */ - public data: Uint8Array; - - /** - * Encodes the specified SignBytes message. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignBytes.verify|verify} messages. - * @param message SignBytes message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.ISignBytes, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SignBytes message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignBytes.verify|verify} messages. - * @param message SignBytes message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.ISignBytes, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignBytes message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.SignBytes; - - /** - * Decodes a SignBytes message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.SignBytes; - - /** - * Verifies a SignBytes message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SignBytes message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SignBytes - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.SignBytes; - - /** - * Creates a plain object from a SignBytes message. Also converts values to other types if specified. - * @param message SignBytes - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.SignBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SignBytes to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** DataType enum. */ - enum DataType { - DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0, - DATA_TYPE_CLIENT_STATE = 1, - DATA_TYPE_CONSENSUS_STATE = 2, - DATA_TYPE_CONNECTION_STATE = 3, - DATA_TYPE_CHANNEL_STATE = 4, - DATA_TYPE_PACKET_COMMITMENT = 5, - DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6, - DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7, - DATA_TYPE_NEXT_SEQUENCE_RECV = 8, - DATA_TYPE_HEADER = 9 - } - - /** Properties of a HeaderData. */ - interface IHeaderData { - - /** HeaderData new_pub_key */ - new_pub_key?: (google.protobuf.IAny|null); - - /** HeaderData new_diversifier */ - new_diversifier?: (string|null); - } - - /** Represents a HeaderData. */ - class HeaderData implements IHeaderData { - - /** - * Constructs a new HeaderData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IHeaderData); - - /** HeaderData new_pub_key. */ - public new_pub_key?: (google.protobuf.IAny|null); - - /** HeaderData new_diversifier. */ - public new_diversifier: string; - - /** - * Encodes the specified HeaderData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.HeaderData.verify|verify} messages. - * @param message HeaderData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IHeaderData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HeaderData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.HeaderData.verify|verify} messages. - * @param message HeaderData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IHeaderData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HeaderData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.HeaderData; - - /** - * Decodes a HeaderData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.HeaderData; - - /** - * Verifies a HeaderData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HeaderData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HeaderData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.HeaderData; - - /** - * Creates a plain object from a HeaderData message. Also converts values to other types if specified. - * @param message HeaderData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.HeaderData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HeaderData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ClientStateData. */ - interface IClientStateData { - - /** ClientStateData path */ - path?: (Uint8Array|null); - - /** ClientStateData client_state */ - client_state?: (google.protobuf.IAny|null); - } - - /** Represents a ClientStateData. */ - class ClientStateData implements IClientStateData { - - /** - * Constructs a new ClientStateData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IClientStateData); - - /** ClientStateData path. */ - public path: Uint8Array; - - /** ClientStateData client_state. */ - public client_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified ClientStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientStateData.verify|verify} messages. - * @param message ClientStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IClientStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientStateData.verify|verify} messages. - * @param message ClientStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IClientStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientStateData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.ClientStateData; - - /** - * Decodes a ClientStateData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.ClientStateData; - - /** - * Verifies a ClientStateData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientStateData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientStateData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.ClientStateData; - - /** - * Creates a plain object from a ClientStateData message. Also converts values to other types if specified. - * @param message ClientStateData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.ClientStateData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientStateData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConsensusStateData. */ - interface IConsensusStateData { - - /** ConsensusStateData path */ - path?: (Uint8Array|null); - - /** ConsensusStateData consensus_state */ - consensus_state?: (google.protobuf.IAny|null); - } - - /** Represents a ConsensusStateData. */ - class ConsensusStateData implements IConsensusStateData { - - /** - * Constructs a new ConsensusStateData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IConsensusStateData); - - /** ConsensusStateData path. */ - public path: Uint8Array; - - /** ConsensusStateData consensus_state. */ - public consensus_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified ConsensusStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusStateData.verify|verify} messages. - * @param message ConsensusStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IConsensusStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsensusStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusStateData.verify|verify} messages. - * @param message ConsensusStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IConsensusStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.ConsensusStateData; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.ConsensusStateData; - - /** - * Verifies a ConsensusStateData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsensusStateData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsensusStateData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.ConsensusStateData; - - /** - * Creates a plain object from a ConsensusStateData message. Also converts values to other types if specified. - * @param message ConsensusStateData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.ConsensusStateData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsensusStateData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConnectionStateData. */ - interface IConnectionStateData { - - /** ConnectionStateData path */ - path?: (Uint8Array|null); - - /** ConnectionStateData connection */ - connection?: (ibc.core.connection.v1.IConnectionEnd|null); - } - - /** Represents a ConnectionStateData. */ - class ConnectionStateData implements IConnectionStateData { - - /** - * Constructs a new ConnectionStateData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IConnectionStateData); - - /** ConnectionStateData path. */ - public path: Uint8Array; - - /** ConnectionStateData connection. */ - public connection?: (ibc.core.connection.v1.IConnectionEnd|null); - - /** - * Encodes the specified ConnectionStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConnectionStateData.verify|verify} messages. - * @param message ConnectionStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IConnectionStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConnectionStateData.verify|verify} messages. - * @param message ConnectionStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IConnectionStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.ConnectionStateData; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.ConnectionStateData; - - /** - * Verifies a ConnectionStateData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionStateData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionStateData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.ConnectionStateData; - - /** - * Creates a plain object from a ConnectionStateData message. Also converts values to other types if specified. - * @param message ConnectionStateData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.ConnectionStateData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionStateData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ChannelStateData. */ - interface IChannelStateData { - - /** ChannelStateData path */ - path?: (Uint8Array|null); - - /** ChannelStateData channel */ - channel?: (ibc.core.channel.v1.IChannel|null); - } - - /** Represents a ChannelStateData. */ - class ChannelStateData implements IChannelStateData { - - /** - * Constructs a new ChannelStateData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IChannelStateData); - - /** ChannelStateData path. */ - public path: Uint8Array; - - /** ChannelStateData channel. */ - public channel?: (ibc.core.channel.v1.IChannel|null); - - /** - * Encodes the specified ChannelStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ChannelStateData.verify|verify} messages. - * @param message ChannelStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IChannelStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChannelStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ChannelStateData.verify|verify} messages. - * @param message ChannelStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IChannelStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.ChannelStateData; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.ChannelStateData; - - /** - * Verifies a ChannelStateData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChannelStateData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChannelStateData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.ChannelStateData; - - /** - * Creates a plain object from a ChannelStateData message. Also converts values to other types if specified. - * @param message ChannelStateData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.ChannelStateData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChannelStateData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketCommitmentData. */ - interface IPacketCommitmentData { - - /** PacketCommitmentData path */ - path?: (Uint8Array|null); - - /** PacketCommitmentData commitment */ - commitment?: (Uint8Array|null); - } - - /** Represents a PacketCommitmentData. */ - class PacketCommitmentData implements IPacketCommitmentData { - - /** - * Constructs a new PacketCommitmentData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IPacketCommitmentData); - - /** PacketCommitmentData path. */ - public path: Uint8Array; - - /** PacketCommitmentData commitment. */ - public commitment: Uint8Array; - - /** - * Encodes the specified PacketCommitmentData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketCommitmentData.verify|verify} messages. - * @param message PacketCommitmentData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IPacketCommitmentData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketCommitmentData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketCommitmentData.verify|verify} messages. - * @param message PacketCommitmentData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IPacketCommitmentData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.PacketCommitmentData; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.PacketCommitmentData; - - /** - * Verifies a PacketCommitmentData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketCommitmentData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketCommitmentData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.PacketCommitmentData; - - /** - * Creates a plain object from a PacketCommitmentData message. Also converts values to other types if specified. - * @param message PacketCommitmentData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.PacketCommitmentData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketCommitmentData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketAcknowledgementData. */ - interface IPacketAcknowledgementData { - - /** PacketAcknowledgementData path */ - path?: (Uint8Array|null); - - /** PacketAcknowledgementData acknowledgement */ - acknowledgement?: (Uint8Array|null); - } - - /** Represents a PacketAcknowledgementData. */ - class PacketAcknowledgementData implements IPacketAcknowledgementData { - - /** - * Constructs a new PacketAcknowledgementData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IPacketAcknowledgementData); - - /** PacketAcknowledgementData path. */ - public path: Uint8Array; - - /** PacketAcknowledgementData acknowledgement. */ - public acknowledgement: Uint8Array; - - /** - * Encodes the specified PacketAcknowledgementData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketAcknowledgementData.verify|verify} messages. - * @param message PacketAcknowledgementData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IPacketAcknowledgementData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketAcknowledgementData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketAcknowledgementData.verify|verify} messages. - * @param message PacketAcknowledgementData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IPacketAcknowledgementData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.PacketAcknowledgementData; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.PacketAcknowledgementData; - - /** - * Verifies a PacketAcknowledgementData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketAcknowledgementData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketAcknowledgementData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.PacketAcknowledgementData; - - /** - * Creates a plain object from a PacketAcknowledgementData message. Also converts values to other types if specified. - * @param message PacketAcknowledgementData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.PacketAcknowledgementData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketAcknowledgementData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketReceiptAbsenceData. */ - interface IPacketReceiptAbsenceData { - - /** PacketReceiptAbsenceData path */ - path?: (Uint8Array|null); - } - - /** Represents a PacketReceiptAbsenceData. */ - class PacketReceiptAbsenceData implements IPacketReceiptAbsenceData { - - /** - * Constructs a new PacketReceiptAbsenceData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.IPacketReceiptAbsenceData); - - /** PacketReceiptAbsenceData path. */ - public path: Uint8Array; - - /** - * Encodes the specified PacketReceiptAbsenceData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData.verify|verify} messages. - * @param message PacketReceiptAbsenceData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.IPacketReceiptAbsenceData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketReceiptAbsenceData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData.verify|verify} messages. - * @param message PacketReceiptAbsenceData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.IPacketReceiptAbsenceData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData; - - /** - * Verifies a PacketReceiptAbsenceData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketReceiptAbsenceData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketReceiptAbsenceData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData; - - /** - * Creates a plain object from a PacketReceiptAbsenceData message. Also converts values to other types if specified. - * @param message PacketReceiptAbsenceData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketReceiptAbsenceData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a NextSequenceRecvData. */ - interface INextSequenceRecvData { - - /** NextSequenceRecvData path */ - path?: (Uint8Array|null); - - /** NextSequenceRecvData next_seq_recv */ - next_seq_recv?: (Long|null); - } - - /** Represents a NextSequenceRecvData. */ - class NextSequenceRecvData implements INextSequenceRecvData { - - /** - * Constructs a new NextSequenceRecvData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v1.INextSequenceRecvData); - - /** NextSequenceRecvData path. */ - public path: Uint8Array; - - /** NextSequenceRecvData next_seq_recv. */ - public next_seq_recv: Long; - - /** - * Encodes the specified NextSequenceRecvData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.NextSequenceRecvData.verify|verify} messages. - * @param message NextSequenceRecvData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v1.INextSequenceRecvData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NextSequenceRecvData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.NextSequenceRecvData.verify|verify} messages. - * @param message NextSequenceRecvData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v1.INextSequenceRecvData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v1.NextSequenceRecvData; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v1.NextSequenceRecvData; - - /** - * Verifies a NextSequenceRecvData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NextSequenceRecvData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NextSequenceRecvData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v1.NextSequenceRecvData; - - /** - * Creates a plain object from a NextSequenceRecvData message. Also converts values to other types if specified. - * @param message NextSequenceRecvData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v1.NextSequenceRecvData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NextSequenceRecvData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace v2. */ - namespace v2 { - - /** Properties of a ClientState. */ - interface IClientState { - - /** ClientState sequence */ - sequence?: (Long|null); - - /** ClientState is_frozen */ - is_frozen?: (boolean|null); - - /** ClientState consensus_state */ - consensus_state?: (ibc.lightclients.solomachine.v2.IConsensusState|null); - - /** ClientState allow_update_after_proposal */ - allow_update_after_proposal?: (boolean|null); - } - - /** Represents a ClientState. */ - class ClientState implements IClientState { - - /** - * Constructs a new ClientState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IClientState); - - /** ClientState sequence. */ - public sequence: Long; - - /** ClientState is_frozen. */ - public is_frozen: boolean; - - /** ClientState consensus_state. */ - public consensus_state?: (ibc.lightclients.solomachine.v2.IConsensusState|null); - - /** ClientState allow_update_after_proposal. */ - public allow_update_after_proposal: boolean; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientState.verify|verify} messages. - * @param message ClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientState.verify|verify} messages. - * @param message ClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.ClientState; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.ClientState; - - /** - * Verifies a ClientState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientState - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.ClientState; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @param message ClientState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.ClientState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConsensusState. */ - interface IConsensusState { - - /** ConsensusState public_key */ - public_key?: (google.protobuf.IAny|null); - - /** ConsensusState diversifier */ - diversifier?: (string|null); - - /** ConsensusState timestamp */ - timestamp?: (Long|null); - } - - /** Represents a ConsensusState. */ - class ConsensusState implements IConsensusState { - - /** - * Constructs a new ConsensusState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IConsensusState); - - /** ConsensusState public_key. */ - public public_key?: (google.protobuf.IAny|null); - - /** ConsensusState diversifier. */ - public diversifier: string; - - /** ConsensusState timestamp. */ - public timestamp: Long; - - /** - * Encodes the specified ConsensusState message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusState.verify|verify} messages. - * @param message ConsensusState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IConsensusState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsensusState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusState.verify|verify} messages. - * @param message ConsensusState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IConsensusState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.ConsensusState; - - /** - * Decodes a ConsensusState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.ConsensusState; - - /** - * Verifies a ConsensusState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsensusState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsensusState - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.ConsensusState; - - /** - * Creates a plain object from a ConsensusState message. Also converts values to other types if specified. - * @param message ConsensusState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.ConsensusState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsensusState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Header. */ - interface IHeader { - - /** Header sequence */ - sequence?: (Long|null); - - /** Header timestamp */ - timestamp?: (Long|null); - - /** Header signature */ - signature?: (Uint8Array|null); - - /** Header new_public_key */ - new_public_key?: (google.protobuf.IAny|null); - - /** Header new_diversifier */ - new_diversifier?: (string|null); - } - - /** Represents a Header. */ - class Header implements IHeader { - - /** - * Constructs a new Header. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IHeader); - - /** Header sequence. */ - public sequence: Long; - - /** Header timestamp. */ - public timestamp: Long; - - /** Header signature. */ - public signature: Uint8Array; - - /** Header new_public_key. */ - public new_public_key?: (google.protobuf.IAny|null); - - /** Header new_diversifier. */ - public new_diversifier: string; - - /** - * Encodes the specified Header message. Does not implicitly {@link ibc.lightclients.solomachine.v2.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Header message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.Header; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.Header; - - /** - * Verifies a Header message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Header - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.Header; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @param message Header - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Header to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Misbehaviour. */ - interface IMisbehaviour { - - /** Misbehaviour client_id */ - client_id?: (string|null); - - /** Misbehaviour sequence */ - sequence?: (Long|null); - - /** Misbehaviour signature_one */ - signature_one?: (ibc.lightclients.solomachine.v2.ISignatureAndData|null); - - /** Misbehaviour signature_two */ - signature_two?: (ibc.lightclients.solomachine.v2.ISignatureAndData|null); - } - - /** Represents a Misbehaviour. */ - class Misbehaviour implements IMisbehaviour { - - /** - * Constructs a new Misbehaviour. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IMisbehaviour); - - /** Misbehaviour client_id. */ - public client_id: string; - - /** Misbehaviour sequence. */ - public sequence: Long; - - /** Misbehaviour signature_one. */ - public signature_one?: (ibc.lightclients.solomachine.v2.ISignatureAndData|null); - - /** Misbehaviour signature_two. */ - public signature_two?: (ibc.lightclients.solomachine.v2.ISignatureAndData|null); - - /** - * Encodes the specified Misbehaviour message. Does not implicitly {@link ibc.lightclients.solomachine.v2.Misbehaviour.verify|verify} messages. - * @param message Misbehaviour message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IMisbehaviour, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Misbehaviour message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.Misbehaviour.verify|verify} messages. - * @param message Misbehaviour message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IMisbehaviour, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.Misbehaviour; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.Misbehaviour; - - /** - * Verifies a Misbehaviour message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Misbehaviour message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Misbehaviour - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.Misbehaviour; - - /** - * Creates a plain object from a Misbehaviour message. Also converts values to other types if specified. - * @param message Misbehaviour - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.Misbehaviour, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Misbehaviour to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SignatureAndData. */ - interface ISignatureAndData { - - /** SignatureAndData signature */ - signature?: (Uint8Array|null); - - /** SignatureAndData data_type */ - data_type?: (ibc.lightclients.solomachine.v2.DataType|null); - - /** SignatureAndData data */ - data?: (Uint8Array|null); - - /** SignatureAndData timestamp */ - timestamp?: (Long|null); - } - - /** Represents a SignatureAndData. */ - class SignatureAndData implements ISignatureAndData { - - /** - * Constructs a new SignatureAndData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.ISignatureAndData); - - /** SignatureAndData signature. */ - public signature: Uint8Array; - - /** SignatureAndData data_type. */ - public data_type: ibc.lightclients.solomachine.v2.DataType; - - /** SignatureAndData data. */ - public data: Uint8Array; - - /** SignatureAndData timestamp. */ - public timestamp: Long; - - /** - * Encodes the specified SignatureAndData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignatureAndData.verify|verify} messages. - * @param message SignatureAndData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.ISignatureAndData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SignatureAndData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignatureAndData.verify|verify} messages. - * @param message SignatureAndData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.ISignatureAndData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.SignatureAndData; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.SignatureAndData; - - /** - * Verifies a SignatureAndData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SignatureAndData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SignatureAndData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.SignatureAndData; - - /** - * Creates a plain object from a SignatureAndData message. Also converts values to other types if specified. - * @param message SignatureAndData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.SignatureAndData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SignatureAndData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TimestampedSignatureData. */ - interface ITimestampedSignatureData { - - /** TimestampedSignatureData signature_data */ - signature_data?: (Uint8Array|null); - - /** TimestampedSignatureData timestamp */ - timestamp?: (Long|null); - } - - /** Represents a TimestampedSignatureData. */ - class TimestampedSignatureData implements ITimestampedSignatureData { - - /** - * Constructs a new TimestampedSignatureData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.ITimestampedSignatureData); - - /** TimestampedSignatureData signature_data. */ - public signature_data: Uint8Array; - - /** TimestampedSignatureData timestamp. */ - public timestamp: Long; - - /** - * Encodes the specified TimestampedSignatureData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.TimestampedSignatureData.verify|verify} messages. - * @param message TimestampedSignatureData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.ITimestampedSignatureData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimestampedSignatureData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.TimestampedSignatureData.verify|verify} messages. - * @param message TimestampedSignatureData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.ITimestampedSignatureData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.TimestampedSignatureData; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.TimestampedSignatureData; - - /** - * Verifies a TimestampedSignatureData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimestampedSignatureData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimestampedSignatureData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.TimestampedSignatureData; - - /** - * Creates a plain object from a TimestampedSignatureData message. Also converts values to other types if specified. - * @param message TimestampedSignatureData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.TimestampedSignatureData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimestampedSignatureData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SignBytes. */ - interface ISignBytes { - - /** SignBytes sequence */ - sequence?: (Long|null); - - /** SignBytes timestamp */ - timestamp?: (Long|null); - - /** SignBytes diversifier */ - diversifier?: (string|null); - - /** SignBytes data_type */ - data_type?: (ibc.lightclients.solomachine.v2.DataType|null); - - /** SignBytes data */ - data?: (Uint8Array|null); - } - - /** Represents a SignBytes. */ - class SignBytes implements ISignBytes { - - /** - * Constructs a new SignBytes. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.ISignBytes); - - /** SignBytes sequence. */ - public sequence: Long; - - /** SignBytes timestamp. */ - public timestamp: Long; - - /** SignBytes diversifier. */ - public diversifier: string; - - /** SignBytes data_type. */ - public data_type: ibc.lightclients.solomachine.v2.DataType; - - /** SignBytes data. */ - public data: Uint8Array; - - /** - * Encodes the specified SignBytes message. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignBytes.verify|verify} messages. - * @param message SignBytes message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.ISignBytes, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SignBytes message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignBytes.verify|verify} messages. - * @param message SignBytes message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.ISignBytes, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignBytes message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.SignBytes; - - /** - * Decodes a SignBytes message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.SignBytes; - - /** - * Verifies a SignBytes message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SignBytes message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SignBytes - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.SignBytes; - - /** - * Creates a plain object from a SignBytes message. Also converts values to other types if specified. - * @param message SignBytes - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.SignBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SignBytes to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** DataType enum. */ - enum DataType { - DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0, - DATA_TYPE_CLIENT_STATE = 1, - DATA_TYPE_CONSENSUS_STATE = 2, - DATA_TYPE_CONNECTION_STATE = 3, - DATA_TYPE_CHANNEL_STATE = 4, - DATA_TYPE_PACKET_COMMITMENT = 5, - DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6, - DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7, - DATA_TYPE_NEXT_SEQUENCE_RECV = 8, - DATA_TYPE_HEADER = 9 - } - - /** Properties of a HeaderData. */ - interface IHeaderData { - - /** HeaderData new_pub_key */ - new_pub_key?: (google.protobuf.IAny|null); - - /** HeaderData new_diversifier */ - new_diversifier?: (string|null); - } - - /** Represents a HeaderData. */ - class HeaderData implements IHeaderData { - - /** - * Constructs a new HeaderData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IHeaderData); - - /** HeaderData new_pub_key. */ - public new_pub_key?: (google.protobuf.IAny|null); - - /** HeaderData new_diversifier. */ - public new_diversifier: string; - - /** - * Encodes the specified HeaderData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.HeaderData.verify|verify} messages. - * @param message HeaderData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IHeaderData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HeaderData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.HeaderData.verify|verify} messages. - * @param message HeaderData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IHeaderData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HeaderData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.HeaderData; - - /** - * Decodes a HeaderData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.HeaderData; - - /** - * Verifies a HeaderData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HeaderData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HeaderData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.HeaderData; - - /** - * Creates a plain object from a HeaderData message. Also converts values to other types if specified. - * @param message HeaderData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.HeaderData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HeaderData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ClientStateData. */ - interface IClientStateData { - - /** ClientStateData path */ - path?: (Uint8Array|null); - - /** ClientStateData client_state */ - client_state?: (google.protobuf.IAny|null); - } - - /** Represents a ClientStateData. */ - class ClientStateData implements IClientStateData { - - /** - * Constructs a new ClientStateData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IClientStateData); - - /** ClientStateData path. */ - public path: Uint8Array; - - /** ClientStateData client_state. */ - public client_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified ClientStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientStateData.verify|verify} messages. - * @param message ClientStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IClientStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientStateData.verify|verify} messages. - * @param message ClientStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IClientStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientStateData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.ClientStateData; - - /** - * Decodes a ClientStateData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.ClientStateData; - - /** - * Verifies a ClientStateData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientStateData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientStateData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.ClientStateData; - - /** - * Creates a plain object from a ClientStateData message. Also converts values to other types if specified. - * @param message ClientStateData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.ClientStateData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientStateData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConsensusStateData. */ - interface IConsensusStateData { - - /** ConsensusStateData path */ - path?: (Uint8Array|null); - - /** ConsensusStateData consensus_state */ - consensus_state?: (google.protobuf.IAny|null); - } - - /** Represents a ConsensusStateData. */ - class ConsensusStateData implements IConsensusStateData { - - /** - * Constructs a new ConsensusStateData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IConsensusStateData); - - /** ConsensusStateData path. */ - public path: Uint8Array; - - /** ConsensusStateData consensus_state. */ - public consensus_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified ConsensusStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusStateData.verify|verify} messages. - * @param message ConsensusStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IConsensusStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsensusStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusStateData.verify|verify} messages. - * @param message ConsensusStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IConsensusStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.ConsensusStateData; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.ConsensusStateData; - - /** - * Verifies a ConsensusStateData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsensusStateData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsensusStateData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.ConsensusStateData; - - /** - * Creates a plain object from a ConsensusStateData message. Also converts values to other types if specified. - * @param message ConsensusStateData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.ConsensusStateData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsensusStateData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConnectionStateData. */ - interface IConnectionStateData { - - /** ConnectionStateData path */ - path?: (Uint8Array|null); - - /** ConnectionStateData connection */ - connection?: (ibc.core.connection.v1.IConnectionEnd|null); - } - - /** Represents a ConnectionStateData. */ - class ConnectionStateData implements IConnectionStateData { - - /** - * Constructs a new ConnectionStateData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IConnectionStateData); - - /** ConnectionStateData path. */ - public path: Uint8Array; - - /** ConnectionStateData connection. */ - public connection?: (ibc.core.connection.v1.IConnectionEnd|null); - - /** - * Encodes the specified ConnectionStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConnectionStateData.verify|verify} messages. - * @param message ConnectionStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IConnectionStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConnectionStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConnectionStateData.verify|verify} messages. - * @param message ConnectionStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IConnectionStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.ConnectionStateData; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.ConnectionStateData; - - /** - * Verifies a ConnectionStateData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConnectionStateData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConnectionStateData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.ConnectionStateData; - - /** - * Creates a plain object from a ConnectionStateData message. Also converts values to other types if specified. - * @param message ConnectionStateData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.ConnectionStateData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConnectionStateData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ChannelStateData. */ - interface IChannelStateData { - - /** ChannelStateData path */ - path?: (Uint8Array|null); - - /** ChannelStateData channel */ - channel?: (ibc.core.channel.v1.IChannel|null); - } - - /** Represents a ChannelStateData. */ - class ChannelStateData implements IChannelStateData { - - /** - * Constructs a new ChannelStateData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IChannelStateData); - - /** ChannelStateData path. */ - public path: Uint8Array; - - /** ChannelStateData channel. */ - public channel?: (ibc.core.channel.v1.IChannel|null); - - /** - * Encodes the specified ChannelStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ChannelStateData.verify|verify} messages. - * @param message ChannelStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IChannelStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChannelStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ChannelStateData.verify|verify} messages. - * @param message ChannelStateData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IChannelStateData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.ChannelStateData; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.ChannelStateData; - - /** - * Verifies a ChannelStateData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChannelStateData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChannelStateData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.ChannelStateData; - - /** - * Creates a plain object from a ChannelStateData message. Also converts values to other types if specified. - * @param message ChannelStateData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.ChannelStateData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChannelStateData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketCommitmentData. */ - interface IPacketCommitmentData { - - /** PacketCommitmentData path */ - path?: (Uint8Array|null); - - /** PacketCommitmentData commitment */ - commitment?: (Uint8Array|null); - } - - /** Represents a PacketCommitmentData. */ - class PacketCommitmentData implements IPacketCommitmentData { - - /** - * Constructs a new PacketCommitmentData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IPacketCommitmentData); - - /** PacketCommitmentData path. */ - public path: Uint8Array; - - /** PacketCommitmentData commitment. */ - public commitment: Uint8Array; - - /** - * Encodes the specified PacketCommitmentData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketCommitmentData.verify|verify} messages. - * @param message PacketCommitmentData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IPacketCommitmentData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketCommitmentData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketCommitmentData.verify|verify} messages. - * @param message PacketCommitmentData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IPacketCommitmentData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.PacketCommitmentData; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.PacketCommitmentData; - - /** - * Verifies a PacketCommitmentData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketCommitmentData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketCommitmentData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.PacketCommitmentData; - - /** - * Creates a plain object from a PacketCommitmentData message. Also converts values to other types if specified. - * @param message PacketCommitmentData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.PacketCommitmentData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketCommitmentData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketAcknowledgementData. */ - interface IPacketAcknowledgementData { - - /** PacketAcknowledgementData path */ - path?: (Uint8Array|null); - - /** PacketAcknowledgementData acknowledgement */ - acknowledgement?: (Uint8Array|null); - } - - /** Represents a PacketAcknowledgementData. */ - class PacketAcknowledgementData implements IPacketAcknowledgementData { - - /** - * Constructs a new PacketAcknowledgementData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IPacketAcknowledgementData); - - /** PacketAcknowledgementData path. */ - public path: Uint8Array; - - /** PacketAcknowledgementData acknowledgement. */ - public acknowledgement: Uint8Array; - - /** - * Encodes the specified PacketAcknowledgementData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketAcknowledgementData.verify|verify} messages. - * @param message PacketAcknowledgementData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IPacketAcknowledgementData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketAcknowledgementData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketAcknowledgementData.verify|verify} messages. - * @param message PacketAcknowledgementData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IPacketAcknowledgementData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.PacketAcknowledgementData; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.PacketAcknowledgementData; - - /** - * Verifies a PacketAcknowledgementData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketAcknowledgementData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketAcknowledgementData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.PacketAcknowledgementData; - - /** - * Creates a plain object from a PacketAcknowledgementData message. Also converts values to other types if specified. - * @param message PacketAcknowledgementData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.PacketAcknowledgementData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketAcknowledgementData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketReceiptAbsenceData. */ - interface IPacketReceiptAbsenceData { - - /** PacketReceiptAbsenceData path */ - path?: (Uint8Array|null); - } - - /** Represents a PacketReceiptAbsenceData. */ - class PacketReceiptAbsenceData implements IPacketReceiptAbsenceData { - - /** - * Constructs a new PacketReceiptAbsenceData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.IPacketReceiptAbsenceData); - - /** PacketReceiptAbsenceData path. */ - public path: Uint8Array; - - /** - * Encodes the specified PacketReceiptAbsenceData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData.verify|verify} messages. - * @param message PacketReceiptAbsenceData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.IPacketReceiptAbsenceData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketReceiptAbsenceData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData.verify|verify} messages. - * @param message PacketReceiptAbsenceData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.IPacketReceiptAbsenceData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData; - - /** - * Verifies a PacketReceiptAbsenceData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketReceiptAbsenceData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketReceiptAbsenceData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData; - - /** - * Creates a plain object from a PacketReceiptAbsenceData message. Also converts values to other types if specified. - * @param message PacketReceiptAbsenceData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketReceiptAbsenceData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a NextSequenceRecvData. */ - interface INextSequenceRecvData { - - /** NextSequenceRecvData path */ - path?: (Uint8Array|null); - - /** NextSequenceRecvData next_seq_recv */ - next_seq_recv?: (Long|null); - } - - /** Represents a NextSequenceRecvData. */ - class NextSequenceRecvData implements INextSequenceRecvData { - - /** - * Constructs a new NextSequenceRecvData. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.solomachine.v2.INextSequenceRecvData); - - /** NextSequenceRecvData path. */ - public path: Uint8Array; - - /** NextSequenceRecvData next_seq_recv. */ - public next_seq_recv: Long; - - /** - * Encodes the specified NextSequenceRecvData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.NextSequenceRecvData.verify|verify} messages. - * @param message NextSequenceRecvData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.solomachine.v2.INextSequenceRecvData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NextSequenceRecvData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.NextSequenceRecvData.verify|verify} messages. - * @param message NextSequenceRecvData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.solomachine.v2.INextSequenceRecvData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.solomachine.v2.NextSequenceRecvData; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.solomachine.v2.NextSequenceRecvData; - - /** - * Verifies a NextSequenceRecvData message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NextSequenceRecvData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NextSequenceRecvData - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.solomachine.v2.NextSequenceRecvData; - - /** - * Creates a plain object from a NextSequenceRecvData message. Also converts values to other types if specified. - * @param message NextSequenceRecvData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.solomachine.v2.NextSequenceRecvData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NextSequenceRecvData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace tendermint. */ - namespace tendermint { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of a ClientState. */ - interface IClientState { - - /** ClientState chain_id */ - chain_id?: (string|null); - - /** ClientState trust_level */ - trust_level?: (ibc.lightclients.tendermint.v1.IFraction|null); - - /** ClientState trusting_period */ - trusting_period?: (google.protobuf.IDuration|null); - - /** ClientState unbonding_period */ - unbonding_period?: (google.protobuf.IDuration|null); - - /** ClientState max_clock_drift */ - max_clock_drift?: (google.protobuf.IDuration|null); - - /** ClientState frozen_height */ - frozen_height?: (ibc.core.client.v1.IHeight|null); - - /** ClientState latest_height */ - latest_height?: (ibc.core.client.v1.IHeight|null); - - /** ClientState proof_specs */ - proof_specs?: (ics23.IProofSpec[]|null); - - /** ClientState upgrade_path */ - upgrade_path?: (string[]|null); - - /** ClientState allow_update_after_expiry */ - allow_update_after_expiry?: (boolean|null); - - /** ClientState allow_update_after_misbehaviour */ - allow_update_after_misbehaviour?: (boolean|null); - } - - /** Represents a ClientState. */ - class ClientState implements IClientState { - - /** - * Constructs a new ClientState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.tendermint.v1.IClientState); - - /** ClientState chain_id. */ - public chain_id: string; - - /** ClientState trust_level. */ - public trust_level?: (ibc.lightclients.tendermint.v1.IFraction|null); - - /** ClientState trusting_period. */ - public trusting_period?: (google.protobuf.IDuration|null); - - /** ClientState unbonding_period. */ - public unbonding_period?: (google.protobuf.IDuration|null); - - /** ClientState max_clock_drift. */ - public max_clock_drift?: (google.protobuf.IDuration|null); - - /** ClientState frozen_height. */ - public frozen_height?: (ibc.core.client.v1.IHeight|null); - - /** ClientState latest_height. */ - public latest_height?: (ibc.core.client.v1.IHeight|null); - - /** ClientState proof_specs. */ - public proof_specs: ics23.IProofSpec[]; - - /** ClientState upgrade_path. */ - public upgrade_path: string[]; - - /** ClientState allow_update_after_expiry. */ - public allow_update_after_expiry: boolean; - - /** ClientState allow_update_after_misbehaviour. */ - public allow_update_after_misbehaviour: boolean; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.tendermint.v1.ClientState.verify|verify} messages. - * @param message ClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.tendermint.v1.IClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.ClientState.verify|verify} messages. - * @param message ClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.tendermint.v1.IClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.tendermint.v1.ClientState; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.tendermint.v1.ClientState; - - /** - * Verifies a ClientState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientState - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.tendermint.v1.ClientState; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @param message ClientState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.tendermint.v1.ClientState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConsensusState. */ - interface IConsensusState { - - /** ConsensusState timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - - /** ConsensusState root */ - root?: (ibc.core.commitment.v1.IMerkleRoot|null); - - /** ConsensusState next_validators_hash */ - next_validators_hash?: (Uint8Array|null); - } - - /** Represents a ConsensusState. */ - class ConsensusState implements IConsensusState { - - /** - * Constructs a new ConsensusState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.tendermint.v1.IConsensusState); - - /** ConsensusState timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** ConsensusState root. */ - public root?: (ibc.core.commitment.v1.IMerkleRoot|null); - - /** ConsensusState next_validators_hash. */ - public next_validators_hash: Uint8Array; - - /** - * Encodes the specified ConsensusState message. Does not implicitly {@link ibc.lightclients.tendermint.v1.ConsensusState.verify|verify} messages. - * @param message ConsensusState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.tendermint.v1.IConsensusState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsensusState message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.ConsensusState.verify|verify} messages. - * @param message ConsensusState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.tendermint.v1.IConsensusState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.tendermint.v1.ConsensusState; - - /** - * Decodes a ConsensusState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.tendermint.v1.ConsensusState; - - /** - * Verifies a ConsensusState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsensusState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsensusState - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.tendermint.v1.ConsensusState; - - /** - * Creates a plain object from a ConsensusState message. Also converts values to other types if specified. - * @param message ConsensusState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.tendermint.v1.ConsensusState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsensusState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Misbehaviour. */ - interface IMisbehaviour { - - /** Misbehaviour client_id */ - client_id?: (string|null); - - /** Misbehaviour header_1 */ - header_1?: (ibc.lightclients.tendermint.v1.IHeader|null); - - /** Misbehaviour header_2 */ - header_2?: (ibc.lightclients.tendermint.v1.IHeader|null); - } - - /** Represents a Misbehaviour. */ - class Misbehaviour implements IMisbehaviour { - - /** - * Constructs a new Misbehaviour. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.tendermint.v1.IMisbehaviour); - - /** Misbehaviour client_id. */ - public client_id: string; - - /** Misbehaviour header_1. */ - public header_1?: (ibc.lightclients.tendermint.v1.IHeader|null); - - /** Misbehaviour header_2. */ - public header_2?: (ibc.lightclients.tendermint.v1.IHeader|null); - - /** - * Encodes the specified Misbehaviour message. Does not implicitly {@link ibc.lightclients.tendermint.v1.Misbehaviour.verify|verify} messages. - * @param message Misbehaviour message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.tendermint.v1.IMisbehaviour, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Misbehaviour message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.Misbehaviour.verify|verify} messages. - * @param message Misbehaviour message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.tendermint.v1.IMisbehaviour, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.tendermint.v1.Misbehaviour; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.tendermint.v1.Misbehaviour; - - /** - * Verifies a Misbehaviour message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Misbehaviour message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Misbehaviour - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.tendermint.v1.Misbehaviour; - - /** - * Creates a plain object from a Misbehaviour message. Also converts values to other types if specified. - * @param message Misbehaviour - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.tendermint.v1.Misbehaviour, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Misbehaviour to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Header. */ - interface IHeader { - - /** Header signed_header */ - signed_header?: (tendermint.types.ISignedHeader|null); - - /** Header validator_set */ - validator_set?: (tendermint.types.IValidatorSet|null); - - /** Header trusted_height */ - trusted_height?: (ibc.core.client.v1.IHeight|null); - - /** Header trusted_validators */ - trusted_validators?: (tendermint.types.IValidatorSet|null); - } - - /** Represents a Header. */ - class Header implements IHeader { - - /** - * Constructs a new Header. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.tendermint.v1.IHeader); - - /** Header signed_header. */ - public signed_header?: (tendermint.types.ISignedHeader|null); - - /** Header validator_set. */ - public validator_set?: (tendermint.types.IValidatorSet|null); - - /** Header trusted_height. */ - public trusted_height?: (ibc.core.client.v1.IHeight|null); - - /** Header trusted_validators. */ - public trusted_validators?: (tendermint.types.IValidatorSet|null); - - /** - * Encodes the specified Header message. Does not implicitly {@link ibc.lightclients.tendermint.v1.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.tendermint.v1.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.tendermint.v1.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Header message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.tendermint.v1.Header; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.tendermint.v1.Header; - - /** - * Verifies a Header message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Header - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.tendermint.v1.Header; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @param message Header - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.tendermint.v1.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Header to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Fraction. */ - interface IFraction { - - /** Fraction numerator */ - numerator?: (Long|null); - - /** Fraction denominator */ - denominator?: (Long|null); - } - - /** Represents a Fraction. */ - class Fraction implements IFraction { - - /** - * Constructs a new Fraction. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.lightclients.tendermint.v1.IFraction); - - /** Fraction numerator. */ - public numerator: Long; - - /** Fraction denominator. */ - public denominator: Long; - - /** - * Encodes the specified Fraction message. Does not implicitly {@link ibc.lightclients.tendermint.v1.Fraction.verify|verify} messages. - * @param message Fraction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.lightclients.tendermint.v1.IFraction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Fraction message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.Fraction.verify|verify} messages. - * @param message Fraction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.lightclients.tendermint.v1.IFraction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fraction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Fraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.lightclients.tendermint.v1.Fraction; - - /** - * Decodes a Fraction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Fraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.lightclients.tendermint.v1.Fraction; - - /** - * Verifies a Fraction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Fraction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Fraction - */ - public static fromObject(object: { [k: string]: any }): ibc.lightclients.tendermint.v1.Fraction; - - /** - * Creates a plain object from a Fraction message. Also converts values to other types if specified. - * @param message Fraction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.lightclients.tendermint.v1.Fraction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Fraction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } -} - -/** Namespace ics23. */ -export namespace ics23 { - - /** HashOp enum. */ - enum HashOp { - NO_HASH = 0, - SHA256 = 1, - SHA512 = 2, - KECCAK = 3, - RIPEMD160 = 4, - BITCOIN = 5 - } - - /** - * LengthOp defines how to process the key and value of the LeafOp - * to include length information. After encoding the length with the given - * algorithm, the length will be prepended to the key and value bytes. - * (Each one with it's own encoded length) - */ - enum LengthOp { - NO_PREFIX = 0, - VAR_PROTO = 1, - VAR_RLP = 2, - FIXED32_BIG = 3, - FIXED32_LITTLE = 4, - FIXED64_BIG = 5, - FIXED64_LITTLE = 6, - REQUIRE_32_BYTES = 7, - REQUIRE_64_BYTES = 8 - } - - /** Properties of an ExistenceProof. */ - interface IExistenceProof { - - /** ExistenceProof key */ - key?: (Uint8Array|null); - - /** ExistenceProof value */ - value?: (Uint8Array|null); - - /** ExistenceProof leaf */ - leaf?: (ics23.ILeafOp|null); - - /** ExistenceProof path */ - path?: (ics23.IInnerOp[]|null); - } - - /** - * ExistenceProof takes a key and a value and a set of steps to perform on it. - * The result of peforming all these steps will provide a "root hash", which can - * be compared to the value in a header. - * - * Since it is computationally infeasible to produce a hash collission for any of the used - * cryptographic hash functions, if someone can provide a series of operations to transform - * a given key and value into a root hash that matches some trusted root, these key and values - * must be in the referenced merkle tree. - * - * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, - * which should be controlled by a spec. Eg. with lengthOp as NONE, - * prefix = FOO, key = BAR, value = CHOICE - * and - * prefix = F, key = OOBAR, value = CHOICE - * would produce the same value. - * - * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field - * in the ProofSpec is valuable to prevent this mutability. And why all trees should - * length-prefix the data before hashing it. - */ - class ExistenceProof implements IExistenceProof { - - /** - * Constructs a new ExistenceProof. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.IExistenceProof); - - /** ExistenceProof key. */ - public key: Uint8Array; - - /** ExistenceProof value. */ - public value: Uint8Array; - - /** ExistenceProof leaf. */ - public leaf?: (ics23.ILeafOp|null); - - /** ExistenceProof path. */ - public path: ics23.IInnerOp[]; - - /** - * Encodes the specified ExistenceProof message. Does not implicitly {@link ics23.ExistenceProof.verify|verify} messages. - * @param message ExistenceProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.IExistenceProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExistenceProof message, length delimited. Does not implicitly {@link ics23.ExistenceProof.verify|verify} messages. - * @param message ExistenceProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.IExistenceProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExistenceProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.ExistenceProof; - - /** - * Decodes an ExistenceProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.ExistenceProof; - - /** - * Verifies an ExistenceProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExistenceProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExistenceProof - */ - public static fromObject(object: { [k: string]: any }): ics23.ExistenceProof; - - /** - * Creates a plain object from an ExistenceProof message. Also converts values to other types if specified. - * @param message ExistenceProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.ExistenceProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExistenceProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a NonExistenceProof. */ - interface INonExistenceProof { - - /** NonExistenceProof key */ - key?: (Uint8Array|null); - - /** NonExistenceProof left */ - left?: (ics23.IExistenceProof|null); - - /** NonExistenceProof right */ - right?: (ics23.IExistenceProof|null); - } - - /** Represents a NonExistenceProof. */ - class NonExistenceProof implements INonExistenceProof { - - /** - * Constructs a new NonExistenceProof. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.INonExistenceProof); - - /** NonExistenceProof key. */ - public key: Uint8Array; - - /** NonExistenceProof left. */ - public left?: (ics23.IExistenceProof|null); - - /** NonExistenceProof right. */ - public right?: (ics23.IExistenceProof|null); - - /** - * Encodes the specified NonExistenceProof message. Does not implicitly {@link ics23.NonExistenceProof.verify|verify} messages. - * @param message NonExistenceProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.INonExistenceProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NonExistenceProof message, length delimited. Does not implicitly {@link ics23.NonExistenceProof.verify|verify} messages. - * @param message NonExistenceProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.INonExistenceProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NonExistenceProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.NonExistenceProof; - - /** - * Decodes a NonExistenceProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.NonExistenceProof; - - /** - * Verifies a NonExistenceProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NonExistenceProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NonExistenceProof - */ - public static fromObject(object: { [k: string]: any }): ics23.NonExistenceProof; - - /** - * Creates a plain object from a NonExistenceProof message. Also converts values to other types if specified. - * @param message NonExistenceProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.NonExistenceProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NonExistenceProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CommitmentProof. */ - interface ICommitmentProof { - - /** CommitmentProof exist */ - exist?: (ics23.IExistenceProof|null); - - /** CommitmentProof nonexist */ - nonexist?: (ics23.INonExistenceProof|null); - - /** CommitmentProof batch */ - batch?: (ics23.IBatchProof|null); - - /** CommitmentProof compressed */ - compressed?: (ics23.ICompressedBatchProof|null); - } - - /** Represents a CommitmentProof. */ - class CommitmentProof implements ICommitmentProof { - - /** - * Constructs a new CommitmentProof. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.ICommitmentProof); - - /** CommitmentProof exist. */ - public exist?: (ics23.IExistenceProof|null); - - /** CommitmentProof nonexist. */ - public nonexist?: (ics23.INonExistenceProof|null); - - /** CommitmentProof batch. */ - public batch?: (ics23.IBatchProof|null); - - /** CommitmentProof compressed. */ - public compressed?: (ics23.ICompressedBatchProof|null); - - /** CommitmentProof proof. */ - public proof?: ("exist"|"nonexist"|"batch"|"compressed"); - - /** - * Encodes the specified CommitmentProof message. Does not implicitly {@link ics23.CommitmentProof.verify|verify} messages. - * @param message CommitmentProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.ICommitmentProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitmentProof message, length delimited. Does not implicitly {@link ics23.CommitmentProof.verify|verify} messages. - * @param message CommitmentProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.ICommitmentProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitmentProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitmentProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.CommitmentProof; - - /** - * Decodes a CommitmentProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitmentProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.CommitmentProof; - - /** - * Verifies a CommitmentProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitmentProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitmentProof - */ - public static fromObject(object: { [k: string]: any }): ics23.CommitmentProof; - - /** - * Creates a plain object from a CommitmentProof message. Also converts values to other types if specified. - * @param message CommitmentProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.CommitmentProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitmentProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a LeafOp. */ - interface ILeafOp { - - /** LeafOp hash */ - hash?: (ics23.HashOp|null); - - /** LeafOp prehash_key */ - prehash_key?: (ics23.HashOp|null); - - /** LeafOp prehash_value */ - prehash_value?: (ics23.HashOp|null); - - /** LeafOp length */ - length?: (ics23.LengthOp|null); - - /** LeafOp prefix */ - prefix?: (Uint8Array|null); - } - - /** - * LeafOp represents the raw key-value data we wish to prove, and - * must be flexible to represent the internal transformation from - * the original key-value pairs into the basis hash, for many existing - * merkle trees. - * - * key and value are passed in. So that the signature of this operation is: - * leafOp(key, value) -> output - * - * To process this, first prehash the keys and values if needed (ANY means no hash in this case): - * hkey = prehashKey(key) - * hvalue = prehashValue(value) - * - * Then combine the bytes, and hash it - * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) - */ - class LeafOp implements ILeafOp { - - /** - * Constructs a new LeafOp. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.ILeafOp); - - /** LeafOp hash. */ - public hash: ics23.HashOp; - - /** LeafOp prehash_key. */ - public prehash_key: ics23.HashOp; - - /** LeafOp prehash_value. */ - public prehash_value: ics23.HashOp; - - /** LeafOp length. */ - public length: ics23.LengthOp; - - /** LeafOp prefix. */ - public prefix: Uint8Array; - - /** - * Encodes the specified LeafOp message. Does not implicitly {@link ics23.LeafOp.verify|verify} messages. - * @param message LeafOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.ILeafOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LeafOp message, length delimited. Does not implicitly {@link ics23.LeafOp.verify|verify} messages. - * @param message LeafOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.ILeafOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LeafOp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LeafOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.LeafOp; - - /** - * Decodes a LeafOp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LeafOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.LeafOp; - - /** - * Verifies a LeafOp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LeafOp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LeafOp - */ - public static fromObject(object: { [k: string]: any }): ics23.LeafOp; - - /** - * Creates a plain object from a LeafOp message. Also converts values to other types if specified. - * @param message LeafOp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.LeafOp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LeafOp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an InnerOp. */ - interface IInnerOp { - - /** InnerOp hash */ - hash?: (ics23.HashOp|null); - - /** InnerOp prefix */ - prefix?: (Uint8Array|null); - - /** InnerOp suffix */ - suffix?: (Uint8Array|null); - } - - /** - * InnerOp represents a merkle-proof step that is not a leaf. - * It represents concatenating two children and hashing them to provide the next result. - * - * The result of the previous step is passed in, so the signature of this op is: - * innerOp(child) -> output - * - * The result of applying InnerOp should be: - * output = op.hash(op.prefix || child || op.suffix) - * - * where the || operator is concatenation of binary data, - * and child is the result of hashing all the tree below this step. - * - * Any special data, like prepending child with the length, or prepending the entire operation with - * some value to differentiate from leaf nodes, should be included in prefix and suffix. - * If either of prefix or suffix is empty, we just treat it as an empty string - */ - class InnerOp implements IInnerOp { - - /** - * Constructs a new InnerOp. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.IInnerOp); - - /** InnerOp hash. */ - public hash: ics23.HashOp; - - /** InnerOp prefix. */ - public prefix: Uint8Array; - - /** InnerOp suffix. */ - public suffix: Uint8Array; - - /** - * Encodes the specified InnerOp message. Does not implicitly {@link ics23.InnerOp.verify|verify} messages. - * @param message InnerOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.IInnerOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InnerOp message, length delimited. Does not implicitly {@link ics23.InnerOp.verify|verify} messages. - * @param message InnerOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.IInnerOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InnerOp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InnerOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.InnerOp; - - /** - * Decodes an InnerOp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InnerOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.InnerOp; - - /** - * Verifies an InnerOp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InnerOp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InnerOp - */ - public static fromObject(object: { [k: string]: any }): ics23.InnerOp; - - /** - * Creates a plain object from an InnerOp message. Also converts values to other types if specified. - * @param message InnerOp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.InnerOp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InnerOp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ProofSpec. */ - interface IProofSpec { - - /** ProofSpec leaf_spec */ - leaf_spec?: (ics23.ILeafOp|null); - - /** ProofSpec inner_spec */ - inner_spec?: (ics23.IInnerSpec|null); - - /** ProofSpec max_depth */ - max_depth?: (number|null); - - /** ProofSpec min_depth */ - min_depth?: (number|null); - } - - /** - * ProofSpec defines what the expected parameters are for a given proof type. - * This can be stored in the client and used to validate any incoming proofs. - * - * verify(ProofSpec, Proof) -> Proof | Error - * - * As demonstrated in tests, if we don't fix the algorithm used to calculate the - * LeafHash for a given tree, there are many possible key-value pairs that can - * generate a given hash (by interpretting the preimage differently). - * We need this for proper security, requires client knows a priori what - * tree format server uses. But not in code, rather a configuration object. - */ - class ProofSpec implements IProofSpec { - - /** - * Constructs a new ProofSpec. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.IProofSpec); - - /** ProofSpec leaf_spec. */ - public leaf_spec?: (ics23.ILeafOp|null); - - /** ProofSpec inner_spec. */ - public inner_spec?: (ics23.IInnerSpec|null); - - /** ProofSpec max_depth. */ - public max_depth: number; - - /** ProofSpec min_depth. */ - public min_depth: number; - - /** - * Encodes the specified ProofSpec message. Does not implicitly {@link ics23.ProofSpec.verify|verify} messages. - * @param message ProofSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.IProofSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProofSpec message, length delimited. Does not implicitly {@link ics23.ProofSpec.verify|verify} messages. - * @param message ProofSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.IProofSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProofSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProofSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.ProofSpec; - - /** - * Decodes a ProofSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProofSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.ProofSpec; - - /** - * Verifies a ProofSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProofSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProofSpec - */ - public static fromObject(object: { [k: string]: any }): ics23.ProofSpec; - - /** - * Creates a plain object from a ProofSpec message. Also converts values to other types if specified. - * @param message ProofSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.ProofSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProofSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an InnerSpec. */ - interface IInnerSpec { - - /** InnerSpec child_order */ - child_order?: (number[]|null); - - /** InnerSpec child_size */ - child_size?: (number|null); - - /** InnerSpec min_prefix_length */ - min_prefix_length?: (number|null); - - /** InnerSpec max_prefix_length */ - max_prefix_length?: (number|null); - - /** InnerSpec empty_child */ - empty_child?: (Uint8Array|null); - - /** InnerSpec hash */ - hash?: (ics23.HashOp|null); - } - - /** Represents an InnerSpec. */ - class InnerSpec implements IInnerSpec { - - /** - * Constructs a new InnerSpec. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.IInnerSpec); - - /** InnerSpec child_order. */ - public child_order: number[]; - - /** InnerSpec child_size. */ - public child_size: number; - - /** InnerSpec min_prefix_length. */ - public min_prefix_length: number; - - /** InnerSpec max_prefix_length. */ - public max_prefix_length: number; - - /** InnerSpec empty_child. */ - public empty_child: Uint8Array; - - /** InnerSpec hash. */ - public hash: ics23.HashOp; - - /** - * Encodes the specified InnerSpec message. Does not implicitly {@link ics23.InnerSpec.verify|verify} messages. - * @param message InnerSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.IInnerSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InnerSpec message, length delimited. Does not implicitly {@link ics23.InnerSpec.verify|verify} messages. - * @param message InnerSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.IInnerSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InnerSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InnerSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.InnerSpec; - - /** - * Decodes an InnerSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InnerSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.InnerSpec; - - /** - * Verifies an InnerSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InnerSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InnerSpec - */ - public static fromObject(object: { [k: string]: any }): ics23.InnerSpec; - - /** - * Creates a plain object from an InnerSpec message. Also converts values to other types if specified. - * @param message InnerSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.InnerSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InnerSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchProof. */ - interface IBatchProof { - - /** BatchProof entries */ - entries?: (ics23.IBatchEntry[]|null); - } - - /** Represents a BatchProof. */ - class BatchProof implements IBatchProof { - - /** - * Constructs a new BatchProof. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.IBatchProof); - - /** BatchProof entries. */ - public entries: ics23.IBatchEntry[]; - - /** - * Encodes the specified BatchProof message. Does not implicitly {@link ics23.BatchProof.verify|verify} messages. - * @param message BatchProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.IBatchProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchProof message, length delimited. Does not implicitly {@link ics23.BatchProof.verify|verify} messages. - * @param message BatchProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.IBatchProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.BatchProof; - - /** - * Decodes a BatchProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.BatchProof; - - /** - * Verifies a BatchProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchProof - */ - public static fromObject(object: { [k: string]: any }): ics23.BatchProof; - - /** - * Creates a plain object from a BatchProof message. Also converts values to other types if specified. - * @param message BatchProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.BatchProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BatchEntry. */ - interface IBatchEntry { - - /** BatchEntry exist */ - exist?: (ics23.IExistenceProof|null); - - /** BatchEntry nonexist */ - nonexist?: (ics23.INonExistenceProof|null); - } - - /** Represents a BatchEntry. */ - class BatchEntry implements IBatchEntry { - - /** - * Constructs a new BatchEntry. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.IBatchEntry); - - /** BatchEntry exist. */ - public exist?: (ics23.IExistenceProof|null); - - /** BatchEntry nonexist. */ - public nonexist?: (ics23.INonExistenceProof|null); - - /** BatchEntry proof. */ - public proof?: ("exist"|"nonexist"); - - /** - * Encodes the specified BatchEntry message. Does not implicitly {@link ics23.BatchEntry.verify|verify} messages. - * @param message BatchEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.IBatchEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchEntry message, length delimited. Does not implicitly {@link ics23.BatchEntry.verify|verify} messages. - * @param message BatchEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.IBatchEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchEntry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.BatchEntry; - - /** - * Decodes a BatchEntry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.BatchEntry; - - /** - * Verifies a BatchEntry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchEntry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchEntry - */ - public static fromObject(object: { [k: string]: any }): ics23.BatchEntry; - - /** - * Creates a plain object from a BatchEntry message. Also converts values to other types if specified. - * @param message BatchEntry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.BatchEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchEntry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CompressedBatchProof. */ - interface ICompressedBatchProof { - - /** CompressedBatchProof entries */ - entries?: (ics23.ICompressedBatchEntry[]|null); - - /** CompressedBatchProof lookup_inners */ - lookup_inners?: (ics23.IInnerOp[]|null); - } - - /** Represents a CompressedBatchProof. */ - class CompressedBatchProof implements ICompressedBatchProof { - - /** - * Constructs a new CompressedBatchProof. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.ICompressedBatchProof); - - /** CompressedBatchProof entries. */ - public entries: ics23.ICompressedBatchEntry[]; - - /** CompressedBatchProof lookup_inners. */ - public lookup_inners: ics23.IInnerOp[]; - - /** - * Encodes the specified CompressedBatchProof message. Does not implicitly {@link ics23.CompressedBatchProof.verify|verify} messages. - * @param message CompressedBatchProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.ICompressedBatchProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CompressedBatchProof message, length delimited. Does not implicitly {@link ics23.CompressedBatchProof.verify|verify} messages. - * @param message CompressedBatchProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.ICompressedBatchProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CompressedBatchProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CompressedBatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.CompressedBatchProof; - - /** - * Decodes a CompressedBatchProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CompressedBatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.CompressedBatchProof; - - /** - * Verifies a CompressedBatchProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CompressedBatchProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompressedBatchProof - */ - public static fromObject(object: { [k: string]: any }): ics23.CompressedBatchProof; - - /** - * Creates a plain object from a CompressedBatchProof message. Also converts values to other types if specified. - * @param message CompressedBatchProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.CompressedBatchProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CompressedBatchProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CompressedBatchEntry. */ - interface ICompressedBatchEntry { - - /** CompressedBatchEntry exist */ - exist?: (ics23.ICompressedExistenceProof|null); - - /** CompressedBatchEntry nonexist */ - nonexist?: (ics23.ICompressedNonExistenceProof|null); - } - - /** Represents a CompressedBatchEntry. */ - class CompressedBatchEntry implements ICompressedBatchEntry { - - /** - * Constructs a new CompressedBatchEntry. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.ICompressedBatchEntry); - - /** CompressedBatchEntry exist. */ - public exist?: (ics23.ICompressedExistenceProof|null); - - /** CompressedBatchEntry nonexist. */ - public nonexist?: (ics23.ICompressedNonExistenceProof|null); - - /** CompressedBatchEntry proof. */ - public proof?: ("exist"|"nonexist"); - - /** - * Encodes the specified CompressedBatchEntry message. Does not implicitly {@link ics23.CompressedBatchEntry.verify|verify} messages. - * @param message CompressedBatchEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.ICompressedBatchEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CompressedBatchEntry message, length delimited. Does not implicitly {@link ics23.CompressedBatchEntry.verify|verify} messages. - * @param message CompressedBatchEntry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.ICompressedBatchEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CompressedBatchEntry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CompressedBatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.CompressedBatchEntry; - - /** - * Decodes a CompressedBatchEntry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CompressedBatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.CompressedBatchEntry; - - /** - * Verifies a CompressedBatchEntry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CompressedBatchEntry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompressedBatchEntry - */ - public static fromObject(object: { [k: string]: any }): ics23.CompressedBatchEntry; - - /** - * Creates a plain object from a CompressedBatchEntry message. Also converts values to other types if specified. - * @param message CompressedBatchEntry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.CompressedBatchEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CompressedBatchEntry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CompressedExistenceProof. */ - interface ICompressedExistenceProof { - - /** CompressedExistenceProof key */ - key?: (Uint8Array|null); - - /** CompressedExistenceProof value */ - value?: (Uint8Array|null); - - /** CompressedExistenceProof leaf */ - leaf?: (ics23.ILeafOp|null); - - /** CompressedExistenceProof path */ - path?: (number[]|null); - } - - /** Represents a CompressedExistenceProof. */ - class CompressedExistenceProof implements ICompressedExistenceProof { - - /** - * Constructs a new CompressedExistenceProof. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.ICompressedExistenceProof); - - /** CompressedExistenceProof key. */ - public key: Uint8Array; - - /** CompressedExistenceProof value. */ - public value: Uint8Array; - - /** CompressedExistenceProof leaf. */ - public leaf?: (ics23.ILeafOp|null); - - /** CompressedExistenceProof path. */ - public path: number[]; - - /** - * Encodes the specified CompressedExistenceProof message. Does not implicitly {@link ics23.CompressedExistenceProof.verify|verify} messages. - * @param message CompressedExistenceProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.ICompressedExistenceProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CompressedExistenceProof message, length delimited. Does not implicitly {@link ics23.CompressedExistenceProof.verify|verify} messages. - * @param message CompressedExistenceProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.ICompressedExistenceProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CompressedExistenceProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CompressedExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.CompressedExistenceProof; - - /** - * Decodes a CompressedExistenceProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CompressedExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.CompressedExistenceProof; - - /** - * Verifies a CompressedExistenceProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CompressedExistenceProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompressedExistenceProof - */ - public static fromObject(object: { [k: string]: any }): ics23.CompressedExistenceProof; - - /** - * Creates a plain object from a CompressedExistenceProof message. Also converts values to other types if specified. - * @param message CompressedExistenceProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.CompressedExistenceProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CompressedExistenceProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CompressedNonExistenceProof. */ - interface ICompressedNonExistenceProof { - - /** CompressedNonExistenceProof key */ - key?: (Uint8Array|null); - - /** CompressedNonExistenceProof left */ - left?: (ics23.ICompressedExistenceProof|null); - - /** CompressedNonExistenceProof right */ - right?: (ics23.ICompressedExistenceProof|null); - } - - /** Represents a CompressedNonExistenceProof. */ - class CompressedNonExistenceProof implements ICompressedNonExistenceProof { - - /** - * Constructs a new CompressedNonExistenceProof. - * @param [properties] Properties to set - */ - constructor(properties?: ics23.ICompressedNonExistenceProof); - - /** CompressedNonExistenceProof key. */ - public key: Uint8Array; - - /** CompressedNonExistenceProof left. */ - public left?: (ics23.ICompressedExistenceProof|null); - - /** CompressedNonExistenceProof right. */ - public right?: (ics23.ICompressedExistenceProof|null); - - /** - * Encodes the specified CompressedNonExistenceProof message. Does not implicitly {@link ics23.CompressedNonExistenceProof.verify|verify} messages. - * @param message CompressedNonExistenceProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ics23.ICompressedNonExistenceProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CompressedNonExistenceProof message, length delimited. Does not implicitly {@link ics23.CompressedNonExistenceProof.verify|verify} messages. - * @param message CompressedNonExistenceProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ics23.ICompressedNonExistenceProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CompressedNonExistenceProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CompressedNonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ics23.CompressedNonExistenceProof; - - /** - * Decodes a CompressedNonExistenceProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CompressedNonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ics23.CompressedNonExistenceProof; - - /** - * Verifies a CompressedNonExistenceProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CompressedNonExistenceProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompressedNonExistenceProof - */ - public static fromObject(object: { [k: string]: any }): ics23.CompressedNonExistenceProof; - - /** - * Creates a plain object from a CompressedNonExistenceProof message. Also converts values to other types if specified. - * @param message CompressedNonExistenceProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ics23.CompressedNonExistenceProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CompressedNonExistenceProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } -} - -/** Namespace tendermint. */ -export namespace tendermint { - - /** Namespace types. */ - namespace types { - - /** Properties of a ValidatorSet. */ - interface IValidatorSet { - - /** ValidatorSet validators */ - validators?: (tendermint.types.IValidator[]|null); - - /** ValidatorSet proposer */ - proposer?: (tendermint.types.IValidator|null); - - /** ValidatorSet total_voting_power */ - total_voting_power?: (Long|null); - } - - /** Represents a ValidatorSet. */ - class ValidatorSet implements IValidatorSet { - - /** - * Constructs a new ValidatorSet. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IValidatorSet); - - /** ValidatorSet validators. */ - public validators: tendermint.types.IValidator[]; - - /** ValidatorSet proposer. */ - public proposer?: (tendermint.types.IValidator|null); - - /** ValidatorSet total_voting_power. */ - public total_voting_power: Long; - - /** - * Encodes the specified ValidatorSet message. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @param message ValidatorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IValidatorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidatorSet message, length delimited. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @param message ValidatorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IValidatorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.ValidatorSet; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.ValidatorSet; - - /** - * Verifies a ValidatorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValidatorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidatorSet - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.ValidatorSet; - - /** - * Creates a plain object from a ValidatorSet message. Also converts values to other types if specified. - * @param message ValidatorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.ValidatorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidatorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Validator. */ - interface IValidator { - - /** Validator address */ - address?: (Uint8Array|null); - - /** Validator pub_key */ - pub_key?: (tendermint.crypto.IPublicKey|null); - - /** Validator voting_power */ - voting_power?: (Long|null); - - /** Validator proposer_priority */ - proposer_priority?: (Long|null); - } - - /** Represents a Validator. */ - class Validator implements IValidator { - - /** - * Constructs a new Validator. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IValidator); - - /** Validator address. */ - public address: Uint8Array; - - /** Validator pub_key. */ - public pub_key?: (tendermint.crypto.IPublicKey|null); - - /** Validator voting_power. */ - public voting_power: Long; - - /** Validator proposer_priority. */ - public proposer_priority: Long; - - /** - * Encodes the specified Validator message. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @param message Validator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @param message Validator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Validator; - - /** - * Decodes a Validator message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Validator; - - /** - * Verifies a Validator message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Validator message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Validator - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Validator; - - /** - * Creates a plain object from a Validator message. Also converts values to other types if specified. - * @param message Validator - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Validator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Validator to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SimpleValidator. */ - interface ISimpleValidator { - - /** SimpleValidator pub_key */ - pub_key?: (tendermint.crypto.IPublicKey|null); - - /** SimpleValidator voting_power */ - voting_power?: (Long|null); - } - - /** Represents a SimpleValidator. */ - class SimpleValidator implements ISimpleValidator { - - /** - * Constructs a new SimpleValidator. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ISimpleValidator); - - /** SimpleValidator pub_key. */ - public pub_key?: (tendermint.crypto.IPublicKey|null); - - /** SimpleValidator voting_power. */ - public voting_power: Long; - - /** - * Encodes the specified SimpleValidator message. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @param message SimpleValidator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ISimpleValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SimpleValidator message, length delimited. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @param message SimpleValidator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ISimpleValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.SimpleValidator; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.SimpleValidator; - - /** - * Verifies a SimpleValidator message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SimpleValidator message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimpleValidator - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.SimpleValidator; - - /** - * Creates a plain object from a SimpleValidator message. Also converts values to other types if specified. - * @param message SimpleValidator - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.SimpleValidator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SimpleValidator to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** BlockIDFlag enum. */ - enum BlockIDFlag { - BLOCK_ID_FLAG_UNKNOWN = 0, - BLOCK_ID_FLAG_ABSENT = 1, - BLOCK_ID_FLAG_COMMIT = 2, - BLOCK_ID_FLAG_NIL = 3 - } - - /** SignedMsgType enum. */ - enum SignedMsgType { - SIGNED_MSG_TYPE_UNKNOWN = 0, - SIGNED_MSG_TYPE_PREVOTE = 1, - SIGNED_MSG_TYPE_PRECOMMIT = 2, - SIGNED_MSG_TYPE_PROPOSAL = 32 - } - - /** Properties of a PartSetHeader. */ - interface IPartSetHeader { - - /** PartSetHeader total */ - total?: (number|null); - - /** PartSetHeader hash */ - hash?: (Uint8Array|null); - } - - /** Represents a PartSetHeader. */ - class PartSetHeader implements IPartSetHeader { - - /** - * Constructs a new PartSetHeader. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IPartSetHeader); - - /** PartSetHeader total. */ - public total: number; - - /** PartSetHeader hash. */ - public hash: Uint8Array; - - /** - * Encodes the specified PartSetHeader message. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @param message PartSetHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IPartSetHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartSetHeader message, length delimited. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @param message PartSetHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IPartSetHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.PartSetHeader; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.PartSetHeader; - - /** - * Verifies a PartSetHeader message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartSetHeader message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartSetHeader - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.PartSetHeader; - - /** - * Creates a plain object from a PartSetHeader message. Also converts values to other types if specified. - * @param message PartSetHeader - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.PartSetHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartSetHeader to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Part. */ - interface IPart { - - /** Part index */ - index?: (number|null); - - /** Part bytes */ - bytes?: (Uint8Array|null); - - /** Part proof */ - proof?: (tendermint.crypto.IProof|null); - } - - /** Represents a Part. */ - class Part implements IPart { - - /** - * Constructs a new Part. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IPart); - - /** Part index. */ - public index: number; - - /** Part bytes. */ - public bytes: Uint8Array; - - /** Part proof. */ - public proof?: (tendermint.crypto.IProof|null); - - /** - * Encodes the specified Part message. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Part message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Part; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Part; - - /** - * Verifies a Part message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Part - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Part; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @param message Part - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Part to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BlockID. */ - interface IBlockID { - - /** BlockID hash */ - hash?: (Uint8Array|null); - - /** BlockID part_set_header */ - part_set_header?: (tendermint.types.IPartSetHeader|null); - } - - /** Represents a BlockID. */ - class BlockID implements IBlockID { - - /** - * Constructs a new BlockID. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IBlockID); - - /** BlockID hash. */ - public hash: Uint8Array; - - /** BlockID part_set_header. */ - public part_set_header?: (tendermint.types.IPartSetHeader|null); - - /** - * Encodes the specified BlockID message. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @param message BlockID message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IBlockID, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BlockID message, length delimited. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @param message BlockID message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IBlockID, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockID message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.BlockID; - - /** - * Decodes a BlockID message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.BlockID; - - /** - * Verifies a BlockID message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BlockID message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BlockID - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.BlockID; - - /** - * Creates a plain object from a BlockID message. Also converts values to other types if specified. - * @param message BlockID - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.BlockID, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BlockID to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Header. */ - interface IHeader { - - /** Header version */ - version?: (tendermint.version.IConsensus|null); - - /** Header chain_id */ - chain_id?: (string|null); - - /** Header height */ - height?: (Long|null); - - /** Header time */ - time?: (google.protobuf.ITimestamp|null); - - /** Header last_block_id */ - last_block_id?: (tendermint.types.IBlockID|null); - - /** Header last_commit_hash */ - last_commit_hash?: (Uint8Array|null); - - /** Header data_hash */ - data_hash?: (Uint8Array|null); - - /** Header validators_hash */ - validators_hash?: (Uint8Array|null); - - /** Header next_validators_hash */ - next_validators_hash?: (Uint8Array|null); - - /** Header consensus_hash */ - consensus_hash?: (Uint8Array|null); - - /** Header app_hash */ - app_hash?: (Uint8Array|null); - - /** Header last_results_hash */ - last_results_hash?: (Uint8Array|null); - - /** Header evidence_hash */ - evidence_hash?: (Uint8Array|null); - - /** Header proposer_address */ - proposer_address?: (Uint8Array|null); - } - - /** Represents a Header. */ - class Header implements IHeader { - - /** - * Constructs a new Header. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IHeader); - - /** Header version. */ - public version?: (tendermint.version.IConsensus|null); - - /** Header chain_id. */ - public chain_id: string; - - /** Header height. */ - public height: Long; - - /** Header time. */ - public time?: (google.protobuf.ITimestamp|null); - - /** Header last_block_id. */ - public last_block_id?: (tendermint.types.IBlockID|null); - - /** Header last_commit_hash. */ - public last_commit_hash: Uint8Array; - - /** Header data_hash. */ - public data_hash: Uint8Array; - - /** Header validators_hash. */ - public validators_hash: Uint8Array; - - /** Header next_validators_hash. */ - public next_validators_hash: Uint8Array; - - /** Header consensus_hash. */ - public consensus_hash: Uint8Array; - - /** Header app_hash. */ - public app_hash: Uint8Array; - - /** Header last_results_hash. */ - public last_results_hash: Uint8Array; - - /** Header evidence_hash. */ - public evidence_hash: Uint8Array; - - /** Header proposer_address. */ - public proposer_address: Uint8Array; - - /** - * Encodes the specified Header message. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Header message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Header; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Header; - - /** - * Verifies a Header message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Header - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Header; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @param message Header - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Header to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Data. */ - interface IData { - - /** Data txs */ - txs?: (Uint8Array[]|null); - } - - /** Represents a Data. */ - class Data implements IData { - - /** - * Constructs a new Data. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IData); - - /** Data txs. */ - public txs: Uint8Array[]; - - /** - * Encodes the specified Data message. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @param message Data message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Data message, length delimited. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @param message Data message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Data message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Data; - - /** - * Decodes a Data message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Data; - - /** - * Verifies a Data message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Data message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Data - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Data; - - /** - * Creates a plain object from a Data message. Also converts values to other types if specified. - * @param message Data - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Data, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Data to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Vote. */ - interface IVote { - - /** Vote type */ - type?: (tendermint.types.SignedMsgType|null); - - /** Vote height */ - height?: (Long|null); - - /** Vote round */ - round?: (number|null); - - /** Vote block_id */ - block_id?: (tendermint.types.IBlockID|null); - - /** Vote timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - - /** Vote validator_address */ - validator_address?: (Uint8Array|null); - - /** Vote validator_index */ - validator_index?: (number|null); - - /** Vote signature */ - signature?: (Uint8Array|null); - } - - /** Represents a Vote. */ - class Vote implements IVote { - - /** - * Constructs a new Vote. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IVote); - - /** Vote type. */ - public type: tendermint.types.SignedMsgType; - - /** Vote height. */ - public height: Long; - - /** Vote round. */ - public round: number; - - /** Vote block_id. */ - public block_id?: (tendermint.types.IBlockID|null); - - /** Vote timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** Vote validator_address. */ - public validator_address: Uint8Array; - - /** Vote validator_index. */ - public validator_index: number; - - /** Vote signature. */ - public signature: Uint8Array; - - /** - * Encodes the specified Vote message. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @param message Vote message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IVote, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @param message Vote message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IVote, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Vote; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Vote; - - /** - * Verifies a Vote message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Vote - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Vote; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @param message Vote - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Vote, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Vote to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Commit. */ - interface ICommit { - - /** Commit height */ - height?: (Long|null); - - /** Commit round */ - round?: (number|null); - - /** Commit block_id */ - block_id?: (tendermint.types.IBlockID|null); - - /** Commit signatures */ - signatures?: (tendermint.types.ICommitSig[]|null); - } - - /** Represents a Commit. */ - class Commit implements ICommit { - - /** - * Constructs a new Commit. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ICommit); - - /** Commit height. */ - public height: Long; - - /** Commit round. */ - public round: number; - - /** Commit block_id. */ - public block_id?: (tendermint.types.IBlockID|null); - - /** Commit signatures. */ - public signatures: tendermint.types.ICommitSig[]; - - /** - * Encodes the specified Commit message. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @param message Commit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ICommit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Commit message, length delimited. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @param message Commit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ICommit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Commit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Commit; - - /** - * Decodes a Commit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Commit; - - /** - * Verifies a Commit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Commit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Commit - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Commit; - - /** - * Creates a plain object from a Commit message. Also converts values to other types if specified. - * @param message Commit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Commit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Commit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CommitSig. */ - interface ICommitSig { - - /** CommitSig block_id_flag */ - block_id_flag?: (tendermint.types.BlockIDFlag|null); - - /** CommitSig validator_address */ - validator_address?: (Uint8Array|null); - - /** CommitSig timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - - /** CommitSig signature */ - signature?: (Uint8Array|null); - } - - /** Represents a CommitSig. */ - class CommitSig implements ICommitSig { - - /** - * Constructs a new CommitSig. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ICommitSig); - - /** CommitSig block_id_flag. */ - public block_id_flag: tendermint.types.BlockIDFlag; - - /** CommitSig validator_address. */ - public validator_address: Uint8Array; - - /** CommitSig timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** CommitSig signature. */ - public signature: Uint8Array; - - /** - * Encodes the specified CommitSig message. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @param message CommitSig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ICommitSig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitSig message, length delimited. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @param message CommitSig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ICommitSig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitSig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.CommitSig; - - /** - * Decodes a CommitSig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.CommitSig; - - /** - * Verifies a CommitSig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitSig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitSig - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.CommitSig; - - /** - * Creates a plain object from a CommitSig message. Also converts values to other types if specified. - * @param message CommitSig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.CommitSig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitSig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Proposal. */ - interface IProposal { - - /** Proposal type */ - type?: (tendermint.types.SignedMsgType|null); - - /** Proposal height */ - height?: (Long|null); - - /** Proposal round */ - round?: (number|null); - - /** Proposal pol_round */ - pol_round?: (number|null); - - /** Proposal block_id */ - block_id?: (tendermint.types.IBlockID|null); - - /** Proposal timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - - /** Proposal signature */ - signature?: (Uint8Array|null); - } - - /** Represents a Proposal. */ - class Proposal implements IProposal { - - /** - * Constructs a new Proposal. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IProposal); - - /** Proposal type. */ - public type: tendermint.types.SignedMsgType; - - /** Proposal height. */ - public height: Long; - - /** Proposal round. */ - public round: number; - - /** Proposal pol_round. */ - public pol_round: number; - - /** Proposal block_id. */ - public block_id?: (tendermint.types.IBlockID|null); - - /** Proposal timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** Proposal signature. */ - public signature: Uint8Array; - - /** - * Encodes the specified Proposal message. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @param message Proposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @param message Proposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Proposal; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Proposal; - - /** - * Verifies a Proposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Proposal - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Proposal; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @param message Proposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Proposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Proposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SignedHeader. */ - interface ISignedHeader { - - /** SignedHeader header */ - header?: (tendermint.types.IHeader|null); - - /** SignedHeader commit */ - commit?: (tendermint.types.ICommit|null); - } - - /** Represents a SignedHeader. */ - class SignedHeader implements ISignedHeader { - - /** - * Constructs a new SignedHeader. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ISignedHeader); - - /** SignedHeader header. */ - public header?: (tendermint.types.IHeader|null); - - /** SignedHeader commit. */ - public commit?: (tendermint.types.ICommit|null); - - /** - * Encodes the specified SignedHeader message. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @param message SignedHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ISignedHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SignedHeader message, length delimited. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @param message SignedHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ISignedHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignedHeader message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.SignedHeader; - - /** - * Decodes a SignedHeader message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.SignedHeader; - - /** - * Verifies a SignedHeader message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SignedHeader message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SignedHeader - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.SignedHeader; - - /** - * Creates a plain object from a SignedHeader message. Also converts values to other types if specified. - * @param message SignedHeader - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.SignedHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SignedHeader to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a LightBlock. */ - interface ILightBlock { - - /** LightBlock signed_header */ - signed_header?: (tendermint.types.ISignedHeader|null); - - /** LightBlock validator_set */ - validator_set?: (tendermint.types.IValidatorSet|null); - } - - /** Represents a LightBlock. */ - class LightBlock implements ILightBlock { - - /** - * Constructs a new LightBlock. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ILightBlock); - - /** LightBlock signed_header. */ - public signed_header?: (tendermint.types.ISignedHeader|null); - - /** LightBlock validator_set. */ - public validator_set?: (tendermint.types.IValidatorSet|null); - - /** - * Encodes the specified LightBlock message. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @param message LightBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ILightBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LightBlock message, length delimited. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @param message LightBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ILightBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LightBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.LightBlock; - - /** - * Decodes a LightBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.LightBlock; - - /** - * Verifies a LightBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LightBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LightBlock - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.LightBlock; - - /** - * Creates a plain object from a LightBlock message. Also converts values to other types if specified. - * @param message LightBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.LightBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LightBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BlockMeta. */ - interface IBlockMeta { - - /** BlockMeta block_id */ - block_id?: (tendermint.types.IBlockID|null); - - /** BlockMeta block_size */ - block_size?: (Long|null); - - /** BlockMeta header */ - header?: (tendermint.types.IHeader|null); - - /** BlockMeta num_txs */ - num_txs?: (Long|null); - } - - /** Represents a BlockMeta. */ - class BlockMeta implements IBlockMeta { - - /** - * Constructs a new BlockMeta. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IBlockMeta); - - /** BlockMeta block_id. */ - public block_id?: (tendermint.types.IBlockID|null); - - /** BlockMeta block_size. */ - public block_size: Long; - - /** BlockMeta header. */ - public header?: (tendermint.types.IHeader|null); - - /** BlockMeta num_txs. */ - public num_txs: Long; - - /** - * Encodes the specified BlockMeta message. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @param message BlockMeta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IBlockMeta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BlockMeta message, length delimited. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @param message BlockMeta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IBlockMeta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockMeta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.BlockMeta; - - /** - * Decodes a BlockMeta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.BlockMeta; - - /** - * Verifies a BlockMeta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BlockMeta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BlockMeta - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.BlockMeta; - - /** - * Creates a plain object from a BlockMeta message. Also converts values to other types if specified. - * @param message BlockMeta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.BlockMeta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BlockMeta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TxProof. */ - interface ITxProof { - - /** TxProof root_hash */ - root_hash?: (Uint8Array|null); - - /** TxProof data */ - data?: (Uint8Array|null); - - /** TxProof proof */ - proof?: (tendermint.crypto.IProof|null); - } - - /** Represents a TxProof. */ - class TxProof implements ITxProof { - - /** - * Constructs a new TxProof. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ITxProof); - - /** TxProof root_hash. */ - public root_hash: Uint8Array; - - /** TxProof data. */ - public data: Uint8Array; - - /** TxProof proof. */ - public proof?: (tendermint.crypto.IProof|null); - - /** - * Encodes the specified TxProof message. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @param message TxProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ITxProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TxProof message, length delimited. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @param message TxProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ITxProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.TxProof; - - /** - * Decodes a TxProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.TxProof; - - /** - * Verifies a TxProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TxProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TxProof - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.TxProof; - - /** - * Creates a plain object from a TxProof message. Also converts values to other types if specified. - * @param message TxProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.TxProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TxProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace crypto. */ - namespace crypto { - - /** Properties of a PublicKey. */ - interface IPublicKey { - - /** PublicKey ed25519 */ - ed25519?: (Uint8Array|null); - - /** PublicKey secp256k1 */ - secp256k1?: (Uint8Array|null); - } - - /** Represents a PublicKey. */ - class PublicKey implements IPublicKey { - - /** - * Constructs a new PublicKey. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IPublicKey); - - /** PublicKey ed25519. */ - public ed25519?: (Uint8Array|null); - - /** PublicKey secp256k1. */ - public secp256k1?: (Uint8Array|null); - - /** PublicKey sum. */ - public sum?: ("ed25519"|"secp256k1"); - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @param message PublicKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @param message PublicKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.PublicKey; - - /** - * Decodes a PublicKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.PublicKey; - - /** - * Verifies a PublicKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PublicKey - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.PublicKey; - - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @param message PublicKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.PublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublicKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Proof. */ - interface IProof { - - /** Proof total */ - total?: (Long|null); - - /** Proof index */ - index?: (Long|null); - - /** Proof leaf_hash */ - leaf_hash?: (Uint8Array|null); - - /** Proof aunts */ - aunts?: (Uint8Array[]|null); - } - - /** Represents a Proof. */ - class Proof implements IProof { - - /** - * Constructs a new Proof. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IProof); - - /** Proof total. */ - public total: Long; - - /** Proof index. */ - public index: Long; - - /** Proof leaf_hash. */ - public leaf_hash: Uint8Array; - - /** Proof aunts. */ - public aunts: Uint8Array[]; - - /** - * Encodes the specified Proof message. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @param message Proof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Proof message, length delimited. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @param message Proof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Proof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.Proof; - - /** - * Decodes a Proof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.Proof; - - /** - * Verifies a Proof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Proof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Proof - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.Proof; - - /** - * Creates a plain object from a Proof message. Also converts values to other types if specified. - * @param message Proof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.Proof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Proof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ValueOp. */ - interface IValueOp { - - /** ValueOp key */ - key?: (Uint8Array|null); - - /** ValueOp proof */ - proof?: (tendermint.crypto.IProof|null); - } - - /** Represents a ValueOp. */ - class ValueOp implements IValueOp { - - /** - * Constructs a new ValueOp. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IValueOp); - - /** ValueOp key. */ - public key: Uint8Array; - - /** ValueOp proof. */ - public proof?: (tendermint.crypto.IProof|null); - - /** - * Encodes the specified ValueOp message. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @param message ValueOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IValueOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValueOp message, length delimited. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @param message ValueOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IValueOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValueOp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.ValueOp; - - /** - * Decodes a ValueOp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.ValueOp; - - /** - * Verifies a ValueOp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValueOp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValueOp - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.ValueOp; - - /** - * Creates a plain object from a ValueOp message. Also converts values to other types if specified. - * @param message ValueOp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.ValueOp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValueOp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DominoOp. */ - interface IDominoOp { - - /** DominoOp key */ - key?: (string|null); - - /** DominoOp input */ - input?: (string|null); - - /** DominoOp output */ - output?: (string|null); - } - - /** Represents a DominoOp. */ - class DominoOp implements IDominoOp { - - /** - * Constructs a new DominoOp. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IDominoOp); - - /** DominoOp key. */ - public key: string; - - /** DominoOp input. */ - public input: string; - - /** DominoOp output. */ - public output: string; - - /** - * Encodes the specified DominoOp message. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @param message DominoOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IDominoOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DominoOp message, length delimited. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @param message DominoOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IDominoOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DominoOp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.DominoOp; - - /** - * Decodes a DominoOp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.DominoOp; - - /** - * Verifies a DominoOp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DominoOp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DominoOp - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.DominoOp; - - /** - * Creates a plain object from a DominoOp message. Also converts values to other types if specified. - * @param message DominoOp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.DominoOp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DominoOp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ProofOp. */ - interface IProofOp { - - /** ProofOp type */ - type?: (string|null); - - /** ProofOp key */ - key?: (Uint8Array|null); - - /** ProofOp data */ - data?: (Uint8Array|null); - } - - /** Represents a ProofOp. */ - class ProofOp implements IProofOp { - - /** - * Constructs a new ProofOp. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IProofOp); - - /** ProofOp type. */ - public type: string; - - /** ProofOp key. */ - public key: Uint8Array; - - /** ProofOp data. */ - public data: Uint8Array; - - /** - * Encodes the specified ProofOp message. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @param message ProofOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IProofOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProofOp message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @param message ProofOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IProofOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProofOp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.ProofOp; - - /** - * Decodes a ProofOp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.ProofOp; - - /** - * Verifies a ProofOp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProofOp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProofOp - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.ProofOp; - - /** - * Creates a plain object from a ProofOp message. Also converts values to other types if specified. - * @param message ProofOp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.ProofOp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProofOp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ProofOps. */ - interface IProofOps { - - /** ProofOps ops */ - ops?: (tendermint.crypto.IProofOp[]|null); - } - - /** Represents a ProofOps. */ - class ProofOps implements IProofOps { - - /** - * Constructs a new ProofOps. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IProofOps); - - /** ProofOps ops. */ - public ops: tendermint.crypto.IProofOp[]; - - /** - * Encodes the specified ProofOps message. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @param message ProofOps message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IProofOps, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProofOps message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @param message ProofOps message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IProofOps, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProofOps message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.ProofOps; - - /** - * Decodes a ProofOps message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.ProofOps; - - /** - * Verifies a ProofOps message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProofOps message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProofOps - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.ProofOps; - - /** - * Creates a plain object from a ProofOps message. Also converts values to other types if specified. - * @param message ProofOps - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.ProofOps, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProofOps to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace version. */ - namespace version { - - /** Properties of an App. */ - interface IApp { - - /** App protocol */ - protocol?: (Long|null); - - /** App software */ - software?: (string|null); - } - - /** Represents an App. */ - class App implements IApp { - - /** - * Constructs a new App. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.version.IApp); - - /** App protocol. */ - public protocol: Long; - - /** App software. */ - public software: string; - - /** - * Encodes the specified App message. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @param message App message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.version.IApp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified App message, length delimited. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @param message App message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.version.IApp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an App message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.version.App; - - /** - * Decodes an App message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.version.App; - - /** - * Verifies an App message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an App message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns App - */ - public static fromObject(object: { [k: string]: any }): tendermint.version.App; - - /** - * Creates a plain object from an App message. Also converts values to other types if specified. - * @param message App - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.version.App, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this App to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Consensus. */ - interface IConsensus { - - /** Consensus block */ - block?: (Long|null); - - /** Consensus app */ - app?: (Long|null); - } - - /** Represents a Consensus. */ - class Consensus implements IConsensus { - - /** - * Constructs a new Consensus. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.version.IConsensus); - - /** Consensus block. */ - public block: Long; - - /** Consensus app. */ - public app: Long; - - /** - * Encodes the specified Consensus message. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @param message Consensus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.version.IConsensus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Consensus message, length delimited. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @param message Consensus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.version.IConsensus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Consensus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.version.Consensus; - - /** - * Decodes a Consensus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.version.Consensus; - - /** - * Verifies a Consensus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Consensus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Consensus - */ - public static fromObject(object: { [k: string]: any }): tendermint.version.Consensus; - - /** - * Creates a plain object from a Consensus message. Also converts values to other types if specified. - * @param message Consensus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.version.Consensus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Consensus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace libs. */ - namespace libs { - - /** Namespace bits. */ - namespace bits { - - /** Properties of a BitArray. */ - interface IBitArray { - - /** BitArray bits */ - bits?: (Long|null); - - /** BitArray elems */ - elems?: (Long[]|null); - } - - /** Represents a BitArray. */ - class BitArray implements IBitArray { - - /** - * Constructs a new BitArray. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.libs.bits.IBitArray); - - /** BitArray bits. */ - public bits: Long; - - /** BitArray elems. */ - public elems: Long[]; - - /** - * Encodes the specified BitArray message. Does not implicitly {@link tendermint.libs.bits.BitArray.verify|verify} messages. - * @param message BitArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.libs.bits.IBitArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BitArray message, length delimited. Does not implicitly {@link tendermint.libs.bits.BitArray.verify|verify} messages. - * @param message BitArray message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.libs.bits.IBitArray, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BitArray message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.libs.bits.BitArray; - - /** - * Decodes a BitArray message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.libs.bits.BitArray; - - /** - * Verifies a BitArray message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BitArray message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BitArray - */ - public static fromObject(object: { [k: string]: any }): tendermint.libs.bits.BitArray; - - /** - * Creates a plain object from a BitArray message. Also converts values to other types if specified. - * @param message BitArray - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.libs.bits.BitArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BitArray to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } -} diff --git a/src/generated/ibc/proto.js b/src/generated/ibc/proto.js deleted file mode 100644 index f33f97ab..00000000 --- a/src/generated/ibc/proto.js +++ /dev/null @@ -1,83954 +0,0 @@ -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -import * as $protobuf from "protobufjs/minimal"; - -// Common aliases -const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - -// Exported root namespace -const $root = $protobuf.roots["@cosmos-client/ibc"] || ($protobuf.roots["@cosmos-client/ibc"] = {}); - -export const cosmos = $root.cosmos = (() => { - - /** - * Namespace cosmos. - * @exports cosmos - * @namespace - */ - const cosmos = {}; - - cosmos.adminmodule = (function() { - - /** - * Namespace adminmodule. - * @memberof cosmos - * @namespace - */ - const adminmodule = {}; - - adminmodule.adminmodule = (function() { - - /** - * Namespace adminmodule. - * @memberof cosmos.adminmodule - * @namespace - */ - const adminmodule = {}; - - adminmodule.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#deleteAdmin}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef DeleteAdminCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} [response] MsgDeleteAdminResponse - */ - - /** - * Calls DeleteAdmin. - * @function deleteAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} request MsgDeleteAdmin message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.DeleteAdminCallback} callback Node-style callback called with the error, if any, and MsgDeleteAdminResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.deleteAdmin = function deleteAdmin(request, callback) { - return this.rpcCall(deleteAdmin, $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin, $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse, request, callback); - }, "name", { value: "DeleteAdmin" }); - - /** - * Calls DeleteAdmin. - * @function deleteAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} request MsgDeleteAdmin message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#addAdmin}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef AddAdminCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} [response] MsgAddAdminResponse - */ - - /** - * Calls AddAdmin. - * @function addAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} request MsgAddAdmin message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.AddAdminCallback} callback Node-style callback called with the error, if any, and MsgAddAdminResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.addAdmin = function addAdmin(request, callback) { - return this.rpcCall(addAdmin, $root.cosmos.adminmodule.adminmodule.MsgAddAdmin, $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse, request, callback); - }, "name", { value: "AddAdmin" }); - - /** - * Calls AddAdmin. - * @function addAdmin - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} request MsgAddAdmin message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Msg#submitProposal}. - * @memberof cosmos.adminmodule.adminmodule.Msg - * @typedef SubmitProposalCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} [response] MsgSubmitProposalResponse - */ - - /** - * Calls SubmitProposal. - * @function submitProposal - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} request MsgSubmitProposal message or plain object - * @param {cosmos.adminmodule.adminmodule.Msg.SubmitProposalCallback} callback Node-style callback called with the error, if any, and MsgSubmitProposalResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.submitProposal = function submitProposal(request, callback) { - return this.rpcCall(submitProposal, $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal, $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse, request, callback); - }, "name", { value: "SubmitProposal" }); - - /** - * Calls SubmitProposal. - * @function submitProposal - * @memberof cosmos.adminmodule.adminmodule.Msg - * @instance - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} request MsgSubmitProposal message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - adminmodule.MsgDeleteAdmin = (function() { - - /** - * Properties of a MsgDeleteAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgDeleteAdmin - * @property {string|null} [creator] MsgDeleteAdmin creator - * @property {string|null} [admin] MsgDeleteAdmin admin - */ - - /** - * Constructs a new MsgDeleteAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgDeleteAdmin. - * @implements IMsgDeleteAdmin - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin=} [properties] Properties to set - */ - function MsgDeleteAdmin(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgDeleteAdmin creator. - * @member {string} creator - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - */ - MsgDeleteAdmin.prototype.creator = ""; - - /** - * MsgDeleteAdmin admin. - * @member {string} admin - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - */ - MsgDeleteAdmin.prototype.admin = ""; - - /** - * Encodes the specified MsgDeleteAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} message MsgDeleteAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdmin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.admin); - return writer; - }; - - /** - * Encodes the specified MsgDeleteAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdmin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdmin} message MsgDeleteAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdmin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdmin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeleteAdmin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdmin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeleteAdmin message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeleteAdmin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.admin != null && message.hasOwnProperty("admin")) - if (!$util.isString(message.admin)) - return "admin: string expected"; - return null; - }; - - /** - * Creates a MsgDeleteAdmin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} MsgDeleteAdmin - */ - MsgDeleteAdmin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdmin(); - if (object.creator != null) - message.creator = String(object.creator); - if (object.admin != null) - message.admin = String(object.admin); - return message; - }; - - /** - * Creates a plain object from a MsgDeleteAdmin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdmin} message MsgDeleteAdmin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeleteAdmin.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.creator = ""; - object.admin = ""; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.admin != null && message.hasOwnProperty("admin")) - object.admin = message.admin; - return object; - }; - - /** - * Converts this MsgDeleteAdmin to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdmin - * @instance - * @returns {Object.} JSON object - */ - MsgDeleteAdmin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeleteAdmin; - })(); - - adminmodule.MsgDeleteAdminResponse = (function() { - - /** - * Properties of a MsgDeleteAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgDeleteAdminResponse - */ - - /** - * Constructs a new MsgDeleteAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgDeleteAdminResponse. - * @implements IMsgDeleteAdminResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse=} [properties] Properties to set - */ - function MsgDeleteAdminResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgDeleteAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse} message MsgDeleteAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdminResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgDeleteAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgDeleteAdminResponse} message MsgDeleteAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeleteAdminResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdminResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeleteAdminResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeleteAdminResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeleteAdminResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeleteAdminResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgDeleteAdminResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} MsgDeleteAdminResponse - */ - MsgDeleteAdminResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse) - return object; - return new $root.cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse(); - }; - - /** - * Creates a plain object from a MsgDeleteAdminResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse} message MsgDeleteAdminResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeleteAdminResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgDeleteAdminResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse - * @instance - * @returns {Object.} JSON object - */ - MsgDeleteAdminResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeleteAdminResponse; - })(); - - adminmodule.MsgAddAdmin = (function() { - - /** - * Properties of a MsgAddAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgAddAdmin - * @property {string|null} [creator] MsgAddAdmin creator - * @property {string|null} [admin] MsgAddAdmin admin - */ - - /** - * Constructs a new MsgAddAdmin. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgAddAdmin. - * @implements IMsgAddAdmin - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin=} [properties] Properties to set - */ - function MsgAddAdmin(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgAddAdmin creator. - * @member {string} creator - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - */ - MsgAddAdmin.prototype.creator = ""; - - /** - * MsgAddAdmin admin. - * @member {string} admin - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - */ - MsgAddAdmin.prototype.admin = ""; - - /** - * Encodes the specified MsgAddAdmin message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} message MsgAddAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdmin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.admin); - return writer; - }; - - /** - * Encodes the specified MsgAddAdmin message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdmin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdmin} message MsgAddAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdmin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdmin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdmin(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - case 2: - message.admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAddAdmin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdmin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAddAdmin message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAddAdmin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.admin != null && message.hasOwnProperty("admin")) - if (!$util.isString(message.admin)) - return "admin: string expected"; - return null; - }; - - /** - * Creates a MsgAddAdmin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdmin} MsgAddAdmin - */ - MsgAddAdmin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgAddAdmin) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdmin(); - if (object.creator != null) - message.creator = String(object.creator); - if (object.admin != null) - message.admin = String(object.admin); - return message; - }; - - /** - * Creates a plain object from a MsgAddAdmin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @static - * @param {cosmos.adminmodule.adminmodule.MsgAddAdmin} message MsgAddAdmin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAddAdmin.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.creator = ""; - object.admin = ""; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.admin != null && message.hasOwnProperty("admin")) - object.admin = message.admin; - return object; - }; - - /** - * Converts this MsgAddAdmin to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdmin - * @instance - * @returns {Object.} JSON object - */ - MsgAddAdmin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAddAdmin; - })(); - - adminmodule.MsgAddAdminResponse = (function() { - - /** - * Properties of a MsgAddAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgAddAdminResponse - */ - - /** - * Constructs a new MsgAddAdminResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgAddAdminResponse. - * @implements IMsgAddAdminResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse=} [properties] Properties to set - */ - function MsgAddAdminResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgAddAdminResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse} message MsgAddAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdminResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgAddAdminResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgAddAdminResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgAddAdminResponse} message MsgAddAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAddAdminResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdminResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAddAdminResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAddAdminResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAddAdminResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAddAdminResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgAddAdminResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} MsgAddAdminResponse - */ - MsgAddAdminResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse) - return object; - return new $root.cosmos.adminmodule.adminmodule.MsgAddAdminResponse(); - }; - - /** - * Creates a plain object from a MsgAddAdminResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgAddAdminResponse} message MsgAddAdminResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAddAdminResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgAddAdminResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgAddAdminResponse - * @instance - * @returns {Object.} JSON object - */ - MsgAddAdminResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAddAdminResponse; - })(); - - adminmodule.MsgSubmitProposal = (function() { - - /** - * Properties of a MsgSubmitProposal. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgSubmitProposal - * @property {google.protobuf.IAny|null} [content] MsgSubmitProposal content - * @property {string|null} [proposer] MsgSubmitProposal proposer - */ - - /** - * Constructs a new MsgSubmitProposal. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgSubmitProposal. - * @implements IMsgSubmitProposal - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal=} [properties] Properties to set - */ - function MsgSubmitProposal(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitProposal content. - * @member {google.protobuf.IAny|null|undefined} content - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - */ - MsgSubmitProposal.prototype.content = null; - - /** - * MsgSubmitProposal proposer. - * @member {string} proposer - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - */ - MsgSubmitProposal.prototype.proposer = ""; - - /** - * Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.proposer); - return writer; - }; - - /** - * Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposal} message MsgSubmitProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.proposer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitProposal message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) { - let error = $root.google.protobuf.Any.verify(message.content); - if (error) - return "content." + error; - } - if (message.proposer != null && message.hasOwnProperty("proposer")) - if (!$util.isString(message.proposer)) - return "proposer: string expected"; - return null; - }; - - /** - * Creates a MsgSubmitProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposal} MsgSubmitProposal - */ - MsgSubmitProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposal(); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".cosmos.adminmodule.adminmodule.MsgSubmitProposal.content: object expected"); - message.content = $root.google.protobuf.Any.fromObject(object.content); - } - if (object.proposer != null) - message.proposer = String(object.proposer); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @static - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposal} message MsgSubmitProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.content = null; - object.proposer = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.protobuf.Any.toObject(message.content, options); - if (message.proposer != null && message.hasOwnProperty("proposer")) - object.proposer = message.proposer; - return object; - }; - - /** - * Converts this MsgSubmitProposal to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposal - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitProposal; - })(); - - adminmodule.MsgSubmitProposalResponse = (function() { - - /** - * Properties of a MsgSubmitProposalResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IMsgSubmitProposalResponse - * @property {Long|null} [proposal_id] MsgSubmitProposalResponse proposal_id - */ - - /** - * Constructs a new MsgSubmitProposalResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a MsgSubmitProposalResponse. - * @implements IMsgSubmitProposalResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse=} [properties] Properties to set - */ - function MsgSubmitProposalResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitProposalResponse proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @instance - */ - MsgSubmitProposalResponse.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposalResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - return writer; - }; - - /** - * Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IMsgSubmitProposalResponse} message MsgSubmitProposalResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitProposalResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposalResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitProposalResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitProposalResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitProposalResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitProposalResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - return null; - }; - - /** - * Creates a MsgSubmitProposalResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} MsgSubmitProposalResponse - */ - MsgSubmitProposalResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitProposalResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @static - * @param {cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse} message MsgSubmitProposalResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitProposalResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - return object; - }; - - /** - * Converts this MsgSubmitProposalResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitProposalResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitProposalResponse; - })(); - - adminmodule.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#admins}. - * @memberof cosmos.adminmodule.adminmodule.Query - * @typedef AdminsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.QueryAdminsResponse} [response] QueryAdminsResponse - */ - - /** - * Calls Admins. - * @function admins - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} request QueryAdminsRequest message or plain object - * @param {cosmos.adminmodule.adminmodule.Query.AdminsCallback} callback Node-style callback called with the error, if any, and QueryAdminsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.admins = function admins(request, callback) { - return this.rpcCall(admins, $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest, $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse, request, callback); - }, "name", { value: "Admins" }); - - /** - * Calls Admins. - * @function admins - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} request QueryAdminsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link cosmos.adminmodule.adminmodule.Query#archivedProposals}. - * @memberof cosmos.adminmodule.adminmodule.Query - * @typedef ArchivedProposalsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} [response] QueryArchivedProposalsResponse - */ - - /** - * Calls ArchivedProposals. - * @function archivedProposals - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} request QueryArchivedProposalsRequest message or plain object - * @param {cosmos.adminmodule.adminmodule.Query.ArchivedProposalsCallback} callback Node-style callback called with the error, if any, and QueryArchivedProposalsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.archivedProposals = function archivedProposals(request, callback) { - return this.rpcCall(archivedProposals, $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest, $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse, request, callback); - }, "name", { value: "ArchivedProposals" }); - - /** - * Calls ArchivedProposals. - * @function archivedProposals - * @memberof cosmos.adminmodule.adminmodule.Query - * @instance - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} request QueryArchivedProposalsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - adminmodule.QueryAdminsRequest = (function() { - - /** - * Properties of a QueryAdminsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryAdminsRequest - */ - - /** - * Constructs a new QueryAdminsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryAdminsRequest. - * @implements IQueryAdminsRequest - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest=} [properties] Properties to set - */ - function QueryAdminsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryAdminsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} message QueryAdminsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryAdminsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsRequest} message QueryAdminsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdminsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdminsRequest message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdminsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryAdminsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsRequest} QueryAdminsRequest - */ - QueryAdminsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest) - return object; - return new $root.cosmos.adminmodule.adminmodule.QueryAdminsRequest(); - }; - - /** - * Creates a plain object from a QueryAdminsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.QueryAdminsRequest} message QueryAdminsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdminsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryAdminsRequest to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryAdminsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryAdminsRequest; - })(); - - adminmodule.QueryAdminsResponse = (function() { - - /** - * Properties of a QueryAdminsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryAdminsResponse - * @property {Array.|null} [admins] QueryAdminsResponse admins - */ - - /** - * Constructs a new QueryAdminsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryAdminsResponse. - * @implements IQueryAdminsResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse=} [properties] Properties to set - */ - function QueryAdminsResponse(properties) { - this.admins = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryAdminsResponse admins. - * @member {Array.} admins - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @instance - */ - QueryAdminsResponse.prototype.admins = $util.emptyArray; - - /** - * Encodes the specified QueryAdminsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse} message QueryAdminsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.admins != null && message.admins.length) - for (let i = 0; i < message.admins.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.admins[i]); - return writer; - }; - - /** - * Encodes the specified QueryAdminsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryAdminsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryAdminsResponse} message QueryAdminsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryAdminsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.admins && message.admins.length)) - message.admins = []; - message.admins.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryAdminsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryAdminsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryAdminsResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryAdminsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.admins != null && message.hasOwnProperty("admins")) { - if (!Array.isArray(message.admins)) - return "admins: array expected"; - for (let i = 0; i < message.admins.length; ++i) - if (!$util.isString(message.admins[i])) - return "admins: string[] expected"; - } - return null; - }; - - /** - * Creates a QueryAdminsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryAdminsResponse} QueryAdminsResponse - */ - QueryAdminsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.QueryAdminsResponse(); - if (object.admins) { - if (!Array.isArray(object.admins)) - throw TypeError(".cosmos.adminmodule.adminmodule.QueryAdminsResponse.admins: array expected"); - message.admins = []; - for (let i = 0; i < object.admins.length; ++i) - message.admins[i] = String(object.admins[i]); - } - return message; - }; - - /** - * Creates a plain object from a QueryAdminsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.QueryAdminsResponse} message QueryAdminsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryAdminsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.admins = []; - if (message.admins && message.admins.length) { - object.admins = []; - for (let j = 0; j < message.admins.length; ++j) - object.admins[j] = message.admins[j]; - } - return object; - }; - - /** - * Converts this QueryAdminsResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryAdminsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryAdminsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryAdminsResponse; - })(); - - adminmodule.QueryArchivedProposalsRequest = (function() { - - /** - * Properties of a QueryArchivedProposalsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryArchivedProposalsRequest - */ - - /** - * Constructs a new QueryArchivedProposalsRequest. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryArchivedProposalsRequest. - * @implements IQueryArchivedProposalsRequest - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest=} [properties] Properties to set - */ - function QueryArchivedProposalsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryArchivedProposalsRequest message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} message QueryArchivedProposalsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryArchivedProposalsRequest message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsRequest} message QueryArchivedProposalsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryArchivedProposalsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryArchivedProposalsRequest message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryArchivedProposalsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryArchivedProposalsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} QueryArchivedProposalsRequest - */ - QueryArchivedProposalsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest) - return object; - return new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest(); - }; - - /** - * Creates a plain object from a QueryArchivedProposalsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @static - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest} message QueryArchivedProposalsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryArchivedProposalsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryArchivedProposalsRequest to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryArchivedProposalsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryArchivedProposalsRequest; - })(); - - adminmodule.QueryArchivedProposalsResponse = (function() { - - /** - * Properties of a QueryArchivedProposalsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @interface IQueryArchivedProposalsResponse - * @property {Array.|null} [proposals] QueryArchivedProposalsResponse proposals - */ - - /** - * Constructs a new QueryArchivedProposalsResponse. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a QueryArchivedProposalsResponse. - * @implements IQueryArchivedProposalsResponse - * @constructor - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse=} [properties] Properties to set - */ - function QueryArchivedProposalsResponse(properties) { - this.proposals = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryArchivedProposalsResponse proposals. - * @member {Array.} proposals - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @instance - */ - QueryArchivedProposalsResponse.prototype.proposals = $util.emptyArray; - - /** - * Encodes the specified QueryArchivedProposalsResponse message. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse} message QueryArchivedProposalsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposals != null && message.proposals.length) - for (let i = 0; i < message.proposals.length; ++i) - $root.cosmos.gov.v1beta1.Proposal.encode(message.proposals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryArchivedProposalsResponse message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.IQueryArchivedProposalsResponse} message QueryArchivedProposalsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryArchivedProposalsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.proposals && message.proposals.length)) - message.proposals = []; - message.proposals.push($root.cosmos.gov.v1beta1.Proposal.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryArchivedProposalsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryArchivedProposalsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryArchivedProposalsResponse message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryArchivedProposalsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposals != null && message.hasOwnProperty("proposals")) { - if (!Array.isArray(message.proposals)) - return "proposals: array expected"; - for (let i = 0; i < message.proposals.length; ++i) { - let error = $root.cosmos.gov.v1beta1.Proposal.verify(message.proposals[i]); - if (error) - return "proposals." + error; - } - } - return null; - }; - - /** - * Creates a QueryArchivedProposalsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} QueryArchivedProposalsResponse - */ - QueryArchivedProposalsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse(); - if (object.proposals) { - if (!Array.isArray(object.proposals)) - throw TypeError(".cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.proposals: array expected"); - message.proposals = []; - for (let i = 0; i < object.proposals.length; ++i) { - if (typeof object.proposals[i] !== "object") - throw TypeError(".cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse.proposals: object expected"); - message.proposals[i] = $root.cosmos.gov.v1beta1.Proposal.fromObject(object.proposals[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryArchivedProposalsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @static - * @param {cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse} message QueryArchivedProposalsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryArchivedProposalsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.proposals = []; - if (message.proposals && message.proposals.length) { - object.proposals = []; - for (let j = 0; j < message.proposals.length; ++j) - object.proposals[j] = $root.cosmos.gov.v1beta1.Proposal.toObject(message.proposals[j], options); - } - return object; - }; - - /** - * Converts this QueryArchivedProposalsResponse to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryArchivedProposalsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryArchivedProposalsResponse; - })(); - - adminmodule.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof cosmos.adminmodule.adminmodule - * @interface IGenesisState - * @property {Array.|null} [admins] GenesisState admins - */ - - /** - * Constructs a new GenesisState. - * @memberof cosmos.adminmodule.adminmodule - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {cosmos.adminmodule.adminmodule.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.admins = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState admins. - * @member {Array.} admins - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @instance - */ - GenesisState.prototype.admins = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @function encode - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.admins != null && message.admins.length) - for (let i = 0; i < message.admins.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.admins[i]); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link cosmos.adminmodule.adminmodule.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.adminmodule.adminmodule.GenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.admins && message.admins.length)) - message.admins = []; - message.admins.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.admins != null && message.hasOwnProperty("admins")) { - if (!Array.isArray(message.admins)) - return "admins: array expected"; - for (let i = 0; i < message.admins.length; ++i) - if (!$util.isString(message.admins[i])) - return "admins: string[] expected"; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {cosmos.adminmodule.adminmodule.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.adminmodule.adminmodule.GenesisState) - return object; - let message = new $root.cosmos.adminmodule.adminmodule.GenesisState(); - if (object.admins) { - if (!Array.isArray(object.admins)) - throw TypeError(".cosmos.adminmodule.adminmodule.GenesisState.admins: array expected"); - message.admins = []; - for (let i = 0; i < object.admins.length; ++i) - message.admins[i] = String(object.admins[i]); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @static - * @param {cosmos.adminmodule.adminmodule.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.admins = []; - if (message.admins && message.admins.length) { - object.admins = []; - for (let j = 0; j < message.admins.length; ++j) - object.admins[j] = message.admins[j]; - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof cosmos.adminmodule.adminmodule.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return adminmodule; - })(); - - return adminmodule; - })(); - - cosmos.gov = (function() { - - /** - * Namespace gov. - * @memberof cosmos - * @namespace - */ - const gov = {}; - - gov.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.gov - * @namespace - */ - const v1beta1 = {}; - - /** - * VoteOption enum. - * @name cosmos.gov.v1beta1.VoteOption - * @enum {number} - * @property {number} VOTE_OPTION_UNSPECIFIED=0 VOTE_OPTION_UNSPECIFIED value - * @property {number} VOTE_OPTION_YES=1 VOTE_OPTION_YES value - * @property {number} VOTE_OPTION_ABSTAIN=2 VOTE_OPTION_ABSTAIN value - * @property {number} VOTE_OPTION_NO=3 VOTE_OPTION_NO value - * @property {number} VOTE_OPTION_NO_WITH_VETO=4 VOTE_OPTION_NO_WITH_VETO value - */ - v1beta1.VoteOption = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VOTE_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "VOTE_OPTION_YES"] = 1; - values[valuesById[2] = "VOTE_OPTION_ABSTAIN"] = 2; - values[valuesById[3] = "VOTE_OPTION_NO"] = 3; - values[valuesById[4] = "VOTE_OPTION_NO_WITH_VETO"] = 4; - return values; - })(); - - v1beta1.WeightedVoteOption = (function() { - - /** - * Properties of a WeightedVoteOption. - * @memberof cosmos.gov.v1beta1 - * @interface IWeightedVoteOption - * @property {cosmos.gov.v1beta1.VoteOption|null} [option] WeightedVoteOption option - * @property {string|null} [weight] WeightedVoteOption weight - */ - - /** - * Constructs a new WeightedVoteOption. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a WeightedVoteOption. - * @implements IWeightedVoteOption - * @constructor - * @param {cosmos.gov.v1beta1.IWeightedVoteOption=} [properties] Properties to set - */ - function WeightedVoteOption(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WeightedVoteOption option. - * @member {cosmos.gov.v1beta1.VoteOption} option - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - */ - WeightedVoteOption.prototype.option = 0; - - /** - * WeightedVoteOption weight. - * @member {string} weight - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - */ - WeightedVoteOption.prototype.weight = ""; - - /** - * Encodes the specified WeightedVoteOption message. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.IWeightedVoteOption} message WeightedVoteOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedVoteOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.option != null && Object.hasOwnProperty.call(message, "option")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.option); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.weight); - return writer; - }; - - /** - * Encodes the specified WeightedVoteOption message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.WeightedVoteOption.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.IWeightedVoteOption} message WeightedVoteOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeightedVoteOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedVoteOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.WeightedVoteOption(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.option = reader.int32(); - break; - case 2: - message.weight = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WeightedVoteOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeightedVoteOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WeightedVoteOption message. - * @function verify - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeightedVoteOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.option != null && message.hasOwnProperty("option")) - switch (message.option) { - default: - return "option: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.weight != null && message.hasOwnProperty("weight")) - if (!$util.isString(message.weight)) - return "weight: string expected"; - return null; - }; - - /** - * Creates a WeightedVoteOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.WeightedVoteOption} WeightedVoteOption - */ - WeightedVoteOption.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.WeightedVoteOption) - return object; - let message = new $root.cosmos.gov.v1beta1.WeightedVoteOption(); - switch (object.option) { - case "VOTE_OPTION_UNSPECIFIED": - case 0: - message.option = 0; - break; - case "VOTE_OPTION_YES": - case 1: - message.option = 1; - break; - case "VOTE_OPTION_ABSTAIN": - case 2: - message.option = 2; - break; - case "VOTE_OPTION_NO": - case 3: - message.option = 3; - break; - case "VOTE_OPTION_NO_WITH_VETO": - case 4: - message.option = 4; - break; - } - if (object.weight != null) - message.weight = String(object.weight); - return message; - }; - - /** - * Creates a plain object from a WeightedVoteOption message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @static - * @param {cosmos.gov.v1beta1.WeightedVoteOption} message WeightedVoteOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeightedVoteOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; - object.weight = ""; - } - if (message.option != null && message.hasOwnProperty("option")) - object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; - if (message.weight != null && message.hasOwnProperty("weight")) - object.weight = message.weight; - return object; - }; - - /** - * Converts this WeightedVoteOption to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.WeightedVoteOption - * @instance - * @returns {Object.} JSON object - */ - WeightedVoteOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return WeightedVoteOption; - })(); - - v1beta1.TextProposal = (function() { - - /** - * Properties of a TextProposal. - * @memberof cosmos.gov.v1beta1 - * @interface ITextProposal - * @property {string|null} [title] TextProposal title - * @property {string|null} [description] TextProposal description - */ - - /** - * Constructs a new TextProposal. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TextProposal. - * @implements ITextProposal - * @constructor - * @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set - */ - function TextProposal(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TextProposal title. - * @member {string} title - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - */ - TextProposal.prototype.title = ""; - - /** - * TextProposal description. - * @member {string} description - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - */ - TextProposal.prototype.description = ""; - - /** - * Encodes the specified TextProposal message. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified TextProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TextProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.ITextProposal} message TextProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TextProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TextProposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TextProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TextProposal message. - * @function verify - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a TextProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TextProposal} TextProposal - */ - TextProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TextProposal) - return object; - let message = new $root.cosmos.gov.v1beta1.TextProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a TextProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TextProposal - * @static - * @param {cosmos.gov.v1beta1.TextProposal} message TextProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this TextProposal to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TextProposal - * @instance - * @returns {Object.} JSON object - */ - TextProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TextProposal; - })(); - - v1beta1.Deposit = (function() { - - /** - * Properties of a Deposit. - * @memberof cosmos.gov.v1beta1 - * @interface IDeposit - * @property {Long|null} [proposal_id] Deposit proposal_id - * @property {string|null} [depositor] Deposit depositor - * @property {Array.|null} [amount] Deposit amount - */ - - /** - * Constructs a new Deposit. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Deposit. - * @implements IDeposit - * @constructor - * @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set - */ - function Deposit(properties) { - this.amount = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Deposit proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Deposit depositor. - * @member {string} depositor - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.depositor = ""; - - /** - * Deposit amount. - * @member {Array.} amount - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - */ - Deposit.prototype.amount = $util.emptyArray; - - /** - * Encodes the specified Deposit message. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deposit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor); - if (message.amount != null && message.amount.length) - for (let i = 0; i < message.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Deposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Deposit.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.IDeposit} message Deposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Deposit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Deposit message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deposit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Deposit(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.depositor = reader.string(); - break; - case 3: - if (!(message.amount && message.amount.length)) - message.amount = []; - message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Deposit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Deposit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Deposit message. - * @function verify - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Deposit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.depositor != null && message.hasOwnProperty("depositor")) - if (!$util.isString(message.depositor)) - return "depositor: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - if (!Array.isArray(message.amount)) - return "amount: array expected"; - for (let i = 0; i < message.amount.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); - if (error) - return "amount." + error; - } - } - return null; - }; - - /** - * Creates a Deposit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Deposit} Deposit - */ - Deposit.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Deposit) - return object; - let message = new $root.cosmos.gov.v1beta1.Deposit(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.depositor != null) - message.depositor = String(object.depositor); - if (object.amount) { - if (!Array.isArray(object.amount)) - throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: array expected"); - message.amount = []; - for (let i = 0; i < object.amount.length; ++i) { - if (typeof object.amount[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Deposit.amount: object expected"); - message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Deposit message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Deposit - * @static - * @param {cosmos.gov.v1beta1.Deposit} message Deposit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Deposit.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.amount = []; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.depositor = ""; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.depositor != null && message.hasOwnProperty("depositor")) - object.depositor = message.depositor; - if (message.amount && message.amount.length) { - object.amount = []; - for (let j = 0; j < message.amount.length; ++j) - object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); - } - return object; - }; - - /** - * Converts this Deposit to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Deposit - * @instance - * @returns {Object.} JSON object - */ - Deposit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Deposit; - })(); - - v1beta1.Proposal = (function() { - - /** - * Properties of a Proposal. - * @memberof cosmos.gov.v1beta1 - * @interface IProposal - * @property {Long|null} [proposal_id] Proposal proposal_id - * @property {google.protobuf.IAny|null} [content] Proposal content - * @property {cosmos.gov.v1beta1.ProposalStatus|null} [status] Proposal status - * @property {cosmos.gov.v1beta1.ITallyResult|null} [final_tally_result] Proposal final_tally_result - * @property {google.protobuf.ITimestamp|null} [submit_time] Proposal submit_time - * @property {google.protobuf.ITimestamp|null} [deposit_end_time] Proposal deposit_end_time - * @property {Array.|null} [total_deposit] Proposal total_deposit - * @property {google.protobuf.ITimestamp|null} [voting_start_time] Proposal voting_start_time - * @property {google.protobuf.ITimestamp|null} [voting_end_time] Proposal voting_end_time - */ - - /** - * Constructs a new Proposal. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Proposal. - * @implements IProposal - * @constructor - * @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set - */ - function Proposal(properties) { - this.total_deposit = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proposal proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Proposal content. - * @member {google.protobuf.IAny|null|undefined} content - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.content = null; - - /** - * Proposal status. - * @member {cosmos.gov.v1beta1.ProposalStatus} status - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.status = 0; - - /** - * Proposal final_tally_result. - * @member {cosmos.gov.v1beta1.ITallyResult|null|undefined} final_tally_result - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.final_tally_result = null; - - /** - * Proposal submit_time. - * @member {google.protobuf.ITimestamp|null|undefined} submit_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.submit_time = null; - - /** - * Proposal deposit_end_time. - * @member {google.protobuf.ITimestamp|null|undefined} deposit_end_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.deposit_end_time = null; - - /** - * Proposal total_deposit. - * @member {Array.} total_deposit - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.total_deposit = $util.emptyArray; - - /** - * Proposal voting_start_time. - * @member {google.protobuf.ITimestamp|null|undefined} voting_start_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.voting_start_time = null; - - /** - * Proposal voting_end_time. - * @member {google.protobuf.ITimestamp|null|undefined} voting_end_time - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - */ - Proposal.prototype.voting_end_time = null; - - /** - * Encodes the specified Proposal message. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.protobuf.Any.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.status); - if (message.final_tally_result != null && Object.hasOwnProperty.call(message, "final_tally_result")) - $root.cosmos.gov.v1beta1.TallyResult.encode(message.final_tally_result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.submit_time != null && Object.hasOwnProperty.call(message, "submit_time")) - $root.google.protobuf.Timestamp.encode(message.submit_time, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.deposit_end_time != null && Object.hasOwnProperty.call(message, "deposit_end_time")) - $root.google.protobuf.Timestamp.encode(message.deposit_end_time, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.total_deposit != null && message.total_deposit.length) - for (let i = 0; i < message.total_deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.total_deposit[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.voting_start_time != null && Object.hasOwnProperty.call(message, "voting_start_time")) - $root.google.protobuf.Timestamp.encode(message.voting_start_time, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.voting_end_time != null && Object.hasOwnProperty.call(message, "voting_end_time")) - $root.google.protobuf.Timestamp.encode(message.voting_end_time, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Proposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Proposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.content = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.status = reader.int32(); - break; - case 4: - message.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.decode(reader, reader.uint32()); - break; - case 5: - message.submit_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.deposit_end_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - if (!(message.total_deposit && message.total_deposit.length)) - message.total_deposit = []; - message.total_deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 8: - message.voting_start_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 9: - message.voting_end_time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proposal message. - * @function verify - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.content != null && message.hasOwnProperty("content")) { - let error = $root.google.protobuf.Any.verify(message.content); - if (error) - return "content." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.final_tally_result != null && message.hasOwnProperty("final_tally_result")) { - let error = $root.cosmos.gov.v1beta1.TallyResult.verify(message.final_tally_result); - if (error) - return "final_tally_result." + error; - } - if (message.submit_time != null && message.hasOwnProperty("submit_time")) { - let error = $root.google.protobuf.Timestamp.verify(message.submit_time); - if (error) - return "submit_time." + error; - } - if (message.deposit_end_time != null && message.hasOwnProperty("deposit_end_time")) { - let error = $root.google.protobuf.Timestamp.verify(message.deposit_end_time); - if (error) - return "deposit_end_time." + error; - } - if (message.total_deposit != null && message.hasOwnProperty("total_deposit")) { - if (!Array.isArray(message.total_deposit)) - return "total_deposit: array expected"; - for (let i = 0; i < message.total_deposit.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.total_deposit[i]); - if (error) - return "total_deposit." + error; - } - } - if (message.voting_start_time != null && message.hasOwnProperty("voting_start_time")) { - let error = $root.google.protobuf.Timestamp.verify(message.voting_start_time); - if (error) - return "voting_start_time." + error; - } - if (message.voting_end_time != null && message.hasOwnProperty("voting_end_time")) { - let error = $root.google.protobuf.Timestamp.verify(message.voting_end_time); - if (error) - return "voting_end_time." + error; - } - return null; - }; - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Proposal} Proposal - */ - Proposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Proposal) - return object; - let message = new $root.cosmos.gov.v1beta1.Proposal(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.content: object expected"); - message.content = $root.google.protobuf.Any.fromObject(object.content); - } - switch (object.status) { - case "PROPOSAL_STATUS_UNSPECIFIED": - case 0: - message.status = 0; - break; - case "PROPOSAL_STATUS_DEPOSIT_PERIOD": - case 1: - message.status = 1; - break; - case "PROPOSAL_STATUS_VOTING_PERIOD": - case 2: - message.status = 2; - break; - case "PROPOSAL_STATUS_PASSED": - case 3: - message.status = 3; - break; - case "PROPOSAL_STATUS_REJECTED": - case 4: - message.status = 4; - break; - case "PROPOSAL_STATUS_FAILED": - case 5: - message.status = 5; - break; - } - if (object.final_tally_result != null) { - if (typeof object.final_tally_result !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.final_tally_result: object expected"); - message.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.fromObject(object.final_tally_result); - } - if (object.submit_time != null) { - if (typeof object.submit_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.submit_time: object expected"); - message.submit_time = $root.google.protobuf.Timestamp.fromObject(object.submit_time); - } - if (object.deposit_end_time != null) { - if (typeof object.deposit_end_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.deposit_end_time: object expected"); - message.deposit_end_time = $root.google.protobuf.Timestamp.fromObject(object.deposit_end_time); - } - if (object.total_deposit) { - if (!Array.isArray(object.total_deposit)) - throw TypeError(".cosmos.gov.v1beta1.Proposal.total_deposit: array expected"); - message.total_deposit = []; - for (let i = 0; i < object.total_deposit.length; ++i) { - if (typeof object.total_deposit[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.total_deposit: object expected"); - message.total_deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.total_deposit[i]); - } - } - if (object.voting_start_time != null) { - if (typeof object.voting_start_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.voting_start_time: object expected"); - message.voting_start_time = $root.google.protobuf.Timestamp.fromObject(object.voting_start_time); - } - if (object.voting_end_time != null) { - if (typeof object.voting_end_time !== "object") - throw TypeError(".cosmos.gov.v1beta1.Proposal.voting_end_time: object expected"); - message.voting_end_time = $root.google.protobuf.Timestamp.fromObject(object.voting_end_time); - } - return message; - }; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Proposal - * @static - * @param {cosmos.gov.v1beta1.Proposal} message Proposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.total_deposit = []; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.content = null; - object.status = options.enums === String ? "PROPOSAL_STATUS_UNSPECIFIED" : 0; - object.final_tally_result = null; - object.submit_time = null; - object.deposit_end_time = null; - object.voting_start_time = null; - object.voting_end_time = null; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.protobuf.Any.toObject(message.content, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.cosmos.gov.v1beta1.ProposalStatus[message.status] : message.status; - if (message.final_tally_result != null && message.hasOwnProperty("final_tally_result")) - object.final_tally_result = $root.cosmos.gov.v1beta1.TallyResult.toObject(message.final_tally_result, options); - if (message.submit_time != null && message.hasOwnProperty("submit_time")) - object.submit_time = $root.google.protobuf.Timestamp.toObject(message.submit_time, options); - if (message.deposit_end_time != null && message.hasOwnProperty("deposit_end_time")) - object.deposit_end_time = $root.google.protobuf.Timestamp.toObject(message.deposit_end_time, options); - if (message.total_deposit && message.total_deposit.length) { - object.total_deposit = []; - for (let j = 0; j < message.total_deposit.length; ++j) - object.total_deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.total_deposit[j], options); - } - if (message.voting_start_time != null && message.hasOwnProperty("voting_start_time")) - object.voting_start_time = $root.google.protobuf.Timestamp.toObject(message.voting_start_time, options); - if (message.voting_end_time != null && message.hasOwnProperty("voting_end_time")) - object.voting_end_time = $root.google.protobuf.Timestamp.toObject(message.voting_end_time, options); - return object; - }; - - /** - * Converts this Proposal to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Proposal - * @instance - * @returns {Object.} JSON object - */ - Proposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proposal; - })(); - - /** - * ProposalStatus enum. - * @name cosmos.gov.v1beta1.ProposalStatus - * @enum {number} - * @property {number} PROPOSAL_STATUS_UNSPECIFIED=0 PROPOSAL_STATUS_UNSPECIFIED value - * @property {number} PROPOSAL_STATUS_DEPOSIT_PERIOD=1 PROPOSAL_STATUS_DEPOSIT_PERIOD value - * @property {number} PROPOSAL_STATUS_VOTING_PERIOD=2 PROPOSAL_STATUS_VOTING_PERIOD value - * @property {number} PROPOSAL_STATUS_PASSED=3 PROPOSAL_STATUS_PASSED value - * @property {number} PROPOSAL_STATUS_REJECTED=4 PROPOSAL_STATUS_REJECTED value - * @property {number} PROPOSAL_STATUS_FAILED=5 PROPOSAL_STATUS_FAILED value - */ - v1beta1.ProposalStatus = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROPOSAL_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROPOSAL_STATUS_DEPOSIT_PERIOD"] = 1; - values[valuesById[2] = "PROPOSAL_STATUS_VOTING_PERIOD"] = 2; - values[valuesById[3] = "PROPOSAL_STATUS_PASSED"] = 3; - values[valuesById[4] = "PROPOSAL_STATUS_REJECTED"] = 4; - values[valuesById[5] = "PROPOSAL_STATUS_FAILED"] = 5; - return values; - })(); - - v1beta1.TallyResult = (function() { - - /** - * Properties of a TallyResult. - * @memberof cosmos.gov.v1beta1 - * @interface ITallyResult - * @property {string|null} [yes] TallyResult yes - * @property {string|null} [abstain] TallyResult abstain - * @property {string|null} [no] TallyResult no - * @property {string|null} [no_with_veto] TallyResult no_with_veto - */ - - /** - * Constructs a new TallyResult. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TallyResult. - * @implements ITallyResult - * @constructor - * @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set - */ - function TallyResult(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TallyResult yes. - * @member {string} yes - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.yes = ""; - - /** - * TallyResult abstain. - * @member {string} abstain - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.abstain = ""; - - /** - * TallyResult no. - * @member {string} no - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.no = ""; - - /** - * TallyResult no_with_veto. - * @member {string} no_with_veto - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - */ - TallyResult.prototype.no_with_veto = ""; - - /** - * Encodes the specified TallyResult message. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.yes != null && Object.hasOwnProperty.call(message, "yes")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.yes); - if (message.abstain != null && Object.hasOwnProperty.call(message, "abstain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.abstain); - if (message.no != null && Object.hasOwnProperty.call(message, "no")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.no); - if (message.no_with_veto != null && Object.hasOwnProperty.call(message, "no_with_veto")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.no_with_veto); - return writer; - }; - - /** - * Encodes the specified TallyResult message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyResult.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.ITallyResult} message TallyResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TallyResult message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyResult(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.yes = reader.string(); - break; - case 2: - message.abstain = reader.string(); - break; - case 3: - message.no = reader.string(); - break; - case 4: - message.no_with_veto = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TallyResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TallyResult message. - * @function verify - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TallyResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.yes != null && message.hasOwnProperty("yes")) - if (!$util.isString(message.yes)) - return "yes: string expected"; - if (message.abstain != null && message.hasOwnProperty("abstain")) - if (!$util.isString(message.abstain)) - return "abstain: string expected"; - if (message.no != null && message.hasOwnProperty("no")) - if (!$util.isString(message.no)) - return "no: string expected"; - if (message.no_with_veto != null && message.hasOwnProperty("no_with_veto")) - if (!$util.isString(message.no_with_veto)) - return "no_with_veto: string expected"; - return null; - }; - - /** - * Creates a TallyResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TallyResult} TallyResult - */ - TallyResult.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TallyResult) - return object; - let message = new $root.cosmos.gov.v1beta1.TallyResult(); - if (object.yes != null) - message.yes = String(object.yes); - if (object.abstain != null) - message.abstain = String(object.abstain); - if (object.no != null) - message.no = String(object.no); - if (object.no_with_veto != null) - message.no_with_veto = String(object.no_with_veto); - return message; - }; - - /** - * Creates a plain object from a TallyResult message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TallyResult - * @static - * @param {cosmos.gov.v1beta1.TallyResult} message TallyResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TallyResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.yes = ""; - object.abstain = ""; - object.no = ""; - object.no_with_veto = ""; - } - if (message.yes != null && message.hasOwnProperty("yes")) - object.yes = message.yes; - if (message.abstain != null && message.hasOwnProperty("abstain")) - object.abstain = message.abstain; - if (message.no != null && message.hasOwnProperty("no")) - object.no = message.no; - if (message.no_with_veto != null && message.hasOwnProperty("no_with_veto")) - object.no_with_veto = message.no_with_veto; - return object; - }; - - /** - * Converts this TallyResult to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TallyResult - * @instance - * @returns {Object.} JSON object - */ - TallyResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TallyResult; - })(); - - v1beta1.Vote = (function() { - - /** - * Properties of a Vote. - * @memberof cosmos.gov.v1beta1 - * @interface IVote - * @property {Long|null} [proposal_id] Vote proposal_id - * @property {string|null} [voter] Vote voter - * @property {cosmos.gov.v1beta1.VoteOption|null} [option] Vote option - * @property {Array.|null} [options] Vote options - */ - - /** - * Constructs a new Vote. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a Vote. - * @implements IVote - * @constructor - * @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set - */ - function Vote(properties) { - this.options = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Vote proposal_id. - * @member {Long} proposal_id - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.proposal_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Vote voter. - * @member {string} voter - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.voter = ""; - - /** - * Vote option. - * @member {cosmos.gov.v1beta1.VoteOption} option - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.option = 0; - - /** - * Vote options. - * @member {Array.} options - * @memberof cosmos.gov.v1beta1.Vote - * @instance - */ - Vote.prototype.options = $util.emptyArray; - - /** - * Encodes the specified Vote message. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proposal_id != null && Object.hasOwnProperty.call(message, "proposal_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposal_id); - if (message.voter != null && Object.hasOwnProperty.call(message, "voter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.voter); - if (message.option != null && Object.hasOwnProperty.call(message, "option")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.option); - if (message.options != null && message.options.length) - for (let i = 0; i < message.options.length; ++i) - $root.cosmos.gov.v1beta1.WeightedVoteOption.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.Vote.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.Vote(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposal_id = reader.uint64(); - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.option = reader.int32(); - break; - case 4: - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.cosmos.gov.v1beta1.WeightedVoteOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vote message. - * @function verify - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (!$util.isInteger(message.proposal_id) && !(message.proposal_id && $util.isInteger(message.proposal_id.low) && $util.isInteger(message.proposal_id.high))) - return "proposal_id: integer|Long expected"; - if (message.voter != null && message.hasOwnProperty("voter")) - if (!$util.isString(message.voter)) - return "voter: string expected"; - if (message.option != null && message.hasOwnProperty("option")) - switch (message.option) { - default: - return "option: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.options != null && message.hasOwnProperty("options")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (let i = 0; i < message.options.length; ++i) { - let error = $root.cosmos.gov.v1beta1.WeightedVoteOption.verify(message.options[i]); - if (error) - return "options." + error; - } - } - return null; - }; - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.Vote} Vote - */ - Vote.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.Vote) - return object; - let message = new $root.cosmos.gov.v1beta1.Vote(); - if (object.proposal_id != null) - if ($util.Long) - (message.proposal_id = $util.Long.fromValue(object.proposal_id)).unsigned = true; - else if (typeof object.proposal_id === "string") - message.proposal_id = parseInt(object.proposal_id, 10); - else if (typeof object.proposal_id === "number") - message.proposal_id = object.proposal_id; - else if (typeof object.proposal_id === "object") - message.proposal_id = new $util.LongBits(object.proposal_id.low >>> 0, object.proposal_id.high >>> 0).toNumber(true); - if (object.voter != null) - message.voter = String(object.voter); - switch (object.option) { - case "VOTE_OPTION_UNSPECIFIED": - case 0: - message.option = 0; - break; - case "VOTE_OPTION_YES": - case 1: - message.option = 1; - break; - case "VOTE_OPTION_ABSTAIN": - case 2: - message.option = 2; - break; - case "VOTE_OPTION_NO": - case 3: - message.option = 3; - break; - case "VOTE_OPTION_NO_WITH_VETO": - case 4: - message.option = 4; - break; - } - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".cosmos.gov.v1beta1.Vote.options: array expected"); - message.options = []; - for (let i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.Vote.options: object expected"); - message.options[i] = $root.cosmos.gov.v1beta1.WeightedVoteOption.fromObject(object.options[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.Vote - * @static - * @param {cosmos.gov.v1beta1.Vote} message Vote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vote.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.options = []; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.proposal_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposal_id = options.longs === String ? "0" : 0; - object.voter = ""; - object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0; - } - if (message.proposal_id != null && message.hasOwnProperty("proposal_id")) - if (typeof message.proposal_id === "number") - object.proposal_id = options.longs === String ? String(message.proposal_id) : message.proposal_id; - else - object.proposal_id = options.longs === String ? $util.Long.prototype.toString.call(message.proposal_id) : options.longs === Number ? new $util.LongBits(message.proposal_id.low >>> 0, message.proposal_id.high >>> 0).toNumber(true) : message.proposal_id; - if (message.voter != null && message.hasOwnProperty("voter")) - object.voter = message.voter; - if (message.option != null && message.hasOwnProperty("option")) - object.option = options.enums === String ? $root.cosmos.gov.v1beta1.VoteOption[message.option] : message.option; - if (message.options && message.options.length) { - object.options = []; - for (let j = 0; j < message.options.length; ++j) - object.options[j] = $root.cosmos.gov.v1beta1.WeightedVoteOption.toObject(message.options[j], options); - } - return object; - }; - - /** - * Converts this Vote to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.Vote - * @instance - * @returns {Object.} JSON object - */ - Vote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Vote; - })(); - - v1beta1.DepositParams = (function() { - - /** - * Properties of a DepositParams. - * @memberof cosmos.gov.v1beta1 - * @interface IDepositParams - * @property {Array.|null} [min_deposit] DepositParams min_deposit - * @property {google.protobuf.IDuration|null} [max_deposit_period] DepositParams max_deposit_period - */ - - /** - * Constructs a new DepositParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a DepositParams. - * @implements IDepositParams - * @constructor - * @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set - */ - function DepositParams(properties) { - this.min_deposit = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DepositParams min_deposit. - * @member {Array.} min_deposit - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - */ - DepositParams.prototype.min_deposit = $util.emptyArray; - - /** - * DepositParams max_deposit_period. - * @member {google.protobuf.IDuration|null|undefined} max_deposit_period - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - */ - DepositParams.prototype.max_deposit_period = null; - - /** - * Encodes the specified DepositParams message. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DepositParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.min_deposit != null && message.min_deposit.length) - for (let i = 0; i < message.min_deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.min_deposit[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.max_deposit_period != null && Object.hasOwnProperty.call(message, "max_deposit_period")) - $root.google.protobuf.Duration.encode(message.max_deposit_period, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DepositParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.DepositParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.IDepositParams} message DepositParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DepositParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DepositParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DepositParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.DepositParams(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.min_deposit && message.min_deposit.length)) - message.min_deposit = []; - message.min_deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 2: - message.max_deposit_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DepositParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DepositParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DepositParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DepositParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.min_deposit != null && message.hasOwnProperty("min_deposit")) { - if (!Array.isArray(message.min_deposit)) - return "min_deposit: array expected"; - for (let i = 0; i < message.min_deposit.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.min_deposit[i]); - if (error) - return "min_deposit." + error; - } - } - if (message.max_deposit_period != null && message.hasOwnProperty("max_deposit_period")) { - let error = $root.google.protobuf.Duration.verify(message.max_deposit_period); - if (error) - return "max_deposit_period." + error; - } - return null; - }; - - /** - * Creates a DepositParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.DepositParams} DepositParams - */ - DepositParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.DepositParams) - return object; - let message = new $root.cosmos.gov.v1beta1.DepositParams(); - if (object.min_deposit) { - if (!Array.isArray(object.min_deposit)) - throw TypeError(".cosmos.gov.v1beta1.DepositParams.min_deposit: array expected"); - message.min_deposit = []; - for (let i = 0; i < object.min_deposit.length; ++i) { - if (typeof object.min_deposit[i] !== "object") - throw TypeError(".cosmos.gov.v1beta1.DepositParams.min_deposit: object expected"); - message.min_deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.min_deposit[i]); - } - } - if (object.max_deposit_period != null) { - if (typeof object.max_deposit_period !== "object") - throw TypeError(".cosmos.gov.v1beta1.DepositParams.max_deposit_period: object expected"); - message.max_deposit_period = $root.google.protobuf.Duration.fromObject(object.max_deposit_period); - } - return message; - }; - - /** - * Creates a plain object from a DepositParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.DepositParams - * @static - * @param {cosmos.gov.v1beta1.DepositParams} message DepositParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DepositParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.min_deposit = []; - if (options.defaults) - object.max_deposit_period = null; - if (message.min_deposit && message.min_deposit.length) { - object.min_deposit = []; - for (let j = 0; j < message.min_deposit.length; ++j) - object.min_deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.min_deposit[j], options); - } - if (message.max_deposit_period != null && message.hasOwnProperty("max_deposit_period")) - object.max_deposit_period = $root.google.protobuf.Duration.toObject(message.max_deposit_period, options); - return object; - }; - - /** - * Converts this DepositParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.DepositParams - * @instance - * @returns {Object.} JSON object - */ - DepositParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DepositParams; - })(); - - v1beta1.VotingParams = (function() { - - /** - * Properties of a VotingParams. - * @memberof cosmos.gov.v1beta1 - * @interface IVotingParams - * @property {google.protobuf.IDuration|null} [voting_period] VotingParams voting_period - */ - - /** - * Constructs a new VotingParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a VotingParams. - * @implements IVotingParams - * @constructor - * @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set - */ - function VotingParams(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VotingParams voting_period. - * @member {google.protobuf.IDuration|null|undefined} voting_period - * @memberof cosmos.gov.v1beta1.VotingParams - * @instance - */ - VotingParams.prototype.voting_period = null; - - /** - * Encodes the specified VotingParams message. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VotingParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.voting_period != null && Object.hasOwnProperty.call(message, "voting_period")) - $root.google.protobuf.Duration.encode(message.voting_period, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VotingParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.VotingParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.IVotingParams} message VotingParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VotingParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VotingParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VotingParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.VotingParams(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.voting_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VotingParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VotingParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VotingParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VotingParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.voting_period != null && message.hasOwnProperty("voting_period")) { - let error = $root.google.protobuf.Duration.verify(message.voting_period); - if (error) - return "voting_period." + error; - } - return null; - }; - - /** - * Creates a VotingParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.VotingParams} VotingParams - */ - VotingParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.VotingParams) - return object; - let message = new $root.cosmos.gov.v1beta1.VotingParams(); - if (object.voting_period != null) { - if (typeof object.voting_period !== "object") - throw TypeError(".cosmos.gov.v1beta1.VotingParams.voting_period: object expected"); - message.voting_period = $root.google.protobuf.Duration.fromObject(object.voting_period); - } - return message; - }; - - /** - * Creates a plain object from a VotingParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.VotingParams - * @static - * @param {cosmos.gov.v1beta1.VotingParams} message VotingParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VotingParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.voting_period = null; - if (message.voting_period != null && message.hasOwnProperty("voting_period")) - object.voting_period = $root.google.protobuf.Duration.toObject(message.voting_period, options); - return object; - }; - - /** - * Converts this VotingParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.VotingParams - * @instance - * @returns {Object.} JSON object - */ - VotingParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VotingParams; - })(); - - v1beta1.TallyParams = (function() { - - /** - * Properties of a TallyParams. - * @memberof cosmos.gov.v1beta1 - * @interface ITallyParams - * @property {Uint8Array|null} [quorum] TallyParams quorum - * @property {Uint8Array|null} [threshold] TallyParams threshold - * @property {Uint8Array|null} [veto_threshold] TallyParams veto_threshold - */ - - /** - * Constructs a new TallyParams. - * @memberof cosmos.gov.v1beta1 - * @classdesc Represents a TallyParams. - * @implements ITallyParams - * @constructor - * @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set - */ - function TallyParams(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TallyParams quorum. - * @member {Uint8Array} quorum - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.quorum = $util.newBuffer([]); - - /** - * TallyParams threshold. - * @member {Uint8Array} threshold - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.threshold = $util.newBuffer([]); - - /** - * TallyParams veto_threshold. - * @member {Uint8Array} veto_threshold - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - */ - TallyParams.prototype.veto_threshold = $util.newBuffer([]); - - /** - * Encodes the specified TallyParams message. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @function encode - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quorum != null && Object.hasOwnProperty.call(message, "quorum")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.quorum); - if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.threshold); - if (message.veto_threshold != null && Object.hasOwnProperty.call(message, "veto_threshold")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.veto_threshold); - return writer; - }; - - /** - * Encodes the specified TallyParams message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.TallyParams.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.ITallyParams} message TallyParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TallyParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TallyParams message from the specified reader or buffer. - * @function decode - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.gov.v1beta1.TallyParams(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.quorum = reader.bytes(); - break; - case 2: - message.threshold = reader.bytes(); - break; - case 3: - message.veto_threshold = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TallyParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TallyParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TallyParams message. - * @function verify - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TallyParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quorum != null && message.hasOwnProperty("quorum")) - if (!(message.quorum && typeof message.quorum.length === "number" || $util.isString(message.quorum))) - return "quorum: buffer expected"; - if (message.threshold != null && message.hasOwnProperty("threshold")) - if (!(message.threshold && typeof message.threshold.length === "number" || $util.isString(message.threshold))) - return "threshold: buffer expected"; - if (message.veto_threshold != null && message.hasOwnProperty("veto_threshold")) - if (!(message.veto_threshold && typeof message.veto_threshold.length === "number" || $util.isString(message.veto_threshold))) - return "veto_threshold: buffer expected"; - return null; - }; - - /** - * Creates a TallyParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {Object.} object Plain object - * @returns {cosmos.gov.v1beta1.TallyParams} TallyParams - */ - TallyParams.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.gov.v1beta1.TallyParams) - return object; - let message = new $root.cosmos.gov.v1beta1.TallyParams(); - if (object.quorum != null) - if (typeof object.quorum === "string") - $util.base64.decode(object.quorum, message.quorum = $util.newBuffer($util.base64.length(object.quorum)), 0); - else if (object.quorum.length) - message.quorum = object.quorum; - if (object.threshold != null) - if (typeof object.threshold === "string") - $util.base64.decode(object.threshold, message.threshold = $util.newBuffer($util.base64.length(object.threshold)), 0); - else if (object.threshold.length) - message.threshold = object.threshold; - if (object.veto_threshold != null) - if (typeof object.veto_threshold === "string") - $util.base64.decode(object.veto_threshold, message.veto_threshold = $util.newBuffer($util.base64.length(object.veto_threshold)), 0); - else if (object.veto_threshold.length) - message.veto_threshold = object.veto_threshold; - return message; - }; - - /** - * Creates a plain object from a TallyParams message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.gov.v1beta1.TallyParams - * @static - * @param {cosmos.gov.v1beta1.TallyParams} message TallyParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TallyParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.quorum = ""; - else { - object.quorum = []; - if (options.bytes !== Array) - object.quorum = $util.newBuffer(object.quorum); - } - if (options.bytes === String) - object.threshold = ""; - else { - object.threshold = []; - if (options.bytes !== Array) - object.threshold = $util.newBuffer(object.threshold); - } - if (options.bytes === String) - object.veto_threshold = ""; - else { - object.veto_threshold = []; - if (options.bytes !== Array) - object.veto_threshold = $util.newBuffer(object.veto_threshold); - } - } - if (message.quorum != null && message.hasOwnProperty("quorum")) - object.quorum = options.bytes === String ? $util.base64.encode(message.quorum, 0, message.quorum.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorum) : message.quorum; - if (message.threshold != null && message.hasOwnProperty("threshold")) - object.threshold = options.bytes === String ? $util.base64.encode(message.threshold, 0, message.threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.threshold) : message.threshold; - if (message.veto_threshold != null && message.hasOwnProperty("veto_threshold")) - object.veto_threshold = options.bytes === String ? $util.base64.encode(message.veto_threshold, 0, message.veto_threshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.veto_threshold) : message.veto_threshold; - return object; - }; - - /** - * Converts this TallyParams to JSON. - * @function toJSON - * @memberof cosmos.gov.v1beta1.TallyParams - * @instance - * @returns {Object.} JSON object - */ - TallyParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TallyParams; - })(); - - return v1beta1; - })(); - - return gov; - })(); - - cosmos.base = (function() { - - /** - * Namespace base. - * @memberof cosmos - * @namespace - */ - const base = {}; - - base.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base - * @namespace - */ - const v1beta1 = {}; - - v1beta1.Coin = (function() { - - /** - * Properties of a Coin. - * @memberof cosmos.base.v1beta1 - * @interface ICoin - * @property {string|null} [denom] Coin denom - * @property {string|null} [amount] Coin amount - */ - - /** - * Constructs a new Coin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a Coin. - * @implements ICoin - * @constructor - * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set - */ - function Coin(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Coin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.denom = ""; - - /** - * Coin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.amount = ""; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Coin message. - * @function verify - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Coin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.Coin} Coin - */ - Coin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.Coin) - return object; - let message = new $root.cosmos.base.v1beta1.Coin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.Coin} message Coin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Coin.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this Coin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.Coin - * @instance - * @returns {Object.} JSON object - */ - Coin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Coin; - })(); - - v1beta1.DecCoin = (function() { - - /** - * Properties of a DecCoin. - * @memberof cosmos.base.v1beta1 - * @interface IDecCoin - * @property {string|null} [denom] DecCoin denom - * @property {string|null} [amount] DecCoin amount - */ - - /** - * Constructs a new DecCoin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecCoin. - * @implements IDecCoin - * @constructor - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - */ - function DecCoin(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecCoin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.denom = ""; - - /** - * DecCoin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.amount = ""; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecCoin message. - * @function verify - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecCoin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - */ - DecCoin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecCoin) - return object; - let message = new $root.cosmos.base.v1beta1.DecCoin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.DecCoin} message DecCoin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecCoin.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this DecCoin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - * @returns {Object.} JSON object - */ - DecCoin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecCoin; - })(); - - v1beta1.IntProto = (function() { - - /** - * Properties of an IntProto. - * @memberof cosmos.base.v1beta1 - * @interface IIntProto - * @property {string|null} [int] IntProto int - */ - - /** - * Constructs a new IntProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents an IntProto. - * @implements IIntProto - * @constructor - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - */ - function IntProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IntProto int. - * @member {string} int - * @memberof cosmos.base.v1beta1.IntProto - * @instance - */ - IntProto.prototype.int = ""; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.int != null && Object.hasOwnProperty.call(message, "int")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); - return writer; - }; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntProto message. - * @function verify - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.int != null && message.hasOwnProperty("int")) - if (!$util.isString(message.int)) - return "int: string expected"; - return null; - }; - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.IntProto} IntProto - */ - IntProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.IntProto) - return object; - let message = new $root.cosmos.base.v1beta1.IntProto(); - if (object.int != null) - message.int = String(object.int); - return message; - }; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IntProto} message IntProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.int = ""; - if (message.int != null && message.hasOwnProperty("int")) - object.int = message.int; - return object; - }; - - /** - * Converts this IntProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.IntProto - * @instance - * @returns {Object.} JSON object - */ - IntProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IntProto; - })(); - - v1beta1.DecProto = (function() { - - /** - * Properties of a DecProto. - * @memberof cosmos.base.v1beta1 - * @interface IDecProto - * @property {string|null} [dec] DecProto dec - */ - - /** - * Constructs a new DecProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecProto. - * @implements IDecProto - * @constructor - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - */ - function DecProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecProto dec. - * @member {string} dec - * @memberof cosmos.base.v1beta1.DecProto - * @instance - */ - DecProto.prototype.dec = ""; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); - return writer; - }; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dec = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecProto message. - * @function verify - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dec != null && message.hasOwnProperty("dec")) - if (!$util.isString(message.dec)) - return "dec: string expected"; - return null; - }; - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecProto} DecProto - */ - DecProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecProto) - return object; - let message = new $root.cosmos.base.v1beta1.DecProto(); - if (object.dec != null) - message.dec = String(object.dec); - return message; - }; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.DecProto} message DecProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.dec = ""; - if (message.dec != null && message.hasOwnProperty("dec")) - object.dec = message.dec; - return object; - }; - - /** - * Converts this DecProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecProto - * @instance - * @returns {Object.} JSON object - */ - DecProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecProto; - })(); - - return v1beta1; - })(); - - base.query = (function() { - - /** - * Namespace query. - * @memberof cosmos.base - * @namespace - */ - const query = {}; - - query.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base.query - * @namespace - */ - const v1beta1 = {}; - - v1beta1.PageRequest = (function() { - - /** - * Properties of a PageRequest. - * @memberof cosmos.base.query.v1beta1 - * @interface IPageRequest - * @property {Uint8Array|null} [key] PageRequest key - * @property {Long|null} [offset] PageRequest offset - * @property {Long|null} [limit] PageRequest limit - * @property {boolean|null} [count_total] PageRequest count_total - */ - - /** - * Constructs a new PageRequest. - * @memberof cosmos.base.query.v1beta1 - * @classdesc Represents a PageRequest. - * @implements IPageRequest - * @constructor - * @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set - */ - function PageRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PageRequest key. - * @member {Uint8Array} key - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.key = $util.newBuffer([]); - - /** - * PageRequest offset. - * @member {Long} offset - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PageRequest limit. - * @member {Long} limit - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PageRequest count_total. - * @member {boolean} count_total - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.count_total = false; - - /** - * Encodes the specified PageRequest message. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.offset); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.limit); - if (message.count_total != null && Object.hasOwnProperty.call(message, "count_total")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.count_total); - return writer; - }; - - /** - * Encodes the specified PageRequest message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PageRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = reader.uint64(); - break; - case 3: - message.limit = reader.uint64(); - break; - case 4: - message.count_total = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PageRequest message. - * @function verify - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PageRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) - return "offset: integer|Long expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) - return "limit: integer|Long expected"; - if (message.count_total != null && message.hasOwnProperty("count_total")) - if (typeof message.count_total !== "boolean") - return "count_total: boolean expected"; - return null; - }; - - /** - * Creates a PageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest - */ - PageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.query.v1beta1.PageRequest) - return object; - let message = new $root.cosmos.base.query.v1beta1.PageRequest(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.offset != null) - if ($util.Long) - (message.offset = $util.Long.fromValue(object.offset)).unsigned = true; - else if (typeof object.offset === "string") - message.offset = parseInt(object.offset, 10); - else if (typeof object.offset === "number") - message.offset = object.offset; - else if (typeof object.offset === "object") - message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(true); - if (object.limit != null) - if ($util.Long) - (message.limit = $util.Long.fromValue(object.limit)).unsigned = true; - else if (typeof object.limit === "string") - message.limit = parseInt(object.limit, 10); - else if (typeof object.limit === "number") - message.limit = object.limit; - else if (typeof object.limit === "object") - message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(true); - if (object.count_total != null) - message.count_total = Boolean(object.count_total); - return message; - }; - - /** - * Creates a plain object from a PageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {cosmos.base.query.v1beta1.PageRequest} message PageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PageRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.offset = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.limit = options.longs === String ? "0" : 0; - object.count_total = false; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.offset != null && message.hasOwnProperty("offset")) - if (typeof message.offset === "number") - object.offset = options.longs === String ? String(message.offset) : message.offset; - else - object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber(true) : message.offset; - if (message.limit != null && message.hasOwnProperty("limit")) - if (typeof message.limit === "number") - object.limit = options.longs === String ? String(message.limit) : message.limit; - else - object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber(true) : message.limit; - if (message.count_total != null && message.hasOwnProperty("count_total")) - object.count_total = message.count_total; - return object; - }; - - /** - * Converts this PageRequest to JSON. - * @function toJSON - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - * @returns {Object.} JSON object - */ - PageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PageRequest; - })(); - - v1beta1.PageResponse = (function() { - - /** - * Properties of a PageResponse. - * @memberof cosmos.base.query.v1beta1 - * @interface IPageResponse - * @property {Uint8Array|null} [next_key] PageResponse next_key - * @property {Long|null} [total] PageResponse total - */ - - /** - * Constructs a new PageResponse. - * @memberof cosmos.base.query.v1beta1 - * @classdesc Represents a PageResponse. - * @implements IPageResponse - * @constructor - * @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set - */ - function PageResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PageResponse next_key. - * @member {Uint8Array} next_key - * @memberof cosmos.base.query.v1beta1.PageResponse - * @instance - */ - PageResponse.prototype.next_key = $util.newBuffer([]); - - /** - * PageResponse total. - * @member {Long} total - * @memberof cosmos.base.query.v1beta1.PageResponse - * @instance - */ - PageResponse.prototype.total = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified PageResponse message. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.next_key != null && Object.hasOwnProperty.call(message, "next_key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.next_key); - if (message.total != null && Object.hasOwnProperty.call(message, "total")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.total); - return writer; - }; - - /** - * Encodes the specified PageResponse message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PageResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PageResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PageResponse message. - * @function verify - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PageResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.next_key != null && message.hasOwnProperty("next_key")) - if (!(message.next_key && typeof message.next_key.length === "number" || $util.isString(message.next_key))) - return "next_key: buffer expected"; - if (message.total != null && message.hasOwnProperty("total")) - if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) - return "total: integer|Long expected"; - return null; - }; - - /** - * Creates a PageResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse - */ - PageResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.query.v1beta1.PageResponse) - return object; - let message = new $root.cosmos.base.query.v1beta1.PageResponse(); - if (object.next_key != null) - if (typeof object.next_key === "string") - $util.base64.decode(object.next_key, message.next_key = $util.newBuffer($util.base64.length(object.next_key)), 0); - else if (object.next_key.length) - message.next_key = object.next_key; - if (object.total != null) - if ($util.Long) - (message.total = $util.Long.fromValue(object.total)).unsigned = true; - else if (typeof object.total === "string") - message.total = parseInt(object.total, 10); - else if (typeof object.total === "number") - message.total = object.total; - else if (typeof object.total === "object") - message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PageResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {cosmos.base.query.v1beta1.PageResponse} message PageResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PageResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.next_key = ""; - else { - object.next_key = []; - if (options.bytes !== Array) - object.next_key = $util.newBuffer(object.next_key); - } - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total = options.longs === String ? "0" : 0; - } - if (message.next_key != null && message.hasOwnProperty("next_key")) - object.next_key = options.bytes === String ? $util.base64.encode(message.next_key, 0, message.next_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.next_key) : message.next_key; - if (message.total != null && message.hasOwnProperty("total")) - if (typeof message.total === "number") - object.total = options.longs === String ? String(message.total) : message.total; - else - object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber(true) : message.total; - return object; - }; - - /** - * Converts this PageResponse to JSON. - * @function toJSON - * @memberof cosmos.base.query.v1beta1.PageResponse - * @instance - * @returns {Object.} JSON object - */ - PageResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PageResponse; - })(); - - return v1beta1; - })(); - - return query; - })(); - - return base; - })(); - - cosmos.upgrade = (function() { - - /** - * Namespace upgrade. - * @memberof cosmos - * @namespace - */ - const upgrade = {}; - - upgrade.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.upgrade - * @namespace - */ - const v1beta1 = {}; - - v1beta1.Plan = (function() { - - /** - * Properties of a Plan. - * @memberof cosmos.upgrade.v1beta1 - * @interface IPlan - * @property {string|null} [name] Plan name - * @property {google.protobuf.ITimestamp|null} [time] Plan time - * @property {Long|null} [height] Plan height - * @property {string|null} [info] Plan info - */ - - /** - * Constructs a new Plan. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a Plan. - * @implements IPlan - * @constructor - * @param {cosmos.upgrade.v1beta1.IPlan=} [properties] Properties to set - */ - function Plan(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Plan name. - * @member {string} name - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.name = ""; - - /** - * Plan time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.time = null; - - /** - * Plan height. - * @member {Long} height - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Plan info. - * @member {string} info - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.info = ""; - - /** - * Encodes the specified Plan message. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {cosmos.upgrade.v1beta1.IPlan} message Plan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Plan.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); - return writer; - }; - - /** - * Encodes the specified Plan message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {cosmos.upgrade.v1beta1.IPlan} message Plan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Plan.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Plan message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.Plan} Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Plan.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.Plan(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.height = reader.int64(); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Plan message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.Plan} Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Plan.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Plan message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Plan.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.time != null && message.hasOwnProperty("time")) { - let error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.info != null && message.hasOwnProperty("info")) - if (!$util.isString(message.info)) - return "info: string expected"; - return null; - }; - - /** - * Creates a Plan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.Plan} Plan - */ - Plan.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.Plan) - return object; - let message = new $root.cosmos.upgrade.v1beta1.Plan(); - if (object.name != null) - message.name = String(object.name); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".cosmos.upgrade.v1beta1.Plan.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.info != null) - message.info = String(object.info); - return message; - }; - - /** - * Creates a plain object from a Plan message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {cosmos.upgrade.v1beta1.Plan} message Plan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Plan.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.time = null; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.info = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.info != null && message.hasOwnProperty("info")) - object.info = message.info; - return object; - }; - - /** - * Converts this Plan to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - * @returns {Object.} JSON object - */ - Plan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Plan; - })(); - - v1beta1.SoftwareUpgradeProposal = (function() { - - /** - * Properties of a SoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @interface ISoftwareUpgradeProposal - * @property {string|null} [title] SoftwareUpgradeProposal title - * @property {string|null} [description] SoftwareUpgradeProposal description - * @property {cosmos.upgrade.v1beta1.IPlan|null} [plan] SoftwareUpgradeProposal plan - */ - - /** - * Constructs a new SoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a SoftwareUpgradeProposal. - * @implements ISoftwareUpgradeProposal - * @constructor - * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal=} [properties] Properties to set - */ - function SoftwareUpgradeProposal(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SoftwareUpgradeProposal title. - * @member {string} title - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - */ - SoftwareUpgradeProposal.prototype.title = ""; - - /** - * SoftwareUpgradeProposal description. - * @member {string} description - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - */ - SoftwareUpgradeProposal.prototype.description = ""; - - /** - * SoftwareUpgradeProposal plan. - * @member {cosmos.upgrade.v1beta1.IPlan|null|undefined} plan - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - */ - SoftwareUpgradeProposal.prototype.plan = null; - - /** - * Encodes the specified SoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal} message SoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SoftwareUpgradeProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) - $root.cosmos.upgrade.v1beta1.Plan.encode(message.plan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal} message SoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SoftwareUpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SoftwareUpgradeProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = $root.cosmos.upgrade.v1beta1.Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SoftwareUpgradeProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SoftwareUpgradeProposal message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SoftwareUpgradeProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.plan != null && message.hasOwnProperty("plan")) { - let error = $root.cosmos.upgrade.v1beta1.Plan.verify(message.plan); - if (error) - return "plan." + error; - } - return null; - }; - - /** - * Creates a SoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal - */ - SoftwareUpgradeProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) - return object; - let message = new $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.plan != null) { - if (typeof object.plan !== "object") - throw TypeError(".cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.plan: object expected"); - message.plan = $root.cosmos.upgrade.v1beta1.Plan.fromObject(object.plan); - } - return message; - }; - - /** - * Creates a plain object from a SoftwareUpgradeProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} message SoftwareUpgradeProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SoftwareUpgradeProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.plan = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.plan != null && message.hasOwnProperty("plan")) - object.plan = $root.cosmos.upgrade.v1beta1.Plan.toObject(message.plan, options); - return object; - }; - - /** - * Converts this SoftwareUpgradeProposal to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - * @returns {Object.} JSON object - */ - SoftwareUpgradeProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SoftwareUpgradeProposal; - })(); - - v1beta1.CancelSoftwareUpgradeProposal = (function() { - - /** - * Properties of a CancelSoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @interface ICancelSoftwareUpgradeProposal - * @property {string|null} [title] CancelSoftwareUpgradeProposal title - * @property {string|null} [description] CancelSoftwareUpgradeProposal description - */ - - /** - * Constructs a new CancelSoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a CancelSoftwareUpgradeProposal. - * @implements ICancelSoftwareUpgradeProposal - * @constructor - * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal=} [properties] Properties to set - */ - function CancelSoftwareUpgradeProposal(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelSoftwareUpgradeProposal title. - * @member {string} title - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @instance - */ - CancelSoftwareUpgradeProposal.prototype.title = ""; - - /** - * CancelSoftwareUpgradeProposal description. - * @member {string} description - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @instance - */ - CancelSoftwareUpgradeProposal.prototype.description = ""; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelSoftwareUpgradeProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelSoftwareUpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelSoftwareUpgradeProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelSoftwareUpgradeProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelSoftwareUpgradeProposal message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelSoftwareUpgradeProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a CancelSoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal - */ - CancelSoftwareUpgradeProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) - return object; - let message = new $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a CancelSoftwareUpgradeProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelSoftwareUpgradeProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this CancelSoftwareUpgradeProposal to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @instance - * @returns {Object.} JSON object - */ - CancelSoftwareUpgradeProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CancelSoftwareUpgradeProposal; - })(); - - return v1beta1; - })(); - - return upgrade; - })(); - - cosmos.auth = (function() { - - /** - * Namespace auth. - * @memberof cosmos - * @namespace - */ - const auth = {}; - - auth.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.auth - * @namespace - */ - const v1beta1 = {}; - - v1beta1.BaseAccount = (function() { - - /** - * Properties of a BaseAccount. - * @memberof cosmos.auth.v1beta1 - * @interface IBaseAccount - * @property {string|null} [address] BaseAccount address - * @property {google.protobuf.IAny|null} [pub_key] BaseAccount pub_key - * @property {Long|null} [account_number] BaseAccount account_number - * @property {Long|null} [sequence] BaseAccount sequence - */ - - /** - * Constructs a new BaseAccount. - * @memberof cosmos.auth.v1beta1 - * @classdesc Represents a BaseAccount. - * @implements IBaseAccount - * @constructor - * @param {cosmos.auth.v1beta1.IBaseAccount=} [properties] Properties to set - */ - function BaseAccount(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BaseAccount address. - * @member {string} address - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - */ - BaseAccount.prototype.address = ""; - - /** - * BaseAccount pub_key. - * @member {google.protobuf.IAny|null|undefined} pub_key - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - */ - BaseAccount.prototype.pub_key = null; - - /** - * BaseAccount account_number. - * @member {Long} account_number - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - */ - BaseAccount.prototype.account_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * BaseAccount sequence. - * @member {Long} sequence - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - */ - BaseAccount.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified BaseAccount message. Does not implicitly {@link cosmos.auth.v1beta1.BaseAccount.verify|verify} messages. - * @function encode - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {cosmos.auth.v1beta1.IBaseAccount} message BaseAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BaseAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); - if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key")) - $root.google.protobuf.Any.encode(message.pub_key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.account_number != null && Object.hasOwnProperty.call(message, "account_number")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.account_number); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified BaseAccount message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.BaseAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {cosmos.auth.v1beta1.IBaseAccount} message BaseAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BaseAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BaseAccount message from the specified reader or buffer. - * @function decode - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BaseAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.BaseAccount(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.pub_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.account_number = reader.uint64(); - break; - case 4: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BaseAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BaseAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BaseAccount message. - * @function verify - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BaseAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) { - let error = $root.google.protobuf.Any.verify(message.pub_key); - if (error) - return "pub_key." + error; - } - if (message.account_number != null && message.hasOwnProperty("account_number")) - if (!$util.isInteger(message.account_number) && !(message.account_number && $util.isInteger(message.account_number.low) && $util.isInteger(message.account_number.high))) - return "account_number: integer|Long expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a BaseAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {Object.} object Plain object - * @returns {cosmos.auth.v1beta1.BaseAccount} BaseAccount - */ - BaseAccount.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.auth.v1beta1.BaseAccount) - return object; - let message = new $root.cosmos.auth.v1beta1.BaseAccount(); - if (object.address != null) - message.address = String(object.address); - if (object.pub_key != null) { - if (typeof object.pub_key !== "object") - throw TypeError(".cosmos.auth.v1beta1.BaseAccount.pub_key: object expected"); - message.pub_key = $root.google.protobuf.Any.fromObject(object.pub_key); - } - if (object.account_number != null) - if ($util.Long) - (message.account_number = $util.Long.fromValue(object.account_number)).unsigned = true; - else if (typeof object.account_number === "string") - message.account_number = parseInt(object.account_number, 10); - else if (typeof object.account_number === "number") - message.account_number = object.account_number; - else if (typeof object.account_number === "object") - message.account_number = new $util.LongBits(object.account_number.low >>> 0, object.account_number.high >>> 0).toNumber(true); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a BaseAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.auth.v1beta1.BaseAccount - * @static - * @param {cosmos.auth.v1beta1.BaseAccount} message BaseAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BaseAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.address = ""; - object.pub_key = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.account_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.account_number = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) - object.pub_key = $root.google.protobuf.Any.toObject(message.pub_key, options); - if (message.account_number != null && message.hasOwnProperty("account_number")) - if (typeof message.account_number === "number") - object.account_number = options.longs === String ? String(message.account_number) : message.account_number; - else - object.account_number = options.longs === String ? $util.Long.prototype.toString.call(message.account_number) : options.longs === Number ? new $util.LongBits(message.account_number.low >>> 0, message.account_number.high >>> 0).toNumber(true) : message.account_number; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this BaseAccount to JSON. - * @function toJSON - * @memberof cosmos.auth.v1beta1.BaseAccount - * @instance - * @returns {Object.} JSON object - */ - BaseAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BaseAccount; - })(); - - v1beta1.ModuleAccount = (function() { - - /** - * Properties of a ModuleAccount. - * @memberof cosmos.auth.v1beta1 - * @interface IModuleAccount - * @property {cosmos.auth.v1beta1.IBaseAccount|null} [base_account] ModuleAccount base_account - * @property {string|null} [name] ModuleAccount name - * @property {Array.|null} [permissions] ModuleAccount permissions - */ - - /** - * Constructs a new ModuleAccount. - * @memberof cosmos.auth.v1beta1 - * @classdesc Represents a ModuleAccount. - * @implements IModuleAccount - * @constructor - * @param {cosmos.auth.v1beta1.IModuleAccount=} [properties] Properties to set - */ - function ModuleAccount(properties) { - this.permissions = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModuleAccount base_account. - * @member {cosmos.auth.v1beta1.IBaseAccount|null|undefined} base_account - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @instance - */ - ModuleAccount.prototype.base_account = null; - - /** - * ModuleAccount name. - * @member {string} name - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @instance - */ - ModuleAccount.prototype.name = ""; - - /** - * ModuleAccount permissions. - * @member {Array.} permissions - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @instance - */ - ModuleAccount.prototype.permissions = $util.emptyArray; - - /** - * Encodes the specified ModuleAccount message. Does not implicitly {@link cosmos.auth.v1beta1.ModuleAccount.verify|verify} messages. - * @function encode - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {cosmos.auth.v1beta1.IModuleAccount} message ModuleAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModuleAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.base_account != null && Object.hasOwnProperty.call(message, "base_account")) - $root.cosmos.auth.v1beta1.BaseAccount.encode(message.base_account, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.permissions != null && message.permissions.length) - for (let i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified ModuleAccount message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.ModuleAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {cosmos.auth.v1beta1.IModuleAccount} message ModuleAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModuleAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModuleAccount message from the specified reader or buffer. - * @function decode - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModuleAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.ModuleAccount(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_account = $root.cosmos.auth.v1beta1.BaseAccount.decode(reader, reader.uint32()); - break; - case 2: - message.name = reader.string(); - break; - case 3: - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModuleAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModuleAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModuleAccount message. - * @function verify - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModuleAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.base_account != null && message.hasOwnProperty("base_account")) { - let error = $root.cosmos.auth.v1beta1.BaseAccount.verify(message.base_account); - if (error) - return "base_account." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (let i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a ModuleAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {Object.} object Plain object - * @returns {cosmos.auth.v1beta1.ModuleAccount} ModuleAccount - */ - ModuleAccount.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.auth.v1beta1.ModuleAccount) - return object; - let message = new $root.cosmos.auth.v1beta1.ModuleAccount(); - if (object.base_account != null) { - if (typeof object.base_account !== "object") - throw TypeError(".cosmos.auth.v1beta1.ModuleAccount.base_account: object expected"); - message.base_account = $root.cosmos.auth.v1beta1.BaseAccount.fromObject(object.base_account); - } - if (object.name != null) - message.name = String(object.name); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".cosmos.auth.v1beta1.ModuleAccount.permissions: array expected"); - message.permissions = []; - for (let i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a ModuleAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @static - * @param {cosmos.auth.v1beta1.ModuleAccount} message ModuleAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModuleAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) { - object.base_account = null; - object.name = ""; - } - if (message.base_account != null && message.hasOwnProperty("base_account")) - object.base_account = $root.cosmos.auth.v1beta1.BaseAccount.toObject(message.base_account, options); - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (let j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this ModuleAccount to JSON. - * @function toJSON - * @memberof cosmos.auth.v1beta1.ModuleAccount - * @instance - * @returns {Object.} JSON object - */ - ModuleAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ModuleAccount; - })(); - - v1beta1.Params = (function() { - - /** - * Properties of a Params. - * @memberof cosmos.auth.v1beta1 - * @interface IParams - * @property {Long|null} [max_memo_characters] Params max_memo_characters - * @property {Long|null} [tx_sig_limit] Params tx_sig_limit - * @property {Long|null} [tx_size_cost_per_byte] Params tx_size_cost_per_byte - * @property {Long|null} [sig_verify_cost_ed25519] Params sig_verify_cost_ed25519 - * @property {Long|null} [sig_verify_cost_secp256k1] Params sig_verify_cost_secp256k1 - */ - - /** - * Constructs a new Params. - * @memberof cosmos.auth.v1beta1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {cosmos.auth.v1beta1.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params max_memo_characters. - * @member {Long} max_memo_characters - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.max_memo_characters = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Params tx_sig_limit. - * @member {Long} tx_sig_limit - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.tx_sig_limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Params tx_size_cost_per_byte. - * @member {Long} tx_size_cost_per_byte - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.tx_size_cost_per_byte = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Params sig_verify_cost_ed25519. - * @member {Long} sig_verify_cost_ed25519 - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.sig_verify_cost_ed25519 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Params sig_verify_cost_secp256k1. - * @member {Long} sig_verify_cost_secp256k1 - * @memberof cosmos.auth.v1beta1.Params - * @instance - */ - Params.prototype.sig_verify_cost_secp256k1 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Params message. Does not implicitly {@link cosmos.auth.v1beta1.Params.verify|verify} messages. - * @function encode - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {cosmos.auth.v1beta1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.max_memo_characters != null && Object.hasOwnProperty.call(message, "max_memo_characters")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.max_memo_characters); - if (message.tx_sig_limit != null && Object.hasOwnProperty.call(message, "tx_sig_limit")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.tx_sig_limit); - if (message.tx_size_cost_per_byte != null && Object.hasOwnProperty.call(message, "tx_size_cost_per_byte")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.tx_size_cost_per_byte); - if (message.sig_verify_cost_ed25519 != null && Object.hasOwnProperty.call(message, "sig_verify_cost_ed25519")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sig_verify_cost_ed25519); - if (message.sig_verify_cost_secp256k1 != null && Object.hasOwnProperty.call(message, "sig_verify_cost_secp256k1")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.sig_verify_cost_secp256k1); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.auth.v1beta1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {cosmos.auth.v1beta1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.auth.v1beta1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.auth.v1beta1.Params(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_memo_characters = reader.uint64(); - break; - case 2: - message.tx_sig_limit = reader.uint64(); - break; - case 3: - message.tx_size_cost_per_byte = reader.uint64(); - break; - case 4: - message.sig_verify_cost_ed25519 = reader.uint64(); - break; - case 5: - message.sig_verify_cost_secp256k1 = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.auth.v1beta1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.max_memo_characters != null && message.hasOwnProperty("max_memo_characters")) - if (!$util.isInteger(message.max_memo_characters) && !(message.max_memo_characters && $util.isInteger(message.max_memo_characters.low) && $util.isInteger(message.max_memo_characters.high))) - return "max_memo_characters: integer|Long expected"; - if (message.tx_sig_limit != null && message.hasOwnProperty("tx_sig_limit")) - if (!$util.isInteger(message.tx_sig_limit) && !(message.tx_sig_limit && $util.isInteger(message.tx_sig_limit.low) && $util.isInteger(message.tx_sig_limit.high))) - return "tx_sig_limit: integer|Long expected"; - if (message.tx_size_cost_per_byte != null && message.hasOwnProperty("tx_size_cost_per_byte")) - if (!$util.isInteger(message.tx_size_cost_per_byte) && !(message.tx_size_cost_per_byte && $util.isInteger(message.tx_size_cost_per_byte.low) && $util.isInteger(message.tx_size_cost_per_byte.high))) - return "tx_size_cost_per_byte: integer|Long expected"; - if (message.sig_verify_cost_ed25519 != null && message.hasOwnProperty("sig_verify_cost_ed25519")) - if (!$util.isInteger(message.sig_verify_cost_ed25519) && !(message.sig_verify_cost_ed25519 && $util.isInteger(message.sig_verify_cost_ed25519.low) && $util.isInteger(message.sig_verify_cost_ed25519.high))) - return "sig_verify_cost_ed25519: integer|Long expected"; - if (message.sig_verify_cost_secp256k1 != null && message.hasOwnProperty("sig_verify_cost_secp256k1")) - if (!$util.isInteger(message.sig_verify_cost_secp256k1) && !(message.sig_verify_cost_secp256k1 && $util.isInteger(message.sig_verify_cost_secp256k1.low) && $util.isInteger(message.sig_verify_cost_secp256k1.high))) - return "sig_verify_cost_secp256k1: integer|Long expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {Object.} object Plain object - * @returns {cosmos.auth.v1beta1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.auth.v1beta1.Params) - return object; - let message = new $root.cosmos.auth.v1beta1.Params(); - if (object.max_memo_characters != null) - if ($util.Long) - (message.max_memo_characters = $util.Long.fromValue(object.max_memo_characters)).unsigned = true; - else if (typeof object.max_memo_characters === "string") - message.max_memo_characters = parseInt(object.max_memo_characters, 10); - else if (typeof object.max_memo_characters === "number") - message.max_memo_characters = object.max_memo_characters; - else if (typeof object.max_memo_characters === "object") - message.max_memo_characters = new $util.LongBits(object.max_memo_characters.low >>> 0, object.max_memo_characters.high >>> 0).toNumber(true); - if (object.tx_sig_limit != null) - if ($util.Long) - (message.tx_sig_limit = $util.Long.fromValue(object.tx_sig_limit)).unsigned = true; - else if (typeof object.tx_sig_limit === "string") - message.tx_sig_limit = parseInt(object.tx_sig_limit, 10); - else if (typeof object.tx_sig_limit === "number") - message.tx_sig_limit = object.tx_sig_limit; - else if (typeof object.tx_sig_limit === "object") - message.tx_sig_limit = new $util.LongBits(object.tx_sig_limit.low >>> 0, object.tx_sig_limit.high >>> 0).toNumber(true); - if (object.tx_size_cost_per_byte != null) - if ($util.Long) - (message.tx_size_cost_per_byte = $util.Long.fromValue(object.tx_size_cost_per_byte)).unsigned = true; - else if (typeof object.tx_size_cost_per_byte === "string") - message.tx_size_cost_per_byte = parseInt(object.tx_size_cost_per_byte, 10); - else if (typeof object.tx_size_cost_per_byte === "number") - message.tx_size_cost_per_byte = object.tx_size_cost_per_byte; - else if (typeof object.tx_size_cost_per_byte === "object") - message.tx_size_cost_per_byte = new $util.LongBits(object.tx_size_cost_per_byte.low >>> 0, object.tx_size_cost_per_byte.high >>> 0).toNumber(true); - if (object.sig_verify_cost_ed25519 != null) - if ($util.Long) - (message.sig_verify_cost_ed25519 = $util.Long.fromValue(object.sig_verify_cost_ed25519)).unsigned = true; - else if (typeof object.sig_verify_cost_ed25519 === "string") - message.sig_verify_cost_ed25519 = parseInt(object.sig_verify_cost_ed25519, 10); - else if (typeof object.sig_verify_cost_ed25519 === "number") - message.sig_verify_cost_ed25519 = object.sig_verify_cost_ed25519; - else if (typeof object.sig_verify_cost_ed25519 === "object") - message.sig_verify_cost_ed25519 = new $util.LongBits(object.sig_verify_cost_ed25519.low >>> 0, object.sig_verify_cost_ed25519.high >>> 0).toNumber(true); - if (object.sig_verify_cost_secp256k1 != null) - if ($util.Long) - (message.sig_verify_cost_secp256k1 = $util.Long.fromValue(object.sig_verify_cost_secp256k1)).unsigned = true; - else if (typeof object.sig_verify_cost_secp256k1 === "string") - message.sig_verify_cost_secp256k1 = parseInt(object.sig_verify_cost_secp256k1, 10); - else if (typeof object.sig_verify_cost_secp256k1 === "number") - message.sig_verify_cost_secp256k1 = object.sig_verify_cost_secp256k1; - else if (typeof object.sig_verify_cost_secp256k1 === "object") - message.sig_verify_cost_secp256k1 = new $util.LongBits(object.sig_verify_cost_secp256k1.low >>> 0, object.sig_verify_cost_secp256k1.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.auth.v1beta1.Params - * @static - * @param {cosmos.auth.v1beta1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.max_memo_characters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_memo_characters = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.tx_sig_limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tx_sig_limit = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.tx_size_cost_per_byte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tx_size_cost_per_byte = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sig_verify_cost_ed25519 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sig_verify_cost_ed25519 = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sig_verify_cost_secp256k1 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sig_verify_cost_secp256k1 = options.longs === String ? "0" : 0; - } - if (message.max_memo_characters != null && message.hasOwnProperty("max_memo_characters")) - if (typeof message.max_memo_characters === "number") - object.max_memo_characters = options.longs === String ? String(message.max_memo_characters) : message.max_memo_characters; - else - object.max_memo_characters = options.longs === String ? $util.Long.prototype.toString.call(message.max_memo_characters) : options.longs === Number ? new $util.LongBits(message.max_memo_characters.low >>> 0, message.max_memo_characters.high >>> 0).toNumber(true) : message.max_memo_characters; - if (message.tx_sig_limit != null && message.hasOwnProperty("tx_sig_limit")) - if (typeof message.tx_sig_limit === "number") - object.tx_sig_limit = options.longs === String ? String(message.tx_sig_limit) : message.tx_sig_limit; - else - object.tx_sig_limit = options.longs === String ? $util.Long.prototype.toString.call(message.tx_sig_limit) : options.longs === Number ? new $util.LongBits(message.tx_sig_limit.low >>> 0, message.tx_sig_limit.high >>> 0).toNumber(true) : message.tx_sig_limit; - if (message.tx_size_cost_per_byte != null && message.hasOwnProperty("tx_size_cost_per_byte")) - if (typeof message.tx_size_cost_per_byte === "number") - object.tx_size_cost_per_byte = options.longs === String ? String(message.tx_size_cost_per_byte) : message.tx_size_cost_per_byte; - else - object.tx_size_cost_per_byte = options.longs === String ? $util.Long.prototype.toString.call(message.tx_size_cost_per_byte) : options.longs === Number ? new $util.LongBits(message.tx_size_cost_per_byte.low >>> 0, message.tx_size_cost_per_byte.high >>> 0).toNumber(true) : message.tx_size_cost_per_byte; - if (message.sig_verify_cost_ed25519 != null && message.hasOwnProperty("sig_verify_cost_ed25519")) - if (typeof message.sig_verify_cost_ed25519 === "number") - object.sig_verify_cost_ed25519 = options.longs === String ? String(message.sig_verify_cost_ed25519) : message.sig_verify_cost_ed25519; - else - object.sig_verify_cost_ed25519 = options.longs === String ? $util.Long.prototype.toString.call(message.sig_verify_cost_ed25519) : options.longs === Number ? new $util.LongBits(message.sig_verify_cost_ed25519.low >>> 0, message.sig_verify_cost_ed25519.high >>> 0).toNumber(true) : message.sig_verify_cost_ed25519; - if (message.sig_verify_cost_secp256k1 != null && message.hasOwnProperty("sig_verify_cost_secp256k1")) - if (typeof message.sig_verify_cost_secp256k1 === "number") - object.sig_verify_cost_secp256k1 = options.longs === String ? String(message.sig_verify_cost_secp256k1) : message.sig_verify_cost_secp256k1; - else - object.sig_verify_cost_secp256k1 = options.longs === String ? $util.Long.prototype.toString.call(message.sig_verify_cost_secp256k1) : options.longs === Number ? new $util.LongBits(message.sig_verify_cost_secp256k1.low >>> 0, message.sig_verify_cost_secp256k1.high >>> 0).toNumber(true) : message.sig_verify_cost_secp256k1; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof cosmos.auth.v1beta1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - return v1beta1; - })(); - - return auth; - })(); - - return cosmos; -})(); - -export const gogoproto = $root.gogoproto = (() => { - - /** - * Namespace gogoproto. - * @exports gogoproto - * @namespace - */ - const gogoproto = {}; - - return gogoproto; -})(); - -export const cosmos_proto = $root.cosmos_proto = (() => { - - /** - * Namespace cosmos_proto. - * @exports cosmos_proto - * @namespace - */ - const cosmos_proto = {}; - - return cosmos_proto; -})(); - -export const google = $root.google = (() => { - - /** - * Namespace google. - * @exports google - * @namespace - */ - const google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - const protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (let i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (let i = 0; i < message.file.length; ++i) { - let error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - let message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (let i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (let j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorSet; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [public_dependency] FileDescriptorProto public_dependency - * @property {Array.|null} [weak_dependency] FileDescriptorProto weak_dependency - * @property {Array.|null} [message_type] FileDescriptorProto message_type - * @property {Array.|null} [enum_type] FileDescriptorProto enum_type - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [source_code_info] FileDescriptorProto source_code_info - * @property {string|null} [syntax] FileDescriptorProto syntax - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.public_dependency = []; - this.weak_dependency = []; - this.message_type = []; - this.enum_type = []; - this.service = []; - this.extension = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto public_dependency. - * @member {Array.} public_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.public_dependency = $util.emptyArray; - - /** - * FileDescriptorProto weak_dependency. - * @member {Array.} weak_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weak_dependency = $util.emptyArray; - - /** - * FileDescriptorProto message_type. - * @member {Array.} message_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.message_type = $util.emptyArray; - - /** - * FileDescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto source_code_info. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} source_code_info - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.source_code_info = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (let i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.message_type != null && message.message_type.length) - for (let i = 0; i < message.message_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.message_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (let i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (let i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (let i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.source_code_info != null && Object.hasOwnProperty.call(message, "source_code_info")) - $root.google.protobuf.SourceCodeInfo.encode(message.source_code_info, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.public_dependency != null && message.public_dependency.length) - for (let i = 0; i < message.public_dependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.public_dependency[i]); - if (message.weak_dependency != null && message.weak_dependency.length) - for (let i = 0; i < message.weak_dependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weak_dependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.public_dependency && message.public_dependency.length)) - message.public_dependency = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.public_dependency.push(reader.int32()); - } else - message.public_dependency.push(reader.int32()); - break; - case 11: - if (!(message.weak_dependency && message.weak_dependency.length)) - message.weak_dependency = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weak_dependency.push(reader.int32()); - } else - message.weak_dependency.push(reader.int32()); - break; - case 4: - if (!(message.message_type && message.message_type.length)) - message.message_type = []; - message.message_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.source_code_info = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (let i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.public_dependency != null && message.hasOwnProperty("public_dependency")) { - if (!Array.isArray(message.public_dependency)) - return "public_dependency: array expected"; - for (let i = 0; i < message.public_dependency.length; ++i) - if (!$util.isInteger(message.public_dependency[i])) - return "public_dependency: integer[] expected"; - } - if (message.weak_dependency != null && message.hasOwnProperty("weak_dependency")) { - if (!Array.isArray(message.weak_dependency)) - return "weak_dependency: array expected"; - for (let i = 0; i < message.weak_dependency.length; ++i) - if (!$util.isInteger(message.weak_dependency[i])) - return "weak_dependency: integer[] expected"; - } - if (message.message_type != null && message.hasOwnProperty("message_type")) { - if (!Array.isArray(message.message_type)) - return "message_type: array expected"; - for (let i = 0; i < message.message_type.length; ++i) { - let error = $root.google.protobuf.DescriptorProto.verify(message.message_type[i]); - if (error) - return "message_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (let i = 0; i < message.enum_type.length; ++i) { - let error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (let i = 0; i < message.service.length; ++i) { - let error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (let i = 0; i < message.extension.length; ++i) { - let error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) { - let error = $root.google.protobuf.SourceCodeInfo.verify(message.source_code_info); - if (error) - return "source_code_info." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - let message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (let i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.public_dependency) { - if (!Array.isArray(object.public_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.public_dependency: array expected"); - message.public_dependency = []; - for (let i = 0; i < object.public_dependency.length; ++i) - message.public_dependency[i] = object.public_dependency[i] | 0; - } - if (object.weak_dependency) { - if (!Array.isArray(object.weak_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weak_dependency: array expected"); - message.weak_dependency = []; - for (let i = 0; i < object.weak_dependency.length; ++i) - message.weak_dependency[i] = object.weak_dependency[i] | 0; - } - if (object.message_type) { - if (!Array.isArray(object.message_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: array expected"); - message.message_type = []; - for (let i = 0; i < object.message_type.length; ++i) { - if (typeof object.message_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: object expected"); - message.message_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.message_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (let i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (let i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (let i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.source_code_info != null) { - if (typeof object.source_code_info !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.source_code_info: object expected"); - message.source_code_info = $root.google.protobuf.SourceCodeInfo.fromObject(object.source_code_info); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.message_type = []; - object.enum_type = []; - object.service = []; - object.extension = []; - object.public_dependency = []; - object.weak_dependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.source_code_info = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (let j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.message_type && message.message_type.length) { - object.message_type = []; - for (let j = 0; j < message.message_type.length; ++j) - object.message_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.message_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (let j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (let j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (let j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) - object.source_code_info = $root.google.protobuf.SourceCodeInfo.toObject(message.source_code_info, options); - if (message.public_dependency && message.public_dependency.length) { - object.public_dependency = []; - for (let j = 0; j < message.public_dependency.length; ++j) - object.public_dependency[j] = message.public_dependency[j]; - } - if (message.weak_dependency && message.weak_dependency.length) { - object.weak_dependency = []; - for (let j = 0; j < message.weak_dependency.length; ++j) - object.weak_dependency[j] = message.weak_dependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nested_type] DescriptorProto nested_type - * @property {Array.|null} [enum_type] DescriptorProto enum_type - * @property {Array.|null} [extension_range] DescriptorProto extension_range - * @property {Array.|null} [oneof_decl] DescriptorProto oneof_decl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reserved_range] DescriptorProto reserved_range - * @property {Array.|null} [reserved_name] DescriptorProto reserved_name - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nested_type = []; - this.enum_type = []; - this.extension_range = []; - this.oneof_decl = []; - this.reserved_range = []; - this.reserved_name = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nested_type. - * @member {Array.} nested_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nested_type = $util.emptyArray; - - /** - * DescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * DescriptorProto extension_range. - * @member {Array.} extension_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension_range = $util.emptyArray; - - /** - * DescriptorProto oneof_decl. - * @member {Array.} oneof_decl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneof_decl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reserved_range. - * @member {Array.} reserved_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_range = $util.emptyArray; - - /** - * DescriptorProto reserved_name. - * @member {Array.} reserved_name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_name = $util.emptyArray; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (let i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nested_type != null && message.nested_type.length) - for (let i = 0; i < message.nested_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nested_type[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (let i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extension_range != null && message.extension_range.length) - for (let i = 0; i < message.extension_range.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extension_range[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (let i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneof_decl != null && message.oneof_decl.length) - for (let i = 0; i < message.oneof_decl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneof_decl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reserved_range != null && message.reserved_range.length) - for (let i = 0; i < message.reserved_range.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reserved_range[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reserved_name != null && message.reserved_name.length) - for (let i = 0; i < message.reserved_name.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reserved_name[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nested_type && message.nested_type.length)) - message.nested_type = []; - message.nested_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extension_range && message.extension_range.length)) - message.extension_range = []; - message.extension_range.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneof_decl && message.oneof_decl.length)) - message.oneof_decl = []; - message.oneof_decl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reserved_range && message.reserved_range.length)) - message.reserved_range = []; - message.reserved_range.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reserved_name && message.reserved_name.length)) - message.reserved_name = []; - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (let i = 0; i < message.field.length; ++i) { - let error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (let i = 0; i < message.extension.length; ++i) { - let error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nested_type != null && message.hasOwnProperty("nested_type")) { - if (!Array.isArray(message.nested_type)) - return "nested_type: array expected"; - for (let i = 0; i < message.nested_type.length; ++i) { - let error = $root.google.protobuf.DescriptorProto.verify(message.nested_type[i]); - if (error) - return "nested_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (let i = 0; i < message.enum_type.length; ++i) { - let error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.extension_range != null && message.hasOwnProperty("extension_range")) { - if (!Array.isArray(message.extension_range)) - return "extension_range: array expected"; - for (let i = 0; i < message.extension_range.length; ++i) { - let error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extension_range[i]); - if (error) - return "extension_range." + error; - } - } - if (message.oneof_decl != null && message.hasOwnProperty("oneof_decl")) { - if (!Array.isArray(message.oneof_decl)) - return "oneof_decl: array expected"; - for (let i = 0; i < message.oneof_decl.length; ++i) { - let error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneof_decl[i]); - if (error) - return "oneof_decl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reserved_range != null && message.hasOwnProperty("reserved_range")) { - if (!Array.isArray(message.reserved_range)) - return "reserved_range: array expected"; - for (let i = 0; i < message.reserved_range.length; ++i) { - let error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reserved_range[i]); - if (error) - return "reserved_range." + error; - } - } - if (message.reserved_name != null && message.hasOwnProperty("reserved_name")) { - if (!Array.isArray(message.reserved_name)) - return "reserved_name: array expected"; - for (let i = 0; i < message.reserved_name.length; ++i) - if (!$util.isString(message.reserved_name[i])) - return "reserved_name: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - let message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (let i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (let i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nested_type) { - if (!Array.isArray(object.nested_type)) - throw TypeError(".google.protobuf.DescriptorProto.nested_type: array expected"); - message.nested_type = []; - for (let i = 0; i < object.nested_type.length; ++i) { - if (typeof object.nested_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nested_type: object expected"); - message.nested_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nested_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.DescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (let i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.extension_range) { - if (!Array.isArray(object.extension_range)) - throw TypeError(".google.protobuf.DescriptorProto.extension_range: array expected"); - message.extension_range = []; - for (let i = 0; i < object.extension_range.length; ++i) { - if (typeof object.extension_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension_range: object expected"); - message.extension_range[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extension_range[i]); - } - } - if (object.oneof_decl) { - if (!Array.isArray(object.oneof_decl)) - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: array expected"); - message.oneof_decl = []; - for (let i = 0; i < object.oneof_decl.length; ++i) { - if (typeof object.oneof_decl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: object expected"); - message.oneof_decl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneof_decl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reserved_range) { - if (!Array.isArray(object.reserved_range)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: array expected"); - message.reserved_range = []; - for (let i = 0; i < object.reserved_range.length; ++i) { - if (typeof object.reserved_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: object expected"); - message.reserved_range[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reserved_range[i]); - } - } - if (object.reserved_name) { - if (!Array.isArray(object.reserved_name)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_name: array expected"); - message.reserved_name = []; - for (let i = 0; i < object.reserved_name.length; ++i) - message.reserved_name[i] = String(object.reserved_name[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nested_type = []; - object.enum_type = []; - object.extension_range = []; - object.extension = []; - object.oneof_decl = []; - object.reserved_range = []; - object.reserved_name = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (let j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nested_type && message.nested_type.length) { - object.nested_type = []; - for (let j = 0; j < message.nested_type.length; ++j) - object.nested_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.nested_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (let j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.extension_range && message.extension_range.length) { - object.extension_range = []; - for (let j = 0; j < message.extension_range.length; ++j) - object.extension_range[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extension_range[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (let j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneof_decl && message.oneof_decl.length) { - object.oneof_decl = []; - for (let j = 0; j < message.oneof_decl.length; ++j) - object.oneof_decl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneof_decl[j], options); - } - if (message.reserved_range && message.reserved_range.length) { - object.reserved_range = []; - for (let j = 0; j < message.reserved_range.length; ++j) - object.reserved_range[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reserved_range[j], options); - } - if (message.reserved_name && message.reserved_name.length) { - object.reserved_name = []; - for (let j = 0; j < message.reserved_name.length; ++j) - object.reserved_name[j] = message.reserved_name[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - let message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - let message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [type_name] FieldDescriptorProto type_name - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [default_value] FieldDescriptorProto default_value - * @property {number|null} [oneof_index] FieldDescriptorProto oneof_index - * @property {string|null} [json_name] FieldDescriptorProto json_name - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto type_name. - * @member {string} type_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type_name = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto default_value. - * @member {string} default_value - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.default_value = ""; - - /** - * FieldDescriptorProto oneof_index. - * @member {number} oneof_index - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneof_index = 0; - - /** - * FieldDescriptorProto json_name. - * @member {string} json_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.json_name = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.type_name != null && Object.hasOwnProperty.call(message, "type_name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.type_name); - if (message.default_value != null && Object.hasOwnProperty.call(message, "default_value")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.default_value); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneof_index != null && Object.hasOwnProperty.call(message, "oneof_index")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneof_index); - if (message.json_name != null && Object.hasOwnProperty.call(message, "json_name")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.json_name); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.type_name != null && message.hasOwnProperty("type_name")) - if (!$util.isString(message.type_name)) - return "type_name: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.default_value != null && message.hasOwnProperty("default_value")) - if (!$util.isString(message.default_value)) - return "default_value: string expected"; - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - if (!$util.isInteger(message.oneof_index)) - return "oneof_index: integer expected"; - if (message.json_name != null && message.hasOwnProperty("json_name")) - if (!$util.isString(message.json_name)) - return "json_name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - let message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.type_name != null) - message.type_name = String(object.type_name); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.default_value != null) - message.default_value = String(object.default_value); - if (object.oneof_index != null) - message.oneof_index = object.oneof_index | 0; - if (object.json_name != null) - message.json_name = String(object.json_name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.type_name = ""; - object.default_value = ""; - object.options = null; - object.oneof_index = 0; - object.json_name = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.type_name != null && message.hasOwnProperty("type_name")) - object.type_name = message.type_name; - if (message.default_value != null && message.hasOwnProperty("default_value")) - object.default_value = message.default_value; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - object.oneof_index = message.oneof_index; - if (message.json_name != null && message.hasOwnProperty("json_name")) - object.json_name = message.json_name; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - let message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (let i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (let i = 0; i < message.value.length; ++i) { - let error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - let message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (let i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.value = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (let j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - let message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (let i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (let i = 0; i < message.method.length; ++i) { - let error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - let message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (let i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (let j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [input_type] MethodDescriptorProto input_type - * @property {string|null} [output_type] MethodDescriptorProto output_type - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [client_streaming] MethodDescriptorProto client_streaming - * @property {boolean|null} [server_streaming] MethodDescriptorProto server_streaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto input_type. - * @member {string} input_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.input_type = ""; - - /** - * MethodDescriptorProto output_type. - * @member {string} output_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.output_type = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto client_streaming. - * @member {boolean} client_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.client_streaming = false; - - /** - * MethodDescriptorProto server_streaming. - * @member {boolean} server_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.server_streaming = false; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.input_type != null && Object.hasOwnProperty.call(message, "input_type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.input_type); - if (message.output_type != null && Object.hasOwnProperty.call(message, "output_type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.output_type); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.client_streaming != null && Object.hasOwnProperty.call(message, "client_streaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.client_streaming); - if (message.server_streaming != null && Object.hasOwnProperty.call(message, "server_streaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.server_streaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.input_type != null && message.hasOwnProperty("input_type")) - if (!$util.isString(message.input_type)) - return "input_type: string expected"; - if (message.output_type != null && message.hasOwnProperty("output_type")) - if (!$util.isString(message.output_type)) - return "output_type: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - let error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - if (typeof message.client_streaming !== "boolean") - return "client_streaming: boolean expected"; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - if (typeof message.server_streaming !== "boolean") - return "server_streaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - let message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.input_type != null) - message.input_type = String(object.input_type); - if (object.output_type != null) - message.output_type = String(object.output_type); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.client_streaming != null) - message.client_streaming = Boolean(object.client_streaming); - if (object.server_streaming != null) - message.server_streaming = Boolean(object.server_streaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name = ""; - object.input_type = ""; - object.output_type = ""; - object.options = null; - object.client_streaming = false; - object.server_streaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.input_type != null && message.hasOwnProperty("input_type")) - object.input_type = message.input_type; - if (message.output_type != null && message.hasOwnProperty("output_type")) - object.output_type = message.output_type; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - object.client_streaming = message.client_streaming; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - object.server_streaming = message.server_streaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [java_package] FileOptions java_package - * @property {string|null} [java_outer_classname] FileOptions java_outer_classname - * @property {boolean|null} [java_multiple_files] FileOptions java_multiple_files - * @property {boolean|null} [java_generate_equals_and_hash] FileOptions java_generate_equals_and_hash - * @property {boolean|null} [java_string_check_utf8] FileOptions java_string_check_utf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimize_for] FileOptions optimize_for - * @property {string|null} [go_package] FileOptions go_package - * @property {boolean|null} [cc_generic_services] FileOptions cc_generic_services - * @property {boolean|null} [java_generic_services] FileOptions java_generic_services - * @property {boolean|null} [py_generic_services] FileOptions py_generic_services - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [cc_enable_arenas] FileOptions cc_enable_arenas - * @property {string|null} [objc_class_prefix] FileOptions objc_class_prefix - * @property {string|null} [csharp_namespace] FileOptions csharp_namespace - * @property {Array.|null} [uninterpreted_option] FileOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters_all"] FileOptions .gogoproto.goproto_getters_all - * @property {boolean|null} [".gogoproto.goproto_enum_prefix_all"] FileOptions .gogoproto.goproto_enum_prefix_all - * @property {boolean|null} [".gogoproto.goproto_stringer_all"] FileOptions .gogoproto.goproto_stringer_all - * @property {boolean|null} [".gogoproto.verbose_equal_all"] FileOptions .gogoproto.verbose_equal_all - * @property {boolean|null} [".gogoproto.face_all"] FileOptions .gogoproto.face_all - * @property {boolean|null} [".gogoproto.gostring_all"] FileOptions .gogoproto.gostring_all - * @property {boolean|null} [".gogoproto.populate_all"] FileOptions .gogoproto.populate_all - * @property {boolean|null} [".gogoproto.stringer_all"] FileOptions .gogoproto.stringer_all - * @property {boolean|null} [".gogoproto.onlyone_all"] FileOptions .gogoproto.onlyone_all - * @property {boolean|null} [".gogoproto.equal_all"] FileOptions .gogoproto.equal_all - * @property {boolean|null} [".gogoproto.description_all"] FileOptions .gogoproto.description_all - * @property {boolean|null} [".gogoproto.testgen_all"] FileOptions .gogoproto.testgen_all - * @property {boolean|null} [".gogoproto.benchgen_all"] FileOptions .gogoproto.benchgen_all - * @property {boolean|null} [".gogoproto.marshaler_all"] FileOptions .gogoproto.marshaler_all - * @property {boolean|null} [".gogoproto.unmarshaler_all"] FileOptions .gogoproto.unmarshaler_all - * @property {boolean|null} [".gogoproto.stable_marshaler_all"] FileOptions .gogoproto.stable_marshaler_all - * @property {boolean|null} [".gogoproto.sizer_all"] FileOptions .gogoproto.sizer_all - * @property {boolean|null} [".gogoproto.goproto_enum_stringer_all"] FileOptions .gogoproto.goproto_enum_stringer_all - * @property {boolean|null} [".gogoproto.enum_stringer_all"] FileOptions .gogoproto.enum_stringer_all - * @property {boolean|null} [".gogoproto.unsafe_marshaler_all"] FileOptions .gogoproto.unsafe_marshaler_all - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler_all"] FileOptions .gogoproto.unsafe_unmarshaler_all - * @property {boolean|null} [".gogoproto.goproto_extensions_map_all"] FileOptions .gogoproto.goproto_extensions_map_all - * @property {boolean|null} [".gogoproto.goproto_unrecognized_all"] FileOptions .gogoproto.goproto_unrecognized_all - * @property {boolean|null} [".gogoproto.gogoproto_import"] FileOptions .gogoproto.gogoproto_import - * @property {boolean|null} [".gogoproto.protosizer_all"] FileOptions .gogoproto.protosizer_all - * @property {boolean|null} [".gogoproto.compare_all"] FileOptions .gogoproto.compare_all - * @property {boolean|null} [".gogoproto.typedecl_all"] FileOptions .gogoproto.typedecl_all - * @property {boolean|null} [".gogoproto.enumdecl_all"] FileOptions .gogoproto.enumdecl_all - * @property {boolean|null} [".gogoproto.goproto_registration"] FileOptions .gogoproto.goproto_registration - * @property {boolean|null} [".gogoproto.messagename_all"] FileOptions .gogoproto.messagename_all - * @property {boolean|null} [".gogoproto.goproto_sizecache_all"] FileOptions .gogoproto.goproto_sizecache_all - * @property {boolean|null} [".gogoproto.goproto_unkeyed_all"] FileOptions .gogoproto.goproto_unkeyed_all - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions java_package. - * @member {string} java_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_package = ""; - - /** - * FileOptions java_outer_classname. - * @member {string} java_outer_classname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_outer_classname = ""; - - /** - * FileOptions java_multiple_files. - * @member {boolean} java_multiple_files - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_multiple_files = false; - - /** - * FileOptions java_generate_equals_and_hash. - * @member {boolean} java_generate_equals_and_hash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generate_equals_and_hash = false; - - /** - * FileOptions java_string_check_utf8. - * @member {boolean} java_string_check_utf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_string_check_utf8 = false; - - /** - * FileOptions optimize_for. - * @member {google.protobuf.FileOptions.OptimizeMode} optimize_for - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimize_for = 1; - - /** - * FileOptions go_package. - * @member {string} go_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.go_package = ""; - - /** - * FileOptions cc_generic_services. - * @member {boolean} cc_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_generic_services = false; - - /** - * FileOptions java_generic_services. - * @member {boolean} java_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generic_services = false; - - /** - * FileOptions py_generic_services. - * @member {boolean} py_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.py_generic_services = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions cc_enable_arenas. - * @member {boolean} cc_enable_arenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_enable_arenas = false; - - /** - * FileOptions objc_class_prefix. - * @member {string} objc_class_prefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objc_class_prefix = ""; - - /** - * FileOptions csharp_namespace. - * @member {string} csharp_namespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharp_namespace = ""; - - /** - * FileOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FileOptions .gogoproto.goproto_getters_all. - * @member {boolean} .gogoproto.goproto_getters_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_getters_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_prefix_all. - * @member {boolean} .gogoproto.goproto_enum_prefix_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_prefix_all"] = false; - - /** - * FileOptions .gogoproto.goproto_stringer_all. - * @member {boolean} .gogoproto.goproto_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_stringer_all"] = false; - - /** - * FileOptions .gogoproto.verbose_equal_all. - * @member {boolean} .gogoproto.verbose_equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.verbose_equal_all"] = false; - - /** - * FileOptions .gogoproto.face_all. - * @member {boolean} .gogoproto.face_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.face_all"] = false; - - /** - * FileOptions .gogoproto.gostring_all. - * @member {boolean} .gogoproto.gostring_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gostring_all"] = false; - - /** - * FileOptions .gogoproto.populate_all. - * @member {boolean} .gogoproto.populate_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.populate_all"] = false; - - /** - * FileOptions .gogoproto.stringer_all. - * @member {boolean} .gogoproto.stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stringer_all"] = false; - - /** - * FileOptions .gogoproto.onlyone_all. - * @member {boolean} .gogoproto.onlyone_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.onlyone_all"] = false; - - /** - * FileOptions .gogoproto.equal_all. - * @member {boolean} .gogoproto.equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.equal_all"] = false; - - /** - * FileOptions .gogoproto.description_all. - * @member {boolean} .gogoproto.description_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.description_all"] = false; - - /** - * FileOptions .gogoproto.testgen_all. - * @member {boolean} .gogoproto.testgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.testgen_all"] = false; - - /** - * FileOptions .gogoproto.benchgen_all. - * @member {boolean} .gogoproto.benchgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.benchgen_all"] = false; - - /** - * FileOptions .gogoproto.marshaler_all. - * @member {boolean} .gogoproto.marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unmarshaler_all. - * @member {boolean} .gogoproto.unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.stable_marshaler_all. - * @member {boolean} .gogoproto.stable_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stable_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.sizer_all. - * @member {boolean} .gogoproto.sizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.sizer_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_stringer_all. - * @member {boolean} .gogoproto.goproto_enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.enum_stringer_all. - * @member {boolean} .gogoproto.enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_marshaler_all. - * @member {boolean} .gogoproto.unsafe_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_unmarshaler_all. - * @member {boolean} .gogoproto.unsafe_unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.goproto_extensions_map_all. - * @member {boolean} .gogoproto.goproto_extensions_map_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_extensions_map_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unrecognized_all. - * @member {boolean} .gogoproto.goproto_unrecognized_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unrecognized_all"] = false; - - /** - * FileOptions .gogoproto.gogoproto_import. - * @member {boolean} .gogoproto.gogoproto_import - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gogoproto_import"] = false; - - /** - * FileOptions .gogoproto.protosizer_all. - * @member {boolean} .gogoproto.protosizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.protosizer_all"] = false; - - /** - * FileOptions .gogoproto.compare_all. - * @member {boolean} .gogoproto.compare_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.compare_all"] = false; - - /** - * FileOptions .gogoproto.typedecl_all. - * @member {boolean} .gogoproto.typedecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.typedecl_all"] = false; - - /** - * FileOptions .gogoproto.enumdecl_all. - * @member {boolean} .gogoproto.enumdecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enumdecl_all"] = false; - - /** - * FileOptions .gogoproto.goproto_registration. - * @member {boolean} .gogoproto.goproto_registration - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_registration"] = false; - - /** - * FileOptions .gogoproto.messagename_all. - * @member {boolean} .gogoproto.messagename_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.messagename_all"] = false; - - /** - * FileOptions .gogoproto.goproto_sizecache_all. - * @member {boolean} .gogoproto.goproto_sizecache_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_sizecache_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unkeyed_all. - * @member {boolean} .gogoproto.goproto_unkeyed_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unkeyed_all"] = false; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.java_package != null && Object.hasOwnProperty.call(message, "java_package")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.java_package); - if (message.java_outer_classname != null && Object.hasOwnProperty.call(message, "java_outer_classname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.java_outer_classname); - if (message.optimize_for != null && Object.hasOwnProperty.call(message, "optimize_for")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimize_for); - if (message.java_multiple_files != null && Object.hasOwnProperty.call(message, "java_multiple_files")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.java_multiple_files); - if (message.go_package != null && Object.hasOwnProperty.call(message, "go_package")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.go_package); - if (message.cc_generic_services != null && Object.hasOwnProperty.call(message, "cc_generic_services")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.cc_generic_services); - if (message.java_generic_services != null && Object.hasOwnProperty.call(message, "java_generic_services")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.java_generic_services); - if (message.py_generic_services != null && Object.hasOwnProperty.call(message, "py_generic_services")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.py_generic_services); - if (message.java_generate_equals_and_hash != null && Object.hasOwnProperty.call(message, "java_generate_equals_and_hash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.java_generate_equals_and_hash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.java_string_check_utf8 != null && Object.hasOwnProperty.call(message, "java_string_check_utf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.java_string_check_utf8); - if (message.cc_enable_arenas != null && Object.hasOwnProperty.call(message, "cc_enable_arenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.cc_enable_arenas); - if (message.objc_class_prefix != null && Object.hasOwnProperty.call(message, "objc_class_prefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objc_class_prefix); - if (message.csharp_namespace != null && Object.hasOwnProperty.call(message, "csharp_namespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharp_namespace); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters_all")) - writer.uint32(/* id 63001, wireType 0 =*/504008).bool(message[".gogoproto.goproto_getters_all"]); - if (message[".gogoproto.goproto_enum_prefix_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix_all")) - writer.uint32(/* id 63002, wireType 0 =*/504016).bool(message[".gogoproto.goproto_enum_prefix_all"]); - if (message[".gogoproto.goproto_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer_all")) - writer.uint32(/* id 63003, wireType 0 =*/504024).bool(message[".gogoproto.goproto_stringer_all"]); - if (message[".gogoproto.verbose_equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal_all")) - writer.uint32(/* id 63004, wireType 0 =*/504032).bool(message[".gogoproto.verbose_equal_all"]); - if (message[".gogoproto.face_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face_all")) - writer.uint32(/* id 63005, wireType 0 =*/504040).bool(message[".gogoproto.face_all"]); - if (message[".gogoproto.gostring_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring_all")) - writer.uint32(/* id 63006, wireType 0 =*/504048).bool(message[".gogoproto.gostring_all"]); - if (message[".gogoproto.populate_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate_all")) - writer.uint32(/* id 63007, wireType 0 =*/504056).bool(message[".gogoproto.populate_all"]); - if (message[".gogoproto.stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer_all")) - writer.uint32(/* id 63008, wireType 0 =*/504064).bool(message[".gogoproto.stringer_all"]); - if (message[".gogoproto.onlyone_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone_all")) - writer.uint32(/* id 63009, wireType 0 =*/504072).bool(message[".gogoproto.onlyone_all"]); - if (message[".gogoproto.equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal_all")) - writer.uint32(/* id 63013, wireType 0 =*/504104).bool(message[".gogoproto.equal_all"]); - if (message[".gogoproto.description_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description_all")) - writer.uint32(/* id 63014, wireType 0 =*/504112).bool(message[".gogoproto.description_all"]); - if (message[".gogoproto.testgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen_all")) - writer.uint32(/* id 63015, wireType 0 =*/504120).bool(message[".gogoproto.testgen_all"]); - if (message[".gogoproto.benchgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen_all")) - writer.uint32(/* id 63016, wireType 0 =*/504128).bool(message[".gogoproto.benchgen_all"]); - if (message[".gogoproto.marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler_all")) - writer.uint32(/* id 63017, wireType 0 =*/504136).bool(message[".gogoproto.marshaler_all"]); - if (message[".gogoproto.unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler_all")) - writer.uint32(/* id 63018, wireType 0 =*/504144).bool(message[".gogoproto.unmarshaler_all"]); - if (message[".gogoproto.stable_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler_all")) - writer.uint32(/* id 63019, wireType 0 =*/504152).bool(message[".gogoproto.stable_marshaler_all"]); - if (message[".gogoproto.sizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer_all")) - writer.uint32(/* id 63020, wireType 0 =*/504160).bool(message[".gogoproto.sizer_all"]); - if (message[".gogoproto.goproto_enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer_all")) - writer.uint32(/* id 63021, wireType 0 =*/504168).bool(message[".gogoproto.goproto_enum_stringer_all"]); - if (message[".gogoproto.enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer_all")) - writer.uint32(/* id 63022, wireType 0 =*/504176).bool(message[".gogoproto.enum_stringer_all"]); - if (message[".gogoproto.unsafe_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler_all")) - writer.uint32(/* id 63023, wireType 0 =*/504184).bool(message[".gogoproto.unsafe_marshaler_all"]); - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler_all")) - writer.uint32(/* id 63024, wireType 0 =*/504192).bool(message[".gogoproto.unsafe_unmarshaler_all"]); - if (message[".gogoproto.goproto_extensions_map_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map_all")) - writer.uint32(/* id 63025, wireType 0 =*/504200).bool(message[".gogoproto.goproto_extensions_map_all"]); - if (message[".gogoproto.goproto_unrecognized_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized_all")) - writer.uint32(/* id 63026, wireType 0 =*/504208).bool(message[".gogoproto.goproto_unrecognized_all"]); - if (message[".gogoproto.gogoproto_import"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gogoproto_import")) - writer.uint32(/* id 63027, wireType 0 =*/504216).bool(message[".gogoproto.gogoproto_import"]); - if (message[".gogoproto.protosizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer_all")) - writer.uint32(/* id 63028, wireType 0 =*/504224).bool(message[".gogoproto.protosizer_all"]); - if (message[".gogoproto.compare_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare_all")) - writer.uint32(/* id 63029, wireType 0 =*/504232).bool(message[".gogoproto.compare_all"]); - if (message[".gogoproto.typedecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl_all")) - writer.uint32(/* id 63030, wireType 0 =*/504240).bool(message[".gogoproto.typedecl_all"]); - if (message[".gogoproto.enumdecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl_all")) - writer.uint32(/* id 63031, wireType 0 =*/504248).bool(message[".gogoproto.enumdecl_all"]); - if (message[".gogoproto.goproto_registration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_registration")) - writer.uint32(/* id 63032, wireType 0 =*/504256).bool(message[".gogoproto.goproto_registration"]); - if (message[".gogoproto.messagename_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename_all")) - writer.uint32(/* id 63033, wireType 0 =*/504264).bool(message[".gogoproto.messagename_all"]); - if (message[".gogoproto.goproto_sizecache_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache_all")) - writer.uint32(/* id 63034, wireType 0 =*/504272).bool(message[".gogoproto.goproto_sizecache_all"]); - if (message[".gogoproto.goproto_unkeyed_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed_all")) - writer.uint32(/* id 63035, wireType 0 =*/504280).bool(message[".gogoproto.goproto_unkeyed_all"]); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32(); - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 63001: - message[".gogoproto.goproto_getters_all"] = reader.bool(); - break; - case 63002: - message[".gogoproto.goproto_enum_prefix_all"] = reader.bool(); - break; - case 63003: - message[".gogoproto.goproto_stringer_all"] = reader.bool(); - break; - case 63004: - message[".gogoproto.verbose_equal_all"] = reader.bool(); - break; - case 63005: - message[".gogoproto.face_all"] = reader.bool(); - break; - case 63006: - message[".gogoproto.gostring_all"] = reader.bool(); - break; - case 63007: - message[".gogoproto.populate_all"] = reader.bool(); - break; - case 63008: - message[".gogoproto.stringer_all"] = reader.bool(); - break; - case 63009: - message[".gogoproto.onlyone_all"] = reader.bool(); - break; - case 63013: - message[".gogoproto.equal_all"] = reader.bool(); - break; - case 63014: - message[".gogoproto.description_all"] = reader.bool(); - break; - case 63015: - message[".gogoproto.testgen_all"] = reader.bool(); - break; - case 63016: - message[".gogoproto.benchgen_all"] = reader.bool(); - break; - case 63017: - message[".gogoproto.marshaler_all"] = reader.bool(); - break; - case 63018: - message[".gogoproto.unmarshaler_all"] = reader.bool(); - break; - case 63019: - message[".gogoproto.stable_marshaler_all"] = reader.bool(); - break; - case 63020: - message[".gogoproto.sizer_all"] = reader.bool(); - break; - case 63021: - message[".gogoproto.goproto_enum_stringer_all"] = reader.bool(); - break; - case 63022: - message[".gogoproto.enum_stringer_all"] = reader.bool(); - break; - case 63023: - message[".gogoproto.unsafe_marshaler_all"] = reader.bool(); - break; - case 63024: - message[".gogoproto.unsafe_unmarshaler_all"] = reader.bool(); - break; - case 63025: - message[".gogoproto.goproto_extensions_map_all"] = reader.bool(); - break; - case 63026: - message[".gogoproto.goproto_unrecognized_all"] = reader.bool(); - break; - case 63027: - message[".gogoproto.gogoproto_import"] = reader.bool(); - break; - case 63028: - message[".gogoproto.protosizer_all"] = reader.bool(); - break; - case 63029: - message[".gogoproto.compare_all"] = reader.bool(); - break; - case 63030: - message[".gogoproto.typedecl_all"] = reader.bool(); - break; - case 63031: - message[".gogoproto.enumdecl_all"] = reader.bool(); - break; - case 63032: - message[".gogoproto.goproto_registration"] = reader.bool(); - break; - case 63033: - message[".gogoproto.messagename_all"] = reader.bool(); - break; - case 63034: - message[".gogoproto.goproto_sizecache_all"] = reader.bool(); - break; - case 63035: - message[".gogoproto.goproto_unkeyed_all"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.java_package != null && message.hasOwnProperty("java_package")) - if (!$util.isString(message.java_package)) - return "java_package: string expected"; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - if (!$util.isString(message.java_outer_classname)) - return "java_outer_classname: string expected"; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - if (typeof message.java_multiple_files !== "boolean") - return "java_multiple_files: boolean expected"; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - if (typeof message.java_generate_equals_and_hash !== "boolean") - return "java_generate_equals_and_hash: boolean expected"; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - if (typeof message.java_string_check_utf8 !== "boolean") - return "java_string_check_utf8: boolean expected"; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - switch (message.optimize_for) { - default: - return "optimize_for: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.go_package != null && message.hasOwnProperty("go_package")) - if (!$util.isString(message.go_package)) - return "go_package: string expected"; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - if (typeof message.cc_generic_services !== "boolean") - return "cc_generic_services: boolean expected"; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - if (typeof message.java_generic_services !== "boolean") - return "java_generic_services: boolean expected"; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - if (typeof message.py_generic_services !== "boolean") - return "py_generic_services: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - if (typeof message.cc_enable_arenas !== "boolean") - return "cc_enable_arenas: boolean expected"; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - if (!$util.isString(message.objc_class_prefix)) - return "objc_class_prefix: string expected"; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - if (!$util.isString(message.csharp_namespace)) - return "csharp_namespace: string expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - if (typeof message[".gogoproto.goproto_getters_all"] !== "boolean") - return ".gogoproto.goproto_getters_all: boolean expected"; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - if (typeof message[".gogoproto.goproto_enum_prefix_all"] !== "boolean") - return ".gogoproto.goproto_enum_prefix_all: boolean expected"; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - if (typeof message[".gogoproto.goproto_stringer_all"] !== "boolean") - return ".gogoproto.goproto_stringer_all: boolean expected"; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - if (typeof message[".gogoproto.verbose_equal_all"] !== "boolean") - return ".gogoproto.verbose_equal_all: boolean expected"; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - if (typeof message[".gogoproto.face_all"] !== "boolean") - return ".gogoproto.face_all: boolean expected"; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - if (typeof message[".gogoproto.gostring_all"] !== "boolean") - return ".gogoproto.gostring_all: boolean expected"; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - if (typeof message[".gogoproto.populate_all"] !== "boolean") - return ".gogoproto.populate_all: boolean expected"; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - if (typeof message[".gogoproto.stringer_all"] !== "boolean") - return ".gogoproto.stringer_all: boolean expected"; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - if (typeof message[".gogoproto.onlyone_all"] !== "boolean") - return ".gogoproto.onlyone_all: boolean expected"; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - if (typeof message[".gogoproto.equal_all"] !== "boolean") - return ".gogoproto.equal_all: boolean expected"; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - if (typeof message[".gogoproto.description_all"] !== "boolean") - return ".gogoproto.description_all: boolean expected"; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - if (typeof message[".gogoproto.testgen_all"] !== "boolean") - return ".gogoproto.testgen_all: boolean expected"; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - if (typeof message[".gogoproto.benchgen_all"] !== "boolean") - return ".gogoproto.benchgen_all: boolean expected"; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - if (typeof message[".gogoproto.marshaler_all"] !== "boolean") - return ".gogoproto.marshaler_all: boolean expected"; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - if (typeof message[".gogoproto.unmarshaler_all"] !== "boolean") - return ".gogoproto.unmarshaler_all: boolean expected"; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - if (typeof message[".gogoproto.stable_marshaler_all"] !== "boolean") - return ".gogoproto.stable_marshaler_all: boolean expected"; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - if (typeof message[".gogoproto.sizer_all"] !== "boolean") - return ".gogoproto.sizer_all: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - if (typeof message[".gogoproto.goproto_enum_stringer_all"] !== "boolean") - return ".gogoproto.goproto_enum_stringer_all: boolean expected"; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - if (typeof message[".gogoproto.enum_stringer_all"] !== "boolean") - return ".gogoproto.enum_stringer_all: boolean expected"; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - if (typeof message[".gogoproto.unsafe_marshaler_all"] !== "boolean") - return ".gogoproto.unsafe_marshaler_all: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - if (typeof message[".gogoproto.unsafe_unmarshaler_all"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler_all: boolean expected"; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - if (typeof message[".gogoproto.goproto_extensions_map_all"] !== "boolean") - return ".gogoproto.goproto_extensions_map_all: boolean expected"; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - if (typeof message[".gogoproto.goproto_unrecognized_all"] !== "boolean") - return ".gogoproto.goproto_unrecognized_all: boolean expected"; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - if (typeof message[".gogoproto.gogoproto_import"] !== "boolean") - return ".gogoproto.gogoproto_import: boolean expected"; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - if (typeof message[".gogoproto.protosizer_all"] !== "boolean") - return ".gogoproto.protosizer_all: boolean expected"; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - if (typeof message[".gogoproto.compare_all"] !== "boolean") - return ".gogoproto.compare_all: boolean expected"; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - if (typeof message[".gogoproto.typedecl_all"] !== "boolean") - return ".gogoproto.typedecl_all: boolean expected"; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - if (typeof message[".gogoproto.enumdecl_all"] !== "boolean") - return ".gogoproto.enumdecl_all: boolean expected"; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - if (typeof message[".gogoproto.goproto_registration"] !== "boolean") - return ".gogoproto.goproto_registration: boolean expected"; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - if (typeof message[".gogoproto.messagename_all"] !== "boolean") - return ".gogoproto.messagename_all: boolean expected"; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - if (typeof message[".gogoproto.goproto_sizecache_all"] !== "boolean") - return ".gogoproto.goproto_sizecache_all: boolean expected"; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - if (typeof message[".gogoproto.goproto_unkeyed_all"] !== "boolean") - return ".gogoproto.goproto_unkeyed_all: boolean expected"; - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - let message = new $root.google.protobuf.FileOptions(); - if (object.java_package != null) - message.java_package = String(object.java_package); - if (object.java_outer_classname != null) - message.java_outer_classname = String(object.java_outer_classname); - if (object.java_multiple_files != null) - message.java_multiple_files = Boolean(object.java_multiple_files); - if (object.java_generate_equals_and_hash != null) - message.java_generate_equals_and_hash = Boolean(object.java_generate_equals_and_hash); - if (object.java_string_check_utf8 != null) - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - switch (object.optimize_for) { - case "SPEED": - case 1: - message.optimize_for = 1; - break; - case "CODE_SIZE": - case 2: - message.optimize_for = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimize_for = 3; - break; - } - if (object.go_package != null) - message.go_package = String(object.go_package); - if (object.cc_generic_services != null) - message.cc_generic_services = Boolean(object.cc_generic_services); - if (object.java_generic_services != null) - message.java_generic_services = Boolean(object.java_generic_services); - if (object.py_generic_services != null) - message.py_generic_services = Boolean(object.py_generic_services); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.cc_enable_arenas != null) - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - if (object.objc_class_prefix != null) - message.objc_class_prefix = String(object.objc_class_prefix); - if (object.csharp_namespace != null) - message.csharp_namespace = String(object.csharp_namespace); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters_all"] != null) - message[".gogoproto.goproto_getters_all"] = Boolean(object[".gogoproto.goproto_getters_all"]); - if (object[".gogoproto.goproto_enum_prefix_all"] != null) - message[".gogoproto.goproto_enum_prefix_all"] = Boolean(object[".gogoproto.goproto_enum_prefix_all"]); - if (object[".gogoproto.goproto_stringer_all"] != null) - message[".gogoproto.goproto_stringer_all"] = Boolean(object[".gogoproto.goproto_stringer_all"]); - if (object[".gogoproto.verbose_equal_all"] != null) - message[".gogoproto.verbose_equal_all"] = Boolean(object[".gogoproto.verbose_equal_all"]); - if (object[".gogoproto.face_all"] != null) - message[".gogoproto.face_all"] = Boolean(object[".gogoproto.face_all"]); - if (object[".gogoproto.gostring_all"] != null) - message[".gogoproto.gostring_all"] = Boolean(object[".gogoproto.gostring_all"]); - if (object[".gogoproto.populate_all"] != null) - message[".gogoproto.populate_all"] = Boolean(object[".gogoproto.populate_all"]); - if (object[".gogoproto.stringer_all"] != null) - message[".gogoproto.stringer_all"] = Boolean(object[".gogoproto.stringer_all"]); - if (object[".gogoproto.onlyone_all"] != null) - message[".gogoproto.onlyone_all"] = Boolean(object[".gogoproto.onlyone_all"]); - if (object[".gogoproto.equal_all"] != null) - message[".gogoproto.equal_all"] = Boolean(object[".gogoproto.equal_all"]); - if (object[".gogoproto.description_all"] != null) - message[".gogoproto.description_all"] = Boolean(object[".gogoproto.description_all"]); - if (object[".gogoproto.testgen_all"] != null) - message[".gogoproto.testgen_all"] = Boolean(object[".gogoproto.testgen_all"]); - if (object[".gogoproto.benchgen_all"] != null) - message[".gogoproto.benchgen_all"] = Boolean(object[".gogoproto.benchgen_all"]); - if (object[".gogoproto.marshaler_all"] != null) - message[".gogoproto.marshaler_all"] = Boolean(object[".gogoproto.marshaler_all"]); - if (object[".gogoproto.unmarshaler_all"] != null) - message[".gogoproto.unmarshaler_all"] = Boolean(object[".gogoproto.unmarshaler_all"]); - if (object[".gogoproto.stable_marshaler_all"] != null) - message[".gogoproto.stable_marshaler_all"] = Boolean(object[".gogoproto.stable_marshaler_all"]); - if (object[".gogoproto.sizer_all"] != null) - message[".gogoproto.sizer_all"] = Boolean(object[".gogoproto.sizer_all"]); - if (object[".gogoproto.goproto_enum_stringer_all"] != null) - message[".gogoproto.goproto_enum_stringer_all"] = Boolean(object[".gogoproto.goproto_enum_stringer_all"]); - if (object[".gogoproto.enum_stringer_all"] != null) - message[".gogoproto.enum_stringer_all"] = Boolean(object[".gogoproto.enum_stringer_all"]); - if (object[".gogoproto.unsafe_marshaler_all"] != null) - message[".gogoproto.unsafe_marshaler_all"] = Boolean(object[".gogoproto.unsafe_marshaler_all"]); - if (object[".gogoproto.unsafe_unmarshaler_all"] != null) - message[".gogoproto.unsafe_unmarshaler_all"] = Boolean(object[".gogoproto.unsafe_unmarshaler_all"]); - if (object[".gogoproto.goproto_extensions_map_all"] != null) - message[".gogoproto.goproto_extensions_map_all"] = Boolean(object[".gogoproto.goproto_extensions_map_all"]); - if (object[".gogoproto.goproto_unrecognized_all"] != null) - message[".gogoproto.goproto_unrecognized_all"] = Boolean(object[".gogoproto.goproto_unrecognized_all"]); - if (object[".gogoproto.gogoproto_import"] != null) - message[".gogoproto.gogoproto_import"] = Boolean(object[".gogoproto.gogoproto_import"]); - if (object[".gogoproto.protosizer_all"] != null) - message[".gogoproto.protosizer_all"] = Boolean(object[".gogoproto.protosizer_all"]); - if (object[".gogoproto.compare_all"] != null) - message[".gogoproto.compare_all"] = Boolean(object[".gogoproto.compare_all"]); - if (object[".gogoproto.typedecl_all"] != null) - message[".gogoproto.typedecl_all"] = Boolean(object[".gogoproto.typedecl_all"]); - if (object[".gogoproto.enumdecl_all"] != null) - message[".gogoproto.enumdecl_all"] = Boolean(object[".gogoproto.enumdecl_all"]); - if (object[".gogoproto.goproto_registration"] != null) - message[".gogoproto.goproto_registration"] = Boolean(object[".gogoproto.goproto_registration"]); - if (object[".gogoproto.messagename_all"] != null) - message[".gogoproto.messagename_all"] = Boolean(object[".gogoproto.messagename_all"]); - if (object[".gogoproto.goproto_sizecache_all"] != null) - message[".gogoproto.goproto_sizecache_all"] = Boolean(object[".gogoproto.goproto_sizecache_all"]); - if (object[".gogoproto.goproto_unkeyed_all"] != null) - message[".gogoproto.goproto_unkeyed_all"] = Boolean(object[".gogoproto.goproto_unkeyed_all"]); - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.java_package = ""; - object.java_outer_classname = ""; - object.optimize_for = options.enums === String ? "SPEED" : 1; - object.java_multiple_files = false; - object.go_package = ""; - object.cc_generic_services = false; - object.java_generic_services = false; - object.py_generic_services = false; - object.java_generate_equals_and_hash = false; - object.deprecated = false; - object.java_string_check_utf8 = false; - object.cc_enable_arenas = false; - object.objc_class_prefix = ""; - object.csharp_namespace = ""; - object[".gogoproto.goproto_getters_all"] = false; - object[".gogoproto.goproto_enum_prefix_all"] = false; - object[".gogoproto.goproto_stringer_all"] = false; - object[".gogoproto.verbose_equal_all"] = false; - object[".gogoproto.face_all"] = false; - object[".gogoproto.gostring_all"] = false; - object[".gogoproto.populate_all"] = false; - object[".gogoproto.stringer_all"] = false; - object[".gogoproto.onlyone_all"] = false; - object[".gogoproto.equal_all"] = false; - object[".gogoproto.description_all"] = false; - object[".gogoproto.testgen_all"] = false; - object[".gogoproto.benchgen_all"] = false; - object[".gogoproto.marshaler_all"] = false; - object[".gogoproto.unmarshaler_all"] = false; - object[".gogoproto.stable_marshaler_all"] = false; - object[".gogoproto.sizer_all"] = false; - object[".gogoproto.goproto_enum_stringer_all"] = false; - object[".gogoproto.enum_stringer_all"] = false; - object[".gogoproto.unsafe_marshaler_all"] = false; - object[".gogoproto.unsafe_unmarshaler_all"] = false; - object[".gogoproto.goproto_extensions_map_all"] = false; - object[".gogoproto.goproto_unrecognized_all"] = false; - object[".gogoproto.gogoproto_import"] = false; - object[".gogoproto.protosizer_all"] = false; - object[".gogoproto.compare_all"] = false; - object[".gogoproto.typedecl_all"] = false; - object[".gogoproto.enumdecl_all"] = false; - object[".gogoproto.goproto_registration"] = false; - object[".gogoproto.messagename_all"] = false; - object[".gogoproto.goproto_sizecache_all"] = false; - object[".gogoproto.goproto_unkeyed_all"] = false; - } - if (message.java_package != null && message.hasOwnProperty("java_package")) - object.java_package = message.java_package; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - object.java_outer_classname = message.java_outer_classname; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - object.optimize_for = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimize_for] : message.optimize_for; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - object.java_multiple_files = message.java_multiple_files; - if (message.go_package != null && message.hasOwnProperty("go_package")) - object.go_package = message.go_package; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - object.cc_generic_services = message.cc_generic_services; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - object.java_generic_services = message.java_generic_services; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - object.py_generic_services = message.py_generic_services; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - object.java_generate_equals_and_hash = message.java_generate_equals_and_hash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - object.java_string_check_utf8 = message.java_string_check_utf8; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - object.cc_enable_arenas = message.cc_enable_arenas; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - object.objc_class_prefix = message.objc_class_prefix; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - object.csharp_namespace = message.csharp_namespace; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - object[".gogoproto.goproto_getters_all"] = message[".gogoproto.goproto_getters_all"]; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - object[".gogoproto.goproto_enum_prefix_all"] = message[".gogoproto.goproto_enum_prefix_all"]; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - object[".gogoproto.goproto_stringer_all"] = message[".gogoproto.goproto_stringer_all"]; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - object[".gogoproto.verbose_equal_all"] = message[".gogoproto.verbose_equal_all"]; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - object[".gogoproto.face_all"] = message[".gogoproto.face_all"]; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - object[".gogoproto.gostring_all"] = message[".gogoproto.gostring_all"]; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - object[".gogoproto.populate_all"] = message[".gogoproto.populate_all"]; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - object[".gogoproto.stringer_all"] = message[".gogoproto.stringer_all"]; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - object[".gogoproto.onlyone_all"] = message[".gogoproto.onlyone_all"]; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - object[".gogoproto.equal_all"] = message[".gogoproto.equal_all"]; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - object[".gogoproto.description_all"] = message[".gogoproto.description_all"]; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - object[".gogoproto.testgen_all"] = message[".gogoproto.testgen_all"]; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - object[".gogoproto.benchgen_all"] = message[".gogoproto.benchgen_all"]; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - object[".gogoproto.marshaler_all"] = message[".gogoproto.marshaler_all"]; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - object[".gogoproto.unmarshaler_all"] = message[".gogoproto.unmarshaler_all"]; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - object[".gogoproto.stable_marshaler_all"] = message[".gogoproto.stable_marshaler_all"]; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - object[".gogoproto.sizer_all"] = message[".gogoproto.sizer_all"]; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - object[".gogoproto.goproto_enum_stringer_all"] = message[".gogoproto.goproto_enum_stringer_all"]; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - object[".gogoproto.enum_stringer_all"] = message[".gogoproto.enum_stringer_all"]; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - object[".gogoproto.unsafe_marshaler_all"] = message[".gogoproto.unsafe_marshaler_all"]; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - object[".gogoproto.unsafe_unmarshaler_all"] = message[".gogoproto.unsafe_unmarshaler_all"]; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - object[".gogoproto.goproto_extensions_map_all"] = message[".gogoproto.goproto_extensions_map_all"]; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - object[".gogoproto.goproto_unrecognized_all"] = message[".gogoproto.goproto_unrecognized_all"]; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - object[".gogoproto.gogoproto_import"] = message[".gogoproto.gogoproto_import"]; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - object[".gogoproto.protosizer_all"] = message[".gogoproto.protosizer_all"]; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - object[".gogoproto.compare_all"] = message[".gogoproto.compare_all"]; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - object[".gogoproto.typedecl_all"] = message[".gogoproto.typedecl_all"]; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - object[".gogoproto.enumdecl_all"] = message[".gogoproto.enumdecl_all"]; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - object[".gogoproto.goproto_registration"] = message[".gogoproto.goproto_registration"]; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - object[".gogoproto.messagename_all"] = message[".gogoproto.messagename_all"]; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - object[".gogoproto.goproto_sizecache_all"] = message[".gogoproto.goproto_sizecache_all"]; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - object[".gogoproto.goproto_unkeyed_all"] = message[".gogoproto.goproto_unkeyed_all"]; - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [message_set_wire_format] MessageOptions message_set_wire_format - * @property {boolean|null} [no_standard_descriptor_accessor] MessageOptions no_standard_descriptor_accessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [map_entry] MessageOptions map_entry - * @property {Array.|null} [uninterpreted_option] MessageOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters"] MessageOptions .gogoproto.goproto_getters - * @property {boolean|null} [".gogoproto.goproto_stringer"] MessageOptions .gogoproto.goproto_stringer - * @property {boolean|null} [".gogoproto.verbose_equal"] MessageOptions .gogoproto.verbose_equal - * @property {boolean|null} [".gogoproto.face"] MessageOptions .gogoproto.face - * @property {boolean|null} [".gogoproto.gostring"] MessageOptions .gogoproto.gostring - * @property {boolean|null} [".gogoproto.populate"] MessageOptions .gogoproto.populate - * @property {boolean|null} [".gogoproto.stringer"] MessageOptions .gogoproto.stringer - * @property {boolean|null} [".gogoproto.onlyone"] MessageOptions .gogoproto.onlyone - * @property {boolean|null} [".gogoproto.equal"] MessageOptions .gogoproto.equal - * @property {boolean|null} [".gogoproto.description"] MessageOptions .gogoproto.description - * @property {boolean|null} [".gogoproto.testgen"] MessageOptions .gogoproto.testgen - * @property {boolean|null} [".gogoproto.benchgen"] MessageOptions .gogoproto.benchgen - * @property {boolean|null} [".gogoproto.marshaler"] MessageOptions .gogoproto.marshaler - * @property {boolean|null} [".gogoproto.unmarshaler"] MessageOptions .gogoproto.unmarshaler - * @property {boolean|null} [".gogoproto.stable_marshaler"] MessageOptions .gogoproto.stable_marshaler - * @property {boolean|null} [".gogoproto.sizer"] MessageOptions .gogoproto.sizer - * @property {boolean|null} [".gogoproto.unsafe_marshaler"] MessageOptions .gogoproto.unsafe_marshaler - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler"] MessageOptions .gogoproto.unsafe_unmarshaler - * @property {boolean|null} [".gogoproto.goproto_extensions_map"] MessageOptions .gogoproto.goproto_extensions_map - * @property {boolean|null} [".gogoproto.goproto_unrecognized"] MessageOptions .gogoproto.goproto_unrecognized - * @property {boolean|null} [".gogoproto.protosizer"] MessageOptions .gogoproto.protosizer - * @property {boolean|null} [".gogoproto.compare"] MessageOptions .gogoproto.compare - * @property {boolean|null} [".gogoproto.typedecl"] MessageOptions .gogoproto.typedecl - * @property {boolean|null} [".gogoproto.messagename"] MessageOptions .gogoproto.messagename - * @property {boolean|null} [".gogoproto.goproto_sizecache"] MessageOptions .gogoproto.goproto_sizecache - * @property {boolean|null} [".gogoproto.goproto_unkeyed"] MessageOptions .gogoproto.goproto_unkeyed - * @property {string|null} [".cosmos_proto.interface_type"] MessageOptions .cosmos_proto.interface_type - * @property {string|null} [".cosmos_proto.implements_interface"] MessageOptions .cosmos_proto.implements_interface - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions message_set_wire_format. - * @member {boolean} message_set_wire_format - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.message_set_wire_format = false; - - /** - * MessageOptions no_standard_descriptor_accessor. - * @member {boolean} no_standard_descriptor_accessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.no_standard_descriptor_accessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions map_entry. - * @member {boolean} map_entry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.map_entry = false; - - /** - * MessageOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MessageOptions .gogoproto.goproto_getters. - * @member {boolean} .gogoproto.goproto_getters - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_getters"] = false; - - /** - * MessageOptions .gogoproto.goproto_stringer. - * @member {boolean} .gogoproto.goproto_stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_stringer"] = false; - - /** - * MessageOptions .gogoproto.verbose_equal. - * @member {boolean} .gogoproto.verbose_equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.verbose_equal"] = false; - - /** - * MessageOptions .gogoproto.face. - * @member {boolean} .gogoproto.face - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.face"] = false; - - /** - * MessageOptions .gogoproto.gostring. - * @member {boolean} .gogoproto.gostring - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.gostring"] = false; - - /** - * MessageOptions .gogoproto.populate. - * @member {boolean} .gogoproto.populate - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.populate"] = false; - - /** - * MessageOptions .gogoproto.stringer. - * @member {boolean} .gogoproto.stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stringer"] = false; - - /** - * MessageOptions .gogoproto.onlyone. - * @member {boolean} .gogoproto.onlyone - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.onlyone"] = false; - - /** - * MessageOptions .gogoproto.equal. - * @member {boolean} .gogoproto.equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.equal"] = false; - - /** - * MessageOptions .gogoproto.description. - * @member {boolean} .gogoproto.description - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.description"] = false; - - /** - * MessageOptions .gogoproto.testgen. - * @member {boolean} .gogoproto.testgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.testgen"] = false; - - /** - * MessageOptions .gogoproto.benchgen. - * @member {boolean} .gogoproto.benchgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.benchgen"] = false; - - /** - * MessageOptions .gogoproto.marshaler. - * @member {boolean} .gogoproto.marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.marshaler"] = false; - - /** - * MessageOptions .gogoproto.unmarshaler. - * @member {boolean} .gogoproto.unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.stable_marshaler. - * @member {boolean} .gogoproto.stable_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stable_marshaler"] = false; - - /** - * MessageOptions .gogoproto.sizer. - * @member {boolean} .gogoproto.sizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.sizer"] = false; - - /** - * MessageOptions .gogoproto.unsafe_marshaler. - * @member {boolean} .gogoproto.unsafe_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_marshaler"] = false; - - /** - * MessageOptions .gogoproto.unsafe_unmarshaler. - * @member {boolean} .gogoproto.unsafe_unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.goproto_extensions_map. - * @member {boolean} .gogoproto.goproto_extensions_map - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_extensions_map"] = false; - - /** - * MessageOptions .gogoproto.goproto_unrecognized. - * @member {boolean} .gogoproto.goproto_unrecognized - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unrecognized"] = false; - - /** - * MessageOptions .gogoproto.protosizer. - * @member {boolean} .gogoproto.protosizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.protosizer"] = false; - - /** - * MessageOptions .gogoproto.compare. - * @member {boolean} .gogoproto.compare - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.compare"] = false; - - /** - * MessageOptions .gogoproto.typedecl. - * @member {boolean} .gogoproto.typedecl - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.typedecl"] = false; - - /** - * MessageOptions .gogoproto.messagename. - * @member {boolean} .gogoproto.messagename - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.messagename"] = false; - - /** - * MessageOptions .gogoproto.goproto_sizecache. - * @member {boolean} .gogoproto.goproto_sizecache - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_sizecache"] = false; - - /** - * MessageOptions .gogoproto.goproto_unkeyed. - * @member {boolean} .gogoproto.goproto_unkeyed - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unkeyed"] = false; - - /** - * MessageOptions .cosmos_proto.interface_type. - * @member {string} .cosmos_proto.interface_type - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".cosmos_proto.interface_type"] = ""; - - /** - * MessageOptions .cosmos_proto.implements_interface. - * @member {string} .cosmos_proto.implements_interface - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".cosmos_proto.implements_interface"] = ""; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message_set_wire_format != null && Object.hasOwnProperty.call(message, "message_set_wire_format")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.message_set_wire_format); - if (message.no_standard_descriptor_accessor != null && Object.hasOwnProperty.call(message, "no_standard_descriptor_accessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.no_standard_descriptor_accessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.map_entry != null && Object.hasOwnProperty.call(message, "map_entry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.map_entry); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters")) - writer.uint32(/* id 64001, wireType 0 =*/512008).bool(message[".gogoproto.goproto_getters"]); - if (message[".gogoproto.goproto_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer")) - writer.uint32(/* id 64003, wireType 0 =*/512024).bool(message[".gogoproto.goproto_stringer"]); - if (message[".gogoproto.verbose_equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal")) - writer.uint32(/* id 64004, wireType 0 =*/512032).bool(message[".gogoproto.verbose_equal"]); - if (message[".gogoproto.face"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face")) - writer.uint32(/* id 64005, wireType 0 =*/512040).bool(message[".gogoproto.face"]); - if (message[".gogoproto.gostring"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring")) - writer.uint32(/* id 64006, wireType 0 =*/512048).bool(message[".gogoproto.gostring"]); - if (message[".gogoproto.populate"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate")) - writer.uint32(/* id 64007, wireType 0 =*/512056).bool(message[".gogoproto.populate"]); - if (message[".gogoproto.onlyone"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone")) - writer.uint32(/* id 64009, wireType 0 =*/512072).bool(message[".gogoproto.onlyone"]); - if (message[".gogoproto.equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal")) - writer.uint32(/* id 64013, wireType 0 =*/512104).bool(message[".gogoproto.equal"]); - if (message[".gogoproto.description"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description")) - writer.uint32(/* id 64014, wireType 0 =*/512112).bool(message[".gogoproto.description"]); - if (message[".gogoproto.testgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen")) - writer.uint32(/* id 64015, wireType 0 =*/512120).bool(message[".gogoproto.testgen"]); - if (message[".gogoproto.benchgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen")) - writer.uint32(/* id 64016, wireType 0 =*/512128).bool(message[".gogoproto.benchgen"]); - if (message[".gogoproto.marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler")) - writer.uint32(/* id 64017, wireType 0 =*/512136).bool(message[".gogoproto.marshaler"]); - if (message[".gogoproto.unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler")) - writer.uint32(/* id 64018, wireType 0 =*/512144).bool(message[".gogoproto.unmarshaler"]); - if (message[".gogoproto.stable_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler")) - writer.uint32(/* id 64019, wireType 0 =*/512152).bool(message[".gogoproto.stable_marshaler"]); - if (message[".gogoproto.sizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer")) - writer.uint32(/* id 64020, wireType 0 =*/512160).bool(message[".gogoproto.sizer"]); - if (message[".gogoproto.unsafe_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler")) - writer.uint32(/* id 64023, wireType 0 =*/512184).bool(message[".gogoproto.unsafe_marshaler"]); - if (message[".gogoproto.unsafe_unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler")) - writer.uint32(/* id 64024, wireType 0 =*/512192).bool(message[".gogoproto.unsafe_unmarshaler"]); - if (message[".gogoproto.goproto_extensions_map"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map")) - writer.uint32(/* id 64025, wireType 0 =*/512200).bool(message[".gogoproto.goproto_extensions_map"]); - if (message[".gogoproto.goproto_unrecognized"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized")) - writer.uint32(/* id 64026, wireType 0 =*/512208).bool(message[".gogoproto.goproto_unrecognized"]); - if (message[".gogoproto.protosizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer")) - writer.uint32(/* id 64028, wireType 0 =*/512224).bool(message[".gogoproto.protosizer"]); - if (message[".gogoproto.compare"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare")) - writer.uint32(/* id 64029, wireType 0 =*/512232).bool(message[".gogoproto.compare"]); - if (message[".gogoproto.typedecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl")) - writer.uint32(/* id 64030, wireType 0 =*/512240).bool(message[".gogoproto.typedecl"]); - if (message[".gogoproto.messagename"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename")) - writer.uint32(/* id 64033, wireType 0 =*/512264).bool(message[".gogoproto.messagename"]); - if (message[".gogoproto.goproto_sizecache"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache")) - writer.uint32(/* id 64034, wireType 0 =*/512272).bool(message[".gogoproto.goproto_sizecache"]); - if (message[".gogoproto.goproto_unkeyed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed")) - writer.uint32(/* id 64035, wireType 0 =*/512280).bool(message[".gogoproto.goproto_unkeyed"]); - if (message[".gogoproto.stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer")) - writer.uint32(/* id 67008, wireType 0 =*/536064).bool(message[".gogoproto.stringer"]); - if (message[".cosmos_proto.interface_type"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.interface_type")) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.interface_type"]); - if (message[".cosmos_proto.implements_interface"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.implements_interface")) - writer.uint32(/* id 93002, wireType 2 =*/744018).string(message[".cosmos_proto.implements_interface"]); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 64001: - message[".gogoproto.goproto_getters"] = reader.bool(); - break; - case 64003: - message[".gogoproto.goproto_stringer"] = reader.bool(); - break; - case 64004: - message[".gogoproto.verbose_equal"] = reader.bool(); - break; - case 64005: - message[".gogoproto.face"] = reader.bool(); - break; - case 64006: - message[".gogoproto.gostring"] = reader.bool(); - break; - case 64007: - message[".gogoproto.populate"] = reader.bool(); - break; - case 67008: - message[".gogoproto.stringer"] = reader.bool(); - break; - case 64009: - message[".gogoproto.onlyone"] = reader.bool(); - break; - case 64013: - message[".gogoproto.equal"] = reader.bool(); - break; - case 64014: - message[".gogoproto.description"] = reader.bool(); - break; - case 64015: - message[".gogoproto.testgen"] = reader.bool(); - break; - case 64016: - message[".gogoproto.benchgen"] = reader.bool(); - break; - case 64017: - message[".gogoproto.marshaler"] = reader.bool(); - break; - case 64018: - message[".gogoproto.unmarshaler"] = reader.bool(); - break; - case 64019: - message[".gogoproto.stable_marshaler"] = reader.bool(); - break; - case 64020: - message[".gogoproto.sizer"] = reader.bool(); - break; - case 64023: - message[".gogoproto.unsafe_marshaler"] = reader.bool(); - break; - case 64024: - message[".gogoproto.unsafe_unmarshaler"] = reader.bool(); - break; - case 64025: - message[".gogoproto.goproto_extensions_map"] = reader.bool(); - break; - case 64026: - message[".gogoproto.goproto_unrecognized"] = reader.bool(); - break; - case 64028: - message[".gogoproto.protosizer"] = reader.bool(); - break; - case 64029: - message[".gogoproto.compare"] = reader.bool(); - break; - case 64030: - message[".gogoproto.typedecl"] = reader.bool(); - break; - case 64033: - message[".gogoproto.messagename"] = reader.bool(); - break; - case 64034: - message[".gogoproto.goproto_sizecache"] = reader.bool(); - break; - case 64035: - message[".gogoproto.goproto_unkeyed"] = reader.bool(); - break; - case 93001: - message[".cosmos_proto.interface_type"] = reader.string(); - break; - case 93002: - message[".cosmos_proto.implements_interface"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - if (typeof message.message_set_wire_format !== "boolean") - return "message_set_wire_format: boolean expected"; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - if (typeof message.no_standard_descriptor_accessor !== "boolean") - return "no_standard_descriptor_accessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - if (typeof message.map_entry !== "boolean") - return "map_entry: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - if (typeof message[".gogoproto.goproto_getters"] !== "boolean") - return ".gogoproto.goproto_getters: boolean expected"; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - if (typeof message[".gogoproto.goproto_stringer"] !== "boolean") - return ".gogoproto.goproto_stringer: boolean expected"; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - if (typeof message[".gogoproto.verbose_equal"] !== "boolean") - return ".gogoproto.verbose_equal: boolean expected"; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - if (typeof message[".gogoproto.face"] !== "boolean") - return ".gogoproto.face: boolean expected"; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - if (typeof message[".gogoproto.gostring"] !== "boolean") - return ".gogoproto.gostring: boolean expected"; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - if (typeof message[".gogoproto.populate"] !== "boolean") - return ".gogoproto.populate: boolean expected"; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - if (typeof message[".gogoproto.stringer"] !== "boolean") - return ".gogoproto.stringer: boolean expected"; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - if (typeof message[".gogoproto.onlyone"] !== "boolean") - return ".gogoproto.onlyone: boolean expected"; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - if (typeof message[".gogoproto.equal"] !== "boolean") - return ".gogoproto.equal: boolean expected"; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - if (typeof message[".gogoproto.description"] !== "boolean") - return ".gogoproto.description: boolean expected"; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - if (typeof message[".gogoproto.testgen"] !== "boolean") - return ".gogoproto.testgen: boolean expected"; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - if (typeof message[".gogoproto.benchgen"] !== "boolean") - return ".gogoproto.benchgen: boolean expected"; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - if (typeof message[".gogoproto.marshaler"] !== "boolean") - return ".gogoproto.marshaler: boolean expected"; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - if (typeof message[".gogoproto.unmarshaler"] !== "boolean") - return ".gogoproto.unmarshaler: boolean expected"; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - if (typeof message[".gogoproto.stable_marshaler"] !== "boolean") - return ".gogoproto.stable_marshaler: boolean expected"; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - if (typeof message[".gogoproto.sizer"] !== "boolean") - return ".gogoproto.sizer: boolean expected"; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - if (typeof message[".gogoproto.unsafe_marshaler"] !== "boolean") - return ".gogoproto.unsafe_marshaler: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - if (typeof message[".gogoproto.unsafe_unmarshaler"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler: boolean expected"; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - if (typeof message[".gogoproto.goproto_extensions_map"] !== "boolean") - return ".gogoproto.goproto_extensions_map: boolean expected"; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - if (typeof message[".gogoproto.goproto_unrecognized"] !== "boolean") - return ".gogoproto.goproto_unrecognized: boolean expected"; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - if (typeof message[".gogoproto.protosizer"] !== "boolean") - return ".gogoproto.protosizer: boolean expected"; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - if (typeof message[".gogoproto.compare"] !== "boolean") - return ".gogoproto.compare: boolean expected"; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - if (typeof message[".gogoproto.typedecl"] !== "boolean") - return ".gogoproto.typedecl: boolean expected"; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - if (typeof message[".gogoproto.messagename"] !== "boolean") - return ".gogoproto.messagename: boolean expected"; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - if (typeof message[".gogoproto.goproto_sizecache"] !== "boolean") - return ".gogoproto.goproto_sizecache: boolean expected"; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - if (typeof message[".gogoproto.goproto_unkeyed"] !== "boolean") - return ".gogoproto.goproto_unkeyed: boolean expected"; - if (message[".cosmos_proto.interface_type"] != null && message.hasOwnProperty(".cosmos_proto.interface_type")) - if (!$util.isString(message[".cosmos_proto.interface_type"])) - return ".cosmos_proto.interface_type: string expected"; - if (message[".cosmos_proto.implements_interface"] != null && message.hasOwnProperty(".cosmos_proto.implements_interface")) - if (!$util.isString(message[".cosmos_proto.implements_interface"])) - return ".cosmos_proto.implements_interface: string expected"; - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - let message = new $root.google.protobuf.MessageOptions(); - if (object.message_set_wire_format != null) - message.message_set_wire_format = Boolean(object.message_set_wire_format); - if (object.no_standard_descriptor_accessor != null) - message.no_standard_descriptor_accessor = Boolean(object.no_standard_descriptor_accessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.map_entry != null) - message.map_entry = Boolean(object.map_entry); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters"] != null) - message[".gogoproto.goproto_getters"] = Boolean(object[".gogoproto.goproto_getters"]); - if (object[".gogoproto.goproto_stringer"] != null) - message[".gogoproto.goproto_stringer"] = Boolean(object[".gogoproto.goproto_stringer"]); - if (object[".gogoproto.verbose_equal"] != null) - message[".gogoproto.verbose_equal"] = Boolean(object[".gogoproto.verbose_equal"]); - if (object[".gogoproto.face"] != null) - message[".gogoproto.face"] = Boolean(object[".gogoproto.face"]); - if (object[".gogoproto.gostring"] != null) - message[".gogoproto.gostring"] = Boolean(object[".gogoproto.gostring"]); - if (object[".gogoproto.populate"] != null) - message[".gogoproto.populate"] = Boolean(object[".gogoproto.populate"]); - if (object[".gogoproto.stringer"] != null) - message[".gogoproto.stringer"] = Boolean(object[".gogoproto.stringer"]); - if (object[".gogoproto.onlyone"] != null) - message[".gogoproto.onlyone"] = Boolean(object[".gogoproto.onlyone"]); - if (object[".gogoproto.equal"] != null) - message[".gogoproto.equal"] = Boolean(object[".gogoproto.equal"]); - if (object[".gogoproto.description"] != null) - message[".gogoproto.description"] = Boolean(object[".gogoproto.description"]); - if (object[".gogoproto.testgen"] != null) - message[".gogoproto.testgen"] = Boolean(object[".gogoproto.testgen"]); - if (object[".gogoproto.benchgen"] != null) - message[".gogoproto.benchgen"] = Boolean(object[".gogoproto.benchgen"]); - if (object[".gogoproto.marshaler"] != null) - message[".gogoproto.marshaler"] = Boolean(object[".gogoproto.marshaler"]); - if (object[".gogoproto.unmarshaler"] != null) - message[".gogoproto.unmarshaler"] = Boolean(object[".gogoproto.unmarshaler"]); - if (object[".gogoproto.stable_marshaler"] != null) - message[".gogoproto.stable_marshaler"] = Boolean(object[".gogoproto.stable_marshaler"]); - if (object[".gogoproto.sizer"] != null) - message[".gogoproto.sizer"] = Boolean(object[".gogoproto.sizer"]); - if (object[".gogoproto.unsafe_marshaler"] != null) - message[".gogoproto.unsafe_marshaler"] = Boolean(object[".gogoproto.unsafe_marshaler"]); - if (object[".gogoproto.unsafe_unmarshaler"] != null) - message[".gogoproto.unsafe_unmarshaler"] = Boolean(object[".gogoproto.unsafe_unmarshaler"]); - if (object[".gogoproto.goproto_extensions_map"] != null) - message[".gogoproto.goproto_extensions_map"] = Boolean(object[".gogoproto.goproto_extensions_map"]); - if (object[".gogoproto.goproto_unrecognized"] != null) - message[".gogoproto.goproto_unrecognized"] = Boolean(object[".gogoproto.goproto_unrecognized"]); - if (object[".gogoproto.protosizer"] != null) - message[".gogoproto.protosizer"] = Boolean(object[".gogoproto.protosizer"]); - if (object[".gogoproto.compare"] != null) - message[".gogoproto.compare"] = Boolean(object[".gogoproto.compare"]); - if (object[".gogoproto.typedecl"] != null) - message[".gogoproto.typedecl"] = Boolean(object[".gogoproto.typedecl"]); - if (object[".gogoproto.messagename"] != null) - message[".gogoproto.messagename"] = Boolean(object[".gogoproto.messagename"]); - if (object[".gogoproto.goproto_sizecache"] != null) - message[".gogoproto.goproto_sizecache"] = Boolean(object[".gogoproto.goproto_sizecache"]); - if (object[".gogoproto.goproto_unkeyed"] != null) - message[".gogoproto.goproto_unkeyed"] = Boolean(object[".gogoproto.goproto_unkeyed"]); - if (object[".cosmos_proto.interface_type"] != null) - message[".cosmos_proto.interface_type"] = String(object[".cosmos_proto.interface_type"]); - if (object[".cosmos_proto.implements_interface"] != null) - message[".cosmos_proto.implements_interface"] = String(object[".cosmos_proto.implements_interface"]); - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.message_set_wire_format = false; - object.no_standard_descriptor_accessor = false; - object.deprecated = false; - object.map_entry = false; - object[".gogoproto.goproto_getters"] = false; - object[".gogoproto.goproto_stringer"] = false; - object[".gogoproto.verbose_equal"] = false; - object[".gogoproto.face"] = false; - object[".gogoproto.gostring"] = false; - object[".gogoproto.populate"] = false; - object[".gogoproto.onlyone"] = false; - object[".gogoproto.equal"] = false; - object[".gogoproto.description"] = false; - object[".gogoproto.testgen"] = false; - object[".gogoproto.benchgen"] = false; - object[".gogoproto.marshaler"] = false; - object[".gogoproto.unmarshaler"] = false; - object[".gogoproto.stable_marshaler"] = false; - object[".gogoproto.sizer"] = false; - object[".gogoproto.unsafe_marshaler"] = false; - object[".gogoproto.unsafe_unmarshaler"] = false; - object[".gogoproto.goproto_extensions_map"] = false; - object[".gogoproto.goproto_unrecognized"] = false; - object[".gogoproto.protosizer"] = false; - object[".gogoproto.compare"] = false; - object[".gogoproto.typedecl"] = false; - object[".gogoproto.messagename"] = false; - object[".gogoproto.goproto_sizecache"] = false; - object[".gogoproto.goproto_unkeyed"] = false; - object[".gogoproto.stringer"] = false; - object[".cosmos_proto.interface_type"] = ""; - object[".cosmos_proto.implements_interface"] = ""; - } - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - object.message_set_wire_format = message.message_set_wire_format; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - object.no_standard_descriptor_accessor = message.no_standard_descriptor_accessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - object.map_entry = message.map_entry; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - object[".gogoproto.goproto_getters"] = message[".gogoproto.goproto_getters"]; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - object[".gogoproto.goproto_stringer"] = message[".gogoproto.goproto_stringer"]; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - object[".gogoproto.verbose_equal"] = message[".gogoproto.verbose_equal"]; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - object[".gogoproto.face"] = message[".gogoproto.face"]; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - object[".gogoproto.gostring"] = message[".gogoproto.gostring"]; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - object[".gogoproto.populate"] = message[".gogoproto.populate"]; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - object[".gogoproto.onlyone"] = message[".gogoproto.onlyone"]; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - object[".gogoproto.equal"] = message[".gogoproto.equal"]; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - object[".gogoproto.description"] = message[".gogoproto.description"]; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - object[".gogoproto.testgen"] = message[".gogoproto.testgen"]; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - object[".gogoproto.benchgen"] = message[".gogoproto.benchgen"]; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - object[".gogoproto.marshaler"] = message[".gogoproto.marshaler"]; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - object[".gogoproto.unmarshaler"] = message[".gogoproto.unmarshaler"]; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - object[".gogoproto.stable_marshaler"] = message[".gogoproto.stable_marshaler"]; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - object[".gogoproto.sizer"] = message[".gogoproto.sizer"]; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - object[".gogoproto.unsafe_marshaler"] = message[".gogoproto.unsafe_marshaler"]; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - object[".gogoproto.unsafe_unmarshaler"] = message[".gogoproto.unsafe_unmarshaler"]; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - object[".gogoproto.goproto_extensions_map"] = message[".gogoproto.goproto_extensions_map"]; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - object[".gogoproto.goproto_unrecognized"] = message[".gogoproto.goproto_unrecognized"]; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - object[".gogoproto.protosizer"] = message[".gogoproto.protosizer"]; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - object[".gogoproto.compare"] = message[".gogoproto.compare"]; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - object[".gogoproto.typedecl"] = message[".gogoproto.typedecl"]; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - object[".gogoproto.messagename"] = message[".gogoproto.messagename"]; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - object[".gogoproto.goproto_sizecache"] = message[".gogoproto.goproto_sizecache"]; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - object[".gogoproto.goproto_unkeyed"] = message[".gogoproto.goproto_unkeyed"]; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - object[".gogoproto.stringer"] = message[".gogoproto.stringer"]; - if (message[".cosmos_proto.interface_type"] != null && message.hasOwnProperty(".cosmos_proto.interface_type")) - object[".cosmos_proto.interface_type"] = message[".cosmos_proto.interface_type"]; - if (message[".cosmos_proto.implements_interface"] != null && message.hasOwnProperty(".cosmos_proto.implements_interface")) - object[".cosmos_proto.implements_interface"] = message[".cosmos_proto.implements_interface"]; - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpreted_option] FieldOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.nullable"] FieldOptions .gogoproto.nullable - * @property {boolean|null} [".gogoproto.embed"] FieldOptions .gogoproto.embed - * @property {string|null} [".gogoproto.customtype"] FieldOptions .gogoproto.customtype - * @property {string|null} [".gogoproto.customname"] FieldOptions .gogoproto.customname - * @property {string|null} [".gogoproto.jsontag"] FieldOptions .gogoproto.jsontag - * @property {string|null} [".gogoproto.moretags"] FieldOptions .gogoproto.moretags - * @property {string|null} [".gogoproto.casttype"] FieldOptions .gogoproto.casttype - * @property {string|null} [".gogoproto.castkey"] FieldOptions .gogoproto.castkey - * @property {string|null} [".gogoproto.castvalue"] FieldOptions .gogoproto.castvalue - * @property {boolean|null} [".gogoproto.stdtime"] FieldOptions .gogoproto.stdtime - * @property {boolean|null} [".gogoproto.stdduration"] FieldOptions .gogoproto.stdduration - * @property {boolean|null} [".gogoproto.wktpointer"] FieldOptions .gogoproto.wktpointer - * @property {string|null} [".gogoproto.castrepeated"] FieldOptions .gogoproto.castrepeated - * @property {string|null} [".cosmos_proto.accepts_interface"] FieldOptions .cosmos_proto.accepts_interface - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FieldOptions .gogoproto.nullable. - * @member {boolean} .gogoproto.nullable - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.nullable"] = false; - - /** - * FieldOptions .gogoproto.embed. - * @member {boolean} .gogoproto.embed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.embed"] = false; - - /** - * FieldOptions .gogoproto.customtype. - * @member {string} .gogoproto.customtype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customtype"] = ""; - - /** - * FieldOptions .gogoproto.customname. - * @member {string} .gogoproto.customname - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customname"] = ""; - - /** - * FieldOptions .gogoproto.jsontag. - * @member {string} .gogoproto.jsontag - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.jsontag"] = ""; - - /** - * FieldOptions .gogoproto.moretags. - * @member {string} .gogoproto.moretags - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.moretags"] = ""; - - /** - * FieldOptions .gogoproto.casttype. - * @member {string} .gogoproto.casttype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.casttype"] = ""; - - /** - * FieldOptions .gogoproto.castkey. - * @member {string} .gogoproto.castkey - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castkey"] = ""; - - /** - * FieldOptions .gogoproto.castvalue. - * @member {string} .gogoproto.castvalue - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castvalue"] = ""; - - /** - * FieldOptions .gogoproto.stdtime. - * @member {boolean} .gogoproto.stdtime - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdtime"] = false; - - /** - * FieldOptions .gogoproto.stdduration. - * @member {boolean} .gogoproto.stdduration - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdduration"] = false; - - /** - * FieldOptions .gogoproto.wktpointer. - * @member {boolean} .gogoproto.wktpointer - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.wktpointer"] = false; - - /** - * FieldOptions .gogoproto.castrepeated. - * @member {string} .gogoproto.castrepeated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castrepeated"] = ""; - - /** - * FieldOptions .cosmos_proto.accepts_interface. - * @member {string} .cosmos_proto.accepts_interface - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".cosmos_proto.accepts_interface"] = ""; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.nullable"] != null && Object.hasOwnProperty.call(message, ".gogoproto.nullable")) - writer.uint32(/* id 65001, wireType 0 =*/520008).bool(message[".gogoproto.nullable"]); - if (message[".gogoproto.embed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.embed")) - writer.uint32(/* id 65002, wireType 0 =*/520016).bool(message[".gogoproto.embed"]); - if (message[".gogoproto.customtype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customtype")) - writer.uint32(/* id 65003, wireType 2 =*/520026).string(message[".gogoproto.customtype"]); - if (message[".gogoproto.customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customname")) - writer.uint32(/* id 65004, wireType 2 =*/520034).string(message[".gogoproto.customname"]); - if (message[".gogoproto.jsontag"] != null && Object.hasOwnProperty.call(message, ".gogoproto.jsontag")) - writer.uint32(/* id 65005, wireType 2 =*/520042).string(message[".gogoproto.jsontag"]); - if (message[".gogoproto.moretags"] != null && Object.hasOwnProperty.call(message, ".gogoproto.moretags")) - writer.uint32(/* id 65006, wireType 2 =*/520050).string(message[".gogoproto.moretags"]); - if (message[".gogoproto.casttype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.casttype")) - writer.uint32(/* id 65007, wireType 2 =*/520058).string(message[".gogoproto.casttype"]); - if (message[".gogoproto.castkey"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castkey")) - writer.uint32(/* id 65008, wireType 2 =*/520066).string(message[".gogoproto.castkey"]); - if (message[".gogoproto.castvalue"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castvalue")) - writer.uint32(/* id 65009, wireType 2 =*/520074).string(message[".gogoproto.castvalue"]); - if (message[".gogoproto.stdtime"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdtime")) - writer.uint32(/* id 65010, wireType 0 =*/520080).bool(message[".gogoproto.stdtime"]); - if (message[".gogoproto.stdduration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdduration")) - writer.uint32(/* id 65011, wireType 0 =*/520088).bool(message[".gogoproto.stdduration"]); - if (message[".gogoproto.wktpointer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.wktpointer")) - writer.uint32(/* id 65012, wireType 0 =*/520096).bool(message[".gogoproto.wktpointer"]); - if (message[".gogoproto.castrepeated"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castrepeated")) - writer.uint32(/* id 65013, wireType 2 =*/520106).string(message[".gogoproto.castrepeated"]); - if (message[".cosmos_proto.accepts_interface"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.accepts_interface")) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.accepts_interface"]); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 65001: - message[".gogoproto.nullable"] = reader.bool(); - break; - case 65002: - message[".gogoproto.embed"] = reader.bool(); - break; - case 65003: - message[".gogoproto.customtype"] = reader.string(); - break; - case 65004: - message[".gogoproto.customname"] = reader.string(); - break; - case 65005: - message[".gogoproto.jsontag"] = reader.string(); - break; - case 65006: - message[".gogoproto.moretags"] = reader.string(); - break; - case 65007: - message[".gogoproto.casttype"] = reader.string(); - break; - case 65008: - message[".gogoproto.castkey"] = reader.string(); - break; - case 65009: - message[".gogoproto.castvalue"] = reader.string(); - break; - case 65010: - message[".gogoproto.stdtime"] = reader.bool(); - break; - case 65011: - message[".gogoproto.stdduration"] = reader.bool(); - break; - case 65012: - message[".gogoproto.wktpointer"] = reader.bool(); - break; - case 65013: - message[".gogoproto.castrepeated"] = reader.string(); - break; - case 93001: - message[".cosmos_proto.accepts_interface"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - if (typeof message[".gogoproto.nullable"] !== "boolean") - return ".gogoproto.nullable: boolean expected"; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - if (typeof message[".gogoproto.embed"] !== "boolean") - return ".gogoproto.embed: boolean expected"; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - if (!$util.isString(message[".gogoproto.customtype"])) - return ".gogoproto.customtype: string expected"; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - if (!$util.isString(message[".gogoproto.customname"])) - return ".gogoproto.customname: string expected"; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - if (!$util.isString(message[".gogoproto.jsontag"])) - return ".gogoproto.jsontag: string expected"; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - if (!$util.isString(message[".gogoproto.moretags"])) - return ".gogoproto.moretags: string expected"; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - if (!$util.isString(message[".gogoproto.casttype"])) - return ".gogoproto.casttype: string expected"; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - if (!$util.isString(message[".gogoproto.castkey"])) - return ".gogoproto.castkey: string expected"; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - if (!$util.isString(message[".gogoproto.castvalue"])) - return ".gogoproto.castvalue: string expected"; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - if (typeof message[".gogoproto.stdtime"] !== "boolean") - return ".gogoproto.stdtime: boolean expected"; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - if (typeof message[".gogoproto.stdduration"] !== "boolean") - return ".gogoproto.stdduration: boolean expected"; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - if (typeof message[".gogoproto.wktpointer"] !== "boolean") - return ".gogoproto.wktpointer: boolean expected"; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - if (!$util.isString(message[".gogoproto.castrepeated"])) - return ".gogoproto.castrepeated: string expected"; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - if (!$util.isString(message[".cosmos_proto.accepts_interface"])) - return ".cosmos_proto.accepts_interface: string expected"; - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - let message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.nullable"] != null) - message[".gogoproto.nullable"] = Boolean(object[".gogoproto.nullable"]); - if (object[".gogoproto.embed"] != null) - message[".gogoproto.embed"] = Boolean(object[".gogoproto.embed"]); - if (object[".gogoproto.customtype"] != null) - message[".gogoproto.customtype"] = String(object[".gogoproto.customtype"]); - if (object[".gogoproto.customname"] != null) - message[".gogoproto.customname"] = String(object[".gogoproto.customname"]); - if (object[".gogoproto.jsontag"] != null) - message[".gogoproto.jsontag"] = String(object[".gogoproto.jsontag"]); - if (object[".gogoproto.moretags"] != null) - message[".gogoproto.moretags"] = String(object[".gogoproto.moretags"]); - if (object[".gogoproto.casttype"] != null) - message[".gogoproto.casttype"] = String(object[".gogoproto.casttype"]); - if (object[".gogoproto.castkey"] != null) - message[".gogoproto.castkey"] = String(object[".gogoproto.castkey"]); - if (object[".gogoproto.castvalue"] != null) - message[".gogoproto.castvalue"] = String(object[".gogoproto.castvalue"]); - if (object[".gogoproto.stdtime"] != null) - message[".gogoproto.stdtime"] = Boolean(object[".gogoproto.stdtime"]); - if (object[".gogoproto.stdduration"] != null) - message[".gogoproto.stdduration"] = Boolean(object[".gogoproto.stdduration"]); - if (object[".gogoproto.wktpointer"] != null) - message[".gogoproto.wktpointer"] = Boolean(object[".gogoproto.wktpointer"]); - if (object[".gogoproto.castrepeated"] != null) - message[".gogoproto.castrepeated"] = String(object[".gogoproto.castrepeated"]); - if (object[".cosmos_proto.accepts_interface"] != null) - message[".cosmos_proto.accepts_interface"] = String(object[".cosmos_proto.accepts_interface"]); - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object[".gogoproto.nullable"] = false; - object[".gogoproto.embed"] = false; - object[".gogoproto.customtype"] = ""; - object[".gogoproto.customname"] = ""; - object[".gogoproto.jsontag"] = ""; - object[".gogoproto.moretags"] = ""; - object[".gogoproto.casttype"] = ""; - object[".gogoproto.castkey"] = ""; - object[".gogoproto.castvalue"] = ""; - object[".gogoproto.stdtime"] = false; - object[".gogoproto.stdduration"] = false; - object[".gogoproto.wktpointer"] = false; - object[".gogoproto.castrepeated"] = ""; - object[".cosmos_proto.accepts_interface"] = ""; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - object[".gogoproto.nullable"] = message[".gogoproto.nullable"]; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - object[".gogoproto.embed"] = message[".gogoproto.embed"]; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - object[".gogoproto.customtype"] = message[".gogoproto.customtype"]; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - object[".gogoproto.customname"] = message[".gogoproto.customname"]; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - object[".gogoproto.jsontag"] = message[".gogoproto.jsontag"]; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - object[".gogoproto.moretags"] = message[".gogoproto.moretags"]; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - object[".gogoproto.casttype"] = message[".gogoproto.casttype"]; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - object[".gogoproto.castkey"] = message[".gogoproto.castkey"]; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - object[".gogoproto.castvalue"] = message[".gogoproto.castvalue"]; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - object[".gogoproto.stdtime"] = message[".gogoproto.stdtime"]; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - object[".gogoproto.stdduration"] = message[".gogoproto.stdduration"]; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - object[".gogoproto.wktpointer"] = message[".gogoproto.wktpointer"]; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - object[".gogoproto.castrepeated"] = message[".gogoproto.castrepeated"]; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - object[".cosmos_proto.accepts_interface"] = message[".cosmos_proto.accepts_interface"]; - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpreted_option] OneofOptions uninterpreted_option - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - let message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allow_alias] EnumOptions allow_alias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_enum_prefix"] EnumOptions .gogoproto.goproto_enum_prefix - * @property {boolean|null} [".gogoproto.goproto_enum_stringer"] EnumOptions .gogoproto.goproto_enum_stringer - * @property {boolean|null} [".gogoproto.enum_stringer"] EnumOptions .gogoproto.enum_stringer - * @property {string|null} [".gogoproto.enum_customname"] EnumOptions .gogoproto.enum_customname - * @property {boolean|null} [".gogoproto.enumdecl"] EnumOptions .gogoproto.enumdecl - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allow_alias. - * @member {boolean} allow_alias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allow_alias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumOptions .gogoproto.goproto_enum_prefix. - * @member {boolean} .gogoproto.goproto_enum_prefix - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_prefix"] = false; - - /** - * EnumOptions .gogoproto.goproto_enum_stringer. - * @member {boolean} .gogoproto.goproto_enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_stringer. - * @member {boolean} .gogoproto.enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_customname. - * @member {string} .gogoproto.enum_customname - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_customname"] = ""; - - /** - * EnumOptions .gogoproto.enumdecl. - * @member {boolean} .gogoproto.enumdecl - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enumdecl"] = false; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allow_alias != null && Object.hasOwnProperty.call(message, "allow_alias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allow_alias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_enum_prefix"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix")) - writer.uint32(/* id 62001, wireType 0 =*/496008).bool(message[".gogoproto.goproto_enum_prefix"]); - if (message[".gogoproto.goproto_enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer")) - writer.uint32(/* id 62021, wireType 0 =*/496168).bool(message[".gogoproto.goproto_enum_stringer"]); - if (message[".gogoproto.enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer")) - writer.uint32(/* id 62022, wireType 0 =*/496176).bool(message[".gogoproto.enum_stringer"]); - if (message[".gogoproto.enum_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_customname")) - writer.uint32(/* id 62023, wireType 2 =*/496186).string(message[".gogoproto.enum_customname"]); - if (message[".gogoproto.enumdecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl")) - writer.uint32(/* id 62024, wireType 0 =*/496192).bool(message[".gogoproto.enumdecl"]); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 62001: - message[".gogoproto.goproto_enum_prefix"] = reader.bool(); - break; - case 62021: - message[".gogoproto.goproto_enum_stringer"] = reader.bool(); - break; - case 62022: - message[".gogoproto.enum_stringer"] = reader.bool(); - break; - case 62023: - message[".gogoproto.enum_customname"] = reader.string(); - break; - case 62024: - message[".gogoproto.enumdecl"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - if (typeof message.allow_alias !== "boolean") - return "allow_alias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - if (typeof message[".gogoproto.goproto_enum_prefix"] !== "boolean") - return ".gogoproto.goproto_enum_prefix: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - if (typeof message[".gogoproto.goproto_enum_stringer"] !== "boolean") - return ".gogoproto.goproto_enum_stringer: boolean expected"; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - if (typeof message[".gogoproto.enum_stringer"] !== "boolean") - return ".gogoproto.enum_stringer: boolean expected"; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - if (!$util.isString(message[".gogoproto.enum_customname"])) - return ".gogoproto.enum_customname: string expected"; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - if (typeof message[".gogoproto.enumdecl"] !== "boolean") - return ".gogoproto.enumdecl: boolean expected"; - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - let message = new $root.google.protobuf.EnumOptions(); - if (object.allow_alias != null) - message.allow_alias = Boolean(object.allow_alias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_enum_prefix"] != null) - message[".gogoproto.goproto_enum_prefix"] = Boolean(object[".gogoproto.goproto_enum_prefix"]); - if (object[".gogoproto.goproto_enum_stringer"] != null) - message[".gogoproto.goproto_enum_stringer"] = Boolean(object[".gogoproto.goproto_enum_stringer"]); - if (object[".gogoproto.enum_stringer"] != null) - message[".gogoproto.enum_stringer"] = Boolean(object[".gogoproto.enum_stringer"]); - if (object[".gogoproto.enum_customname"] != null) - message[".gogoproto.enum_customname"] = String(object[".gogoproto.enum_customname"]); - if (object[".gogoproto.enumdecl"] != null) - message[".gogoproto.enumdecl"] = Boolean(object[".gogoproto.enumdecl"]); - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.allow_alias = false; - object.deprecated = false; - object[".gogoproto.goproto_enum_prefix"] = false; - object[".gogoproto.goproto_enum_stringer"] = false; - object[".gogoproto.enum_stringer"] = false; - object[".gogoproto.enum_customname"] = ""; - object[".gogoproto.enumdecl"] = false; - } - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - object.allow_alias = message.allow_alias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - object[".gogoproto.goproto_enum_prefix"] = message[".gogoproto.goproto_enum_prefix"]; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - object[".gogoproto.goproto_enum_stringer"] = message[".gogoproto.goproto_enum_stringer"]; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - object[".gogoproto.enum_stringer"] = message[".gogoproto.enum_stringer"]; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - object[".gogoproto.enum_customname"] = message[".gogoproto.enum_customname"]; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - object[".gogoproto.enumdecl"] = message[".gogoproto.enumdecl"]; - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumValueOptions uninterpreted_option - * @property {string|null} [".gogoproto.enumvalue_customname"] EnumValueOptions .gogoproto.enumvalue_customname - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumValueOptions .gogoproto.enumvalue_customname. - * @member {string} .gogoproto.enumvalue_customname - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype[".gogoproto.enumvalue_customname"] = ""; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.enumvalue_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumvalue_customname")) - writer.uint32(/* id 66001, wireType 2 =*/528010).string(message[".gogoproto.enumvalue_customname"]); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 66001: - message[".gogoproto.enumvalue_customname"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - if (!$util.isString(message[".gogoproto.enumvalue_customname"])) - return ".gogoproto.enumvalue_customname: string expected"; - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - let message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.enumvalue_customname"] != null) - message[".gogoproto.enumvalue_customname"] = String(object[".gogoproto.enumvalue_customname"]); - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".gogoproto.enumvalue_customname"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - object[".gogoproto.enumvalue_customname"] = message[".gogoproto.enumvalue_customname"]; - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpreted_option] ServiceOptions uninterpreted_option - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - let message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {Array.|null} [uninterpreted_option] MethodOptions uninterpreted_option - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (let i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (let i = 0; i < message.uninterpreted_option.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - let error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - let message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (let i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (let j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifier_value] UninterpretedOption identifier_value - * @property {Long|null} [positive_int_value] UninterpretedOption positive_int_value - * @property {Long|null} [negative_int_value] UninterpretedOption negative_int_value - * @property {number|null} [double_value] UninterpretedOption double_value - * @property {Uint8Array|null} [string_value] UninterpretedOption string_value - * @property {string|null} [aggregate_value] UninterpretedOption aggregate_value - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifier_value. - * @member {string} identifier_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifier_value = ""; - - /** - * UninterpretedOption positive_int_value. - * @member {Long} positive_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positive_int_value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negative_int_value. - * @member {Long} negative_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negative_int_value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption double_value. - * @member {number} double_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.double_value = 0; - - /** - * UninterpretedOption string_value. - * @member {Uint8Array} string_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.string_value = $util.newBuffer([]); - - /** - * UninterpretedOption aggregate_value. - * @member {string} aggregate_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregate_value = ""; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (let i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifier_value != null && Object.hasOwnProperty.call(message, "identifier_value")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifier_value); - if (message.positive_int_value != null && Object.hasOwnProperty.call(message, "positive_int_value")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positive_int_value); - if (message.negative_int_value != null && Object.hasOwnProperty.call(message, "negative_int_value")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negative_int_value); - if (message.double_value != null && Object.hasOwnProperty.call(message, "double_value")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.double_value); - if (message.string_value != null && Object.hasOwnProperty.call(message, "string_value")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.string_value); - if (message.aggregate_value != null && Object.hasOwnProperty.call(message, "aggregate_value")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregate_value); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = reader.uint64(); - break; - case 5: - message.negative_int_value = reader.int64(); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (let i = 0; i < message.name.length; ++i) { - let error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - if (!$util.isString(message.identifier_value)) - return "identifier_value: string expected"; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (!$util.isInteger(message.positive_int_value) && !(message.positive_int_value && $util.isInteger(message.positive_int_value.low) && $util.isInteger(message.positive_int_value.high))) - return "positive_int_value: integer|Long expected"; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (!$util.isInteger(message.negative_int_value) && !(message.negative_int_value && $util.isInteger(message.negative_int_value.low) && $util.isInteger(message.negative_int_value.high))) - return "negative_int_value: integer|Long expected"; - if (message.double_value != null && message.hasOwnProperty("double_value")) - if (typeof message.double_value !== "number") - return "double_value: number expected"; - if (message.string_value != null && message.hasOwnProperty("string_value")) - if (!(message.string_value && typeof message.string_value.length === "number" || $util.isString(message.string_value))) - return "string_value: buffer expected"; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - if (!$util.isString(message.aggregate_value)) - return "aggregate_value: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - let message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (let i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifier_value != null) - message.identifier_value = String(object.identifier_value); - if (object.positive_int_value != null) - if ($util.Long) - (message.positive_int_value = $util.Long.fromValue(object.positive_int_value)).unsigned = true; - else if (typeof object.positive_int_value === "string") - message.positive_int_value = parseInt(object.positive_int_value, 10); - else if (typeof object.positive_int_value === "number") - message.positive_int_value = object.positive_int_value; - else if (typeof object.positive_int_value === "object") - message.positive_int_value = new $util.LongBits(object.positive_int_value.low >>> 0, object.positive_int_value.high >>> 0).toNumber(true); - if (object.negative_int_value != null) - if ($util.Long) - (message.negative_int_value = $util.Long.fromValue(object.negative_int_value)).unsigned = false; - else if (typeof object.negative_int_value === "string") - message.negative_int_value = parseInt(object.negative_int_value, 10); - else if (typeof object.negative_int_value === "number") - message.negative_int_value = object.negative_int_value; - else if (typeof object.negative_int_value === "object") - message.negative_int_value = new $util.LongBits(object.negative_int_value.low >>> 0, object.negative_int_value.high >>> 0).toNumber(); - if (object.double_value != null) - message.double_value = Number(object.double_value); - if (object.string_value != null) - if (typeof object.string_value === "string") - $util.base64.decode(object.string_value, message.string_value = $util.newBuffer($util.base64.length(object.string_value)), 0); - else if (object.string_value.length) - message.string_value = object.string_value; - if (object.aggregate_value != null) - message.aggregate_value = String(object.aggregate_value); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifier_value = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.positive_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positive_int_value = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.negative_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negative_int_value = options.longs === String ? "0" : 0; - object.double_value = 0; - if (options.bytes === String) - object.string_value = ""; - else { - object.string_value = []; - if (options.bytes !== Array) - object.string_value = $util.newBuffer(object.string_value); - } - object.aggregate_value = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (let j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - object.identifier_value = message.identifier_value; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (typeof message.positive_int_value === "number") - object.positive_int_value = options.longs === String ? String(message.positive_int_value) : message.positive_int_value; - else - object.positive_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.positive_int_value) : options.longs === Number ? new $util.LongBits(message.positive_int_value.low >>> 0, message.positive_int_value.high >>> 0).toNumber(true) : message.positive_int_value; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (typeof message.negative_int_value === "number") - object.negative_int_value = options.longs === String ? String(message.negative_int_value) : message.negative_int_value; - else - object.negative_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.negative_int_value) : options.longs === Number ? new $util.LongBits(message.negative_int_value.low >>> 0, message.negative_int_value.high >>> 0).toNumber() : message.negative_int_value; - if (message.double_value != null && message.hasOwnProperty("double_value")) - object.double_value = options.json && !isFinite(message.double_value) ? String(message.double_value) : message.double_value; - if (message.string_value != null && message.hasOwnProperty("string_value")) - object.string_value = options.bytes === String ? $util.base64.encode(message.string_value, 0, message.string_value.length) : options.bytes === Array ? Array.prototype.slice.call(message.string_value) : message.string_value; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - object.aggregate_value = message.aggregate_value; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} name_part NamePart name_part - * @property {boolean} is_extension NamePart is_extension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart name_part. - * @member {string} name_part - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.name_part = ""; - - /** - * NamePart is_extension. - * @member {boolean} is_extension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.is_extension = false; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name_part); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_extension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("name_part")) - throw $util.ProtocolError("missing required 'name_part'", { instance: message }); - if (!message.hasOwnProperty("is_extension")) - throw $util.ProtocolError("missing required 'is_extension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.name_part)) - return "name_part: string expected"; - if (typeof message.is_extension !== "boolean") - return "is_extension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - let message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.name_part != null) - message.name_part = String(object.name_part); - if (object.is_extension != null) - message.is_extension = Boolean(object.is_extension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.name_part = ""; - object.is_extension = false; - } - if (message.name_part != null && message.hasOwnProperty("name_part")) - object.name_part = message.name_part; - if (message.is_extension != null && message.hasOwnProperty("is_extension")) - object.is_extension = message.is_extension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (let i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (let i = 0; i < message.location.length; ++i) { - let error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - let message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (let i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (let j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leading_comments] Location leading_comments - * @property {string|null} [trailing_comments] Location trailing_comments - * @property {Array.|null} [leading_detached_comments] Location leading_detached_comments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leading_detached_comments = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leading_comments. - * @member {string} leading_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_comments = ""; - - /** - * Location trailing_comments. - * @member {string} trailing_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailing_comments = ""; - - /** - * Location leading_detached_comments. - * @member {Array.} leading_detached_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_detached_comments = $util.emptyArray; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (let i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (let i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leading_comments != null && Object.hasOwnProperty.call(message, "leading_comments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leading_comments); - if (message.trailing_comments != null && Object.hasOwnProperty.call(message, "trailing_comments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailing_comments); - if (message.leading_detached_comments != null && message.leading_detached_comments.length) - for (let i = 0; i < message.leading_detached_comments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leading_detached_comments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - if (!(message.leading_detached_comments && message.leading_detached_comments.length)) - message.leading_detached_comments = []; - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (let i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (let i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - if (!$util.isString(message.leading_comments)) - return "leading_comments: string expected"; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - if (!$util.isString(message.trailing_comments)) - return "trailing_comments: string expected"; - if (message.leading_detached_comments != null && message.hasOwnProperty("leading_detached_comments")) { - if (!Array.isArray(message.leading_detached_comments)) - return "leading_detached_comments: array expected"; - for (let i = 0; i < message.leading_detached_comments.length; ++i) - if (!$util.isString(message.leading_detached_comments[i])) - return "leading_detached_comments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - let message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (let i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (let i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leading_comments != null) - message.leading_comments = String(object.leading_comments); - if (object.trailing_comments != null) - message.trailing_comments = String(object.trailing_comments); - if (object.leading_detached_comments) { - if (!Array.isArray(object.leading_detached_comments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leading_detached_comments: array expected"); - message.leading_detached_comments = []; - for (let i = 0; i < object.leading_detached_comments.length; ++i) - message.leading_detached_comments[i] = String(object.leading_detached_comments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leading_detached_comments = []; - } - if (options.defaults) { - object.leading_comments = ""; - object.trailing_comments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (let j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (let j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - object.leading_comments = message.leading_comments; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - object.trailing_comments = message.trailing_comments; - if (message.leading_detached_comments && message.leading_detached_comments.length) { - object.leading_detached_comments = []; - for (let j = 0; j < message.leading_detached_comments.length; ++j) - object.leading_detached_comments[j] = message.leading_detached_comments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (let i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (let i = 0; i < message.annotation.length; ++i) { - let error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - let message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (let i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (let j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [source_file] Annotation source_file - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation source_file. - * @member {string} source_file - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.source_file = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (let i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.source_file != null && Object.hasOwnProperty.call(message, "source_file")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_file); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.source_file = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (let i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - if (!$util.isString(message.source_file)) - return "source_file: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - let message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (let i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.source_file != null) - message.source_file = String(object.source_file); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.source_file = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (let j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - object.source_file = message.source_file; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - let message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Any; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - let message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Timestamp; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - let message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Duration; - })(); - - return protobuf; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - const api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fully_decode_reserved_expansion] Http fully_decode_reserved_expansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fully_decode_reserved_expansion. - * @member {boolean} fully_decode_reserved_expansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fully_decode_reserved_expansion = false; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (let i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fully_decode_reserved_expansion != null && Object.hasOwnProperty.call(message, "fully_decode_reserved_expansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fully_decode_reserved_expansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (let i = 0; i < message.rules.length; ++i) { - let error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - if (typeof message.fully_decode_reserved_expansion !== "boolean") - return "fully_decode_reserved_expansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - let message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (let i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fully_decode_reserved_expansion != null) - message.fully_decode_reserved_expansion = Boolean(object.fully_decode_reserved_expansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fully_decode_reserved_expansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (let j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - object.fully_decode_reserved_expansion = message.fully_decode_reserved_expansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [response_body] HttpRule response_body - * @property {Array.|null} [additional_bindings] HttpRule additional_bindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additional_bindings = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule response_body. - * @member {string} response_body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.response_body = ""; - - /** - * HttpRule additional_bindings. - * @member {Array.} additional_bindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additional_bindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - let $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additional_bindings != null && message.additional_bindings.length) - for (let i = 0; i < message.additional_bindings.length; ++i) - $root.google.api.HttpRule.encode(message.additional_bindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.response_body != null && Object.hasOwnProperty.call(message, "response_body")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.response_body); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.response_body = reader.string(); - break; - case 11: - if (!(message.additional_bindings && message.additional_bindings.length)) - message.additional_bindings = []; - message.additional_bindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - let error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.response_body != null && message.hasOwnProperty("response_body")) - if (!$util.isString(message.response_body)) - return "response_body: string expected"; - if (message.additional_bindings != null && message.hasOwnProperty("additional_bindings")) { - if (!Array.isArray(message.additional_bindings)) - return "additional_bindings: array expected"; - for (let i = 0; i < message.additional_bindings.length; ++i) { - let error = $root.google.api.HttpRule.verify(message.additional_bindings[i]); - if (error) - return "additional_bindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - let message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.response_body != null) - message.response_body = String(object.response_body); - if (object.additional_bindings) { - if (!Array.isArray(object.additional_bindings)) - throw TypeError(".google.api.HttpRule.additional_bindings: array expected"); - message.additional_bindings = []; - for (let i = 0; i < object.additional_bindings.length; ++i) { - if (typeof object.additional_bindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additional_bindings: object expected"); - message.additional_bindings[i] = $root.google.api.HttpRule.fromObject(object.additional_bindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.additional_bindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.response_body = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additional_bindings && message.additional_bindings.length) { - object.additional_bindings = []; - for (let j = 0; j < message.additional_bindings.length; ++j) - object.additional_bindings[j] = $root.google.api.HttpRule.toObject(message.additional_bindings[j], options); - } - if (message.response_body != null && message.hasOwnProperty("response_body")) - object.response_body = message.response_body; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - let message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CustomHttpPattern; - })(); - - return api; - })(); - - return google; -})(); - -export const ibc = $root.ibc = (() => { - - /** - * Namespace ibc. - * @exports ibc - * @namespace - */ - const ibc = {}; - - ibc.applications = (function() { - - /** - * Namespace applications. - * @memberof ibc - * @namespace - */ - const applications = {}; - - applications.fee = (function() { - - /** - * Namespace fee. - * @memberof ibc.applications - * @namespace - */ - const fee = {}; - - fee.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.fee - * @namespace - */ - const v1 = {}; - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#registerPayee}. - * @memberof ibc.applications.fee.v1.Msg - * @typedef RegisterPayeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.MsgRegisterPayeeResponse} [response] MsgRegisterPayeeResponse - */ - - /** - * Calls RegisterPayee. - * @function registerPayee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgRegisterPayee} request MsgRegisterPayee message or plain object - * @param {ibc.applications.fee.v1.Msg.RegisterPayeeCallback} callback Node-style callback called with the error, if any, and MsgRegisterPayeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.registerPayee = function registerPayee(request, callback) { - return this.rpcCall(registerPayee, $root.ibc.applications.fee.v1.MsgRegisterPayee, $root.ibc.applications.fee.v1.MsgRegisterPayeeResponse, request, callback); - }, "name", { value: "RegisterPayee" }); - - /** - * Calls RegisterPayee. - * @function registerPayee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgRegisterPayee} request MsgRegisterPayee message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#registerCounterpartyPayee}. - * @memberof ibc.applications.fee.v1.Msg - * @typedef RegisterCounterpartyPayeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} [response] MsgRegisterCounterpartyPayeeResponse - */ - - /** - * Calls RegisterCounterpartyPayee. - * @function registerCounterpartyPayee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee} request MsgRegisterCounterpartyPayee message or plain object - * @param {ibc.applications.fee.v1.Msg.RegisterCounterpartyPayeeCallback} callback Node-style callback called with the error, if any, and MsgRegisterCounterpartyPayeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.registerCounterpartyPayee = function registerCounterpartyPayee(request, callback) { - return this.rpcCall(registerCounterpartyPayee, $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayee, $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse, request, callback); - }, "name", { value: "RegisterCounterpartyPayee" }); - - /** - * Calls RegisterCounterpartyPayee. - * @function registerCounterpartyPayee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee} request MsgRegisterCounterpartyPayee message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#payPacketFee}. - * @memberof ibc.applications.fee.v1.Msg - * @typedef PayPacketFeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.MsgPayPacketFeeResponse} [response] MsgPayPacketFeeResponse - */ - - /** - * Calls PayPacketFee. - * @function payPacketFee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgPayPacketFee} request MsgPayPacketFee message or plain object - * @param {ibc.applications.fee.v1.Msg.PayPacketFeeCallback} callback Node-style callback called with the error, if any, and MsgPayPacketFeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.payPacketFee = function payPacketFee(request, callback) { - return this.rpcCall(payPacketFee, $root.ibc.applications.fee.v1.MsgPayPacketFee, $root.ibc.applications.fee.v1.MsgPayPacketFeeResponse, request, callback); - }, "name", { value: "PayPacketFee" }); - - /** - * Calls PayPacketFee. - * @function payPacketFee - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgPayPacketFee} request MsgPayPacketFee message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Msg#payPacketFeeAsync}. - * @memberof ibc.applications.fee.v1.Msg - * @typedef PayPacketFeeAsyncCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} [response] MsgPayPacketFeeAsyncResponse - */ - - /** - * Calls PayPacketFeeAsync. - * @function payPacketFeeAsync - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync} request MsgPayPacketFeeAsync message or plain object - * @param {ibc.applications.fee.v1.Msg.PayPacketFeeAsyncCallback} callback Node-style callback called with the error, if any, and MsgPayPacketFeeAsyncResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.payPacketFeeAsync = function payPacketFeeAsync(request, callback) { - return this.rpcCall(payPacketFeeAsync, $root.ibc.applications.fee.v1.MsgPayPacketFeeAsync, $root.ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse, request, callback); - }, "name", { value: "PayPacketFeeAsync" }); - - /** - * Calls PayPacketFeeAsync. - * @function payPacketFeeAsync - * @memberof ibc.applications.fee.v1.Msg - * @instance - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync} request MsgPayPacketFeeAsync message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1.MsgRegisterPayee = (function() { - - /** - * Properties of a MsgRegisterPayee. - * @memberof ibc.applications.fee.v1 - * @interface IMsgRegisterPayee - * @property {string|null} [port_id] MsgRegisterPayee port_id - * @property {string|null} [channel_id] MsgRegisterPayee channel_id - * @property {string|null} [relayer] MsgRegisterPayee relayer - * @property {string|null} [payee] MsgRegisterPayee payee - */ - - /** - * Constructs a new MsgRegisterPayee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgRegisterPayee. - * @implements IMsgRegisterPayee - * @constructor - * @param {ibc.applications.fee.v1.IMsgRegisterPayee=} [properties] Properties to set - */ - function MsgRegisterPayee(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRegisterPayee port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - */ - MsgRegisterPayee.prototype.port_id = ""; - - /** - * MsgRegisterPayee channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - */ - MsgRegisterPayee.prototype.channel_id = ""; - - /** - * MsgRegisterPayee relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - */ - MsgRegisterPayee.prototype.relayer = ""; - - /** - * MsgRegisterPayee payee. - * @member {string} payee - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - */ - MsgRegisterPayee.prototype.payee = ""; - - /** - * Encodes the specified MsgRegisterPayee message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterPayee} message MsgRegisterPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterPayee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relayer); - if (message.payee != null && Object.hasOwnProperty.call(message, "payee")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.payee); - return writer; - }; - - /** - * Encodes the specified MsgRegisterPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterPayee} message MsgRegisterPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterPayee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterPayee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgRegisterPayee} MsgRegisterPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterPayee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgRegisterPayee(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.relayer = reader.string(); - break; - case 4: - message.payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterPayee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgRegisterPayee} MsgRegisterPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterPayee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterPayee message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterPayee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - if (message.payee != null && message.hasOwnProperty("payee")) - if (!$util.isString(message.payee)) - return "payee: string expected"; - return null; - }; - - /** - * Creates a MsgRegisterPayee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgRegisterPayee} MsgRegisterPayee - */ - MsgRegisterPayee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgRegisterPayee) - return object; - let message = new $root.ibc.applications.fee.v1.MsgRegisterPayee(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - if (object.payee != null) - message.payee = String(object.payee); - return message; - }; - - /** - * Creates a plain object from a MsgRegisterPayee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @static - * @param {ibc.applications.fee.v1.MsgRegisterPayee} message MsgRegisterPayee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterPayee.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.relayer = ""; - object.payee = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - if (message.payee != null && message.hasOwnProperty("payee")) - object.payee = message.payee; - return object; - }; - - /** - * Converts this MsgRegisterPayee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgRegisterPayee - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterPayee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterPayee; - })(); - - v1.MsgRegisterPayeeResponse = (function() { - - /** - * Properties of a MsgRegisterPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IMsgRegisterPayeeResponse - */ - - /** - * Constructs a new MsgRegisterPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgRegisterPayeeResponse. - * @implements IMsgRegisterPayeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IMsgRegisterPayeeResponse=} [properties] Properties to set - */ - function MsgRegisterPayeeResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgRegisterPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterPayeeResponse} message MsgRegisterPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterPayeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgRegisterPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterPayeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterPayeeResponse} message MsgRegisterPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterPayeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterPayeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgRegisterPayeeResponse} MsgRegisterPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterPayeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgRegisterPayeeResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterPayeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgRegisterPayeeResponse} MsgRegisterPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterPayeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterPayeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterPayeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgRegisterPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgRegisterPayeeResponse} MsgRegisterPayeeResponse - */ - MsgRegisterPayeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgRegisterPayeeResponse) - return object; - return new $root.ibc.applications.fee.v1.MsgRegisterPayeeResponse(); - }; - - /** - * Creates a plain object from a MsgRegisterPayeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @static - * @param {ibc.applications.fee.v1.MsgRegisterPayeeResponse} message MsgRegisterPayeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterPayeeResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgRegisterPayeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgRegisterPayeeResponse - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterPayeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterPayeeResponse; - })(); - - v1.MsgRegisterCounterpartyPayee = (function() { - - /** - * Properties of a MsgRegisterCounterpartyPayee. - * @memberof ibc.applications.fee.v1 - * @interface IMsgRegisterCounterpartyPayee - * @property {string|null} [port_id] MsgRegisterCounterpartyPayee port_id - * @property {string|null} [channel_id] MsgRegisterCounterpartyPayee channel_id - * @property {string|null} [relayer] MsgRegisterCounterpartyPayee relayer - * @property {string|null} [counterparty_payee] MsgRegisterCounterpartyPayee counterparty_payee - */ - - /** - * Constructs a new MsgRegisterCounterpartyPayee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgRegisterCounterpartyPayee. - * @implements IMsgRegisterCounterpartyPayee - * @constructor - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee=} [properties] Properties to set - */ - function MsgRegisterCounterpartyPayee(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRegisterCounterpartyPayee port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - */ - MsgRegisterCounterpartyPayee.prototype.port_id = ""; - - /** - * MsgRegisterCounterpartyPayee channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - */ - MsgRegisterCounterpartyPayee.prototype.channel_id = ""; - - /** - * MsgRegisterCounterpartyPayee relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - */ - MsgRegisterCounterpartyPayee.prototype.relayer = ""; - - /** - * MsgRegisterCounterpartyPayee counterparty_payee. - * @member {string} counterparty_payee - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - */ - MsgRegisterCounterpartyPayee.prototype.counterparty_payee = ""; - - /** - * Encodes the specified MsgRegisterCounterpartyPayee message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee} message MsgRegisterCounterpartyPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterCounterpartyPayee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relayer); - if (message.counterparty_payee != null && Object.hasOwnProperty.call(message, "counterparty_payee")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.counterparty_payee); - return writer; - }; - - /** - * Encodes the specified MsgRegisterCounterpartyPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayee} message MsgRegisterCounterpartyPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterCounterpartyPayee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterCounterpartyPayee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayee} MsgRegisterCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterCounterpartyPayee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayee(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.relayer = reader.string(); - break; - case 4: - message.counterparty_payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterCounterpartyPayee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayee} MsgRegisterCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterCounterpartyPayee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterCounterpartyPayee message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterCounterpartyPayee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - if (!$util.isString(message.counterparty_payee)) - return "counterparty_payee: string expected"; - return null; - }; - - /** - * Creates a MsgRegisterCounterpartyPayee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayee} MsgRegisterCounterpartyPayee - */ - MsgRegisterCounterpartyPayee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayee) - return object; - let message = new $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayee(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - if (object.counterparty_payee != null) - message.counterparty_payee = String(object.counterparty_payee); - return message; - }; - - /** - * Creates a plain object from a MsgRegisterCounterpartyPayee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.MsgRegisterCounterpartyPayee} message MsgRegisterCounterpartyPayee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterCounterpartyPayee.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.relayer = ""; - object.counterparty_payee = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - object.counterparty_payee = message.counterparty_payee; - return object; - }; - - /** - * Converts this MsgRegisterCounterpartyPayee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterCounterpartyPayee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterCounterpartyPayee; - })(); - - v1.MsgRegisterCounterpartyPayeeResponse = (function() { - - /** - * Properties of a MsgRegisterCounterpartyPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IMsgRegisterCounterpartyPayeeResponse - */ - - /** - * Constructs a new MsgRegisterCounterpartyPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgRegisterCounterpartyPayeeResponse. - * @implements IMsgRegisterCounterpartyPayeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayeeResponse=} [properties] Properties to set - */ - function MsgRegisterCounterpartyPayeeResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgRegisterCounterpartyPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayeeResponse} message MsgRegisterCounterpartyPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterCounterpartyPayeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgRegisterCounterpartyPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgRegisterCounterpartyPayeeResponse} message MsgRegisterCounterpartyPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterCounterpartyPayeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterCounterpartyPayeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} MsgRegisterCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterCounterpartyPayeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterCounterpartyPayeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} MsgRegisterCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterCounterpartyPayeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterCounterpartyPayeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterCounterpartyPayeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgRegisterCounterpartyPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} MsgRegisterCounterpartyPayeeResponse - */ - MsgRegisterCounterpartyPayeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse) - return object; - return new $root.ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse(); - }; - - /** - * Creates a plain object from a MsgRegisterCounterpartyPayeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse} message MsgRegisterCounterpartyPayeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterCounterpartyPayeeResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgRegisterCounterpartyPayeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterCounterpartyPayeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterCounterpartyPayeeResponse; - })(); - - v1.MsgPayPacketFee = (function() { - - /** - * Properties of a MsgPayPacketFee. - * @memberof ibc.applications.fee.v1 - * @interface IMsgPayPacketFee - * @property {ibc.applications.fee.v1.IFee|null} [fee] MsgPayPacketFee fee - * @property {string|null} [source_port_id] MsgPayPacketFee source_port_id - * @property {string|null} [source_channel_id] MsgPayPacketFee source_channel_id - * @property {string|null} [signer] MsgPayPacketFee signer - * @property {Array.|null} [relayers] MsgPayPacketFee relayers - */ - - /** - * Constructs a new MsgPayPacketFee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgPayPacketFee. - * @implements IMsgPayPacketFee - * @constructor - * @param {ibc.applications.fee.v1.IMsgPayPacketFee=} [properties] Properties to set - */ - function MsgPayPacketFee(properties) { - this.relayers = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgPayPacketFee fee. - * @member {ibc.applications.fee.v1.IFee|null|undefined} fee - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.fee = null; - - /** - * MsgPayPacketFee source_port_id. - * @member {string} source_port_id - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.source_port_id = ""; - - /** - * MsgPayPacketFee source_channel_id. - * @member {string} source_channel_id - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.source_channel_id = ""; - - /** - * MsgPayPacketFee signer. - * @member {string} signer - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.signer = ""; - - /** - * MsgPayPacketFee relayers. - * @member {Array.} relayers - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - */ - MsgPayPacketFee.prototype.relayers = $util.emptyArray; - - /** - * Encodes the specified MsgPayPacketFee message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFee} message MsgPayPacketFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) - $root.ibc.applications.fee.v1.Fee.encode(message.fee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.source_port_id != null && Object.hasOwnProperty.call(message, "source_port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_port_id); - if (message.source_channel_id != null && Object.hasOwnProperty.call(message, "source_channel_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.source_channel_id); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.signer); - if (message.relayers != null && message.relayers.length) - for (let i = 0; i < message.relayers.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.relayers[i]); - return writer; - }; - - /** - * Encodes the specified MsgPayPacketFee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFee} message MsgPayPacketFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgPayPacketFee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgPayPacketFee} MsgPayPacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgPayPacketFee(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee = $root.ibc.applications.fee.v1.Fee.decode(reader, reader.uint32()); - break; - case 2: - message.source_port_id = reader.string(); - break; - case 3: - message.source_channel_id = reader.string(); - break; - case 4: - message.signer = reader.string(); - break; - case 5: - if (!(message.relayers && message.relayers.length)) - message.relayers = []; - message.relayers.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgPayPacketFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgPayPacketFee} MsgPayPacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgPayPacketFee message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgPayPacketFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee != null && message.hasOwnProperty("fee")) { - let error = $root.ibc.applications.fee.v1.Fee.verify(message.fee); - if (error) - return "fee." + error; - } - if (message.source_port_id != null && message.hasOwnProperty("source_port_id")) - if (!$util.isString(message.source_port_id)) - return "source_port_id: string expected"; - if (message.source_channel_id != null && message.hasOwnProperty("source_channel_id")) - if (!$util.isString(message.source_channel_id)) - return "source_channel_id: string expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - if (message.relayers != null && message.hasOwnProperty("relayers")) { - if (!Array.isArray(message.relayers)) - return "relayers: array expected"; - for (let i = 0; i < message.relayers.length; ++i) - if (!$util.isString(message.relayers[i])) - return "relayers: string[] expected"; - } - return null; - }; - - /** - * Creates a MsgPayPacketFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgPayPacketFee} MsgPayPacketFee - */ - MsgPayPacketFee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgPayPacketFee) - return object; - let message = new $root.ibc.applications.fee.v1.MsgPayPacketFee(); - if (object.fee != null) { - if (typeof object.fee !== "object") - throw TypeError(".ibc.applications.fee.v1.MsgPayPacketFee.fee: object expected"); - message.fee = $root.ibc.applications.fee.v1.Fee.fromObject(object.fee); - } - if (object.source_port_id != null) - message.source_port_id = String(object.source_port_id); - if (object.source_channel_id != null) - message.source_channel_id = String(object.source_channel_id); - if (object.signer != null) - message.signer = String(object.signer); - if (object.relayers) { - if (!Array.isArray(object.relayers)) - throw TypeError(".ibc.applications.fee.v1.MsgPayPacketFee.relayers: array expected"); - message.relayers = []; - for (let i = 0; i < object.relayers.length; ++i) - message.relayers[i] = String(object.relayers[i]); - } - return message; - }; - - /** - * Creates a plain object from a MsgPayPacketFee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @static - * @param {ibc.applications.fee.v1.MsgPayPacketFee} message MsgPayPacketFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgPayPacketFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.relayers = []; - if (options.defaults) { - object.fee = null; - object.source_port_id = ""; - object.source_channel_id = ""; - object.signer = ""; - } - if (message.fee != null && message.hasOwnProperty("fee")) - object.fee = $root.ibc.applications.fee.v1.Fee.toObject(message.fee, options); - if (message.source_port_id != null && message.hasOwnProperty("source_port_id")) - object.source_port_id = message.source_port_id; - if (message.source_channel_id != null && message.hasOwnProperty("source_channel_id")) - object.source_channel_id = message.source_channel_id; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - if (message.relayers && message.relayers.length) { - object.relayers = []; - for (let j = 0; j < message.relayers.length; ++j) - object.relayers[j] = message.relayers[j]; - } - return object; - }; - - /** - * Converts this MsgPayPacketFee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgPayPacketFee - * @instance - * @returns {Object.} JSON object - */ - MsgPayPacketFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgPayPacketFee; - })(); - - v1.MsgPayPacketFeeResponse = (function() { - - /** - * Properties of a MsgPayPacketFeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IMsgPayPacketFeeResponse - */ - - /** - * Constructs a new MsgPayPacketFeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgPayPacketFeeResponse. - * @implements IMsgPayPacketFeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeResponse=} [properties] Properties to set - */ - function MsgPayPacketFeeResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgPayPacketFeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeResponse} message MsgPayPacketFeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgPayPacketFeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeResponse} message MsgPayPacketFeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgPayPacketFeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeResponse} MsgPayPacketFeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgPayPacketFeeResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgPayPacketFeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeResponse} MsgPayPacketFeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgPayPacketFeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgPayPacketFeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgPayPacketFeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeResponse} MsgPayPacketFeeResponse - */ - MsgPayPacketFeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgPayPacketFeeResponse) - return object; - return new $root.ibc.applications.fee.v1.MsgPayPacketFeeResponse(); - }; - - /** - * Creates a plain object from a MsgPayPacketFeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @static - * @param {ibc.applications.fee.v1.MsgPayPacketFeeResponse} message MsgPayPacketFeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgPayPacketFeeResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgPayPacketFeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeResponse - * @instance - * @returns {Object.} JSON object - */ - MsgPayPacketFeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgPayPacketFeeResponse; - })(); - - v1.MsgPayPacketFeeAsync = (function() { - - /** - * Properties of a MsgPayPacketFeeAsync. - * @memberof ibc.applications.fee.v1 - * @interface IMsgPayPacketFeeAsync - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] MsgPayPacketFeeAsync packet_id - * @property {ibc.applications.fee.v1.IPacketFee|null} [packet_fee] MsgPayPacketFeeAsync packet_fee - */ - - /** - * Constructs a new MsgPayPacketFeeAsync. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgPayPacketFeeAsync. - * @implements IMsgPayPacketFeeAsync - * @constructor - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync=} [properties] Properties to set - */ - function MsgPayPacketFeeAsync(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgPayPacketFeeAsync packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @instance - */ - MsgPayPacketFeeAsync.prototype.packet_id = null; - - /** - * MsgPayPacketFeeAsync packet_fee. - * @member {ibc.applications.fee.v1.IPacketFee|null|undefined} packet_fee - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @instance - */ - MsgPayPacketFeeAsync.prototype.packet_fee = null; - - /** - * Encodes the specified MsgPayPacketFeeAsync message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsync.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync} message MsgPayPacketFeeAsync message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeAsync.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.packet_fee != null && Object.hasOwnProperty.call(message, "packet_fee")) - $root.ibc.applications.fee.v1.PacketFee.encode(message.packet_fee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MsgPayPacketFeeAsync message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsync.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsync} message MsgPayPacketFeeAsync message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeAsync.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgPayPacketFeeAsync message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsync} MsgPayPacketFeeAsync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeAsync.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgPayPacketFeeAsync(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - case 2: - message.packet_fee = $root.ibc.applications.fee.v1.PacketFee.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgPayPacketFeeAsync message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsync} MsgPayPacketFeeAsync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeAsync.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgPayPacketFeeAsync message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgPayPacketFeeAsync.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - let error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - if (message.packet_fee != null && message.hasOwnProperty("packet_fee")) { - let error = $root.ibc.applications.fee.v1.PacketFee.verify(message.packet_fee); - if (error) - return "packet_fee." + error; - } - return null; - }; - - /** - * Creates a MsgPayPacketFeeAsync message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsync} MsgPayPacketFeeAsync - */ - MsgPayPacketFeeAsync.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgPayPacketFeeAsync) - return object; - let message = new $root.ibc.applications.fee.v1.MsgPayPacketFeeAsync(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.MsgPayPacketFeeAsync.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - if (object.packet_fee != null) { - if (typeof object.packet_fee !== "object") - throw TypeError(".ibc.applications.fee.v1.MsgPayPacketFeeAsync.packet_fee: object expected"); - message.packet_fee = $root.ibc.applications.fee.v1.PacketFee.fromObject(object.packet_fee); - } - return message; - }; - - /** - * Creates a plain object from a MsgPayPacketFeeAsync message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @static - * @param {ibc.applications.fee.v1.MsgPayPacketFeeAsync} message MsgPayPacketFeeAsync - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgPayPacketFeeAsync.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.packet_id = null; - object.packet_fee = null; - } - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - if (message.packet_fee != null && message.hasOwnProperty("packet_fee")) - object.packet_fee = $root.ibc.applications.fee.v1.PacketFee.toObject(message.packet_fee, options); - return object; - }; - - /** - * Converts this MsgPayPacketFeeAsync to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsync - * @instance - * @returns {Object.} JSON object - */ - MsgPayPacketFeeAsync.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgPayPacketFeeAsync; - })(); - - v1.MsgPayPacketFeeAsyncResponse = (function() { - - /** - * Properties of a MsgPayPacketFeeAsyncResponse. - * @memberof ibc.applications.fee.v1 - * @interface IMsgPayPacketFeeAsyncResponse - */ - - /** - * Constructs a new MsgPayPacketFeeAsyncResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a MsgPayPacketFeeAsyncResponse. - * @implements IMsgPayPacketFeeAsyncResponse - * @constructor - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsyncResponse=} [properties] Properties to set - */ - function MsgPayPacketFeeAsyncResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgPayPacketFeeAsyncResponse message. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsyncResponse} message MsgPayPacketFeeAsyncResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeAsyncResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgPayPacketFeeAsyncResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {ibc.applications.fee.v1.IMsgPayPacketFeeAsyncResponse} message MsgPayPacketFeeAsyncResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgPayPacketFeeAsyncResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgPayPacketFeeAsyncResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} MsgPayPacketFeeAsyncResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeAsyncResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgPayPacketFeeAsyncResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} MsgPayPacketFeeAsyncResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgPayPacketFeeAsyncResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgPayPacketFeeAsyncResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgPayPacketFeeAsyncResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgPayPacketFeeAsyncResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} MsgPayPacketFeeAsyncResponse - */ - MsgPayPacketFeeAsyncResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse) - return object; - return new $root.ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse(); - }; - - /** - * Creates a plain object from a MsgPayPacketFeeAsyncResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @static - * @param {ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse} message MsgPayPacketFeeAsyncResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgPayPacketFeeAsyncResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgPayPacketFeeAsyncResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - * @instance - * @returns {Object.} JSON object - */ - MsgPayPacketFeeAsyncResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgPayPacketFeeAsyncResponse; - })(); - - v1.Fee = (function() { - - /** - * Properties of a Fee. - * @memberof ibc.applications.fee.v1 - * @interface IFee - * @property {Array.|null} [recv_fee] Fee recv_fee - * @property {Array.|null} [ack_fee] Fee ack_fee - * @property {Array.|null} [timeout_fee] Fee timeout_fee - */ - - /** - * Constructs a new Fee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a Fee. - * @implements IFee - * @constructor - * @param {ibc.applications.fee.v1.IFee=} [properties] Properties to set - */ - function Fee(properties) { - this.recv_fee = []; - this.ack_fee = []; - this.timeout_fee = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Fee recv_fee. - * @member {Array.} recv_fee - * @memberof ibc.applications.fee.v1.Fee - * @instance - */ - Fee.prototype.recv_fee = $util.emptyArray; - - /** - * Fee ack_fee. - * @member {Array.} ack_fee - * @memberof ibc.applications.fee.v1.Fee - * @instance - */ - Fee.prototype.ack_fee = $util.emptyArray; - - /** - * Fee timeout_fee. - * @member {Array.} timeout_fee - * @memberof ibc.applications.fee.v1.Fee - * @instance - */ - Fee.prototype.timeout_fee = $util.emptyArray; - - /** - * Encodes the specified Fee message. Does not implicitly {@link ibc.applications.fee.v1.Fee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {ibc.applications.fee.v1.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recv_fee != null && message.recv_fee.length) - for (let i = 0; i < message.recv_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.recv_fee[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.ack_fee != null && message.ack_fee.length) - for (let i = 0; i < message.ack_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.ack_fee[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.timeout_fee != null && message.timeout_fee.length) - for (let i = 0; i < message.timeout_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.timeout_fee[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.Fee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {ibc.applications.fee.v1.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.Fee(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.recv_fee && message.recv_fee.length)) - message.recv_fee = []; - message.recv_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.ack_fee && message.ack_fee.length)) - message.ack_fee = []; - message.ack_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.timeout_fee && message.timeout_fee.length)) - message.timeout_fee = []; - message.timeout_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Fee message. - * @function verify - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Fee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recv_fee != null && message.hasOwnProperty("recv_fee")) { - if (!Array.isArray(message.recv_fee)) - return "recv_fee: array expected"; - for (let i = 0; i < message.recv_fee.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.recv_fee[i]); - if (error) - return "recv_fee." + error; - } - } - if (message.ack_fee != null && message.hasOwnProperty("ack_fee")) { - if (!Array.isArray(message.ack_fee)) - return "ack_fee: array expected"; - for (let i = 0; i < message.ack_fee.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.ack_fee[i]); - if (error) - return "ack_fee." + error; - } - } - if (message.timeout_fee != null && message.hasOwnProperty("timeout_fee")) { - if (!Array.isArray(message.timeout_fee)) - return "timeout_fee: array expected"; - for (let i = 0; i < message.timeout_fee.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.timeout_fee[i]); - if (error) - return "timeout_fee." + error; - } - } - return null; - }; - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.Fee} Fee - */ - Fee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.Fee) - return object; - let message = new $root.ibc.applications.fee.v1.Fee(); - if (object.recv_fee) { - if (!Array.isArray(object.recv_fee)) - throw TypeError(".ibc.applications.fee.v1.Fee.recv_fee: array expected"); - message.recv_fee = []; - for (let i = 0; i < object.recv_fee.length; ++i) { - if (typeof object.recv_fee[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.Fee.recv_fee: object expected"); - message.recv_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.recv_fee[i]); - } - } - if (object.ack_fee) { - if (!Array.isArray(object.ack_fee)) - throw TypeError(".ibc.applications.fee.v1.Fee.ack_fee: array expected"); - message.ack_fee = []; - for (let i = 0; i < object.ack_fee.length; ++i) { - if (typeof object.ack_fee[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.Fee.ack_fee: object expected"); - message.ack_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.ack_fee[i]); - } - } - if (object.timeout_fee) { - if (!Array.isArray(object.timeout_fee)) - throw TypeError(".ibc.applications.fee.v1.Fee.timeout_fee: array expected"); - message.timeout_fee = []; - for (let i = 0; i < object.timeout_fee.length; ++i) { - if (typeof object.timeout_fee[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.Fee.timeout_fee: object expected"); - message.timeout_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.timeout_fee[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.Fee - * @static - * @param {ibc.applications.fee.v1.Fee} message Fee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Fee.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.recv_fee = []; - object.ack_fee = []; - object.timeout_fee = []; - } - if (message.recv_fee && message.recv_fee.length) { - object.recv_fee = []; - for (let j = 0; j < message.recv_fee.length; ++j) - object.recv_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.recv_fee[j], options); - } - if (message.ack_fee && message.ack_fee.length) { - object.ack_fee = []; - for (let j = 0; j < message.ack_fee.length; ++j) - object.ack_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.ack_fee[j], options); - } - if (message.timeout_fee && message.timeout_fee.length) { - object.timeout_fee = []; - for (let j = 0; j < message.timeout_fee.length; ++j) - object.timeout_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.timeout_fee[j], options); - } - return object; - }; - - /** - * Converts this Fee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.Fee - * @instance - * @returns {Object.} JSON object - */ - Fee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Fee; - })(); - - v1.PacketFee = (function() { - - /** - * Properties of a PacketFee. - * @memberof ibc.applications.fee.v1 - * @interface IPacketFee - * @property {ibc.applications.fee.v1.IFee|null} [fee] PacketFee fee - * @property {string|null} [refund_address] PacketFee refund_address - * @property {Array.|null} [relayers] PacketFee relayers - */ - - /** - * Constructs a new PacketFee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a PacketFee. - * @implements IPacketFee - * @constructor - * @param {ibc.applications.fee.v1.IPacketFee=} [properties] Properties to set - */ - function PacketFee(properties) { - this.relayers = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketFee fee. - * @member {ibc.applications.fee.v1.IFee|null|undefined} fee - * @memberof ibc.applications.fee.v1.PacketFee - * @instance - */ - PacketFee.prototype.fee = null; - - /** - * PacketFee refund_address. - * @member {string} refund_address - * @memberof ibc.applications.fee.v1.PacketFee - * @instance - */ - PacketFee.prototype.refund_address = ""; - - /** - * PacketFee relayers. - * @member {Array.} relayers - * @memberof ibc.applications.fee.v1.PacketFee - * @instance - */ - PacketFee.prototype.relayers = $util.emptyArray; - - /** - * Encodes the specified PacketFee message. Does not implicitly {@link ibc.applications.fee.v1.PacketFee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {ibc.applications.fee.v1.IPacketFee} message PacketFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) - $root.ibc.applications.fee.v1.Fee.encode(message.fee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.refund_address != null && Object.hasOwnProperty.call(message, "refund_address")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.refund_address); - if (message.relayers != null && message.relayers.length) - for (let i = 0; i < message.relayers.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relayers[i]); - return writer; - }; - - /** - * Encodes the specified PacketFee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.PacketFee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {ibc.applications.fee.v1.IPacketFee} message PacketFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketFee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.PacketFee} PacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketFee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.PacketFee(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee = $root.ibc.applications.fee.v1.Fee.decode(reader, reader.uint32()); - break; - case 2: - message.refund_address = reader.string(); - break; - case 3: - if (!(message.relayers && message.relayers.length)) - message.relayers = []; - message.relayers.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.PacketFee} PacketFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketFee message. - * @function verify - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee != null && message.hasOwnProperty("fee")) { - let error = $root.ibc.applications.fee.v1.Fee.verify(message.fee); - if (error) - return "fee." + error; - } - if (message.refund_address != null && message.hasOwnProperty("refund_address")) - if (!$util.isString(message.refund_address)) - return "refund_address: string expected"; - if (message.relayers != null && message.hasOwnProperty("relayers")) { - if (!Array.isArray(message.relayers)) - return "relayers: array expected"; - for (let i = 0; i < message.relayers.length; ++i) - if (!$util.isString(message.relayers[i])) - return "relayers: string[] expected"; - } - return null; - }; - - /** - * Creates a PacketFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.PacketFee} PacketFee - */ - PacketFee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.PacketFee) - return object; - let message = new $root.ibc.applications.fee.v1.PacketFee(); - if (object.fee != null) { - if (typeof object.fee !== "object") - throw TypeError(".ibc.applications.fee.v1.PacketFee.fee: object expected"); - message.fee = $root.ibc.applications.fee.v1.Fee.fromObject(object.fee); - } - if (object.refund_address != null) - message.refund_address = String(object.refund_address); - if (object.relayers) { - if (!Array.isArray(object.relayers)) - throw TypeError(".ibc.applications.fee.v1.PacketFee.relayers: array expected"); - message.relayers = []; - for (let i = 0; i < object.relayers.length; ++i) - message.relayers[i] = String(object.relayers[i]); - } - return message; - }; - - /** - * Creates a plain object from a PacketFee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.PacketFee - * @static - * @param {ibc.applications.fee.v1.PacketFee} message PacketFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.relayers = []; - if (options.defaults) { - object.fee = null; - object.refund_address = ""; - } - if (message.fee != null && message.hasOwnProperty("fee")) - object.fee = $root.ibc.applications.fee.v1.Fee.toObject(message.fee, options); - if (message.refund_address != null && message.hasOwnProperty("refund_address")) - object.refund_address = message.refund_address; - if (message.relayers && message.relayers.length) { - object.relayers = []; - for (let j = 0; j < message.relayers.length; ++j) - object.relayers[j] = message.relayers[j]; - } - return object; - }; - - /** - * Converts this PacketFee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.PacketFee - * @instance - * @returns {Object.} JSON object - */ - PacketFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketFee; - })(); - - v1.PacketFees = (function() { - - /** - * Properties of a PacketFees. - * @memberof ibc.applications.fee.v1 - * @interface IPacketFees - * @property {Array.|null} [packet_fees] PacketFees packet_fees - */ - - /** - * Constructs a new PacketFees. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a PacketFees. - * @implements IPacketFees - * @constructor - * @param {ibc.applications.fee.v1.IPacketFees=} [properties] Properties to set - */ - function PacketFees(properties) { - this.packet_fees = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketFees packet_fees. - * @member {Array.} packet_fees - * @memberof ibc.applications.fee.v1.PacketFees - * @instance - */ - PacketFees.prototype.packet_fees = $util.emptyArray; - - /** - * Encodes the specified PacketFees message. Does not implicitly {@link ibc.applications.fee.v1.PacketFees.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {ibc.applications.fee.v1.IPacketFees} message PacketFees message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketFees.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_fees != null && message.packet_fees.length) - for (let i = 0; i < message.packet_fees.length; ++i) - $root.ibc.applications.fee.v1.PacketFee.encode(message.packet_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PacketFees message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.PacketFees.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {ibc.applications.fee.v1.IPacketFees} message PacketFees message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketFees.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketFees message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.PacketFees} PacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketFees.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.PacketFees(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.packet_fees && message.packet_fees.length)) - message.packet_fees = []; - message.packet_fees.push($root.ibc.applications.fee.v1.PacketFee.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketFees message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.PacketFees} PacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketFees.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketFees message. - * @function verify - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketFees.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_fees != null && message.hasOwnProperty("packet_fees")) { - if (!Array.isArray(message.packet_fees)) - return "packet_fees: array expected"; - for (let i = 0; i < message.packet_fees.length; ++i) { - let error = $root.ibc.applications.fee.v1.PacketFee.verify(message.packet_fees[i]); - if (error) - return "packet_fees." + error; - } - } - return null; - }; - - /** - * Creates a PacketFees message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.PacketFees} PacketFees - */ - PacketFees.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.PacketFees) - return object; - let message = new $root.ibc.applications.fee.v1.PacketFees(); - if (object.packet_fees) { - if (!Array.isArray(object.packet_fees)) - throw TypeError(".ibc.applications.fee.v1.PacketFees.packet_fees: array expected"); - message.packet_fees = []; - for (let i = 0; i < object.packet_fees.length; ++i) { - if (typeof object.packet_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.PacketFees.packet_fees: object expected"); - message.packet_fees[i] = $root.ibc.applications.fee.v1.PacketFee.fromObject(object.packet_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PacketFees message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.PacketFees - * @static - * @param {ibc.applications.fee.v1.PacketFees} message PacketFees - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketFees.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.packet_fees = []; - if (message.packet_fees && message.packet_fees.length) { - object.packet_fees = []; - for (let j = 0; j < message.packet_fees.length; ++j) - object.packet_fees[j] = $root.ibc.applications.fee.v1.PacketFee.toObject(message.packet_fees[j], options); - } - return object; - }; - - /** - * Converts this PacketFees to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.PacketFees - * @instance - * @returns {Object.} JSON object - */ - PacketFees.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketFees; - })(); - - v1.IdentifiedPacketFees = (function() { - - /** - * Properties of an IdentifiedPacketFees. - * @memberof ibc.applications.fee.v1 - * @interface IIdentifiedPacketFees - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] IdentifiedPacketFees packet_id - * @property {Array.|null} [packet_fees] IdentifiedPacketFees packet_fees - */ - - /** - * Constructs a new IdentifiedPacketFees. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents an IdentifiedPacketFees. - * @implements IIdentifiedPacketFees - * @constructor - * @param {ibc.applications.fee.v1.IIdentifiedPacketFees=} [properties] Properties to set - */ - function IdentifiedPacketFees(properties) { - this.packet_fees = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedPacketFees packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @instance - */ - IdentifiedPacketFees.prototype.packet_id = null; - - /** - * IdentifiedPacketFees packet_fees. - * @member {Array.} packet_fees - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @instance - */ - IdentifiedPacketFees.prototype.packet_fees = $util.emptyArray; - - /** - * Encodes the specified IdentifiedPacketFees message. Does not implicitly {@link ibc.applications.fee.v1.IdentifiedPacketFees.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {ibc.applications.fee.v1.IIdentifiedPacketFees} message IdentifiedPacketFees message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedPacketFees.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.packet_fees != null && message.packet_fees.length) - for (let i = 0; i < message.packet_fees.length; ++i) - $root.ibc.applications.fee.v1.PacketFee.encode(message.packet_fees[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentifiedPacketFees message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.IdentifiedPacketFees.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {ibc.applications.fee.v1.IIdentifiedPacketFees} message IdentifiedPacketFees message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedPacketFees.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedPacketFees message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.IdentifiedPacketFees} IdentifiedPacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedPacketFees.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.IdentifiedPacketFees(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.packet_fees && message.packet_fees.length)) - message.packet_fees = []; - message.packet_fees.push($root.ibc.applications.fee.v1.PacketFee.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedPacketFees message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.IdentifiedPacketFees} IdentifiedPacketFees - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedPacketFees.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedPacketFees message. - * @function verify - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedPacketFees.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - let error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - if (message.packet_fees != null && message.hasOwnProperty("packet_fees")) { - if (!Array.isArray(message.packet_fees)) - return "packet_fees: array expected"; - for (let i = 0; i < message.packet_fees.length; ++i) { - let error = $root.ibc.applications.fee.v1.PacketFee.verify(message.packet_fees[i]); - if (error) - return "packet_fees." + error; - } - } - return null; - }; - - /** - * Creates an IdentifiedPacketFees message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.IdentifiedPacketFees} IdentifiedPacketFees - */ - IdentifiedPacketFees.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.IdentifiedPacketFees) - return object; - let message = new $root.ibc.applications.fee.v1.IdentifiedPacketFees(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.IdentifiedPacketFees.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - if (object.packet_fees) { - if (!Array.isArray(object.packet_fees)) - throw TypeError(".ibc.applications.fee.v1.IdentifiedPacketFees.packet_fees: array expected"); - message.packet_fees = []; - for (let i = 0; i < object.packet_fees.length; ++i) { - if (typeof object.packet_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.IdentifiedPacketFees.packet_fees: object expected"); - message.packet_fees[i] = $root.ibc.applications.fee.v1.PacketFee.fromObject(object.packet_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentifiedPacketFees message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @static - * @param {ibc.applications.fee.v1.IdentifiedPacketFees} message IdentifiedPacketFees - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedPacketFees.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.packet_fees = []; - if (options.defaults) - object.packet_id = null; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - if (message.packet_fees && message.packet_fees.length) { - object.packet_fees = []; - for (let j = 0; j < message.packet_fees.length; ++j) - object.packet_fees[j] = $root.ibc.applications.fee.v1.PacketFee.toObject(message.packet_fees[j], options); - } - return object; - }; - - /** - * Converts this IdentifiedPacketFees to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.IdentifiedPacketFees - * @instance - * @returns {Object.} JSON object - */ - IdentifiedPacketFees.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedPacketFees; - })(); - - v1.IncentivizedAcknowledgement = (function() { - - /** - * Properties of an IncentivizedAcknowledgement. - * @memberof ibc.applications.fee.v1 - * @interface IIncentivizedAcknowledgement - * @property {Uint8Array|null} [app_acknowledgement] IncentivizedAcknowledgement app_acknowledgement - * @property {string|null} [forward_relayer_address] IncentivizedAcknowledgement forward_relayer_address - * @property {boolean|null} [underlying_app_success] IncentivizedAcknowledgement underlying_app_success - */ - - /** - * Constructs a new IncentivizedAcknowledgement. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents an IncentivizedAcknowledgement. - * @implements IIncentivizedAcknowledgement - * @constructor - * @param {ibc.applications.fee.v1.IIncentivizedAcknowledgement=} [properties] Properties to set - */ - function IncentivizedAcknowledgement(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IncentivizedAcknowledgement app_acknowledgement. - * @member {Uint8Array} app_acknowledgement - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @instance - */ - IncentivizedAcknowledgement.prototype.app_acknowledgement = $util.newBuffer([]); - - /** - * IncentivizedAcknowledgement forward_relayer_address. - * @member {string} forward_relayer_address - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @instance - */ - IncentivizedAcknowledgement.prototype.forward_relayer_address = ""; - - /** - * IncentivizedAcknowledgement underlying_app_success. - * @member {boolean} underlying_app_success - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @instance - */ - IncentivizedAcknowledgement.prototype.underlying_app_success = false; - - /** - * Encodes the specified IncentivizedAcknowledgement message. Does not implicitly {@link ibc.applications.fee.v1.IncentivizedAcknowledgement.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {ibc.applications.fee.v1.IIncentivizedAcknowledgement} message IncentivizedAcknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncentivizedAcknowledgement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app_acknowledgement != null && Object.hasOwnProperty.call(message, "app_acknowledgement")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.app_acknowledgement); - if (message.forward_relayer_address != null && Object.hasOwnProperty.call(message, "forward_relayer_address")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.forward_relayer_address); - if (message.underlying_app_success != null && Object.hasOwnProperty.call(message, "underlying_app_success")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.underlying_app_success); - return writer; - }; - - /** - * Encodes the specified IncentivizedAcknowledgement message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.IncentivizedAcknowledgement.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {ibc.applications.fee.v1.IIncentivizedAcknowledgement} message IncentivizedAcknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IncentivizedAcknowledgement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IncentivizedAcknowledgement message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.IncentivizedAcknowledgement} IncentivizedAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncentivizedAcknowledgement.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.IncentivizedAcknowledgement(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.app_acknowledgement = reader.bytes(); - break; - case 2: - message.forward_relayer_address = reader.string(); - break; - case 3: - message.underlying_app_success = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IncentivizedAcknowledgement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.IncentivizedAcknowledgement} IncentivizedAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IncentivizedAcknowledgement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IncentivizedAcknowledgement message. - * @function verify - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IncentivizedAcknowledgement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app_acknowledgement != null && message.hasOwnProperty("app_acknowledgement")) - if (!(message.app_acknowledgement && typeof message.app_acknowledgement.length === "number" || $util.isString(message.app_acknowledgement))) - return "app_acknowledgement: buffer expected"; - if (message.forward_relayer_address != null && message.hasOwnProperty("forward_relayer_address")) - if (!$util.isString(message.forward_relayer_address)) - return "forward_relayer_address: string expected"; - if (message.underlying_app_success != null && message.hasOwnProperty("underlying_app_success")) - if (typeof message.underlying_app_success !== "boolean") - return "underlying_app_success: boolean expected"; - return null; - }; - - /** - * Creates an IncentivizedAcknowledgement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.IncentivizedAcknowledgement} IncentivizedAcknowledgement - */ - IncentivizedAcknowledgement.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.IncentivizedAcknowledgement) - return object; - let message = new $root.ibc.applications.fee.v1.IncentivizedAcknowledgement(); - if (object.app_acknowledgement != null) - if (typeof object.app_acknowledgement === "string") - $util.base64.decode(object.app_acknowledgement, message.app_acknowledgement = $util.newBuffer($util.base64.length(object.app_acknowledgement)), 0); - else if (object.app_acknowledgement.length) - message.app_acknowledgement = object.app_acknowledgement; - if (object.forward_relayer_address != null) - message.forward_relayer_address = String(object.forward_relayer_address); - if (object.underlying_app_success != null) - message.underlying_app_success = Boolean(object.underlying_app_success); - return message; - }; - - /** - * Creates a plain object from an IncentivizedAcknowledgement message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @static - * @param {ibc.applications.fee.v1.IncentivizedAcknowledgement} message IncentivizedAcknowledgement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IncentivizedAcknowledgement.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.app_acknowledgement = ""; - else { - object.app_acknowledgement = []; - if (options.bytes !== Array) - object.app_acknowledgement = $util.newBuffer(object.app_acknowledgement); - } - object.forward_relayer_address = ""; - object.underlying_app_success = false; - } - if (message.app_acknowledgement != null && message.hasOwnProperty("app_acknowledgement")) - object.app_acknowledgement = options.bytes === String ? $util.base64.encode(message.app_acknowledgement, 0, message.app_acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.app_acknowledgement) : message.app_acknowledgement; - if (message.forward_relayer_address != null && message.hasOwnProperty("forward_relayer_address")) - object.forward_relayer_address = message.forward_relayer_address; - if (message.underlying_app_success != null && message.hasOwnProperty("underlying_app_success")) - object.underlying_app_success = message.underlying_app_success; - return object; - }; - - /** - * Converts this IncentivizedAcknowledgement to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.IncentivizedAcknowledgement - * @instance - * @returns {Object.} JSON object - */ - IncentivizedAcknowledgement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IncentivizedAcknowledgement; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#incentivizedPackets}. - * @memberof ibc.applications.fee.v1.Query - * @typedef IncentivizedPacketsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} [response] QueryIncentivizedPacketsResponse - */ - - /** - * Calls IncentivizedPackets. - * @function incentivizedPackets - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest} request QueryIncentivizedPacketsRequest message or plain object - * @param {ibc.applications.fee.v1.Query.IncentivizedPacketsCallback} callback Node-style callback called with the error, if any, and QueryIncentivizedPacketsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.incentivizedPackets = function incentivizedPackets(request, callback) { - return this.rpcCall(incentivizedPackets, $root.ibc.applications.fee.v1.QueryIncentivizedPacketsRequest, $root.ibc.applications.fee.v1.QueryIncentivizedPacketsResponse, request, callback); - }, "name", { value: "IncentivizedPackets" }); - - /** - * Calls IncentivizedPackets. - * @function incentivizedPackets - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest} request QueryIncentivizedPacketsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#incentivizedPacket}. - * @memberof ibc.applications.fee.v1.Query - * @typedef IncentivizedPacketCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} [response] QueryIncentivizedPacketResponse - */ - - /** - * Calls IncentivizedPacket. - * @function incentivizedPacket - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest} request QueryIncentivizedPacketRequest message or plain object - * @param {ibc.applications.fee.v1.Query.IncentivizedPacketCallback} callback Node-style callback called with the error, if any, and QueryIncentivizedPacketResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.incentivizedPacket = function incentivizedPacket(request, callback) { - return this.rpcCall(incentivizedPacket, $root.ibc.applications.fee.v1.QueryIncentivizedPacketRequest, $root.ibc.applications.fee.v1.QueryIncentivizedPacketResponse, request, callback); - }, "name", { value: "IncentivizedPacket" }); - - /** - * Calls IncentivizedPacket. - * @function incentivizedPacket - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest} request QueryIncentivizedPacketRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#incentivizedPacketsForChannel}. - * @memberof ibc.applications.fee.v1.Query - * @typedef IncentivizedPacketsForChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} [response] QueryIncentivizedPacketsForChannelResponse - */ - - /** - * Calls IncentivizedPacketsForChannel. - * @function incentivizedPacketsForChannel - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest} request QueryIncentivizedPacketsForChannelRequest message or plain object - * @param {ibc.applications.fee.v1.Query.IncentivizedPacketsForChannelCallback} callback Node-style callback called with the error, if any, and QueryIncentivizedPacketsForChannelResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.incentivizedPacketsForChannel = function incentivizedPacketsForChannel(request, callback) { - return this.rpcCall(incentivizedPacketsForChannel, $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest, $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse, request, callback); - }, "name", { value: "IncentivizedPacketsForChannel" }); - - /** - * Calls IncentivizedPacketsForChannel. - * @function incentivizedPacketsForChannel - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest} request QueryIncentivizedPacketsForChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#totalRecvFees}. - * @memberof ibc.applications.fee.v1.Query - * @typedef TotalRecvFeesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} [response] QueryTotalRecvFeesResponse - */ - - /** - * Calls TotalRecvFees. - * @function totalRecvFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest} request QueryTotalRecvFeesRequest message or plain object - * @param {ibc.applications.fee.v1.Query.TotalRecvFeesCallback} callback Node-style callback called with the error, if any, and QueryTotalRecvFeesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.totalRecvFees = function totalRecvFees(request, callback) { - return this.rpcCall(totalRecvFees, $root.ibc.applications.fee.v1.QueryTotalRecvFeesRequest, $root.ibc.applications.fee.v1.QueryTotalRecvFeesResponse, request, callback); - }, "name", { value: "TotalRecvFees" }); - - /** - * Calls TotalRecvFees. - * @function totalRecvFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest} request QueryTotalRecvFeesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#totalAckFees}. - * @memberof ibc.applications.fee.v1.Query - * @typedef TotalAckFeesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryTotalAckFeesResponse} [response] QueryTotalAckFeesResponse - */ - - /** - * Calls TotalAckFees. - * @function totalAckFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest} request QueryTotalAckFeesRequest message or plain object - * @param {ibc.applications.fee.v1.Query.TotalAckFeesCallback} callback Node-style callback called with the error, if any, and QueryTotalAckFeesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.totalAckFees = function totalAckFees(request, callback) { - return this.rpcCall(totalAckFees, $root.ibc.applications.fee.v1.QueryTotalAckFeesRequest, $root.ibc.applications.fee.v1.QueryTotalAckFeesResponse, request, callback); - }, "name", { value: "TotalAckFees" }); - - /** - * Calls TotalAckFees. - * @function totalAckFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest} request QueryTotalAckFeesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#totalTimeoutFees}. - * @memberof ibc.applications.fee.v1.Query - * @typedef TotalTimeoutFeesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} [response] QueryTotalTimeoutFeesResponse - */ - - /** - * Calls TotalTimeoutFees. - * @function totalTimeoutFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest} request QueryTotalTimeoutFeesRequest message or plain object - * @param {ibc.applications.fee.v1.Query.TotalTimeoutFeesCallback} callback Node-style callback called with the error, if any, and QueryTotalTimeoutFeesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.totalTimeoutFees = function totalTimeoutFees(request, callback) { - return this.rpcCall(totalTimeoutFees, $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest, $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse, request, callback); - }, "name", { value: "TotalTimeoutFees" }); - - /** - * Calls TotalTimeoutFees. - * @function totalTimeoutFees - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest} request QueryTotalTimeoutFeesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#payee}. - * @memberof ibc.applications.fee.v1.Query - * @typedef PayeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryPayeeResponse} [response] QueryPayeeResponse - */ - - /** - * Calls Payee. - * @function payee - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryPayeeRequest} request QueryPayeeRequest message or plain object - * @param {ibc.applications.fee.v1.Query.PayeeCallback} callback Node-style callback called with the error, if any, and QueryPayeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.payee = function payee(request, callback) { - return this.rpcCall(payee, $root.ibc.applications.fee.v1.QueryPayeeRequest, $root.ibc.applications.fee.v1.QueryPayeeResponse, request, callback); - }, "name", { value: "Payee" }); - - /** - * Calls Payee. - * @function payee - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryPayeeRequest} request QueryPayeeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#counterpartyPayee}. - * @memberof ibc.applications.fee.v1.Query - * @typedef CounterpartyPayeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} [response] QueryCounterpartyPayeeResponse - */ - - /** - * Calls CounterpartyPayee. - * @function counterpartyPayee - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest} request QueryCounterpartyPayeeRequest message or plain object - * @param {ibc.applications.fee.v1.Query.CounterpartyPayeeCallback} callback Node-style callback called with the error, if any, and QueryCounterpartyPayeeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.counterpartyPayee = function counterpartyPayee(request, callback) { - return this.rpcCall(counterpartyPayee, $root.ibc.applications.fee.v1.QueryCounterpartyPayeeRequest, $root.ibc.applications.fee.v1.QueryCounterpartyPayeeResponse, request, callback); - }, "name", { value: "CounterpartyPayee" }); - - /** - * Calls CounterpartyPayee. - * @function counterpartyPayee - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest} request QueryCounterpartyPayeeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#feeEnabledChannels}. - * @memberof ibc.applications.fee.v1.Query - * @typedef FeeEnabledChannelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} [response] QueryFeeEnabledChannelsResponse - */ - - /** - * Calls FeeEnabledChannels. - * @function feeEnabledChannels - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest} request QueryFeeEnabledChannelsRequest message or plain object - * @param {ibc.applications.fee.v1.Query.FeeEnabledChannelsCallback} callback Node-style callback called with the error, if any, and QueryFeeEnabledChannelsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.feeEnabledChannels = function feeEnabledChannels(request, callback) { - return this.rpcCall(feeEnabledChannels, $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest, $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse, request, callback); - }, "name", { value: "FeeEnabledChannels" }); - - /** - * Calls FeeEnabledChannels. - * @function feeEnabledChannels - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest} request QueryFeeEnabledChannelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.fee.v1.Query#feeEnabledChannel}. - * @memberof ibc.applications.fee.v1.Query - * @typedef FeeEnabledChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} [response] QueryFeeEnabledChannelResponse - */ - - /** - * Calls FeeEnabledChannel. - * @function feeEnabledChannel - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest} request QueryFeeEnabledChannelRequest message or plain object - * @param {ibc.applications.fee.v1.Query.FeeEnabledChannelCallback} callback Node-style callback called with the error, if any, and QueryFeeEnabledChannelResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.feeEnabledChannel = function feeEnabledChannel(request, callback) { - return this.rpcCall(feeEnabledChannel, $root.ibc.applications.fee.v1.QueryFeeEnabledChannelRequest, $root.ibc.applications.fee.v1.QueryFeeEnabledChannelResponse, request, callback); - }, "name", { value: "FeeEnabledChannel" }); - - /** - * Calls FeeEnabledChannel. - * @function feeEnabledChannel - * @memberof ibc.applications.fee.v1.Query - * @instance - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest} request QueryFeeEnabledChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryIncentivizedPacketsRequest = (function() { - - /** - * Properties of a QueryIncentivizedPacketsRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketsRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryIncentivizedPacketsRequest pagination - * @property {Long|null} [query_height] QueryIncentivizedPacketsRequest query_height - */ - - /** - * Constructs a new QueryIncentivizedPacketsRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketsRequest. - * @implements IQueryIncentivizedPacketsRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest=} [properties] Properties to set - */ - function QueryIncentivizedPacketsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @instance - */ - QueryIncentivizedPacketsRequest.prototype.pagination = null; - - /** - * QueryIncentivizedPacketsRequest query_height. - * @member {Long} query_height - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @instance - */ - QueryIncentivizedPacketsRequest.prototype.query_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryIncentivizedPacketsRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest} message QueryIncentivizedPacketsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query_height != null && Object.hasOwnProperty.call(message, "query_height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.query_height); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketsRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsRequest} message QueryIncentivizedPacketsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsRequest} QueryIncentivizedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - case 2: - message.query_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsRequest} QueryIncentivizedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketsRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (!$util.isInteger(message.query_height) && !(message.query_height && $util.isInteger(message.query_height.low) && $util.isInteger(message.query_height.high))) - return "query_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryIncentivizedPacketsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsRequest} QueryIncentivizedPacketsRequest - */ - QueryIncentivizedPacketsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketsRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - if (object.query_height != null) - if ($util.Long) - (message.query_height = $util.Long.fromValue(object.query_height)).unsigned = true; - else if (typeof object.query_height === "string") - message.query_height = parseInt(object.query_height, 10); - else if (typeof object.query_height === "number") - message.query_height = object.query_height; - else if (typeof object.query_height === "object") - message.query_height = new $util.LongBits(object.query_height.low >>> 0, object.query_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsRequest} message QueryIncentivizedPacketsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.pagination = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.query_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_height = options.longs === String ? "0" : 0; - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (typeof message.query_height === "number") - object.query_height = options.longs === String ? String(message.query_height) : message.query_height; - else - object.query_height = options.longs === String ? $util.Long.prototype.toString.call(message.query_height) : options.longs === Number ? new $util.LongBits(message.query_height.low >>> 0, message.query_height.high >>> 0).toNumber(true) : message.query_height; - return object; - }; - - /** - * Converts this QueryIncentivizedPacketsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketsRequest; - })(); - - v1.QueryIncentivizedPacketsResponse = (function() { - - /** - * Properties of a QueryIncentivizedPacketsResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketsResponse - * @property {Array.|null} [incentivized_packets] QueryIncentivizedPacketsResponse incentivized_packets - */ - - /** - * Constructs a new QueryIncentivizedPacketsResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketsResponse. - * @implements IQueryIncentivizedPacketsResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsResponse=} [properties] Properties to set - */ - function QueryIncentivizedPacketsResponse(properties) { - this.incentivized_packets = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketsResponse incentivized_packets. - * @member {Array.} incentivized_packets - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @instance - */ - QueryIncentivizedPacketsResponse.prototype.incentivized_packets = $util.emptyArray; - - /** - * Encodes the specified QueryIncentivizedPacketsResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsResponse} message QueryIncentivizedPacketsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.incentivized_packets != null && message.incentivized_packets.length) - for (let i = 0; i < message.incentivized_packets.length; ++i) - $root.ibc.applications.fee.v1.IdentifiedPacketFees.encode(message.incentivized_packets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketsResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsResponse} message QueryIncentivizedPacketsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} QueryIncentivizedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.incentivized_packets && message.incentivized_packets.length)) - message.incentivized_packets = []; - message.incentivized_packets.push($root.ibc.applications.fee.v1.IdentifiedPacketFees.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} QueryIncentivizedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketsResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.incentivized_packets != null && message.hasOwnProperty("incentivized_packets")) { - if (!Array.isArray(message.incentivized_packets)) - return "incentivized_packets: array expected"; - for (let i = 0; i < message.incentivized_packets.length; ++i) { - let error = $root.ibc.applications.fee.v1.IdentifiedPacketFees.verify(message.incentivized_packets[i]); - if (error) - return "incentivized_packets." + error; - } - } - return null; - }; - - /** - * Creates a QueryIncentivizedPacketsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} QueryIncentivizedPacketsResponse - */ - QueryIncentivizedPacketsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketsResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsResponse(); - if (object.incentivized_packets) { - if (!Array.isArray(object.incentivized_packets)) - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.incentivized_packets: array expected"); - message.incentivized_packets = []; - for (let i = 0; i < object.incentivized_packets.length; ++i) { - if (typeof object.incentivized_packets[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsResponse.incentivized_packets: object expected"); - message.incentivized_packets[i] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.fromObject(object.incentivized_packets[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsResponse} message QueryIncentivizedPacketsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.incentivized_packets = []; - if (message.incentivized_packets && message.incentivized_packets.length) { - object.incentivized_packets = []; - for (let j = 0; j < message.incentivized_packets.length; ++j) - object.incentivized_packets[j] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.toObject(message.incentivized_packets[j], options); - } - return object; - }; - - /** - * Converts this QueryIncentivizedPacketsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketsResponse; - })(); - - v1.QueryIncentivizedPacketRequest = (function() { - - /** - * Properties of a QueryIncentivizedPacketRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketRequest - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] QueryIncentivizedPacketRequest packet_id - * @property {Long|null} [query_height] QueryIncentivizedPacketRequest query_height - */ - - /** - * Constructs a new QueryIncentivizedPacketRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketRequest. - * @implements IQueryIncentivizedPacketRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest=} [properties] Properties to set - */ - function QueryIncentivizedPacketRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketRequest packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @instance - */ - QueryIncentivizedPacketRequest.prototype.packet_id = null; - - /** - * QueryIncentivizedPacketRequest query_height. - * @member {Long} query_height - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @instance - */ - QueryIncentivizedPacketRequest.prototype.query_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryIncentivizedPacketRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest} message QueryIncentivizedPacketRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query_height != null && Object.hasOwnProperty.call(message, "query_height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.query_height); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketRequest} message QueryIncentivizedPacketRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketRequest} QueryIncentivizedPacketRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - case 2: - message.query_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketRequest} QueryIncentivizedPacketRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - let error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (!$util.isInteger(message.query_height) && !(message.query_height && $util.isInteger(message.query_height.low) && $util.isInteger(message.query_height.high))) - return "query_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryIncentivizedPacketRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketRequest} QueryIncentivizedPacketRequest - */ - QueryIncentivizedPacketRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketRequest(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketRequest.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - if (object.query_height != null) - if ($util.Long) - (message.query_height = $util.Long.fromValue(object.query_height)).unsigned = true; - else if (typeof object.query_height === "string") - message.query_height = parseInt(object.query_height, 10); - else if (typeof object.query_height === "number") - message.query_height = object.query_height; - else if (typeof object.query_height === "object") - message.query_height = new $util.LongBits(object.query_height.low >>> 0, object.query_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketRequest} message QueryIncentivizedPacketRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.packet_id = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.query_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_height = options.longs === String ? "0" : 0; - } - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (typeof message.query_height === "number") - object.query_height = options.longs === String ? String(message.query_height) : message.query_height; - else - object.query_height = options.longs === String ? $util.Long.prototype.toString.call(message.query_height) : options.longs === Number ? new $util.LongBits(message.query_height.low >>> 0, message.query_height.high >>> 0).toNumber(true) : message.query_height; - return object; - }; - - /** - * Converts this QueryIncentivizedPacketRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketRequest - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketRequest; - })(); - - v1.QueryIncentivizedPacketResponse = (function() { - - /** - * Properties of a QueryIncentivizedPacketResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketResponse - * @property {ibc.applications.fee.v1.IIdentifiedPacketFees|null} [incentivized_packet] QueryIncentivizedPacketResponse incentivized_packet - */ - - /** - * Constructs a new QueryIncentivizedPacketResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketResponse. - * @implements IQueryIncentivizedPacketResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketResponse=} [properties] Properties to set - */ - function QueryIncentivizedPacketResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketResponse incentivized_packet. - * @member {ibc.applications.fee.v1.IIdentifiedPacketFees|null|undefined} incentivized_packet - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @instance - */ - QueryIncentivizedPacketResponse.prototype.incentivized_packet = null; - - /** - * Encodes the specified QueryIncentivizedPacketResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketResponse} message QueryIncentivizedPacketResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.incentivized_packet != null && Object.hasOwnProperty.call(message, "incentivized_packet")) - $root.ibc.applications.fee.v1.IdentifiedPacketFees.encode(message.incentivized_packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketResponse} message QueryIncentivizedPacketResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} QueryIncentivizedPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.incentivized_packet = $root.ibc.applications.fee.v1.IdentifiedPacketFees.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} QueryIncentivizedPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.incentivized_packet != null && message.hasOwnProperty("incentivized_packet")) { - let error = $root.ibc.applications.fee.v1.IdentifiedPacketFees.verify(message.incentivized_packet); - if (error) - return "incentivized_packet." + error; - } - return null; - }; - - /** - * Creates a QueryIncentivizedPacketResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} QueryIncentivizedPacketResponse - */ - QueryIncentivizedPacketResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketResponse(); - if (object.incentivized_packet != null) { - if (typeof object.incentivized_packet !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketResponse.incentivized_packet: object expected"); - message.incentivized_packet = $root.ibc.applications.fee.v1.IdentifiedPacketFees.fromObject(object.incentivized_packet); - } - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketResponse} message QueryIncentivizedPacketResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.incentivized_packet = null; - if (message.incentivized_packet != null && message.hasOwnProperty("incentivized_packet")) - object.incentivized_packet = $root.ibc.applications.fee.v1.IdentifiedPacketFees.toObject(message.incentivized_packet, options); - return object; - }; - - /** - * Converts this QueryIncentivizedPacketResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketResponse - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketResponse; - })(); - - v1.QueryIncentivizedPacketsForChannelRequest = (function() { - - /** - * Properties of a QueryIncentivizedPacketsForChannelRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketsForChannelRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryIncentivizedPacketsForChannelRequest pagination - * @property {string|null} [port_id] QueryIncentivizedPacketsForChannelRequest port_id - * @property {string|null} [channel_id] QueryIncentivizedPacketsForChannelRequest channel_id - * @property {Long|null} [query_height] QueryIncentivizedPacketsForChannelRequest query_height - */ - - /** - * Constructs a new QueryIncentivizedPacketsForChannelRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketsForChannelRequest. - * @implements IQueryIncentivizedPacketsForChannelRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest=} [properties] Properties to set - */ - function QueryIncentivizedPacketsForChannelRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketsForChannelRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - */ - QueryIncentivizedPacketsForChannelRequest.prototype.pagination = null; - - /** - * QueryIncentivizedPacketsForChannelRequest port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - */ - QueryIncentivizedPacketsForChannelRequest.prototype.port_id = ""; - - /** - * QueryIncentivizedPacketsForChannelRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - */ - QueryIncentivizedPacketsForChannelRequest.prototype.channel_id = ""; - - /** - * QueryIncentivizedPacketsForChannelRequest query_height. - * @member {Long} query_height - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - */ - QueryIncentivizedPacketsForChannelRequest.prototype.query_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest} message QueryIncentivizedPacketsForChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsForChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.channel_id); - if (message.query_height != null && Object.hasOwnProperty.call(message, "query_height")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.query_height); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelRequest} message QueryIncentivizedPacketsForChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsForChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketsForChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest} QueryIncentivizedPacketsForChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsForChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - case 2: - message.port_id = reader.string(); - break; - case 3: - message.channel_id = reader.string(); - break; - case 4: - message.query_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketsForChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest} QueryIncentivizedPacketsForChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsForChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketsForChannelRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketsForChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (!$util.isInteger(message.query_height) && !(message.query_height && $util.isInteger(message.query_height.low) && $util.isInteger(message.query_height.high))) - return "query_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryIncentivizedPacketsForChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest} QueryIncentivizedPacketsForChannelRequest - */ - QueryIncentivizedPacketsForChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.query_height != null) - if ($util.Long) - (message.query_height = $util.Long.fromValue(object.query_height)).unsigned = true; - else if (typeof object.query_height === "string") - message.query_height = parseInt(object.query_height, 10); - else if (typeof object.query_height === "number") - message.query_height = object.query_height; - else if (typeof object.query_height === "object") - message.query_height = new $util.LongBits(object.query_height.low >>> 0, object.query_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketsForChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest} message QueryIncentivizedPacketsForChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketsForChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.pagination = null; - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.query_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_height = options.longs === String ? "0" : 0; - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (typeof message.query_height === "number") - object.query_height = options.longs === String ? String(message.query_height) : message.query_height; - else - object.query_height = options.longs === String ? $util.Long.prototype.toString.call(message.query_height) : options.longs === Number ? new $util.LongBits(message.query_height.low >>> 0, message.query_height.high >>> 0).toNumber(true) : message.query_height; - return object; - }; - - /** - * Converts this QueryIncentivizedPacketsForChannelRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketsForChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketsForChannelRequest; - })(); - - v1.QueryIncentivizedPacketsForChannelResponse = (function() { - - /** - * Properties of a QueryIncentivizedPacketsForChannelResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryIncentivizedPacketsForChannelResponse - * @property {Array.|null} [incentivized_packets] QueryIncentivizedPacketsForChannelResponse incentivized_packets - */ - - /** - * Constructs a new QueryIncentivizedPacketsForChannelResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryIncentivizedPacketsForChannelResponse. - * @implements IQueryIncentivizedPacketsForChannelResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelResponse=} [properties] Properties to set - */ - function QueryIncentivizedPacketsForChannelResponse(properties) { - this.incentivized_packets = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryIncentivizedPacketsForChannelResponse incentivized_packets. - * @member {Array.} incentivized_packets - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @instance - */ - QueryIncentivizedPacketsForChannelResponse.prototype.incentivized_packets = $util.emptyArray; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelResponse} message QueryIncentivizedPacketsForChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsForChannelResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.incentivized_packets != null && message.incentivized_packets.length) - for (let i = 0; i < message.incentivized_packets.length; ++i) - $root.ibc.applications.fee.v1.IdentifiedPacketFees.encode(message.incentivized_packets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryIncentivizedPacketsForChannelResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {ibc.applications.fee.v1.IQueryIncentivizedPacketsForChannelResponse} message QueryIncentivizedPacketsForChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryIncentivizedPacketsForChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryIncentivizedPacketsForChannelResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} QueryIncentivizedPacketsForChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsForChannelResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.incentivized_packets && message.incentivized_packets.length)) - message.incentivized_packets = []; - message.incentivized_packets.push($root.ibc.applications.fee.v1.IdentifiedPacketFees.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryIncentivizedPacketsForChannelResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} QueryIncentivizedPacketsForChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryIncentivizedPacketsForChannelResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryIncentivizedPacketsForChannelResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryIncentivizedPacketsForChannelResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.incentivized_packets != null && message.hasOwnProperty("incentivized_packets")) { - if (!Array.isArray(message.incentivized_packets)) - return "incentivized_packets: array expected"; - for (let i = 0; i < message.incentivized_packets.length; ++i) { - let error = $root.ibc.applications.fee.v1.IdentifiedPacketFees.verify(message.incentivized_packets[i]); - if (error) - return "incentivized_packets." + error; - } - } - return null; - }; - - /** - * Creates a QueryIncentivizedPacketsForChannelResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} QueryIncentivizedPacketsForChannelResponse - */ - QueryIncentivizedPacketsForChannelResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse(); - if (object.incentivized_packets) { - if (!Array.isArray(object.incentivized_packets)) - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.incentivized_packets: array expected"); - message.incentivized_packets = []; - for (let i = 0; i < object.incentivized_packets.length; ++i) { - if (typeof object.incentivized_packets[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse.incentivized_packets: object expected"); - message.incentivized_packets[i] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.fromObject(object.incentivized_packets[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryIncentivizedPacketsForChannelResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @static - * @param {ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse} message QueryIncentivizedPacketsForChannelResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryIncentivizedPacketsForChannelResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.incentivized_packets = []; - if (message.incentivized_packets && message.incentivized_packets.length) { - object.incentivized_packets = []; - for (let j = 0; j < message.incentivized_packets.length; ++j) - object.incentivized_packets[j] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.toObject(message.incentivized_packets[j], options); - } - return object; - }; - - /** - * Converts this QueryIncentivizedPacketsForChannelResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse - * @instance - * @returns {Object.} JSON object - */ - QueryIncentivizedPacketsForChannelResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryIncentivizedPacketsForChannelResponse; - })(); - - v1.QueryTotalRecvFeesRequest = (function() { - - /** - * Properties of a QueryTotalRecvFeesRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalRecvFeesRequest - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] QueryTotalRecvFeesRequest packet_id - */ - - /** - * Constructs a new QueryTotalRecvFeesRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalRecvFeesRequest. - * @implements IQueryTotalRecvFeesRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest=} [properties] Properties to set - */ - function QueryTotalRecvFeesRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalRecvFeesRequest packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @instance - */ - QueryTotalRecvFeesRequest.prototype.packet_id = null; - - /** - * Encodes the specified QueryTotalRecvFeesRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest} message QueryTotalRecvFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalRecvFeesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalRecvFeesRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesRequest} message QueryTotalRecvFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalRecvFeesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalRecvFeesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesRequest} QueryTotalRecvFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalRecvFeesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalRecvFeesRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalRecvFeesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesRequest} QueryTotalRecvFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalRecvFeesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalRecvFeesRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalRecvFeesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - let error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - return null; - }; - - /** - * Creates a QueryTotalRecvFeesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesRequest} QueryTotalRecvFeesRequest - */ - QueryTotalRecvFeesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalRecvFeesRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryTotalRecvFeesRequest(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalRecvFeesRequest.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalRecvFeesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @static - * @param {ibc.applications.fee.v1.QueryTotalRecvFeesRequest} message QueryTotalRecvFeesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalRecvFeesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.packet_id = null; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - return object; - }; - - /** - * Converts this QueryTotalRecvFeesRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryTotalRecvFeesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalRecvFeesRequest; - })(); - - v1.QueryTotalRecvFeesResponse = (function() { - - /** - * Properties of a QueryTotalRecvFeesResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalRecvFeesResponse - * @property {Array.|null} [recv_fees] QueryTotalRecvFeesResponse recv_fees - */ - - /** - * Constructs a new QueryTotalRecvFeesResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalRecvFeesResponse. - * @implements IQueryTotalRecvFeesResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesResponse=} [properties] Properties to set - */ - function QueryTotalRecvFeesResponse(properties) { - this.recv_fees = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalRecvFeesResponse recv_fees. - * @member {Array.} recv_fees - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @instance - */ - QueryTotalRecvFeesResponse.prototype.recv_fees = $util.emptyArray; - - /** - * Encodes the specified QueryTotalRecvFeesResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesResponse} message QueryTotalRecvFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalRecvFeesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recv_fees != null && message.recv_fees.length) - for (let i = 0; i < message.recv_fees.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.recv_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalRecvFeesResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalRecvFeesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalRecvFeesResponse} message QueryTotalRecvFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalRecvFeesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalRecvFeesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} QueryTotalRecvFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalRecvFeesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalRecvFeesResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.recv_fees && message.recv_fees.length)) - message.recv_fees = []; - message.recv_fees.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalRecvFeesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} QueryTotalRecvFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalRecvFeesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalRecvFeesResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalRecvFeesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recv_fees != null && message.hasOwnProperty("recv_fees")) { - if (!Array.isArray(message.recv_fees)) - return "recv_fees: array expected"; - for (let i = 0; i < message.recv_fees.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.recv_fees[i]); - if (error) - return "recv_fees." + error; - } - } - return null; - }; - - /** - * Creates a QueryTotalRecvFeesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} QueryTotalRecvFeesResponse - */ - QueryTotalRecvFeesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalRecvFeesResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryTotalRecvFeesResponse(); - if (object.recv_fees) { - if (!Array.isArray(object.recv_fees)) - throw TypeError(".ibc.applications.fee.v1.QueryTotalRecvFeesResponse.recv_fees: array expected"); - message.recv_fees = []; - for (let i = 0; i < object.recv_fees.length; ++i) { - if (typeof object.recv_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalRecvFeesResponse.recv_fees: object expected"); - message.recv_fees[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.recv_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalRecvFeesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @static - * @param {ibc.applications.fee.v1.QueryTotalRecvFeesResponse} message QueryTotalRecvFeesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalRecvFeesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.recv_fees = []; - if (message.recv_fees && message.recv_fees.length) { - object.recv_fees = []; - for (let j = 0; j < message.recv_fees.length; ++j) - object.recv_fees[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.recv_fees[j], options); - } - return object; - }; - - /** - * Converts this QueryTotalRecvFeesResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalRecvFeesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryTotalRecvFeesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalRecvFeesResponse; - })(); - - v1.QueryTotalAckFeesRequest = (function() { - - /** - * Properties of a QueryTotalAckFeesRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalAckFeesRequest - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] QueryTotalAckFeesRequest packet_id - */ - - /** - * Constructs a new QueryTotalAckFeesRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalAckFeesRequest. - * @implements IQueryTotalAckFeesRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest=} [properties] Properties to set - */ - function QueryTotalAckFeesRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalAckFeesRequest packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @instance - */ - QueryTotalAckFeesRequest.prototype.packet_id = null; - - /** - * Encodes the specified QueryTotalAckFeesRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest} message QueryTotalAckFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalAckFeesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalAckFeesRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesRequest} message QueryTotalAckFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalAckFeesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalAckFeesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesRequest} QueryTotalAckFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalAckFeesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalAckFeesRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalAckFeesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesRequest} QueryTotalAckFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalAckFeesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalAckFeesRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalAckFeesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - let error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - return null; - }; - - /** - * Creates a QueryTotalAckFeesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesRequest} QueryTotalAckFeesRequest - */ - QueryTotalAckFeesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalAckFeesRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryTotalAckFeesRequest(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalAckFeesRequest.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalAckFeesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @static - * @param {ibc.applications.fee.v1.QueryTotalAckFeesRequest} message QueryTotalAckFeesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalAckFeesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.packet_id = null; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - return object; - }; - - /** - * Converts this QueryTotalAckFeesRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryTotalAckFeesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalAckFeesRequest; - })(); - - v1.QueryTotalAckFeesResponse = (function() { - - /** - * Properties of a QueryTotalAckFeesResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalAckFeesResponse - * @property {Array.|null} [ack_fees] QueryTotalAckFeesResponse ack_fees - */ - - /** - * Constructs a new QueryTotalAckFeesResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalAckFeesResponse. - * @implements IQueryTotalAckFeesResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesResponse=} [properties] Properties to set - */ - function QueryTotalAckFeesResponse(properties) { - this.ack_fees = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalAckFeesResponse ack_fees. - * @member {Array.} ack_fees - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @instance - */ - QueryTotalAckFeesResponse.prototype.ack_fees = $util.emptyArray; - - /** - * Encodes the specified QueryTotalAckFeesResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesResponse} message QueryTotalAckFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalAckFeesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ack_fees != null && message.ack_fees.length) - for (let i = 0; i < message.ack_fees.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.ack_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalAckFeesResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalAckFeesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalAckFeesResponse} message QueryTotalAckFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalAckFeesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalAckFeesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesResponse} QueryTotalAckFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalAckFeesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalAckFeesResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ack_fees && message.ack_fees.length)) - message.ack_fees = []; - message.ack_fees.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalAckFeesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesResponse} QueryTotalAckFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalAckFeesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalAckFeesResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalAckFeesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ack_fees != null && message.hasOwnProperty("ack_fees")) { - if (!Array.isArray(message.ack_fees)) - return "ack_fees: array expected"; - for (let i = 0; i < message.ack_fees.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.ack_fees[i]); - if (error) - return "ack_fees." + error; - } - } - return null; - }; - - /** - * Creates a QueryTotalAckFeesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalAckFeesResponse} QueryTotalAckFeesResponse - */ - QueryTotalAckFeesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalAckFeesResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryTotalAckFeesResponse(); - if (object.ack_fees) { - if (!Array.isArray(object.ack_fees)) - throw TypeError(".ibc.applications.fee.v1.QueryTotalAckFeesResponse.ack_fees: array expected"); - message.ack_fees = []; - for (let i = 0; i < object.ack_fees.length; ++i) { - if (typeof object.ack_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalAckFeesResponse.ack_fees: object expected"); - message.ack_fees[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.ack_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalAckFeesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @static - * @param {ibc.applications.fee.v1.QueryTotalAckFeesResponse} message QueryTotalAckFeesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalAckFeesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.ack_fees = []; - if (message.ack_fees && message.ack_fees.length) { - object.ack_fees = []; - for (let j = 0; j < message.ack_fees.length; ++j) - object.ack_fees[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.ack_fees[j], options); - } - return object; - }; - - /** - * Converts this QueryTotalAckFeesResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalAckFeesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryTotalAckFeesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalAckFeesResponse; - })(); - - v1.QueryTotalTimeoutFeesRequest = (function() { - - /** - * Properties of a QueryTotalTimeoutFeesRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalTimeoutFeesRequest - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] QueryTotalTimeoutFeesRequest packet_id - */ - - /** - * Constructs a new QueryTotalTimeoutFeesRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalTimeoutFeesRequest. - * @implements IQueryTotalTimeoutFeesRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest=} [properties] Properties to set - */ - function QueryTotalTimeoutFeesRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalTimeoutFeesRequest packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @instance - */ - QueryTotalTimeoutFeesRequest.prototype.packet_id = null; - - /** - * Encodes the specified QueryTotalTimeoutFeesRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest} message QueryTotalTimeoutFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalTimeoutFeesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalTimeoutFeesRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesRequest} message QueryTotalTimeoutFeesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalTimeoutFeesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalTimeoutFeesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest} QueryTotalTimeoutFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalTimeoutFeesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalTimeoutFeesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest} QueryTotalTimeoutFeesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalTimeoutFeesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalTimeoutFeesRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalTimeoutFeesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - let error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - return null; - }; - - /** - * Creates a QueryTotalTimeoutFeesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest} QueryTotalTimeoutFeesRequest - */ - QueryTotalTimeoutFeesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest(); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalTimeoutFeesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @static - * @param {ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest} message QueryTotalTimeoutFeesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalTimeoutFeesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.packet_id = null; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - return object; - }; - - /** - * Converts this QueryTotalTimeoutFeesRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryTotalTimeoutFeesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalTimeoutFeesRequest; - })(); - - v1.QueryTotalTimeoutFeesResponse = (function() { - - /** - * Properties of a QueryTotalTimeoutFeesResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryTotalTimeoutFeesResponse - * @property {Array.|null} [timeout_fees] QueryTotalTimeoutFeesResponse timeout_fees - */ - - /** - * Constructs a new QueryTotalTimeoutFeesResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryTotalTimeoutFeesResponse. - * @implements IQueryTotalTimeoutFeesResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesResponse=} [properties] Properties to set - */ - function QueryTotalTimeoutFeesResponse(properties) { - this.timeout_fees = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalTimeoutFeesResponse timeout_fees. - * @member {Array.} timeout_fees - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @instance - */ - QueryTotalTimeoutFeesResponse.prototype.timeout_fees = $util.emptyArray; - - /** - * Encodes the specified QueryTotalTimeoutFeesResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesResponse} message QueryTotalTimeoutFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalTimeoutFeesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timeout_fees != null && message.timeout_fees.length) - for (let i = 0; i < message.timeout_fees.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.timeout_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalTimeoutFeesResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {ibc.applications.fee.v1.IQueryTotalTimeoutFeesResponse} message QueryTotalTimeoutFeesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalTimeoutFeesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalTimeoutFeesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} QueryTotalTimeoutFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalTimeoutFeesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.timeout_fees && message.timeout_fees.length)) - message.timeout_fees = []; - message.timeout_fees.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalTimeoutFeesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} QueryTotalTimeoutFeesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalTimeoutFeesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalTimeoutFeesResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalTimeoutFeesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timeout_fees != null && message.hasOwnProperty("timeout_fees")) { - if (!Array.isArray(message.timeout_fees)) - return "timeout_fees: array expected"; - for (let i = 0; i < message.timeout_fees.length; ++i) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.timeout_fees[i]); - if (error) - return "timeout_fees." + error; - } - } - return null; - }; - - /** - * Creates a QueryTotalTimeoutFeesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} QueryTotalTimeoutFeesResponse - */ - QueryTotalTimeoutFeesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse(); - if (object.timeout_fees) { - if (!Array.isArray(object.timeout_fees)) - throw TypeError(".ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.timeout_fees: array expected"); - message.timeout_fees = []; - for (let i = 0; i < object.timeout_fees.length; ++i) { - if (typeof object.timeout_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse.timeout_fees: object expected"); - message.timeout_fees[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.timeout_fees[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalTimeoutFeesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @static - * @param {ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse} message QueryTotalTimeoutFeesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalTimeoutFeesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.timeout_fees = []; - if (message.timeout_fees && message.timeout_fees.length) { - object.timeout_fees = []; - for (let j = 0; j < message.timeout_fees.length; ++j) - object.timeout_fees[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.timeout_fees[j], options); - } - return object; - }; - - /** - * Converts this QueryTotalTimeoutFeesResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryTotalTimeoutFeesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalTimeoutFeesResponse; - })(); - - v1.QueryPayeeRequest = (function() { - - /** - * Properties of a QueryPayeeRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryPayeeRequest - * @property {string|null} [channel_id] QueryPayeeRequest channel_id - * @property {string|null} [relayer] QueryPayeeRequest relayer - */ - - /** - * Constructs a new QueryPayeeRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryPayeeRequest. - * @implements IQueryPayeeRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryPayeeRequest=} [properties] Properties to set - */ - function QueryPayeeRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPayeeRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @instance - */ - QueryPayeeRequest.prototype.channel_id = ""; - - /** - * QueryPayeeRequest relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @instance - */ - QueryPayeeRequest.prototype.relayer = ""; - - /** - * Encodes the specified QueryPayeeRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {ibc.applications.fee.v1.IQueryPayeeRequest} message QueryPayeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPayeeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relayer); - return writer; - }; - - /** - * Encodes the specified QueryPayeeRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {ibc.applications.fee.v1.IQueryPayeeRequest} message QueryPayeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPayeeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPayeeRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryPayeeRequest} QueryPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPayeeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryPayeeRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.relayer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPayeeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryPayeeRequest} QueryPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPayeeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPayeeRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPayeeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - return null; - }; - - /** - * Creates a QueryPayeeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryPayeeRequest} QueryPayeeRequest - */ - QueryPayeeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryPayeeRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryPayeeRequest(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - return message; - }; - - /** - * Creates a plain object from a QueryPayeeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @static - * @param {ibc.applications.fee.v1.QueryPayeeRequest} message QueryPayeeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPayeeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.channel_id = ""; - object.relayer = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - return object; - }; - - /** - * Converts this QueryPayeeRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryPayeeRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPayeeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPayeeRequest; - })(); - - v1.QueryPayeeResponse = (function() { - - /** - * Properties of a QueryPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryPayeeResponse - * @property {string|null} [payee_address] QueryPayeeResponse payee_address - */ - - /** - * Constructs a new QueryPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryPayeeResponse. - * @implements IQueryPayeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryPayeeResponse=} [properties] Properties to set - */ - function QueryPayeeResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPayeeResponse payee_address. - * @member {string} payee_address - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @instance - */ - QueryPayeeResponse.prototype.payee_address = ""; - - /** - * Encodes the specified QueryPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IQueryPayeeResponse} message QueryPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPayeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.payee_address != null && Object.hasOwnProperty.call(message, "payee_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.payee_address); - return writer; - }; - - /** - * Encodes the specified QueryPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryPayeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IQueryPayeeResponse} message QueryPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPayeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPayeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryPayeeResponse} QueryPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPayeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryPayeeResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.payee_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPayeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryPayeeResponse} QueryPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPayeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPayeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPayeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.payee_address != null && message.hasOwnProperty("payee_address")) - if (!$util.isString(message.payee_address)) - return "payee_address: string expected"; - return null; - }; - - /** - * Creates a QueryPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryPayeeResponse} QueryPayeeResponse - */ - QueryPayeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryPayeeResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryPayeeResponse(); - if (object.payee_address != null) - message.payee_address = String(object.payee_address); - return message; - }; - - /** - * Creates a plain object from a QueryPayeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @static - * @param {ibc.applications.fee.v1.QueryPayeeResponse} message QueryPayeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPayeeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.payee_address = ""; - if (message.payee_address != null && message.hasOwnProperty("payee_address")) - object.payee_address = message.payee_address; - return object; - }; - - /** - * Converts this QueryPayeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryPayeeResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPayeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPayeeResponse; - })(); - - v1.QueryCounterpartyPayeeRequest = (function() { - - /** - * Properties of a QueryCounterpartyPayeeRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryCounterpartyPayeeRequest - * @property {string|null} [channel_id] QueryCounterpartyPayeeRequest channel_id - * @property {string|null} [relayer] QueryCounterpartyPayeeRequest relayer - */ - - /** - * Constructs a new QueryCounterpartyPayeeRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryCounterpartyPayeeRequest. - * @implements IQueryCounterpartyPayeeRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest=} [properties] Properties to set - */ - function QueryCounterpartyPayeeRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryCounterpartyPayeeRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @instance - */ - QueryCounterpartyPayeeRequest.prototype.channel_id = ""; - - /** - * QueryCounterpartyPayeeRequest relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @instance - */ - QueryCounterpartyPayeeRequest.prototype.relayer = ""; - - /** - * Encodes the specified QueryCounterpartyPayeeRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest} message QueryCounterpartyPayeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCounterpartyPayeeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relayer); - return writer; - }; - - /** - * Encodes the specified QueryCounterpartyPayeeRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeRequest} message QueryCounterpartyPayeeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCounterpartyPayeeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryCounterpartyPayeeRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeRequest} QueryCounterpartyPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCounterpartyPayeeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryCounterpartyPayeeRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.relayer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryCounterpartyPayeeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeRequest} QueryCounterpartyPayeeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCounterpartyPayeeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryCounterpartyPayeeRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryCounterpartyPayeeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - return null; - }; - - /** - * Creates a QueryCounterpartyPayeeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeRequest} QueryCounterpartyPayeeRequest - */ - QueryCounterpartyPayeeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryCounterpartyPayeeRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryCounterpartyPayeeRequest(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - return message; - }; - - /** - * Creates a plain object from a QueryCounterpartyPayeeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @static - * @param {ibc.applications.fee.v1.QueryCounterpartyPayeeRequest} message QueryCounterpartyPayeeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryCounterpartyPayeeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.channel_id = ""; - object.relayer = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - return object; - }; - - /** - * Converts this QueryCounterpartyPayeeRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeRequest - * @instance - * @returns {Object.} JSON object - */ - QueryCounterpartyPayeeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryCounterpartyPayeeRequest; - })(); - - v1.QueryCounterpartyPayeeResponse = (function() { - - /** - * Properties of a QueryCounterpartyPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryCounterpartyPayeeResponse - * @property {string|null} [counterparty_payee] QueryCounterpartyPayeeResponse counterparty_payee - */ - - /** - * Constructs a new QueryCounterpartyPayeeResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryCounterpartyPayeeResponse. - * @implements IQueryCounterpartyPayeeResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeResponse=} [properties] Properties to set - */ - function QueryCounterpartyPayeeResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryCounterpartyPayeeResponse counterparty_payee. - * @member {string} counterparty_payee - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @instance - */ - QueryCounterpartyPayeeResponse.prototype.counterparty_payee = ""; - - /** - * Encodes the specified QueryCounterpartyPayeeResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeResponse} message QueryCounterpartyPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCounterpartyPayeeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.counterparty_payee != null && Object.hasOwnProperty.call(message, "counterparty_payee")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.counterparty_payee); - return writer; - }; - - /** - * Encodes the specified QueryCounterpartyPayeeResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryCounterpartyPayeeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.IQueryCounterpartyPayeeResponse} message QueryCounterpartyPayeeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryCounterpartyPayeeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryCounterpartyPayeeResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} QueryCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCounterpartyPayeeResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryCounterpartyPayeeResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.counterparty_payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryCounterpartyPayeeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} QueryCounterpartyPayeeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryCounterpartyPayeeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryCounterpartyPayeeResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryCounterpartyPayeeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - if (!$util.isString(message.counterparty_payee)) - return "counterparty_payee: string expected"; - return null; - }; - - /** - * Creates a QueryCounterpartyPayeeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} QueryCounterpartyPayeeResponse - */ - QueryCounterpartyPayeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryCounterpartyPayeeResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryCounterpartyPayeeResponse(); - if (object.counterparty_payee != null) - message.counterparty_payee = String(object.counterparty_payee); - return message; - }; - - /** - * Creates a plain object from a QueryCounterpartyPayeeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @static - * @param {ibc.applications.fee.v1.QueryCounterpartyPayeeResponse} message QueryCounterpartyPayeeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryCounterpartyPayeeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.counterparty_payee = ""; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - object.counterparty_payee = message.counterparty_payee; - return object; - }; - - /** - * Converts this QueryCounterpartyPayeeResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryCounterpartyPayeeResponse - * @instance - * @returns {Object.} JSON object - */ - QueryCounterpartyPayeeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryCounterpartyPayeeResponse; - })(); - - v1.QueryFeeEnabledChannelsRequest = (function() { - - /** - * Properties of a QueryFeeEnabledChannelsRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryFeeEnabledChannelsRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryFeeEnabledChannelsRequest pagination - * @property {Long|null} [query_height] QueryFeeEnabledChannelsRequest query_height - */ - - /** - * Constructs a new QueryFeeEnabledChannelsRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryFeeEnabledChannelsRequest. - * @implements IQueryFeeEnabledChannelsRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest=} [properties] Properties to set - */ - function QueryFeeEnabledChannelsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFeeEnabledChannelsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @instance - */ - QueryFeeEnabledChannelsRequest.prototype.pagination = null; - - /** - * QueryFeeEnabledChannelsRequest query_height. - * @member {Long} query_height - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @instance - */ - QueryFeeEnabledChannelsRequest.prototype.query_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryFeeEnabledChannelsRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest} message QueryFeeEnabledChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query_height != null && Object.hasOwnProperty.call(message, "query_height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.query_height); - return writer; - }; - - /** - * Encodes the specified QueryFeeEnabledChannelsRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsRequest} message QueryFeeEnabledChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFeeEnabledChannelsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest} QueryFeeEnabledChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - case 2: - message.query_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFeeEnabledChannelsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest} QueryFeeEnabledChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFeeEnabledChannelsRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFeeEnabledChannelsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (!$util.isInteger(message.query_height) && !(message.query_height && $util.isInteger(message.query_height.low) && $util.isInteger(message.query_height.high))) - return "query_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryFeeEnabledChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest} QueryFeeEnabledChannelsRequest - */ - QueryFeeEnabledChannelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - if (object.query_height != null) - if ($util.Long) - (message.query_height = $util.Long.fromValue(object.query_height)).unsigned = true; - else if (typeof object.query_height === "string") - message.query_height = parseInt(object.query_height, 10); - else if (typeof object.query_height === "number") - message.query_height = object.query_height; - else if (typeof object.query_height === "object") - message.query_height = new $util.LongBits(object.query_height.low >>> 0, object.query_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryFeeEnabledChannelsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @static - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest} message QueryFeeEnabledChannelsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFeeEnabledChannelsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.pagination = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.query_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_height = options.longs === String ? "0" : 0; - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - if (message.query_height != null && message.hasOwnProperty("query_height")) - if (typeof message.query_height === "number") - object.query_height = options.longs === String ? String(message.query_height) : message.query_height; - else - object.query_height = options.longs === String ? $util.Long.prototype.toString.call(message.query_height) : options.longs === Number ? new $util.LongBits(message.query_height.low >>> 0, message.query_height.high >>> 0).toNumber(true) : message.query_height; - return object; - }; - - /** - * Converts this QueryFeeEnabledChannelsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryFeeEnabledChannelsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFeeEnabledChannelsRequest; - })(); - - v1.QueryFeeEnabledChannelsResponse = (function() { - - /** - * Properties of a QueryFeeEnabledChannelsResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryFeeEnabledChannelsResponse - * @property {Array.|null} [fee_enabled_channels] QueryFeeEnabledChannelsResponse fee_enabled_channels - */ - - /** - * Constructs a new QueryFeeEnabledChannelsResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryFeeEnabledChannelsResponse. - * @implements IQueryFeeEnabledChannelsResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsResponse=} [properties] Properties to set - */ - function QueryFeeEnabledChannelsResponse(properties) { - this.fee_enabled_channels = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFeeEnabledChannelsResponse fee_enabled_channels. - * @member {Array.} fee_enabled_channels - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @instance - */ - QueryFeeEnabledChannelsResponse.prototype.fee_enabled_channels = $util.emptyArray; - - /** - * Encodes the specified QueryFeeEnabledChannelsResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsResponse} message QueryFeeEnabledChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee_enabled_channels != null && message.fee_enabled_channels.length) - for (let i = 0; i < message.fee_enabled_channels.length; ++i) - $root.ibc.applications.fee.v1.FeeEnabledChannel.encode(message.fee_enabled_channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryFeeEnabledChannelsResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelsResponse} message QueryFeeEnabledChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFeeEnabledChannelsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} QueryFeeEnabledChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.fee_enabled_channels && message.fee_enabled_channels.length)) - message.fee_enabled_channels = []; - message.fee_enabled_channels.push($root.ibc.applications.fee.v1.FeeEnabledChannel.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFeeEnabledChannelsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} QueryFeeEnabledChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFeeEnabledChannelsResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFeeEnabledChannelsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee_enabled_channels != null && message.hasOwnProperty("fee_enabled_channels")) { - if (!Array.isArray(message.fee_enabled_channels)) - return "fee_enabled_channels: array expected"; - for (let i = 0; i < message.fee_enabled_channels.length; ++i) { - let error = $root.ibc.applications.fee.v1.FeeEnabledChannel.verify(message.fee_enabled_channels[i]); - if (error) - return "fee_enabled_channels." + error; - } - } - return null; - }; - - /** - * Creates a QueryFeeEnabledChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} QueryFeeEnabledChannelsResponse - */ - QueryFeeEnabledChannelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse(); - if (object.fee_enabled_channels) { - if (!Array.isArray(object.fee_enabled_channels)) - throw TypeError(".ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.fee_enabled_channels: array expected"); - message.fee_enabled_channels = []; - for (let i = 0; i < object.fee_enabled_channels.length; ++i) { - if (typeof object.fee_enabled_channels[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse.fee_enabled_channels: object expected"); - message.fee_enabled_channels[i] = $root.ibc.applications.fee.v1.FeeEnabledChannel.fromObject(object.fee_enabled_channels[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QueryFeeEnabledChannelsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @static - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse} message QueryFeeEnabledChannelsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFeeEnabledChannelsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.fee_enabled_channels = []; - if (message.fee_enabled_channels && message.fee_enabled_channels.length) { - object.fee_enabled_channels = []; - for (let j = 0; j < message.fee_enabled_channels.length; ++j) - object.fee_enabled_channels[j] = $root.ibc.applications.fee.v1.FeeEnabledChannel.toObject(message.fee_enabled_channels[j], options); - } - return object; - }; - - /** - * Converts this QueryFeeEnabledChannelsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryFeeEnabledChannelsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFeeEnabledChannelsResponse; - })(); - - v1.QueryFeeEnabledChannelRequest = (function() { - - /** - * Properties of a QueryFeeEnabledChannelRequest. - * @memberof ibc.applications.fee.v1 - * @interface IQueryFeeEnabledChannelRequest - * @property {string|null} [port_id] QueryFeeEnabledChannelRequest port_id - * @property {string|null} [channel_id] QueryFeeEnabledChannelRequest channel_id - */ - - /** - * Constructs a new QueryFeeEnabledChannelRequest. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryFeeEnabledChannelRequest. - * @implements IQueryFeeEnabledChannelRequest - * @constructor - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest=} [properties] Properties to set - */ - function QueryFeeEnabledChannelRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFeeEnabledChannelRequest port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @instance - */ - QueryFeeEnabledChannelRequest.prototype.port_id = ""; - - /** - * QueryFeeEnabledChannelRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @instance - */ - QueryFeeEnabledChannelRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryFeeEnabledChannelRequest message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest} message QueryFeeEnabledChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryFeeEnabledChannelRequest message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelRequest} message QueryFeeEnabledChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFeeEnabledChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelRequest} QueryFeeEnabledChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFeeEnabledChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelRequest} QueryFeeEnabledChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFeeEnabledChannelRequest message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFeeEnabledChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryFeeEnabledChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelRequest} QueryFeeEnabledChannelRequest - */ - QueryFeeEnabledChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryFeeEnabledChannelRequest) - return object; - let message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryFeeEnabledChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @static - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelRequest} message QueryFeeEnabledChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFeeEnabledChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryFeeEnabledChannelRequest to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelRequest - * @instance - * @returns {Object.} JSON object - */ - QueryFeeEnabledChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFeeEnabledChannelRequest; - })(); - - v1.QueryFeeEnabledChannelResponse = (function() { - - /** - * Properties of a QueryFeeEnabledChannelResponse. - * @memberof ibc.applications.fee.v1 - * @interface IQueryFeeEnabledChannelResponse - * @property {boolean|null} [fee_enabled] QueryFeeEnabledChannelResponse fee_enabled - */ - - /** - * Constructs a new QueryFeeEnabledChannelResponse. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a QueryFeeEnabledChannelResponse. - * @implements IQueryFeeEnabledChannelResponse - * @constructor - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelResponse=} [properties] Properties to set - */ - function QueryFeeEnabledChannelResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFeeEnabledChannelResponse fee_enabled. - * @member {boolean} fee_enabled - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @instance - */ - QueryFeeEnabledChannelResponse.prototype.fee_enabled = false; - - /** - * Encodes the specified QueryFeeEnabledChannelResponse message. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelResponse} message QueryFeeEnabledChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee_enabled != null && Object.hasOwnProperty.call(message, "fee_enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.fee_enabled); - return writer; - }; - - /** - * Encodes the specified QueryFeeEnabledChannelResponse message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.QueryFeeEnabledChannelResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {ibc.applications.fee.v1.IQueryFeeEnabledChannelResponse} message QueryFeeEnabledChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFeeEnabledChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFeeEnabledChannelResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} QueryFeeEnabledChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFeeEnabledChannelResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} QueryFeeEnabledChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFeeEnabledChannelResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFeeEnabledChannelResponse message. - * @function verify - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFeeEnabledChannelResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee_enabled != null && message.hasOwnProperty("fee_enabled")) - if (typeof message.fee_enabled !== "boolean") - return "fee_enabled: boolean expected"; - return null; - }; - - /** - * Creates a QueryFeeEnabledChannelResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} QueryFeeEnabledChannelResponse - */ - QueryFeeEnabledChannelResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.QueryFeeEnabledChannelResponse) - return object; - let message = new $root.ibc.applications.fee.v1.QueryFeeEnabledChannelResponse(); - if (object.fee_enabled != null) - message.fee_enabled = Boolean(object.fee_enabled); - return message; - }; - - /** - * Creates a plain object from a QueryFeeEnabledChannelResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @static - * @param {ibc.applications.fee.v1.QueryFeeEnabledChannelResponse} message QueryFeeEnabledChannelResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFeeEnabledChannelResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.fee_enabled = false; - if (message.fee_enabled != null && message.hasOwnProperty("fee_enabled")) - object.fee_enabled = message.fee_enabled; - return object; - }; - - /** - * Converts this QueryFeeEnabledChannelResponse to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.QueryFeeEnabledChannelResponse - * @instance - * @returns {Object.} JSON object - */ - QueryFeeEnabledChannelResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFeeEnabledChannelResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.applications.fee.v1 - * @interface IGenesisState - * @property {Array.|null} [identified_fees] GenesisState identified_fees - * @property {Array.|null} [fee_enabled_channels] GenesisState fee_enabled_channels - * @property {Array.|null} [registered_payees] GenesisState registered_payees - * @property {Array.|null} [registered_counterparty_payees] GenesisState registered_counterparty_payees - * @property {Array.|null} [forward_relayers] GenesisState forward_relayers - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.applications.fee.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.identified_fees = []; - this.fee_enabled_channels = []; - this.registered_payees = []; - this.registered_counterparty_payees = []; - this.forward_relayers = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState identified_fees. - * @member {Array.} identified_fees - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.identified_fees = $util.emptyArray; - - /** - * GenesisState fee_enabled_channels. - * @member {Array.} fee_enabled_channels - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.fee_enabled_channels = $util.emptyArray; - - /** - * GenesisState registered_payees. - * @member {Array.} registered_payees - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.registered_payees = $util.emptyArray; - - /** - * GenesisState registered_counterparty_payees. - * @member {Array.} registered_counterparty_payees - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.registered_counterparty_payees = $util.emptyArray; - - /** - * GenesisState forward_relayers. - * @member {Array.} forward_relayers - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - */ - GenesisState.prototype.forward_relayers = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.fee.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {ibc.applications.fee.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identified_fees != null && message.identified_fees.length) - for (let i = 0; i < message.identified_fees.length; ++i) - $root.ibc.applications.fee.v1.IdentifiedPacketFees.encode(message.identified_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fee_enabled_channels != null && message.fee_enabled_channels.length) - for (let i = 0; i < message.fee_enabled_channels.length; ++i) - $root.ibc.applications.fee.v1.FeeEnabledChannel.encode(message.fee_enabled_channels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.registered_payees != null && message.registered_payees.length) - for (let i = 0; i < message.registered_payees.length; ++i) - $root.ibc.applications.fee.v1.RegisteredPayee.encode(message.registered_payees[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.registered_counterparty_payees != null && message.registered_counterparty_payees.length) - for (let i = 0; i < message.registered_counterparty_payees.length; ++i) - $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.encode(message.registered_counterparty_payees[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.forward_relayers != null && message.forward_relayers.length) - for (let i = 0; i < message.forward_relayers.length; ++i) - $root.ibc.applications.fee.v1.ForwardRelayerAddress.encode(message.forward_relayers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {ibc.applications.fee.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.GenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.identified_fees && message.identified_fees.length)) - message.identified_fees = []; - message.identified_fees.push($root.ibc.applications.fee.v1.IdentifiedPacketFees.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.fee_enabled_channels && message.fee_enabled_channels.length)) - message.fee_enabled_channels = []; - message.fee_enabled_channels.push($root.ibc.applications.fee.v1.FeeEnabledChannel.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.registered_payees && message.registered_payees.length)) - message.registered_payees = []; - message.registered_payees.push($root.ibc.applications.fee.v1.RegisteredPayee.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.registered_counterparty_payees && message.registered_counterparty_payees.length)) - message.registered_counterparty_payees = []; - message.registered_counterparty_payees.push($root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.forward_relayers && message.forward_relayers.length)) - message.forward_relayers = []; - message.forward_relayers.push($root.ibc.applications.fee.v1.ForwardRelayerAddress.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identified_fees != null && message.hasOwnProperty("identified_fees")) { - if (!Array.isArray(message.identified_fees)) - return "identified_fees: array expected"; - for (let i = 0; i < message.identified_fees.length; ++i) { - let error = $root.ibc.applications.fee.v1.IdentifiedPacketFees.verify(message.identified_fees[i]); - if (error) - return "identified_fees." + error; - } - } - if (message.fee_enabled_channels != null && message.hasOwnProperty("fee_enabled_channels")) { - if (!Array.isArray(message.fee_enabled_channels)) - return "fee_enabled_channels: array expected"; - for (let i = 0; i < message.fee_enabled_channels.length; ++i) { - let error = $root.ibc.applications.fee.v1.FeeEnabledChannel.verify(message.fee_enabled_channels[i]); - if (error) - return "fee_enabled_channels." + error; - } - } - if (message.registered_payees != null && message.hasOwnProperty("registered_payees")) { - if (!Array.isArray(message.registered_payees)) - return "registered_payees: array expected"; - for (let i = 0; i < message.registered_payees.length; ++i) { - let error = $root.ibc.applications.fee.v1.RegisteredPayee.verify(message.registered_payees[i]); - if (error) - return "registered_payees." + error; - } - } - if (message.registered_counterparty_payees != null && message.hasOwnProperty("registered_counterparty_payees")) { - if (!Array.isArray(message.registered_counterparty_payees)) - return "registered_counterparty_payees: array expected"; - for (let i = 0; i < message.registered_counterparty_payees.length; ++i) { - let error = $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.verify(message.registered_counterparty_payees[i]); - if (error) - return "registered_counterparty_payees." + error; - } - } - if (message.forward_relayers != null && message.hasOwnProperty("forward_relayers")) { - if (!Array.isArray(message.forward_relayers)) - return "forward_relayers: array expected"; - for (let i = 0; i < message.forward_relayers.length; ++i) { - let error = $root.ibc.applications.fee.v1.ForwardRelayerAddress.verify(message.forward_relayers[i]); - if (error) - return "forward_relayers." + error; - } - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.GenesisState) - return object; - let message = new $root.ibc.applications.fee.v1.GenesisState(); - if (object.identified_fees) { - if (!Array.isArray(object.identified_fees)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.identified_fees: array expected"); - message.identified_fees = []; - for (let i = 0; i < object.identified_fees.length; ++i) { - if (typeof object.identified_fees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.identified_fees: object expected"); - message.identified_fees[i] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.fromObject(object.identified_fees[i]); - } - } - if (object.fee_enabled_channels) { - if (!Array.isArray(object.fee_enabled_channels)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.fee_enabled_channels: array expected"); - message.fee_enabled_channels = []; - for (let i = 0; i < object.fee_enabled_channels.length; ++i) { - if (typeof object.fee_enabled_channels[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.fee_enabled_channels: object expected"); - message.fee_enabled_channels[i] = $root.ibc.applications.fee.v1.FeeEnabledChannel.fromObject(object.fee_enabled_channels[i]); - } - } - if (object.registered_payees) { - if (!Array.isArray(object.registered_payees)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.registered_payees: array expected"); - message.registered_payees = []; - for (let i = 0; i < object.registered_payees.length; ++i) { - if (typeof object.registered_payees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.registered_payees: object expected"); - message.registered_payees[i] = $root.ibc.applications.fee.v1.RegisteredPayee.fromObject(object.registered_payees[i]); - } - } - if (object.registered_counterparty_payees) { - if (!Array.isArray(object.registered_counterparty_payees)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.registered_counterparty_payees: array expected"); - message.registered_counterparty_payees = []; - for (let i = 0; i < object.registered_counterparty_payees.length; ++i) { - if (typeof object.registered_counterparty_payees[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.registered_counterparty_payees: object expected"); - message.registered_counterparty_payees[i] = $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.fromObject(object.registered_counterparty_payees[i]); - } - } - if (object.forward_relayers) { - if (!Array.isArray(object.forward_relayers)) - throw TypeError(".ibc.applications.fee.v1.GenesisState.forward_relayers: array expected"); - message.forward_relayers = []; - for (let i = 0; i < object.forward_relayers.length; ++i) { - if (typeof object.forward_relayers[i] !== "object") - throw TypeError(".ibc.applications.fee.v1.GenesisState.forward_relayers: object expected"); - message.forward_relayers[i] = $root.ibc.applications.fee.v1.ForwardRelayerAddress.fromObject(object.forward_relayers[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.GenesisState - * @static - * @param {ibc.applications.fee.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.identified_fees = []; - object.fee_enabled_channels = []; - object.registered_payees = []; - object.registered_counterparty_payees = []; - object.forward_relayers = []; - } - if (message.identified_fees && message.identified_fees.length) { - object.identified_fees = []; - for (let j = 0; j < message.identified_fees.length; ++j) - object.identified_fees[j] = $root.ibc.applications.fee.v1.IdentifiedPacketFees.toObject(message.identified_fees[j], options); - } - if (message.fee_enabled_channels && message.fee_enabled_channels.length) { - object.fee_enabled_channels = []; - for (let j = 0; j < message.fee_enabled_channels.length; ++j) - object.fee_enabled_channels[j] = $root.ibc.applications.fee.v1.FeeEnabledChannel.toObject(message.fee_enabled_channels[j], options); - } - if (message.registered_payees && message.registered_payees.length) { - object.registered_payees = []; - for (let j = 0; j < message.registered_payees.length; ++j) - object.registered_payees[j] = $root.ibc.applications.fee.v1.RegisteredPayee.toObject(message.registered_payees[j], options); - } - if (message.registered_counterparty_payees && message.registered_counterparty_payees.length) { - object.registered_counterparty_payees = []; - for (let j = 0; j < message.registered_counterparty_payees.length; ++j) - object.registered_counterparty_payees[j] = $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee.toObject(message.registered_counterparty_payees[j], options); - } - if (message.forward_relayers && message.forward_relayers.length) { - object.forward_relayers = []; - for (let j = 0; j < message.forward_relayers.length; ++j) - object.forward_relayers[j] = $root.ibc.applications.fee.v1.ForwardRelayerAddress.toObject(message.forward_relayers[j], options); - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - v1.FeeEnabledChannel = (function() { - - /** - * Properties of a FeeEnabledChannel. - * @memberof ibc.applications.fee.v1 - * @interface IFeeEnabledChannel - * @property {string|null} [port_id] FeeEnabledChannel port_id - * @property {string|null} [channel_id] FeeEnabledChannel channel_id - */ - - /** - * Constructs a new FeeEnabledChannel. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a FeeEnabledChannel. - * @implements IFeeEnabledChannel - * @constructor - * @param {ibc.applications.fee.v1.IFeeEnabledChannel=} [properties] Properties to set - */ - function FeeEnabledChannel(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeeEnabledChannel port_id. - * @member {string} port_id - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @instance - */ - FeeEnabledChannel.prototype.port_id = ""; - - /** - * FeeEnabledChannel channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @instance - */ - FeeEnabledChannel.prototype.channel_id = ""; - - /** - * Encodes the specified FeeEnabledChannel message. Does not implicitly {@link ibc.applications.fee.v1.FeeEnabledChannel.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {ibc.applications.fee.v1.IFeeEnabledChannel} message FeeEnabledChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeEnabledChannel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified FeeEnabledChannel message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.FeeEnabledChannel.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {ibc.applications.fee.v1.IFeeEnabledChannel} message FeeEnabledChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeEnabledChannel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeeEnabledChannel message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.FeeEnabledChannel} FeeEnabledChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeEnabledChannel.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.FeeEnabledChannel(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeeEnabledChannel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.FeeEnabledChannel} FeeEnabledChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeEnabledChannel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeeEnabledChannel message. - * @function verify - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeeEnabledChannel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a FeeEnabledChannel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.FeeEnabledChannel} FeeEnabledChannel - */ - FeeEnabledChannel.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.FeeEnabledChannel) - return object; - let message = new $root.ibc.applications.fee.v1.FeeEnabledChannel(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a FeeEnabledChannel message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @static - * @param {ibc.applications.fee.v1.FeeEnabledChannel} message FeeEnabledChannel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeeEnabledChannel.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this FeeEnabledChannel to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.FeeEnabledChannel - * @instance - * @returns {Object.} JSON object - */ - FeeEnabledChannel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FeeEnabledChannel; - })(); - - v1.RegisteredPayee = (function() { - - /** - * Properties of a RegisteredPayee. - * @memberof ibc.applications.fee.v1 - * @interface IRegisteredPayee - * @property {string|null} [channel_id] RegisteredPayee channel_id - * @property {string|null} [relayer] RegisteredPayee relayer - * @property {string|null} [payee] RegisteredPayee payee - */ - - /** - * Constructs a new RegisteredPayee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a RegisteredPayee. - * @implements IRegisteredPayee - * @constructor - * @param {ibc.applications.fee.v1.IRegisteredPayee=} [properties] Properties to set - */ - function RegisteredPayee(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RegisteredPayee channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @instance - */ - RegisteredPayee.prototype.channel_id = ""; - - /** - * RegisteredPayee relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @instance - */ - RegisteredPayee.prototype.relayer = ""; - - /** - * RegisteredPayee payee. - * @member {string} payee - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @instance - */ - RegisteredPayee.prototype.payee = ""; - - /** - * Encodes the specified RegisteredPayee message. Does not implicitly {@link ibc.applications.fee.v1.RegisteredPayee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {ibc.applications.fee.v1.IRegisteredPayee} message RegisteredPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredPayee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relayer); - if (message.payee != null && Object.hasOwnProperty.call(message, "payee")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.payee); - return writer; - }; - - /** - * Encodes the specified RegisteredPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.RegisteredPayee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {ibc.applications.fee.v1.IRegisteredPayee} message RegisteredPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredPayee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RegisteredPayee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.RegisteredPayee} RegisteredPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredPayee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.RegisteredPayee(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.relayer = reader.string(); - break; - case 3: - message.payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RegisteredPayee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.RegisteredPayee} RegisteredPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredPayee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RegisteredPayee message. - * @function verify - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RegisteredPayee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - if (message.payee != null && message.hasOwnProperty("payee")) - if (!$util.isString(message.payee)) - return "payee: string expected"; - return null; - }; - - /** - * Creates a RegisteredPayee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.RegisteredPayee} RegisteredPayee - */ - RegisteredPayee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.RegisteredPayee) - return object; - let message = new $root.ibc.applications.fee.v1.RegisteredPayee(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - if (object.payee != null) - message.payee = String(object.payee); - return message; - }; - - /** - * Creates a plain object from a RegisteredPayee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @static - * @param {ibc.applications.fee.v1.RegisteredPayee} message RegisteredPayee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegisteredPayee.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.channel_id = ""; - object.relayer = ""; - object.payee = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - if (message.payee != null && message.hasOwnProperty("payee")) - object.payee = message.payee; - return object; - }; - - /** - * Converts this RegisteredPayee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.RegisteredPayee - * @instance - * @returns {Object.} JSON object - */ - RegisteredPayee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RegisteredPayee; - })(); - - v1.RegisteredCounterpartyPayee = (function() { - - /** - * Properties of a RegisteredCounterpartyPayee. - * @memberof ibc.applications.fee.v1 - * @interface IRegisteredCounterpartyPayee - * @property {string|null} [channel_id] RegisteredCounterpartyPayee channel_id - * @property {string|null} [relayer] RegisteredCounterpartyPayee relayer - * @property {string|null} [counterparty_payee] RegisteredCounterpartyPayee counterparty_payee - */ - - /** - * Constructs a new RegisteredCounterpartyPayee. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a RegisteredCounterpartyPayee. - * @implements IRegisteredCounterpartyPayee - * @constructor - * @param {ibc.applications.fee.v1.IRegisteredCounterpartyPayee=} [properties] Properties to set - */ - function RegisteredCounterpartyPayee(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RegisteredCounterpartyPayee channel_id. - * @member {string} channel_id - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @instance - */ - RegisteredCounterpartyPayee.prototype.channel_id = ""; - - /** - * RegisteredCounterpartyPayee relayer. - * @member {string} relayer - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @instance - */ - RegisteredCounterpartyPayee.prototype.relayer = ""; - - /** - * RegisteredCounterpartyPayee counterparty_payee. - * @member {string} counterparty_payee - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @instance - */ - RegisteredCounterpartyPayee.prototype.counterparty_payee = ""; - - /** - * Encodes the specified RegisteredCounterpartyPayee message. Does not implicitly {@link ibc.applications.fee.v1.RegisteredCounterpartyPayee.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.IRegisteredCounterpartyPayee} message RegisteredCounterpartyPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredCounterpartyPayee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.relayer != null && Object.hasOwnProperty.call(message, "relayer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.relayer); - if (message.counterparty_payee != null && Object.hasOwnProperty.call(message, "counterparty_payee")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.counterparty_payee); - return writer; - }; - - /** - * Encodes the specified RegisteredCounterpartyPayee message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.RegisteredCounterpartyPayee.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.IRegisteredCounterpartyPayee} message RegisteredCounterpartyPayee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredCounterpartyPayee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RegisteredCounterpartyPayee message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.RegisteredCounterpartyPayee} RegisteredCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredCounterpartyPayee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.relayer = reader.string(); - break; - case 3: - message.counterparty_payee = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RegisteredCounterpartyPayee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.RegisteredCounterpartyPayee} RegisteredCounterpartyPayee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredCounterpartyPayee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RegisteredCounterpartyPayee message. - * @function verify - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RegisteredCounterpartyPayee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.relayer != null && message.hasOwnProperty("relayer")) - if (!$util.isString(message.relayer)) - return "relayer: string expected"; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - if (!$util.isString(message.counterparty_payee)) - return "counterparty_payee: string expected"; - return null; - }; - - /** - * Creates a RegisteredCounterpartyPayee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.RegisteredCounterpartyPayee} RegisteredCounterpartyPayee - */ - RegisteredCounterpartyPayee.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee) - return object; - let message = new $root.ibc.applications.fee.v1.RegisteredCounterpartyPayee(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.relayer != null) - message.relayer = String(object.relayer); - if (object.counterparty_payee != null) - message.counterparty_payee = String(object.counterparty_payee); - return message; - }; - - /** - * Creates a plain object from a RegisteredCounterpartyPayee message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @static - * @param {ibc.applications.fee.v1.RegisteredCounterpartyPayee} message RegisteredCounterpartyPayee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegisteredCounterpartyPayee.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.channel_id = ""; - object.relayer = ""; - object.counterparty_payee = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.relayer != null && message.hasOwnProperty("relayer")) - object.relayer = message.relayer; - if (message.counterparty_payee != null && message.hasOwnProperty("counterparty_payee")) - object.counterparty_payee = message.counterparty_payee; - return object; - }; - - /** - * Converts this RegisteredCounterpartyPayee to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.RegisteredCounterpartyPayee - * @instance - * @returns {Object.} JSON object - */ - RegisteredCounterpartyPayee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RegisteredCounterpartyPayee; - })(); - - v1.ForwardRelayerAddress = (function() { - - /** - * Properties of a ForwardRelayerAddress. - * @memberof ibc.applications.fee.v1 - * @interface IForwardRelayerAddress - * @property {string|null} [address] ForwardRelayerAddress address - * @property {ibc.core.channel.v1.IPacketId|null} [packet_id] ForwardRelayerAddress packet_id - */ - - /** - * Constructs a new ForwardRelayerAddress. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a ForwardRelayerAddress. - * @implements IForwardRelayerAddress - * @constructor - * @param {ibc.applications.fee.v1.IForwardRelayerAddress=} [properties] Properties to set - */ - function ForwardRelayerAddress(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ForwardRelayerAddress address. - * @member {string} address - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @instance - */ - ForwardRelayerAddress.prototype.address = ""; - - /** - * ForwardRelayerAddress packet_id. - * @member {ibc.core.channel.v1.IPacketId|null|undefined} packet_id - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @instance - */ - ForwardRelayerAddress.prototype.packet_id = null; - - /** - * Encodes the specified ForwardRelayerAddress message. Does not implicitly {@link ibc.applications.fee.v1.ForwardRelayerAddress.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {ibc.applications.fee.v1.IForwardRelayerAddress} message ForwardRelayerAddress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ForwardRelayerAddress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.ibc.core.channel.v1.PacketId.encode(message.packet_id, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ForwardRelayerAddress message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.ForwardRelayerAddress.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {ibc.applications.fee.v1.IForwardRelayerAddress} message ForwardRelayerAddress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ForwardRelayerAddress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ForwardRelayerAddress message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.ForwardRelayerAddress} ForwardRelayerAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ForwardRelayerAddress.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.ForwardRelayerAddress(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.packet_id = $root.ibc.core.channel.v1.PacketId.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ForwardRelayerAddress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.ForwardRelayerAddress} ForwardRelayerAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ForwardRelayerAddress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ForwardRelayerAddress message. - * @function verify - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ForwardRelayerAddress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - let error = $root.ibc.core.channel.v1.PacketId.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - return null; - }; - - /** - * Creates a ForwardRelayerAddress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.ForwardRelayerAddress} ForwardRelayerAddress - */ - ForwardRelayerAddress.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.ForwardRelayerAddress) - return object; - let message = new $root.ibc.applications.fee.v1.ForwardRelayerAddress(); - if (object.address != null) - message.address = String(object.address); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".ibc.applications.fee.v1.ForwardRelayerAddress.packet_id: object expected"); - message.packet_id = $root.ibc.core.channel.v1.PacketId.fromObject(object.packet_id); - } - return message; - }; - - /** - * Creates a plain object from a ForwardRelayerAddress message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @static - * @param {ibc.applications.fee.v1.ForwardRelayerAddress} message ForwardRelayerAddress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ForwardRelayerAddress.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.address = ""; - object.packet_id = null; - } - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.ibc.core.channel.v1.PacketId.toObject(message.packet_id, options); - return object; - }; - - /** - * Converts this ForwardRelayerAddress to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.ForwardRelayerAddress - * @instance - * @returns {Object.} JSON object - */ - ForwardRelayerAddress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ForwardRelayerAddress; - })(); - - v1.Metadata = (function() { - - /** - * Properties of a Metadata. - * @memberof ibc.applications.fee.v1 - * @interface IMetadata - * @property {string|null} [fee_version] Metadata fee_version - * @property {string|null} [app_version] Metadata app_version - */ - - /** - * Constructs a new Metadata. - * @memberof ibc.applications.fee.v1 - * @classdesc Represents a Metadata. - * @implements IMetadata - * @constructor - * @param {ibc.applications.fee.v1.IMetadata=} [properties] Properties to set - */ - function Metadata(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metadata fee_version. - * @member {string} fee_version - * @memberof ibc.applications.fee.v1.Metadata - * @instance - */ - Metadata.prototype.fee_version = ""; - - /** - * Metadata app_version. - * @member {string} app_version - * @memberof ibc.applications.fee.v1.Metadata - * @instance - */ - Metadata.prototype.app_version = ""; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link ibc.applications.fee.v1.Metadata.verify|verify} messages. - * @function encode - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {ibc.applications.fee.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee_version != null && Object.hasOwnProperty.call(message, "fee_version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fee_version); - if (message.app_version != null && Object.hasOwnProperty.call(message, "app_version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.app_version); - return writer; - }; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link ibc.applications.fee.v1.Metadata.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {ibc.applications.fee.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.fee.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.fee.v1.Metadata(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee_version = reader.string(); - break; - case 2: - message.app_version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.fee.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metadata message. - * @function verify - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee_version != null && message.hasOwnProperty("fee_version")) - if (!$util.isString(message.fee_version)) - return "fee_version: string expected"; - if (message.app_version != null && message.hasOwnProperty("app_version")) - if (!$util.isString(message.app_version)) - return "app_version: string expected"; - return null; - }; - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.fee.v1.Metadata} Metadata - */ - Metadata.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.fee.v1.Metadata) - return object; - let message = new $root.ibc.applications.fee.v1.Metadata(); - if (object.fee_version != null) - message.fee_version = String(object.fee_version); - if (object.app_version != null) - message.app_version = String(object.app_version); - return message; - }; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.fee.v1.Metadata - * @static - * @param {ibc.applications.fee.v1.Metadata} message Metadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.fee_version = ""; - object.app_version = ""; - } - if (message.fee_version != null && message.hasOwnProperty("fee_version")) - object.fee_version = message.fee_version; - if (message.app_version != null && message.hasOwnProperty("app_version")) - object.app_version = message.app_version; - return object; - }; - - /** - * Converts this Metadata to JSON. - * @function toJSON - * @memberof ibc.applications.fee.v1.Metadata - * @instance - * @returns {Object.} JSON object - */ - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Metadata; - })(); - - return v1; - })(); - - return fee; - })(); - - applications.interchain_accounts = (function() { - - /** - * Namespace interchain_accounts. - * @memberof ibc.applications - * @namespace - */ - const interchain_accounts = {}; - - interchain_accounts.controller = (function() { - - /** - * Namespace controller. - * @memberof ibc.applications.interchain_accounts - * @namespace - */ - const controller = {}; - - controller.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.interchain_accounts.controller - * @namespace - */ - const v1 = {}; - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.applications.interchain_accounts.controller.v1.Query#interchainAccount}. - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @typedef InterchainAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} [response] QueryInterchainAccountResponse - */ - - /** - * Calls InterchainAccount. - * @function interchainAccount - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest} request QueryInterchainAccountRequest message or plain object - * @param {ibc.applications.interchain_accounts.controller.v1.Query.InterchainAccountCallback} callback Node-style callback called with the error, if any, and QueryInterchainAccountResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.interchainAccount = function interchainAccount(request, callback) { - return this.rpcCall(interchainAccount, $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest, $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse, request, callback); - }, "name", { value: "InterchainAccount" }); - - /** - * Calls InterchainAccount. - * @function interchainAccount - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest} request QueryInterchainAccountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.interchain_accounts.controller.v1.Query#params}. - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {ibc.applications.interchain_accounts.controller.v1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest, $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.interchain_accounts.controller.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryInterchainAccountRequest = (function() { - - /** - * Properties of a QueryInterchainAccountRequest. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IQueryInterchainAccountRequest - * @property {string|null} [owner] QueryInterchainAccountRequest owner - * @property {string|null} [connection_id] QueryInterchainAccountRequest connection_id - */ - - /** - * Constructs a new QueryInterchainAccountRequest. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a QueryInterchainAccountRequest. - * @implements IQueryInterchainAccountRequest - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest=} [properties] Properties to set - */ - function QueryInterchainAccountRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryInterchainAccountRequest owner. - * @member {string} owner - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @instance - */ - QueryInterchainAccountRequest.prototype.owner = ""; - - /** - * QueryInterchainAccountRequest connection_id. - * @member {string} connection_id - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @instance - */ - QueryInterchainAccountRequest.prototype.connection_id = ""; - - /** - * Encodes the specified QueryInterchainAccountRequest message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest} message QueryInterchainAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.owner); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.connection_id); - return writer; - }; - - /** - * Encodes the specified QueryInterchainAccountRequest message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountRequest} message QueryInterchainAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryInterchainAccountRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest} QueryInterchainAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.owner = reader.string(); - break; - case 2: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryInterchainAccountRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest} QueryInterchainAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryInterchainAccountRequest message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInterchainAccountRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.owner != null && message.hasOwnProperty("owner")) - if (!$util.isString(message.owner)) - return "owner: string expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - return null; - }; - - /** - * Creates a QueryInterchainAccountRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest} QueryInterchainAccountRequest - */ - QueryInterchainAccountRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest) - return object; - let message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest(); - if (object.owner != null) - message.owner = String(object.owner); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - return message; - }; - - /** - * Creates a plain object from a QueryInterchainAccountRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest} message QueryInterchainAccountRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInterchainAccountRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.owner = ""; - object.connection_id = ""; - } - if (message.owner != null && message.hasOwnProperty("owner")) - object.owner = message.owner; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - return object; - }; - - /** - * Converts this QueryInterchainAccountRequest to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest - * @instance - * @returns {Object.} JSON object - */ - QueryInterchainAccountRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryInterchainAccountRequest; - })(); - - v1.QueryInterchainAccountResponse = (function() { - - /** - * Properties of a QueryInterchainAccountResponse. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IQueryInterchainAccountResponse - * @property {string|null} [address] QueryInterchainAccountResponse address - */ - - /** - * Constructs a new QueryInterchainAccountResponse. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a QueryInterchainAccountResponse. - * @implements IQueryInterchainAccountResponse - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountResponse=} [properties] Properties to set - */ - function QueryInterchainAccountResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryInterchainAccountResponse address. - * @member {string} address - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @instance - */ - QueryInterchainAccountResponse.prototype.address = ""; - - /** - * Encodes the specified QueryInterchainAccountResponse message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountResponse} message QueryInterchainAccountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); - return writer; - }; - - /** - * Encodes the specified QueryInterchainAccountResponse message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryInterchainAccountResponse} message QueryInterchainAccountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryInterchainAccountResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} QueryInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryInterchainAccountResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} QueryInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryInterchainAccountResponse message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInterchainAccountResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - return null; - }; - - /** - * Creates a QueryInterchainAccountResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} QueryInterchainAccountResponse - */ - QueryInterchainAccountResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse) - return object; - let message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse(); - if (object.address != null) - message.address = String(object.address); - return message; - }; - - /** - * Creates a plain object from a QueryInterchainAccountResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse} message QueryInterchainAccountResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInterchainAccountResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.address = ""; - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - return object; - }; - - /** - * Converts this QueryInterchainAccountResponse to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse - * @instance - * @returns {Object.} JSON object - */ - QueryInterchainAccountResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryInterchainAccountResponse; - })(); - - v1.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest) - return object; - return new $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - v1.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IQueryParamsResponse - * @property {ibc.applications.interchain_accounts.controller.v1.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {ibc.applications.interchain_accounts.controller.v1.IParams|null|undefined} params - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.interchain_accounts.controller.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - let error = $root.ibc.applications.interchain_accounts.controller.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse) - return object; - let message = new $root.ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse.params: object expected"); - message.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @interface IParams - * @property {boolean|null} [controller_enabled] Params controller_enabled - */ - - /** - * Constructs a new Params. - * @memberof ibc.applications.interchain_accounts.controller.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.applications.interchain_accounts.controller.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params controller_enabled. - * @member {boolean} controller_enabled - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @instance - */ - Params.prototype.controller_enabled = false; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.controller_enabled != null && Object.hasOwnProperty.call(message, "controller_enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.controller_enabled); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.controller.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.controller.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.controller.v1.Params(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.controller_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.controller.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.controller_enabled != null && message.hasOwnProperty("controller_enabled")) - if (typeof message.controller_enabled !== "boolean") - return "controller_enabled: boolean expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.controller.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.controller.v1.Params) - return object; - let message = new $root.ibc.applications.interchain_accounts.controller.v1.Params(); - if (object.controller_enabled != null) - message.controller_enabled = Boolean(object.controller_enabled); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.controller.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.controller_enabled = false; - if (message.controller_enabled != null && message.hasOwnProperty("controller_enabled")) - object.controller_enabled = message.controller_enabled; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.controller.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - return v1; - })(); - - return controller; - })(); - - interchain_accounts.host = (function() { - - /** - * Namespace host. - * @memberof ibc.applications.interchain_accounts - * @namespace - */ - const host = {}; - - host.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.interchain_accounts.host - * @namespace - */ - const v1 = {}; - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @interface IParams - * @property {boolean|null} [host_enabled] Params host_enabled - * @property {Array.|null} [allow_messages] Params allow_messages - */ - - /** - * Constructs a new Params. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.applications.interchain_accounts.host.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - this.allow_messages = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params host_enabled. - * @member {boolean} host_enabled - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @instance - */ - Params.prototype.host_enabled = false; - - /** - * Params allow_messages. - * @member {Array.} allow_messages - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @instance - */ - Params.prototype.allow_messages = $util.emptyArray; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.host_enabled != null && Object.hasOwnProperty.call(message, "host_enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.host_enabled); - if (message.allow_messages != null && message.allow_messages.length) - for (let i = 0; i < message.allow_messages.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.allow_messages[i]); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.host.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.host.v1.Params(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.host_enabled = reader.bool(); - break; - case 2: - if (!(message.allow_messages && message.allow_messages.length)) - message.allow_messages = []; - message.allow_messages.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.host.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.host_enabled != null && message.hasOwnProperty("host_enabled")) - if (typeof message.host_enabled !== "boolean") - return "host_enabled: boolean expected"; - if (message.allow_messages != null && message.hasOwnProperty("allow_messages")) { - if (!Array.isArray(message.allow_messages)) - return "allow_messages: array expected"; - for (let i = 0; i < message.allow_messages.length; ++i) - if (!$util.isString(message.allow_messages[i])) - return "allow_messages: string[] expected"; - } - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.host.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.host.v1.Params) - return object; - let message = new $root.ibc.applications.interchain_accounts.host.v1.Params(); - if (object.host_enabled != null) - message.host_enabled = Boolean(object.host_enabled); - if (object.allow_messages) { - if (!Array.isArray(object.allow_messages)) - throw TypeError(".ibc.applications.interchain_accounts.host.v1.Params.allow_messages: array expected"); - message.allow_messages = []; - for (let i = 0; i < object.allow_messages.length; ++i) - message.allow_messages[i] = String(object.allow_messages[i]); - } - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @static - * @param {ibc.applications.interchain_accounts.host.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.allow_messages = []; - if (options.defaults) - object.host_enabled = false; - if (message.host_enabled != null && message.hasOwnProperty("host_enabled")) - object.host_enabled = message.host_enabled; - if (message.allow_messages && message.allow_messages.length) { - object.allow_messages = []; - for (let j = 0; j < message.allow_messages.length; ++j) - object.allow_messages[j] = message.allow_messages[j]; - } - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.host.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.applications.interchain_accounts.host.v1.Query#params}. - * @memberof ibc.applications.interchain_accounts.host.v1.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.interchain_accounts.host.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {ibc.applications.interchain_accounts.host.v1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.ibc.applications.interchain_accounts.host.v1.QueryParamsRequest, $root.ibc.applications.interchain_accounts.host.v1.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.interchain_accounts.host.v1.Query - * @instance - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.host.v1.QueryParamsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.host.v1.QueryParamsRequest) - return object; - return new $root.ibc.applications.interchain_accounts.host.v1.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @static - * @param {ibc.applications.interchain_accounts.host.v1.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - v1.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @interface IQueryParamsResponse - * @property {ibc.applications.interchain_accounts.host.v1.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof ibc.applications.interchain_accounts.host.v1 - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {ibc.applications.interchain_accounts.host.v1.IParams|null|undefined} params - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.interchain_accounts.host.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.host.v1.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.host.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.host.v1.QueryParamsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.ibc.applications.interchain_accounts.host.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - let error = $root.ibc.applications.interchain_accounts.host.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.host.v1.QueryParamsResponse) - return object; - let message = new $root.ibc.applications.interchain_accounts.host.v1.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.interchain_accounts.host.v1.QueryParamsResponse.params: object expected"); - message.params = $root.ibc.applications.interchain_accounts.host.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @static - * @param {ibc.applications.interchain_accounts.host.v1.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.interchain_accounts.host.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.host.v1.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - return v1; - })(); - - return host; - })(); - - interchain_accounts.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.interchain_accounts - * @namespace - */ - const v1 = {}; - - v1.InterchainAccount = (function() { - - /** - * Properties of an InterchainAccount. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IInterchainAccount - * @property {cosmos.auth.v1beta1.IBaseAccount|null} [base_account] InterchainAccount base_account - * @property {string|null} [account_owner] InterchainAccount account_owner - */ - - /** - * Constructs a new InterchainAccount. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents an InterchainAccount. - * @implements IInterchainAccount - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccount=} [properties] Properties to set - */ - function InterchainAccount(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InterchainAccount base_account. - * @member {cosmos.auth.v1beta1.IBaseAccount|null|undefined} base_account - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @instance - */ - InterchainAccount.prototype.base_account = null; - - /** - * InterchainAccount account_owner. - * @member {string} account_owner - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @instance - */ - InterchainAccount.prototype.account_owner = ""; - - /** - * Encodes the specified InterchainAccount message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccount.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccount} message InterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterchainAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.base_account != null && Object.hasOwnProperty.call(message, "base_account")) - $root.cosmos.auth.v1beta1.BaseAccount.encode(message.base_account, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.account_owner != null && Object.hasOwnProperty.call(message, "account_owner")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.account_owner); - return writer; - }; - - /** - * Encodes the specified InterchainAccount message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccount} message InterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterchainAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InterchainAccount message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccount} InterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterchainAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.InterchainAccount(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.base_account = $root.cosmos.auth.v1beta1.BaseAccount.decode(reader, reader.uint32()); - break; - case 2: - message.account_owner = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InterchainAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccount} InterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterchainAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InterchainAccount message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InterchainAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.base_account != null && message.hasOwnProperty("base_account")) { - let error = $root.cosmos.auth.v1beta1.BaseAccount.verify(message.base_account); - if (error) - return "base_account." + error; - } - if (message.account_owner != null && message.hasOwnProperty("account_owner")) - if (!$util.isString(message.account_owner)) - return "account_owner: string expected"; - return null; - }; - - /** - * Creates an InterchainAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccount} InterchainAccount - */ - InterchainAccount.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.InterchainAccount) - return object; - let message = new $root.ibc.applications.interchain_accounts.v1.InterchainAccount(); - if (object.base_account != null) { - if (typeof object.base_account !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.InterchainAccount.base_account: object expected"); - message.base_account = $root.cosmos.auth.v1beta1.BaseAccount.fromObject(object.base_account); - } - if (object.account_owner != null) - message.account_owner = String(object.account_owner); - return message; - }; - - /** - * Creates a plain object from an InterchainAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.InterchainAccount} message InterchainAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InterchainAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.base_account = null; - object.account_owner = ""; - } - if (message.base_account != null && message.hasOwnProperty("base_account")) - object.base_account = $root.cosmos.auth.v1beta1.BaseAccount.toObject(message.base_account, options); - if (message.account_owner != null && message.hasOwnProperty("account_owner")) - object.account_owner = message.account_owner; - return object; - }; - - /** - * Converts this InterchainAccount to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccount - * @instance - * @returns {Object.} JSON object - */ - InterchainAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InterchainAccount; - })(); - - /** - * Type enum. - * @name ibc.applications.interchain_accounts.v1.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} TYPE_EXECUTE_TX=1 TYPE_EXECUTE_TX value - */ - v1.Type = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TYPE_EXECUTE_TX"] = 1; - return values; - })(); - - v1.InterchainAccountPacketData = (function() { - - /** - * Properties of an InterchainAccountPacketData. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IInterchainAccountPacketData - * @property {ibc.applications.interchain_accounts.v1.Type|null} [type] InterchainAccountPacketData type - * @property {Uint8Array|null} [data] InterchainAccountPacketData data - * @property {string|null} [memo] InterchainAccountPacketData memo - */ - - /** - * Constructs a new InterchainAccountPacketData. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents an InterchainAccountPacketData. - * @implements IInterchainAccountPacketData - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccountPacketData=} [properties] Properties to set - */ - function InterchainAccountPacketData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InterchainAccountPacketData type. - * @member {ibc.applications.interchain_accounts.v1.Type} type - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @instance - */ - InterchainAccountPacketData.prototype.type = 0; - - /** - * InterchainAccountPacketData data. - * @member {Uint8Array} data - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @instance - */ - InterchainAccountPacketData.prototype.data = $util.newBuffer([]); - - /** - * InterchainAccountPacketData memo. - * @member {string} memo - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @instance - */ - InterchainAccountPacketData.prototype.memo = ""; - - /** - * Encodes the specified InterchainAccountPacketData message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccountPacketData.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccountPacketData} message InterchainAccountPacketData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterchainAccountPacketData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.memo); - return writer; - }; - - /** - * Encodes the specified InterchainAccountPacketData message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.InterchainAccountPacketData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {ibc.applications.interchain_accounts.v1.IInterchainAccountPacketData} message InterchainAccountPacketData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterchainAccountPacketData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InterchainAccountPacketData message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccountPacketData} InterchainAccountPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterchainAccountPacketData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.InterchainAccountPacketData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.memo = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InterchainAccountPacketData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccountPacketData} InterchainAccountPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterchainAccountPacketData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InterchainAccountPacketData message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InterchainAccountPacketData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - return null; - }; - - /** - * Creates an InterchainAccountPacketData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.InterchainAccountPacketData} InterchainAccountPacketData - */ - InterchainAccountPacketData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.InterchainAccountPacketData) - return object; - let message = new $root.ibc.applications.interchain_accounts.v1.InterchainAccountPacketData(); - switch (object.type) { - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "TYPE_EXECUTE_TX": - case 1: - message.type = 1; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.memo != null) - message.memo = String(object.memo); - return message; - }; - - /** - * Creates a plain object from an InterchainAccountPacketData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @static - * @param {ibc.applications.interchain_accounts.v1.InterchainAccountPacketData} message InterchainAccountPacketData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InterchainAccountPacketData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.memo = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.ibc.applications.interchain_accounts.v1.Type[message.type] : message.type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - return object; - }; - - /** - * Converts this InterchainAccountPacketData to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.InterchainAccountPacketData - * @instance - * @returns {Object.} JSON object - */ - InterchainAccountPacketData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InterchainAccountPacketData; - })(); - - v1.CosmosTx = (function() { - - /** - * Properties of a CosmosTx. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface ICosmosTx - * @property {Array.|null} [messages] CosmosTx messages - */ - - /** - * Constructs a new CosmosTx. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a CosmosTx. - * @implements ICosmosTx - * @constructor - * @param {ibc.applications.interchain_accounts.v1.ICosmosTx=} [properties] Properties to set - */ - function CosmosTx(properties) { - this.messages = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CosmosTx messages. - * @member {Array.} messages - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @instance - */ - CosmosTx.prototype.messages = $util.emptyArray; - - /** - * Encodes the specified CosmosTx message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.CosmosTx.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {ibc.applications.interchain_accounts.v1.ICosmosTx} message CosmosTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CosmosTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (let i = 0; i < message.messages.length; ++i) - $root.google.protobuf.Any.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CosmosTx message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.CosmosTx.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {ibc.applications.interchain_accounts.v1.ICosmosTx} message CosmosTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CosmosTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CosmosTx message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.CosmosTx} CosmosTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CosmosTx.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.CosmosTx(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CosmosTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.CosmosTx} CosmosTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CosmosTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CosmosTx message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CosmosTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (let i = 0; i < message.messages.length; ++i) { - let error = $root.google.protobuf.Any.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - return null; - }; - - /** - * Creates a CosmosTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.CosmosTx} CosmosTx - */ - CosmosTx.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.CosmosTx) - return object; - let message = new $root.ibc.applications.interchain_accounts.v1.CosmosTx(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".ibc.applications.interchain_accounts.v1.CosmosTx.messages: array expected"); - message.messages = []; - for (let i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.CosmosTx.messages: object expected"); - message.messages[i] = $root.google.protobuf.Any.fromObject(object.messages[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CosmosTx message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @static - * @param {ibc.applications.interchain_accounts.v1.CosmosTx} message CosmosTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CosmosTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (message.messages && message.messages.length) { - object.messages = []; - for (let j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.protobuf.Any.toObject(message.messages[j], options); - } - return object; - }; - - /** - * Converts this CosmosTx to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.CosmosTx - * @instance - * @returns {Object.} JSON object - */ - CosmosTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CosmosTx; - })(); - - v1.Metadata = (function() { - - /** - * Properties of a Metadata. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IMetadata - * @property {string|null} [version] Metadata version - * @property {string|null} [controller_connection_id] Metadata controller_connection_id - * @property {string|null} [host_connection_id] Metadata host_connection_id - * @property {string|null} [address] Metadata address - * @property {string|null} [encoding] Metadata encoding - * @property {string|null} [tx_type] Metadata tx_type - */ - - /** - * Constructs a new Metadata. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a Metadata. - * @implements IMetadata - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IMetadata=} [properties] Properties to set - */ - function Metadata(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metadata version. - * @member {string} version - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.version = ""; - - /** - * Metadata controller_connection_id. - * @member {string} controller_connection_id - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.controller_connection_id = ""; - - /** - * Metadata host_connection_id. - * @member {string} host_connection_id - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.host_connection_id = ""; - - /** - * Metadata address. - * @member {string} address - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.address = ""; - - /** - * Metadata encoding. - * @member {string} encoding - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.encoding = ""; - - /** - * Metadata tx_type. - * @member {string} tx_type - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - */ - Metadata.prototype.tx_type = ""; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.Metadata.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {ibc.applications.interchain_accounts.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.controller_connection_id != null && Object.hasOwnProperty.call(message, "controller_connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.controller_connection_id); - if (message.host_connection_id != null && Object.hasOwnProperty.call(message, "host_connection_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.host_connection_id); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.address); - if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.encoding); - if (message.tx_type != null && Object.hasOwnProperty.call(message, "tx_type")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.tx_type); - return writer; - }; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.Metadata.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {ibc.applications.interchain_accounts.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.Metadata(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.controller_connection_id = reader.string(); - break; - case 3: - message.host_connection_id = reader.string(); - break; - case 4: - message.address = reader.string(); - break; - case 5: - message.encoding = reader.string(); - break; - case 6: - message.tx_type = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metadata message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.controller_connection_id != null && message.hasOwnProperty("controller_connection_id")) - if (!$util.isString(message.controller_connection_id)) - return "controller_connection_id: string expected"; - if (message.host_connection_id != null && message.hasOwnProperty("host_connection_id")) - if (!$util.isString(message.host_connection_id)) - return "host_connection_id: string expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.encoding != null && message.hasOwnProperty("encoding")) - if (!$util.isString(message.encoding)) - return "encoding: string expected"; - if (message.tx_type != null && message.hasOwnProperty("tx_type")) - if (!$util.isString(message.tx_type)) - return "tx_type: string expected"; - return null; - }; - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.Metadata} Metadata - */ - Metadata.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.Metadata) - return object; - let message = new $root.ibc.applications.interchain_accounts.v1.Metadata(); - if (object.version != null) - message.version = String(object.version); - if (object.controller_connection_id != null) - message.controller_connection_id = String(object.controller_connection_id); - if (object.host_connection_id != null) - message.host_connection_id = String(object.host_connection_id); - if (object.address != null) - message.address = String(object.address); - if (object.encoding != null) - message.encoding = String(object.encoding); - if (object.tx_type != null) - message.tx_type = String(object.tx_type); - return message; - }; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @static - * @param {ibc.applications.interchain_accounts.v1.Metadata} message Metadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.version = ""; - object.controller_connection_id = ""; - object.host_connection_id = ""; - object.address = ""; - object.encoding = ""; - object.tx_type = ""; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.controller_connection_id != null && message.hasOwnProperty("controller_connection_id")) - object.controller_connection_id = message.controller_connection_id; - if (message.host_connection_id != null && message.hasOwnProperty("host_connection_id")) - object.host_connection_id = message.host_connection_id; - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.encoding != null && message.hasOwnProperty("encoding")) - object.encoding = message.encoding; - if (message.tx_type != null && message.hasOwnProperty("tx_type")) - object.tx_type = message.tx_type; - return object; - }; - - /** - * Converts this Metadata to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.Metadata - * @instance - * @returns {Object.} JSON object - */ - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Metadata; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IGenesisState - * @property {ibc.applications.interchain_accounts.v1.IControllerGenesisState|null} [controller_genesis_state] GenesisState controller_genesis_state - * @property {ibc.applications.interchain_accounts.v1.IHostGenesisState|null} [host_genesis_state] GenesisState host_genesis_state - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState controller_genesis_state. - * @member {ibc.applications.interchain_accounts.v1.IControllerGenesisState|null|undefined} controller_genesis_state - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @instance - */ - GenesisState.prototype.controller_genesis_state = null; - - /** - * GenesisState host_genesis_state. - * @member {ibc.applications.interchain_accounts.v1.IHostGenesisState|null|undefined} host_genesis_state - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @instance - */ - GenesisState.prototype.host_genesis_state = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.controller_genesis_state != null && Object.hasOwnProperty.call(message, "controller_genesis_state")) - $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.encode(message.controller_genesis_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.host_genesis_state != null && Object.hasOwnProperty.call(message, "host_genesis_state")) - $root.ibc.applications.interchain_accounts.v1.HostGenesisState.encode(message.host_genesis_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.GenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.controller_genesis_state = $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.decode(reader, reader.uint32()); - break; - case 2: - message.host_genesis_state = $root.ibc.applications.interchain_accounts.v1.HostGenesisState.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.controller_genesis_state != null && message.hasOwnProperty("controller_genesis_state")) { - let error = $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.verify(message.controller_genesis_state); - if (error) - return "controller_genesis_state." + error; - } - if (message.host_genesis_state != null && message.hasOwnProperty("host_genesis_state")) { - let error = $root.ibc.applications.interchain_accounts.v1.HostGenesisState.verify(message.host_genesis_state); - if (error) - return "host_genesis_state." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.GenesisState) - return object; - let message = new $root.ibc.applications.interchain_accounts.v1.GenesisState(); - if (object.controller_genesis_state != null) { - if (typeof object.controller_genesis_state !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.GenesisState.controller_genesis_state: object expected"); - message.controller_genesis_state = $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.fromObject(object.controller_genesis_state); - } - if (object.host_genesis_state != null) { - if (typeof object.host_genesis_state !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.GenesisState.host_genesis_state: object expected"); - message.host_genesis_state = $root.ibc.applications.interchain_accounts.v1.HostGenesisState.fromObject(object.host_genesis_state); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.controller_genesis_state = null; - object.host_genesis_state = null; - } - if (message.controller_genesis_state != null && message.hasOwnProperty("controller_genesis_state")) - object.controller_genesis_state = $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState.toObject(message.controller_genesis_state, options); - if (message.host_genesis_state != null && message.hasOwnProperty("host_genesis_state")) - object.host_genesis_state = $root.ibc.applications.interchain_accounts.v1.HostGenesisState.toObject(message.host_genesis_state, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - v1.ControllerGenesisState = (function() { - - /** - * Properties of a ControllerGenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IControllerGenesisState - * @property {Array.|null} [active_channels] ControllerGenesisState active_channels - * @property {Array.|null} [interchain_accounts] ControllerGenesisState interchain_accounts - * @property {Array.|null} [ports] ControllerGenesisState ports - * @property {ibc.applications.interchain_accounts.controller.v1.IParams|null} [params] ControllerGenesisState params - */ - - /** - * Constructs a new ControllerGenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a ControllerGenesisState. - * @implements IControllerGenesisState - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IControllerGenesisState=} [properties] Properties to set - */ - function ControllerGenesisState(properties) { - this.active_channels = []; - this.interchain_accounts = []; - this.ports = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ControllerGenesisState active_channels. - * @member {Array.} active_channels - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - */ - ControllerGenesisState.prototype.active_channels = $util.emptyArray; - - /** - * ControllerGenesisState interchain_accounts. - * @member {Array.} interchain_accounts - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - */ - ControllerGenesisState.prototype.interchain_accounts = $util.emptyArray; - - /** - * ControllerGenesisState ports. - * @member {Array.} ports - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - */ - ControllerGenesisState.prototype.ports = $util.emptyArray; - - /** - * ControllerGenesisState params. - * @member {ibc.applications.interchain_accounts.controller.v1.IParams|null|undefined} params - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - */ - ControllerGenesisState.prototype.params = null; - - /** - * Encodes the specified ControllerGenesisState message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ControllerGenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IControllerGenesisState} message ControllerGenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ControllerGenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.active_channels != null && message.active_channels.length) - for (let i = 0; i < message.active_channels.length; ++i) - $root.ibc.applications.interchain_accounts.v1.ActiveChannel.encode(message.active_channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.interchain_accounts != null && message.interchain_accounts.length) - for (let i = 0; i < message.interchain_accounts.length; ++i) - $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.encode(message.interchain_accounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ports != null && message.ports.length) - for (let i = 0; i < message.ports.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ports[i]); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.interchain_accounts.controller.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ControllerGenesisState message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ControllerGenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IControllerGenesisState} message ControllerGenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ControllerGenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ControllerGenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.ControllerGenesisState} ControllerGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ControllerGenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.active_channels && message.active_channels.length)) - message.active_channels = []; - message.active_channels.push($root.ibc.applications.interchain_accounts.v1.ActiveChannel.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.interchain_accounts && message.interchain_accounts.length)) - message.interchain_accounts = []; - message.interchain_accounts.push($root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.ports && message.ports.length)) - message.ports = []; - message.ports.push(reader.string()); - break; - case 4: - message.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ControllerGenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.ControllerGenesisState} ControllerGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ControllerGenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ControllerGenesisState message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ControllerGenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.active_channels != null && message.hasOwnProperty("active_channels")) { - if (!Array.isArray(message.active_channels)) - return "active_channels: array expected"; - for (let i = 0; i < message.active_channels.length; ++i) { - let error = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.verify(message.active_channels[i]); - if (error) - return "active_channels." + error; - } - } - if (message.interchain_accounts != null && message.hasOwnProperty("interchain_accounts")) { - if (!Array.isArray(message.interchain_accounts)) - return "interchain_accounts: array expected"; - for (let i = 0; i < message.interchain_accounts.length; ++i) { - let error = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify(message.interchain_accounts[i]); - if (error) - return "interchain_accounts." + error; - } - } - if (message.ports != null && message.hasOwnProperty("ports")) { - if (!Array.isArray(message.ports)) - return "ports: array expected"; - for (let i = 0; i < message.ports.length; ++i) - if (!$util.isString(message.ports[i])) - return "ports: string[] expected"; - } - if (message.params != null && message.hasOwnProperty("params")) { - let error = $root.ibc.applications.interchain_accounts.controller.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a ControllerGenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.ControllerGenesisState} ControllerGenesisState - */ - ControllerGenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState) - return object; - let message = new $root.ibc.applications.interchain_accounts.v1.ControllerGenesisState(); - if (object.active_channels) { - if (!Array.isArray(object.active_channels)) - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.active_channels: array expected"); - message.active_channels = []; - for (let i = 0; i < object.active_channels.length; ++i) { - if (typeof object.active_channels[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.active_channels: object expected"); - message.active_channels[i] = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.fromObject(object.active_channels[i]); - } - } - if (object.interchain_accounts) { - if (!Array.isArray(object.interchain_accounts)) - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.interchain_accounts: array expected"); - message.interchain_accounts = []; - for (let i = 0; i < object.interchain_accounts.length; ++i) { - if (typeof object.interchain_accounts[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.interchain_accounts: object expected"); - message.interchain_accounts[i] = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.fromObject(object.interchain_accounts[i]); - } - } - if (object.ports) { - if (!Array.isArray(object.ports)) - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.ports: array expected"); - message.ports = []; - for (let i = 0; i < object.ports.length; ++i) - message.ports[i] = String(object.ports[i]); - } - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.ControllerGenesisState.params: object expected"); - message.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a ControllerGenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.ControllerGenesisState} message ControllerGenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ControllerGenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.active_channels = []; - object.interchain_accounts = []; - object.ports = []; - } - if (options.defaults) - object.params = null; - if (message.active_channels && message.active_channels.length) { - object.active_channels = []; - for (let j = 0; j < message.active_channels.length; ++j) - object.active_channels[j] = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.toObject(message.active_channels[j], options); - } - if (message.interchain_accounts && message.interchain_accounts.length) { - object.interchain_accounts = []; - for (let j = 0; j < message.interchain_accounts.length; ++j) - object.interchain_accounts[j] = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.toObject(message.interchain_accounts[j], options); - } - if (message.ports && message.ports.length) { - object.ports = []; - for (let j = 0; j < message.ports.length; ++j) - object.ports[j] = message.ports[j]; - } - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.interchain_accounts.controller.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this ControllerGenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.ControllerGenesisState - * @instance - * @returns {Object.} JSON object - */ - ControllerGenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ControllerGenesisState; - })(); - - v1.HostGenesisState = (function() { - - /** - * Properties of a HostGenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IHostGenesisState - * @property {Array.|null} [active_channels] HostGenesisState active_channels - * @property {Array.|null} [interchain_accounts] HostGenesisState interchain_accounts - * @property {string|null} [port] HostGenesisState port - * @property {ibc.applications.interchain_accounts.host.v1.IParams|null} [params] HostGenesisState params - */ - - /** - * Constructs a new HostGenesisState. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a HostGenesisState. - * @implements IHostGenesisState - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IHostGenesisState=} [properties] Properties to set - */ - function HostGenesisState(properties) { - this.active_channels = []; - this.interchain_accounts = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HostGenesisState active_channels. - * @member {Array.} active_channels - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - */ - HostGenesisState.prototype.active_channels = $util.emptyArray; - - /** - * HostGenesisState interchain_accounts. - * @member {Array.} interchain_accounts - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - */ - HostGenesisState.prototype.interchain_accounts = $util.emptyArray; - - /** - * HostGenesisState port. - * @member {string} port - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - */ - HostGenesisState.prototype.port = ""; - - /** - * HostGenesisState params. - * @member {ibc.applications.interchain_accounts.host.v1.IParams|null|undefined} params - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - */ - HostGenesisState.prototype.params = null; - - /** - * Encodes the specified HostGenesisState message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.HostGenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IHostGenesisState} message HostGenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HostGenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.active_channels != null && message.active_channels.length) - for (let i = 0; i < message.active_channels.length; ++i) - $root.ibc.applications.interchain_accounts.v1.ActiveChannel.encode(message.active_channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.interchain_accounts != null && message.interchain_accounts.length) - for (let i = 0; i < message.interchain_accounts.length; ++i) - $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.encode(message.interchain_accounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.port); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.interchain_accounts.host.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified HostGenesisState message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.HostGenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.IHostGenesisState} message HostGenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HostGenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HostGenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.HostGenesisState} HostGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HostGenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.HostGenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.active_channels && message.active_channels.length)) - message.active_channels = []; - message.active_channels.push($root.ibc.applications.interchain_accounts.v1.ActiveChannel.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.interchain_accounts && message.interchain_accounts.length)) - message.interchain_accounts = []; - message.interchain_accounts.push($root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.decode(reader, reader.uint32())); - break; - case 3: - message.port = reader.string(); - break; - case 4: - message.params = $root.ibc.applications.interchain_accounts.host.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HostGenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.HostGenesisState} HostGenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HostGenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HostGenesisState message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HostGenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.active_channels != null && message.hasOwnProperty("active_channels")) { - if (!Array.isArray(message.active_channels)) - return "active_channels: array expected"; - for (let i = 0; i < message.active_channels.length; ++i) { - let error = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.verify(message.active_channels[i]); - if (error) - return "active_channels." + error; - } - } - if (message.interchain_accounts != null && message.hasOwnProperty("interchain_accounts")) { - if (!Array.isArray(message.interchain_accounts)) - return "interchain_accounts: array expected"; - for (let i = 0; i < message.interchain_accounts.length; ++i) { - let error = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify(message.interchain_accounts[i]); - if (error) - return "interchain_accounts." + error; - } - } - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isString(message.port)) - return "port: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - let error = $root.ibc.applications.interchain_accounts.host.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a HostGenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.HostGenesisState} HostGenesisState - */ - HostGenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.HostGenesisState) - return object; - let message = new $root.ibc.applications.interchain_accounts.v1.HostGenesisState(); - if (object.active_channels) { - if (!Array.isArray(object.active_channels)) - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.active_channels: array expected"); - message.active_channels = []; - for (let i = 0; i < object.active_channels.length; ++i) { - if (typeof object.active_channels[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.active_channels: object expected"); - message.active_channels[i] = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.fromObject(object.active_channels[i]); - } - } - if (object.interchain_accounts) { - if (!Array.isArray(object.interchain_accounts)) - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.interchain_accounts: array expected"); - message.interchain_accounts = []; - for (let i = 0; i < object.interchain_accounts.length; ++i) { - if (typeof object.interchain_accounts[i] !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.interchain_accounts: object expected"); - message.interchain_accounts[i] = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.fromObject(object.interchain_accounts[i]); - } - } - if (object.port != null) - message.port = String(object.port); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.interchain_accounts.v1.HostGenesisState.params: object expected"); - message.params = $root.ibc.applications.interchain_accounts.host.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a HostGenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @static - * @param {ibc.applications.interchain_accounts.v1.HostGenesisState} message HostGenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HostGenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.active_channels = []; - object.interchain_accounts = []; - } - if (options.defaults) { - object.port = ""; - object.params = null; - } - if (message.active_channels && message.active_channels.length) { - object.active_channels = []; - for (let j = 0; j < message.active_channels.length; ++j) - object.active_channels[j] = $root.ibc.applications.interchain_accounts.v1.ActiveChannel.toObject(message.active_channels[j], options); - } - if (message.interchain_accounts && message.interchain_accounts.length) { - object.interchain_accounts = []; - for (let j = 0; j < message.interchain_accounts.length; ++j) - object.interchain_accounts[j] = $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.toObject(message.interchain_accounts[j], options); - } - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.interchain_accounts.host.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this HostGenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.HostGenesisState - * @instance - * @returns {Object.} JSON object - */ - HostGenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HostGenesisState; - })(); - - v1.ActiveChannel = (function() { - - /** - * Properties of an ActiveChannel. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IActiveChannel - * @property {string|null} [connection_id] ActiveChannel connection_id - * @property {string|null} [port_id] ActiveChannel port_id - * @property {string|null} [channel_id] ActiveChannel channel_id - */ - - /** - * Constructs a new ActiveChannel. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents an ActiveChannel. - * @implements IActiveChannel - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IActiveChannel=} [properties] Properties to set - */ - function ActiveChannel(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ActiveChannel connection_id. - * @member {string} connection_id - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @instance - */ - ActiveChannel.prototype.connection_id = ""; - - /** - * ActiveChannel port_id. - * @member {string} port_id - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @instance - */ - ActiveChannel.prototype.port_id = ""; - - /** - * ActiveChannel channel_id. - * @member {string} channel_id - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @instance - */ - ActiveChannel.prototype.channel_id = ""; - - /** - * Encodes the specified ActiveChannel message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ActiveChannel.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {ibc.applications.interchain_accounts.v1.IActiveChannel} message ActiveChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActiveChannel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified ActiveChannel message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.ActiveChannel.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {ibc.applications.interchain_accounts.v1.IActiveChannel} message ActiveChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActiveChannel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActiveChannel message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.ActiveChannel} ActiveChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActiveChannel.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.ActiveChannel(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.port_id = reader.string(); - break; - case 3: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActiveChannel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.ActiveChannel} ActiveChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActiveChannel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActiveChannel message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActiveChannel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates an ActiveChannel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.ActiveChannel} ActiveChannel - */ - ActiveChannel.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.ActiveChannel) - return object; - let message = new $root.ibc.applications.interchain_accounts.v1.ActiveChannel(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from an ActiveChannel message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @static - * @param {ibc.applications.interchain_accounts.v1.ActiveChannel} message ActiveChannel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActiveChannel.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.connection_id = ""; - object.port_id = ""; - object.channel_id = ""; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this ActiveChannel to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.ActiveChannel - * @instance - * @returns {Object.} JSON object - */ - ActiveChannel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ActiveChannel; - })(); - - v1.RegisteredInterchainAccount = (function() { - - /** - * Properties of a RegisteredInterchainAccount. - * @memberof ibc.applications.interchain_accounts.v1 - * @interface IRegisteredInterchainAccount - * @property {string|null} [connection_id] RegisteredInterchainAccount connection_id - * @property {string|null} [port_id] RegisteredInterchainAccount port_id - * @property {string|null} [account_address] RegisteredInterchainAccount account_address - */ - - /** - * Constructs a new RegisteredInterchainAccount. - * @memberof ibc.applications.interchain_accounts.v1 - * @classdesc Represents a RegisteredInterchainAccount. - * @implements IRegisteredInterchainAccount - * @constructor - * @param {ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount=} [properties] Properties to set - */ - function RegisteredInterchainAccount(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RegisteredInterchainAccount connection_id. - * @member {string} connection_id - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @instance - */ - RegisteredInterchainAccount.prototype.connection_id = ""; - - /** - * RegisteredInterchainAccount port_id. - * @member {string} port_id - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @instance - */ - RegisteredInterchainAccount.prototype.port_id = ""; - - /** - * RegisteredInterchainAccount account_address. - * @member {string} account_address - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @instance - */ - RegisteredInterchainAccount.prototype.account_address = ""; - - /** - * Encodes the specified RegisteredInterchainAccount message. Does not implicitly {@link ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify|verify} messages. - * @function encode - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount} message RegisteredInterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredInterchainAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.port_id); - if (message.account_address != null && Object.hasOwnProperty.call(message, "account_address")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.account_address); - return writer; - }; - - /** - * Encodes the specified RegisteredInterchainAccount message, length delimited. Does not implicitly {@link ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.IRegisteredInterchainAccount} message RegisteredInterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredInterchainAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RegisteredInterchainAccount message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount} RegisteredInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredInterchainAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.port_id = reader.string(); - break; - case 3: - message.account_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RegisteredInterchainAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount} RegisteredInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredInterchainAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RegisteredInterchainAccount message. - * @function verify - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RegisteredInterchainAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.account_address != null && message.hasOwnProperty("account_address")) - if (!$util.isString(message.account_address)) - return "account_address: string expected"; - return null; - }; - - /** - * Creates a RegisteredInterchainAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount} RegisteredInterchainAccount - */ - RegisteredInterchainAccount.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) - return object; - let message = new $root.ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.account_address != null) - message.account_address = String(object.account_address); - return message; - }; - - /** - * Creates a plain object from a RegisteredInterchainAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @static - * @param {ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount} message RegisteredInterchainAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegisteredInterchainAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.connection_id = ""; - object.port_id = ""; - object.account_address = ""; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.account_address != null && message.hasOwnProperty("account_address")) - object.account_address = message.account_address; - return object; - }; - - /** - * Converts this RegisteredInterchainAccount to JSON. - * @function toJSON - * @memberof ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount - * @instance - * @returns {Object.} JSON object - */ - RegisteredInterchainAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RegisteredInterchainAccount; - })(); - - return v1; - })(); - - return interchain_accounts; - })(); - - applications.transfer = (function() { - - /** - * Namespace transfer. - * @memberof ibc.applications - * @namespace - */ - const transfer = {}; - - transfer.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.transfer - * @namespace - */ - const v1 = {}; - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Msg#transfer}. - * @memberof ibc.applications.transfer.v1.Msg - * @typedef TransferCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.MsgTransferResponse} [response] MsgTransferResponse - */ - - /** - * Calls Transfer. - * @function transfer - * @memberof ibc.applications.transfer.v1.Msg - * @instance - * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object - * @param {ibc.applications.transfer.v1.Msg.TransferCallback} callback Node-style callback called with the error, if any, and MsgTransferResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.transfer = function transfer(request, callback) { - return this.rpcCall(transfer, $root.ibc.applications.transfer.v1.MsgTransfer, $root.ibc.applications.transfer.v1.MsgTransferResponse, request, callback); - }, "name", { value: "Transfer" }); - - /** - * Calls Transfer. - * @function transfer - * @memberof ibc.applications.transfer.v1.Msg - * @instance - * @param {ibc.applications.transfer.v1.IMsgTransfer} request MsgTransfer message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1.MsgTransfer = (function() { - - /** - * Properties of a MsgTransfer. - * @memberof ibc.applications.transfer.v1 - * @interface IMsgTransfer - * @property {string|null} [source_port] MsgTransfer source_port - * @property {string|null} [source_channel] MsgTransfer source_channel - * @property {cosmos.base.v1beta1.ICoin|null} [token] MsgTransfer token - * @property {string|null} [sender] MsgTransfer sender - * @property {string|null} [receiver] MsgTransfer receiver - * @property {ibc.core.client.v1.IHeight|null} [timeout_height] MsgTransfer timeout_height - * @property {Long|null} [timeout_timestamp] MsgTransfer timeout_timestamp - * @property {string|null} [memo] MsgTransfer memo - */ - - /** - * Constructs a new MsgTransfer. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a MsgTransfer. - * @implements IMsgTransfer - * @constructor - * @param {ibc.applications.transfer.v1.IMsgTransfer=} [properties] Properties to set - */ - function MsgTransfer(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTransfer source_port. - * @member {string} source_port - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.source_port = ""; - - /** - * MsgTransfer source_channel. - * @member {string} source_channel - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.source_channel = ""; - - /** - * MsgTransfer token. - * @member {cosmos.base.v1beta1.ICoin|null|undefined} token - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.token = null; - - /** - * MsgTransfer sender. - * @member {string} sender - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.sender = ""; - - /** - * MsgTransfer receiver. - * @member {string} receiver - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.receiver = ""; - - /** - * MsgTransfer timeout_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} timeout_height - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.timeout_height = null; - - /** - * MsgTransfer timeout_timestamp. - * @member {Long} timeout_timestamp - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.timeout_timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgTransfer memo. - * @member {string} memo - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - */ - MsgTransfer.prototype.memo = ""; - - /** - * Encodes the specified MsgTransfer message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransfer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.source_port != null && Object.hasOwnProperty.call(message, "source_port")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.source_port); - if (message.source_channel != null && Object.hasOwnProperty.call(message, "source_channel")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_channel); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - $root.cosmos.base.v1beta1.Coin.encode(message.token, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sender); - if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.receiver); - if (message.timeout_height != null && Object.hasOwnProperty.call(message, "timeout_height")) - $root.ibc.core.client.v1.Height.encode(message.timeout_height, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.timeout_timestamp != null && Object.hasOwnProperty.call(message, "timeout_timestamp")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.timeout_timestamp); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.memo); - return writer; - }; - - /** - * Encodes the specified MsgTransfer message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransfer.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {ibc.applications.transfer.v1.IMsgTransfer} message MsgTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransfer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransfer.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransfer(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.source_port = reader.string(); - break; - case 2: - message.source_channel = reader.string(); - break; - case 3: - message.token = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); - break; - case 4: - message.sender = reader.string(); - break; - case 5: - message.receiver = reader.string(); - break; - case 6: - message.timeout_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 7: - message.timeout_timestamp = reader.uint64(); - break; - case 8: - message.memo = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransfer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTransfer message. - * @function verify - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTransfer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.source_port != null && message.hasOwnProperty("source_port")) - if (!$util.isString(message.source_port)) - return "source_port: string expected"; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - if (!$util.isString(message.source_channel)) - return "source_channel: string expected"; - if (message.token != null && message.hasOwnProperty("token")) { - let error = $root.cosmos.base.v1beta1.Coin.verify(message.token); - if (error) - return "token." + error; - } - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.receiver != null && message.hasOwnProperty("receiver")) - if (!$util.isString(message.receiver)) - return "receiver: string expected"; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.timeout_height); - if (error) - return "timeout_height." + error; - } - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (!$util.isInteger(message.timeout_timestamp) && !(message.timeout_timestamp && $util.isInteger(message.timeout_timestamp.low) && $util.isInteger(message.timeout_timestamp.high))) - return "timeout_timestamp: integer|Long expected"; - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - return null; - }; - - /** - * Creates a MsgTransfer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer - */ - MsgTransfer.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.MsgTransfer) - return object; - let message = new $root.ibc.applications.transfer.v1.MsgTransfer(); - if (object.source_port != null) - message.source_port = String(object.source_port); - if (object.source_channel != null) - message.source_channel = String(object.source_channel); - if (object.token != null) { - if (typeof object.token !== "object") - throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.token: object expected"); - message.token = $root.cosmos.base.v1beta1.Coin.fromObject(object.token); - } - if (object.sender != null) - message.sender = String(object.sender); - if (object.receiver != null) - message.receiver = String(object.receiver); - if (object.timeout_height != null) { - if (typeof object.timeout_height !== "object") - throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.timeout_height: object expected"); - message.timeout_height = $root.ibc.core.client.v1.Height.fromObject(object.timeout_height); - } - if (object.timeout_timestamp != null) - if ($util.Long) - (message.timeout_timestamp = $util.Long.fromValue(object.timeout_timestamp)).unsigned = true; - else if (typeof object.timeout_timestamp === "string") - message.timeout_timestamp = parseInt(object.timeout_timestamp, 10); - else if (typeof object.timeout_timestamp === "number") - message.timeout_timestamp = object.timeout_timestamp; - else if (typeof object.timeout_timestamp === "object") - message.timeout_timestamp = new $util.LongBits(object.timeout_timestamp.low >>> 0, object.timeout_timestamp.high >>> 0).toNumber(true); - if (object.memo != null) - message.memo = String(object.memo); - return message; - }; - - /** - * Creates a plain object from a MsgTransfer message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @static - * @param {ibc.applications.transfer.v1.MsgTransfer} message MsgTransfer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTransfer.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.source_port = ""; - object.source_channel = ""; - object.token = null; - object.sender = ""; - object.receiver = ""; - object.timeout_height = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timeout_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timeout_timestamp = options.longs === String ? "0" : 0; - object.memo = ""; - } - if (message.source_port != null && message.hasOwnProperty("source_port")) - object.source_port = message.source_port; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - object.source_channel = message.source_channel; - if (message.token != null && message.hasOwnProperty("token")) - object.token = $root.cosmos.base.v1beta1.Coin.toObject(message.token, options); - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.receiver != null && message.hasOwnProperty("receiver")) - object.receiver = message.receiver; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) - object.timeout_height = $root.ibc.core.client.v1.Height.toObject(message.timeout_height, options); - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (typeof message.timeout_timestamp === "number") - object.timeout_timestamp = options.longs === String ? String(message.timeout_timestamp) : message.timeout_timestamp; - else - object.timeout_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeout_timestamp) : options.longs === Number ? new $util.LongBits(message.timeout_timestamp.low >>> 0, message.timeout_timestamp.high >>> 0).toNumber(true) : message.timeout_timestamp; - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - return object; - }; - - /** - * Converts this MsgTransfer to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.MsgTransfer - * @instance - * @returns {Object.} JSON object - */ - MsgTransfer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTransfer; - })(); - - v1.MsgTransferResponse = (function() { - - /** - * Properties of a MsgTransferResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IMsgTransferResponse - * @property {Long|null} [sequence] MsgTransferResponse sequence - */ - - /** - * Constructs a new MsgTransferResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a MsgTransferResponse. - * @implements IMsgTransferResponse - * @constructor - * @param {ibc.applications.transfer.v1.IMsgTransferResponse=} [properties] Properties to set - */ - function MsgTransferResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTransferResponse sequence. - * @member {Long} sequence - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @instance - */ - MsgTransferResponse.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified MsgTransferResponse message. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransferResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified MsgTransferResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.MsgTransferResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {ibc.applications.transfer.v1.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransferResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransferResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.MsgTransferResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransferResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTransferResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTransferResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a MsgTransferResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse - */ - MsgTransferResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.MsgTransferResponse) - return object; - let message = new $root.ibc.applications.transfer.v1.MsgTransferResponse(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a MsgTransferResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @static - * @param {ibc.applications.transfer.v1.MsgTransferResponse} message MsgTransferResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTransferResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this MsgTransferResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.MsgTransferResponse - * @instance - * @returns {Object.} JSON object - */ - MsgTransferResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTransferResponse; - })(); - - v1.DenomTrace = (function() { - - /** - * Properties of a DenomTrace. - * @memberof ibc.applications.transfer.v1 - * @interface IDenomTrace - * @property {string|null} [path] DenomTrace path - * @property {string|null} [base_denom] DenomTrace base_denom - */ - - /** - * Constructs a new DenomTrace. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a DenomTrace. - * @implements IDenomTrace - * @constructor - * @param {ibc.applications.transfer.v1.IDenomTrace=} [properties] Properties to set - */ - function DenomTrace(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DenomTrace path. - * @member {string} path - * @memberof ibc.applications.transfer.v1.DenomTrace - * @instance - */ - DenomTrace.prototype.path = ""; - - /** - * DenomTrace base_denom. - * @member {string} base_denom - * @memberof ibc.applications.transfer.v1.DenomTrace - * @instance - */ - DenomTrace.prototype.base_denom = ""; - - /** - * Encodes the specified DenomTrace message. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {ibc.applications.transfer.v1.IDenomTrace} message DenomTrace message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenomTrace.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.base_denom != null && Object.hasOwnProperty.call(message, "base_denom")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.base_denom); - return writer; - }; - - /** - * Encodes the specified DenomTrace message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {ibc.applications.transfer.v1.IDenomTrace} message DenomTrace message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenomTrace.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DenomTrace message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenomTrace.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.DenomTrace(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.string(); - break; - case 2: - message.base_denom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DenomTrace message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenomTrace.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DenomTrace message. - * @function verify - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DenomTrace.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.base_denom != null && message.hasOwnProperty("base_denom")) - if (!$util.isString(message.base_denom)) - return "base_denom: string expected"; - return null; - }; - - /** - * Creates a DenomTrace message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace - */ - DenomTrace.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.DenomTrace) - return object; - let message = new $root.ibc.applications.transfer.v1.DenomTrace(); - if (object.path != null) - message.path = String(object.path); - if (object.base_denom != null) - message.base_denom = String(object.base_denom); - return message; - }; - - /** - * Creates a plain object from a DenomTrace message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {ibc.applications.transfer.v1.DenomTrace} message DenomTrace - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DenomTrace.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.path = ""; - object.base_denom = ""; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.base_denom != null && message.hasOwnProperty("base_denom")) - object.base_denom = message.base_denom; - return object; - }; - - /** - * Converts this DenomTrace to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.DenomTrace - * @instance - * @returns {Object.} JSON object - */ - DenomTrace.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DenomTrace; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.applications.transfer.v1 - * @interface IParams - * @property {boolean|null} [send_enabled] Params send_enabled - * @property {boolean|null} [receive_enabled] Params receive_enabled - */ - - /** - * Constructs a new Params. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.applications.transfer.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params send_enabled. - * @member {boolean} send_enabled - * @memberof ibc.applications.transfer.v1.Params - * @instance - */ - Params.prototype.send_enabled = false; - - /** - * Params receive_enabled. - * @member {boolean} receive_enabled - * @memberof ibc.applications.transfer.v1.Params - * @instance - */ - Params.prototype.receive_enabled = false; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {ibc.applications.transfer.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.send_enabled != null && Object.hasOwnProperty.call(message, "send_enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.send_enabled); - if (message.receive_enabled != null && Object.hasOwnProperty.call(message, "receive_enabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.receive_enabled); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {ibc.applications.transfer.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.Params(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.send_enabled = reader.bool(); - break; - case 2: - message.receive_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.send_enabled != null && message.hasOwnProperty("send_enabled")) - if (typeof message.send_enabled !== "boolean") - return "send_enabled: boolean expected"; - if (message.receive_enabled != null && message.hasOwnProperty("receive_enabled")) - if (typeof message.receive_enabled !== "boolean") - return "receive_enabled: boolean expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.Params) - return object; - let message = new $root.ibc.applications.transfer.v1.Params(); - if (object.send_enabled != null) - message.send_enabled = Boolean(object.send_enabled); - if (object.receive_enabled != null) - message.receive_enabled = Boolean(object.receive_enabled); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {ibc.applications.transfer.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.send_enabled = false; - object.receive_enabled = false; - } - if (message.send_enabled != null && message.hasOwnProperty("send_enabled")) - object.send_enabled = message.send_enabled; - if (message.receive_enabled != null && message.hasOwnProperty("receive_enabled")) - object.receive_enabled = message.receive_enabled; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTrace}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef DenomTraceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomTraceResponse} [response] QueryDenomTraceResponse - */ - - /** - * Calls DenomTrace. - * @function denomTrace - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.DenomTraceCallback} callback Node-style callback called with the error, if any, and QueryDenomTraceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomTrace = function denomTrace(request, callback) { - return this.rpcCall(denomTrace, $root.ibc.applications.transfer.v1.QueryDenomTraceRequest, $root.ibc.applications.transfer.v1.QueryDenomTraceResponse, request, callback); - }, "name", { value: "DenomTrace" }); - - /** - * Calls DenomTrace. - * @function denomTrace - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTraces}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef DenomTracesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomTracesResponse} [response] QueryDenomTracesResponse - */ - - /** - * Calls DenomTraces. - * @function denomTraces - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.DenomTracesCallback} callback Node-style callback called with the error, if any, and QueryDenomTracesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomTraces = function denomTraces(request, callback) { - return this.rpcCall(denomTraces, $root.ibc.applications.transfer.v1.QueryDenomTracesRequest, $root.ibc.applications.transfer.v1.QueryDenomTracesResponse, request, callback); - }, "name", { value: "DenomTraces" }); - - /** - * Calls DenomTraces. - * @function denomTraces - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#params}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.ibc.applications.transfer.v1.QueryParamsRequest, $root.ibc.applications.transfer.v1.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomHash}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef DenomHashCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomHashResponse} [response] QueryDenomHashResponse - */ - - /** - * Calls DenomHash. - * @function denomHash - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} request QueryDenomHashRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.DenomHashCallback} callback Node-style callback called with the error, if any, and QueryDenomHashResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomHash = function denomHash(request, callback) { - return this.rpcCall(denomHash, $root.ibc.applications.transfer.v1.QueryDenomHashRequest, $root.ibc.applications.transfer.v1.QueryDenomHashResponse, request, callback); - }, "name", { value: "DenomHash" }); - - /** - * Calls DenomHash. - * @function denomHash - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} request QueryDenomHashRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#escrowAddress}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef EscrowAddressCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryEscrowAddressResponse} [response] QueryEscrowAddressResponse - */ - - /** - * Calls EscrowAddress. - * @function escrowAddress - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} request QueryEscrowAddressRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.EscrowAddressCallback} callback Node-style callback called with the error, if any, and QueryEscrowAddressResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.escrowAddress = function escrowAddress(request, callback) { - return this.rpcCall(escrowAddress, $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest, $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse, request, callback); - }, "name", { value: "EscrowAddress" }); - - /** - * Calls EscrowAddress. - * @function escrowAddress - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} request QueryEscrowAddressRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryDenomTraceRequest = (function() { - - /** - * Properties of a QueryDenomTraceRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTraceRequest - * @property {string|null} [hash] QueryDenomTraceRequest hash - */ - - /** - * Constructs a new QueryDenomTraceRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTraceRequest. - * @implements IQueryDenomTraceRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest=} [properties] Properties to set - */ - function QueryDenomTraceRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTraceRequest hash. - * @member {string} hash - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @instance - */ - QueryDenomTraceRequest.prototype.hash = ""; - - /** - * Encodes the specified QueryDenomTraceRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} message QueryDenomTraceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); - return writer; - }; - - /** - * Encodes the specified QueryDenomTraceRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} message QueryDenomTraceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTraceRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTraceRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTraceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; - return null; - }; - - /** - * Creates a QueryDenomTraceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest - */ - QueryDenomTraceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTraceRequest) - return object; - let message = new $root.ibc.applications.transfer.v1.QueryDenomTraceRequest(); - if (object.hash != null) - message.hash = String(object.hash); - return message; - }; - - /** - * Creates a plain object from a QueryDenomTraceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTraceRequest} message QueryDenomTraceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTraceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.hash = ""; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; - return object; - }; - - /** - * Converts this QueryDenomTraceRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTraceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTraceRequest; - })(); - - v1.QueryDenomTraceResponse = (function() { - - /** - * Properties of a QueryDenomTraceResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTraceResponse - * @property {ibc.applications.transfer.v1.IDenomTrace|null} [denom_trace] QueryDenomTraceResponse denom_trace - */ - - /** - * Constructs a new QueryDenomTraceResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTraceResponse. - * @implements IQueryDenomTraceResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse=} [properties] Properties to set - */ - function QueryDenomTraceResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTraceResponse denom_trace. - * @member {ibc.applications.transfer.v1.IDenomTrace|null|undefined} denom_trace - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @instance - */ - QueryDenomTraceResponse.prototype.denom_trace = null; - - /** - * Encodes the specified QueryDenomTraceResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse} message QueryDenomTraceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom_trace != null && Object.hasOwnProperty.call(message, "denom_trace")) - $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denom_trace, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomTraceResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse} message QueryDenomTraceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTraceResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom_trace = $root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTraceResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTraceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom_trace != null && message.hasOwnProperty("denom_trace")) { - let error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denom_trace); - if (error) - return "denom_trace." + error; - } - return null; - }; - - /** - * Creates a QueryDenomTraceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse - */ - QueryDenomTraceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTraceResponse) - return object; - let message = new $root.ibc.applications.transfer.v1.QueryDenomTraceResponse(); - if (object.denom_trace != null) { - if (typeof object.denom_trace !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTraceResponse.denom_trace: object expected"); - message.denom_trace = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denom_trace); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomTraceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTraceResponse} message QueryDenomTraceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTraceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.denom_trace = null; - if (message.denom_trace != null && message.hasOwnProperty("denom_trace")) - object.denom_trace = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denom_trace, options); - return object; - }; - - /** - * Converts this QueryDenomTraceResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTraceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTraceResponse; - })(); - - v1.QueryDenomTracesRequest = (function() { - - /** - * Properties of a QueryDenomTracesRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTracesRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryDenomTracesRequest pagination - */ - - /** - * Constructs a new QueryDenomTracesRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTracesRequest. - * @implements IQueryDenomTracesRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest=} [properties] Properties to set - */ - function QueryDenomTracesRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTracesRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @instance - */ - QueryDenomTracesRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryDenomTracesRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} message QueryDenomTracesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomTracesRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} message QueryDenomTracesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTracesRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTracesRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTracesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryDenomTracesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest - */ - QueryDenomTracesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTracesRequest) - return object; - let message = new $root.ibc.applications.transfer.v1.QueryDenomTracesRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomTracesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTracesRequest} message QueryDenomTracesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTracesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryDenomTracesRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTracesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTracesRequest; - })(); - - v1.QueryDenomTracesResponse = (function() { - - /** - * Properties of a QueryDenomTracesResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTracesResponse - * @property {Array.|null} [denom_traces] QueryDenomTracesResponse denom_traces - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryDenomTracesResponse pagination - */ - - /** - * Constructs a new QueryDenomTracesResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTracesResponse. - * @implements IQueryDenomTracesResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse=} [properties] Properties to set - */ - function QueryDenomTracesResponse(properties) { - this.denom_traces = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTracesResponse denom_traces. - * @member {Array.} denom_traces - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @instance - */ - QueryDenomTracesResponse.prototype.denom_traces = $util.emptyArray; - - /** - * QueryDenomTracesResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @instance - */ - QueryDenomTracesResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryDenomTracesResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse} message QueryDenomTracesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom_traces != null && message.denom_traces.length) - for (let i = 0; i < message.denom_traces.length; ++i) - $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denom_traces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomTracesResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse} message QueryDenomTracesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTracesResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.denom_traces && message.denom_traces.length)) - message.denom_traces = []; - message.denom_traces.push($root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTracesResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTracesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom_traces != null && message.hasOwnProperty("denom_traces")) { - if (!Array.isArray(message.denom_traces)) - return "denom_traces: array expected"; - for (let i = 0; i < message.denom_traces.length; ++i) { - let error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denom_traces[i]); - if (error) - return "denom_traces." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryDenomTracesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse - */ - QueryDenomTracesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTracesResponse) - return object; - let message = new $root.ibc.applications.transfer.v1.QueryDenomTracesResponse(); - if (object.denom_traces) { - if (!Array.isArray(object.denom_traces)) - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.denom_traces: array expected"); - message.denom_traces = []; - for (let i = 0; i < object.denom_traces.length; ++i) { - if (typeof object.denom_traces[i] !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.denom_traces: object expected"); - message.denom_traces[i] = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denom_traces[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomTracesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTracesResponse} message QueryDenomTracesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTracesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.denom_traces = []; - if (options.defaults) - object.pagination = null; - if (message.denom_traces && message.denom_traces.length) { - object.denom_traces = []; - for (let j = 0; j < message.denom_traces.length; ++j) - object.denom_traces[j] = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denom_traces[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryDenomTracesResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTracesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTracesResponse; - })(); - - v1.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryParamsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryParamsRequest) - return object; - return new $root.ibc.applications.transfer.v1.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {ibc.applications.transfer.v1.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - v1.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryParamsResponse - * @property {ibc.applications.transfer.v1.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {ibc.applications.transfer.v1.IParams|null|undefined} params - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.transfer.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryParamsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.ibc.applications.transfer.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - let error = $root.ibc.applications.transfer.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryParamsResponse) - return object; - let message = new $root.ibc.applications.transfer.v1.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryParamsResponse.params: object expected"); - message.params = $root.ibc.applications.transfer.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {ibc.applications.transfer.v1.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.transfer.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - v1.QueryDenomHashRequest = (function() { - - /** - * Properties of a QueryDenomHashRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomHashRequest - * @property {string|null} [trace] QueryDenomHashRequest trace - */ - - /** - * Constructs a new QueryDenomHashRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomHashRequest. - * @implements IQueryDenomHashRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest=} [properties] Properties to set - */ - function QueryDenomHashRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomHashRequest trace. - * @member {string} trace - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @instance - */ - QueryDenomHashRequest.prototype.trace = ""; - - /** - * Encodes the specified QueryDenomHashRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} message QueryDenomHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trace != null && Object.hasOwnProperty.call(message, "trace")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.trace); - return writer; - }; - - /** - * Encodes the specified QueryDenomHashRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} message QueryDenomHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomHashRequest} QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomHashRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.trace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomHashRequest} QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomHashRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomHashRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trace != null && message.hasOwnProperty("trace")) - if (!$util.isString(message.trace)) - return "trace: string expected"; - return null; - }; - - /** - * Creates a QueryDenomHashRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomHashRequest} QueryDenomHashRequest - */ - QueryDenomHashRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomHashRequest) - return object; - let message = new $root.ibc.applications.transfer.v1.QueryDenomHashRequest(); - if (object.trace != null) - message.trace = String(object.trace); - return message; - }; - - /** - * Creates a plain object from a QueryDenomHashRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {ibc.applications.transfer.v1.QueryDenomHashRequest} message QueryDenomHashRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomHashRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.trace = ""; - if (message.trace != null && message.hasOwnProperty("trace")) - object.trace = message.trace; - return object; - }; - - /** - * Converts this QueryDenomHashRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomHashRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomHashRequest; - })(); - - v1.QueryDenomHashResponse = (function() { - - /** - * Properties of a QueryDenomHashResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomHashResponse - * @property {string|null} [hash] QueryDenomHashResponse hash - */ - - /** - * Constructs a new QueryDenomHashResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomHashResponse. - * @implements IQueryDenomHashResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomHashResponse=} [properties] Properties to set - */ - function QueryDenomHashResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomHashResponse hash. - * @member {string} hash - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @instance - */ - QueryDenomHashResponse.prototype.hash = ""; - - /** - * Encodes the specified QueryDenomHashResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashResponse} message QueryDenomHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); - return writer; - }; - - /** - * Encodes the specified QueryDenomHashResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashResponse} message QueryDenomHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomHashResponse} QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomHashResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomHashResponse} QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomHashResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomHashResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; - return null; - }; - - /** - * Creates a QueryDenomHashResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomHashResponse} QueryDenomHashResponse - */ - QueryDenomHashResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomHashResponse) - return object; - let message = new $root.ibc.applications.transfer.v1.QueryDenomHashResponse(); - if (object.hash != null) - message.hash = String(object.hash); - return message; - }; - - /** - * Creates a plain object from a QueryDenomHashResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {ibc.applications.transfer.v1.QueryDenomHashResponse} message QueryDenomHashResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomHashResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.hash = ""; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; - return object; - }; - - /** - * Converts this QueryDenomHashResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomHashResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomHashResponse; - })(); - - v1.QueryEscrowAddressRequest = (function() { - - /** - * Properties of a QueryEscrowAddressRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryEscrowAddressRequest - * @property {string|null} [port_id] QueryEscrowAddressRequest port_id - * @property {string|null} [channel_id] QueryEscrowAddressRequest channel_id - */ - - /** - * Constructs a new QueryEscrowAddressRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryEscrowAddressRequest. - * @implements IQueryEscrowAddressRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest=} [properties] Properties to set - */ - function QueryEscrowAddressRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryEscrowAddressRequest port_id. - * @member {string} port_id - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @instance - */ - QueryEscrowAddressRequest.prototype.port_id = ""; - - /** - * QueryEscrowAddressRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @instance - */ - QueryEscrowAddressRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryEscrowAddressRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} message QueryEscrowAddressRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryEscrowAddressRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} message QueryEscrowAddressRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressRequest} QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressRequest} QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryEscrowAddressRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryEscrowAddressRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryEscrowAddressRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressRequest} QueryEscrowAddressRequest - */ - QueryEscrowAddressRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest) - return object; - let message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryEscrowAddressRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {ibc.applications.transfer.v1.QueryEscrowAddressRequest} message QueryEscrowAddressRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryEscrowAddressRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryEscrowAddressRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @instance - * @returns {Object.} JSON object - */ - QueryEscrowAddressRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryEscrowAddressRequest; - })(); - - v1.QueryEscrowAddressResponse = (function() { - - /** - * Properties of a QueryEscrowAddressResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryEscrowAddressResponse - * @property {string|null} [escrow_address] QueryEscrowAddressResponse escrow_address - */ - - /** - * Constructs a new QueryEscrowAddressResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryEscrowAddressResponse. - * @implements IQueryEscrowAddressResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressResponse=} [properties] Properties to set - */ - function QueryEscrowAddressResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryEscrowAddressResponse escrow_address. - * @member {string} escrow_address - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @instance - */ - QueryEscrowAddressResponse.prototype.escrow_address = ""; - - /** - * Encodes the specified QueryEscrowAddressResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressResponse} message QueryEscrowAddressResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.escrow_address != null && Object.hasOwnProperty.call(message, "escrow_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.escrow_address); - return writer; - }; - - /** - * Encodes the specified QueryEscrowAddressResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressResponse} message QueryEscrowAddressResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressResponse} QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.escrow_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressResponse} QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryEscrowAddressResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryEscrowAddressResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.escrow_address != null && message.hasOwnProperty("escrow_address")) - if (!$util.isString(message.escrow_address)) - return "escrow_address: string expected"; - return null; - }; - - /** - * Creates a QueryEscrowAddressResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressResponse} QueryEscrowAddressResponse - */ - QueryEscrowAddressResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse) - return object; - let message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse(); - if (object.escrow_address != null) - message.escrow_address = String(object.escrow_address); - return message; - }; - - /** - * Creates a plain object from a QueryEscrowAddressResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {ibc.applications.transfer.v1.QueryEscrowAddressResponse} message QueryEscrowAddressResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryEscrowAddressResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.escrow_address = ""; - if (message.escrow_address != null && message.hasOwnProperty("escrow_address")) - object.escrow_address = message.escrow_address; - return object; - }; - - /** - * Converts this QueryEscrowAddressResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @instance - * @returns {Object.} JSON object - */ - QueryEscrowAddressResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryEscrowAddressResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.applications.transfer.v1 - * @interface IGenesisState - * @property {string|null} [port_id] GenesisState port_id - * @property {Array.|null} [denom_traces] GenesisState denom_traces - * @property {ibc.applications.transfer.v1.IParams|null} [params] GenesisState params - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.applications.transfer.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.denom_traces = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState port_id. - * @member {string} port_id - * @memberof ibc.applications.transfer.v1.GenesisState - * @instance - */ - GenesisState.prototype.port_id = ""; - - /** - * GenesisState denom_traces. - * @member {Array.} denom_traces - * @memberof ibc.applications.transfer.v1.GenesisState - * @instance - */ - GenesisState.prototype.denom_traces = $util.emptyArray; - - /** - * GenesisState params. - * @member {ibc.applications.transfer.v1.IParams|null|undefined} params - * @memberof ibc.applications.transfer.v1.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.applications.transfer.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {ibc.applications.transfer.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.denom_traces != null && message.denom_traces.length) - for (let i = 0; i < message.denom_traces.length; ++i) - $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denom_traces[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.transfer.v1.Params.encode(message.params, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {ibc.applications.transfer.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.GenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - if (!(message.denom_traces && message.denom_traces.length)) - message.denom_traces = []; - message.denom_traces.push($root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32())); - break; - case 3: - message.params = $root.ibc.applications.transfer.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.denom_traces != null && message.hasOwnProperty("denom_traces")) { - if (!Array.isArray(message.denom_traces)) - return "denom_traces: array expected"; - for (let i = 0; i < message.denom_traces.length; ++i) { - let error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denom_traces[i]); - if (error) - return "denom_traces." + error; - } - } - if (message.params != null && message.hasOwnProperty("params")) { - let error = $root.ibc.applications.transfer.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.GenesisState) - return object; - let message = new $root.ibc.applications.transfer.v1.GenesisState(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.denom_traces) { - if (!Array.isArray(object.denom_traces)) - throw TypeError(".ibc.applications.transfer.v1.GenesisState.denom_traces: array expected"); - message.denom_traces = []; - for (let i = 0; i < object.denom_traces.length; ++i) { - if (typeof object.denom_traces[i] !== "object") - throw TypeError(".ibc.applications.transfer.v1.GenesisState.denom_traces: object expected"); - message.denom_traces[i] = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denom_traces[i]); - } - } - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.transfer.v1.GenesisState.params: object expected"); - message.params = $root.ibc.applications.transfer.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.GenesisState - * @static - * @param {ibc.applications.transfer.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.denom_traces = []; - if (options.defaults) { - object.port_id = ""; - object.params = null; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.denom_traces && message.denom_traces.length) { - object.denom_traces = []; - for (let j = 0; j < message.denom_traces.length; ++j) - object.denom_traces[j] = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denom_traces[j], options); - } - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.transfer.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return v1; - })(); - - transfer.v2 = (function() { - - /** - * Namespace v2. - * @memberof ibc.applications.transfer - * @namespace - */ - const v2 = {}; - - v2.FungibleTokenPacketData = (function() { - - /** - * Properties of a FungibleTokenPacketData. - * @memberof ibc.applications.transfer.v2 - * @interface IFungibleTokenPacketData - * @property {string|null} [denom] FungibleTokenPacketData denom - * @property {string|null} [amount] FungibleTokenPacketData amount - * @property {string|null} [sender] FungibleTokenPacketData sender - * @property {string|null} [receiver] FungibleTokenPacketData receiver - * @property {string|null} [memo] FungibleTokenPacketData memo - */ - - /** - * Constructs a new FungibleTokenPacketData. - * @memberof ibc.applications.transfer.v2 - * @classdesc Represents a FungibleTokenPacketData. - * @implements IFungibleTokenPacketData - * @constructor - * @param {ibc.applications.transfer.v2.IFungibleTokenPacketData=} [properties] Properties to set - */ - function FungibleTokenPacketData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FungibleTokenPacketData denom. - * @member {string} denom - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.denom = ""; - - /** - * FungibleTokenPacketData amount. - * @member {string} amount - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.amount = ""; - - /** - * FungibleTokenPacketData sender. - * @member {string} sender - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.sender = ""; - - /** - * FungibleTokenPacketData receiver. - * @member {string} receiver - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.receiver = ""; - - /** - * FungibleTokenPacketData memo. - * @member {string} memo - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - */ - FungibleTokenPacketData.prototype.memo = ""; - - /** - * Encodes the specified FungibleTokenPacketData message. Does not implicitly {@link ibc.applications.transfer.v2.FungibleTokenPacketData.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {ibc.applications.transfer.v2.IFungibleTokenPacketData} message FungibleTokenPacketData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FungibleTokenPacketData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sender); - if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.receiver); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.memo); - return writer; - }; - - /** - * Encodes the specified FungibleTokenPacketData message, length delimited. Does not implicitly {@link ibc.applications.transfer.v2.FungibleTokenPacketData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {ibc.applications.transfer.v2.IFungibleTokenPacketData} message FungibleTokenPacketData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FungibleTokenPacketData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FungibleTokenPacketData message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v2.FungibleTokenPacketData} FungibleTokenPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FungibleTokenPacketData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v2.FungibleTokenPacketData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - case 3: - message.sender = reader.string(); - break; - case 4: - message.receiver = reader.string(); - break; - case 5: - message.memo = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FungibleTokenPacketData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v2.FungibleTokenPacketData} FungibleTokenPacketData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FungibleTokenPacketData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FungibleTokenPacketData message. - * @function verify - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FungibleTokenPacketData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.receiver != null && message.hasOwnProperty("receiver")) - if (!$util.isString(message.receiver)) - return "receiver: string expected"; - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - return null; - }; - - /** - * Creates a FungibleTokenPacketData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v2.FungibleTokenPacketData} FungibleTokenPacketData - */ - FungibleTokenPacketData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v2.FungibleTokenPacketData) - return object; - let message = new $root.ibc.applications.transfer.v2.FungibleTokenPacketData(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - if (object.sender != null) - message.sender = String(object.sender); - if (object.receiver != null) - message.receiver = String(object.receiver); - if (object.memo != null) - message.memo = String(object.memo); - return message; - }; - - /** - * Creates a plain object from a FungibleTokenPacketData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @static - * @param {ibc.applications.transfer.v2.FungibleTokenPacketData} message FungibleTokenPacketData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FungibleTokenPacketData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - object.sender = ""; - object.receiver = ""; - object.memo = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.receiver != null && message.hasOwnProperty("receiver")) - object.receiver = message.receiver; - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - return object; - }; - - /** - * Converts this FungibleTokenPacketData to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v2.FungibleTokenPacketData - * @instance - * @returns {Object.} JSON object - */ - FungibleTokenPacketData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FungibleTokenPacketData; - })(); - - return v2; - })(); - - return transfer; - })(); - - return applications; - })(); - - ibc.core = (function() { - - /** - * Namespace core. - * @memberof ibc - * @namespace - */ - const core = {}; - - core.channel = (function() { - - /** - * Namespace channel. - * @memberof ibc.core - * @namespace - */ - const channel = {}; - - channel.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.channel - * @namespace - */ - const v1 = {}; - - v1.Channel = (function() { - - /** - * Properties of a Channel. - * @memberof ibc.core.channel.v1 - * @interface IChannel - * @property {ibc.core.channel.v1.State|null} [state] Channel state - * @property {ibc.core.channel.v1.Order|null} [ordering] Channel ordering - * @property {ibc.core.channel.v1.ICounterparty|null} [counterparty] Channel counterparty - * @property {Array.|null} [connection_hops] Channel connection_hops - * @property {string|null} [version] Channel version - */ - - /** - * Constructs a new Channel. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Channel. - * @implements IChannel - * @constructor - * @param {ibc.core.channel.v1.IChannel=} [properties] Properties to set - */ - function Channel(properties) { - this.connection_hops = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Channel state. - * @member {ibc.core.channel.v1.State} state - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.state = 0; - - /** - * Channel ordering. - * @member {ibc.core.channel.v1.Order} ordering - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.ordering = 0; - - /** - * Channel counterparty. - * @member {ibc.core.channel.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.counterparty = null; - - /** - * Channel connection_hops. - * @member {Array.} connection_hops - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.connection_hops = $util.emptyArray; - - /** - * Channel version. - * @member {string} version - * @memberof ibc.core.channel.v1.Channel - * @instance - */ - Channel.prototype.version = ""; - - /** - * Encodes the specified Channel message. Does not implicitly {@link ibc.core.channel.v1.Channel.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {ibc.core.channel.v1.IChannel} message Channel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Channel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.ordering != null && Object.hasOwnProperty.call(message, "ordering")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ordering); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.channel.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.connection_hops != null && message.connection_hops.length) - for (let i = 0; i < message.connection_hops.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.connection_hops[i]); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); - return writer; - }; - - /** - * Encodes the specified Channel message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Channel.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {ibc.core.channel.v1.IChannel} message Channel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Channel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Channel message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.Channel} Channel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Channel.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Channel(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.ordering = reader.int32(); - break; - case 3: - message.counterparty = $root.ibc.core.channel.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.connection_hops && message.connection_hops.length)) - message.connection_hops = []; - message.connection_hops.push(reader.string()); - break; - case 5: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Channel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.Channel} Channel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Channel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Channel message. - * @function verify - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Channel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.ordering != null && message.hasOwnProperty("ordering")) - switch (message.ordering) { - default: - return "ordering: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - let error = $root.ibc.core.channel.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.connection_hops != null && message.hasOwnProperty("connection_hops")) { - if (!Array.isArray(message.connection_hops)) - return "connection_hops: array expected"; - for (let i = 0; i < message.connection_hops.length; ++i) - if (!$util.isString(message.connection_hops[i])) - return "connection_hops: string[] expected"; - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a Channel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.Channel} Channel - */ - Channel.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.Channel) - return object; - let message = new $root.ibc.core.channel.v1.Channel(); - switch (object.state) { - case "STATE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STATE_INIT": - case 1: - message.state = 1; - break; - case "STATE_TRYOPEN": - case 2: - message.state = 2; - break; - case "STATE_OPEN": - case 3: - message.state = 3; - break; - case "STATE_CLOSED": - case 4: - message.state = 4; - break; - } - switch (object.ordering) { - case "ORDER_NONE_UNSPECIFIED": - case 0: - message.ordering = 0; - break; - case "ORDER_UNORDERED": - case 1: - message.ordering = 1; - break; - case "ORDER_ORDERED": - case 2: - message.ordering = 2; - break; - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.channel.v1.Channel.counterparty: object expected"); - message.counterparty = $root.ibc.core.channel.v1.Counterparty.fromObject(object.counterparty); - } - if (object.connection_hops) { - if (!Array.isArray(object.connection_hops)) - throw TypeError(".ibc.core.channel.v1.Channel.connection_hops: array expected"); - message.connection_hops = []; - for (let i = 0; i < object.connection_hops.length; ++i) - message.connection_hops[i] = String(object.connection_hops[i]); - } - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a Channel message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.Channel - * @static - * @param {ibc.core.channel.v1.Channel} message Channel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Channel.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.connection_hops = []; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; - object.ordering = options.enums === String ? "ORDER_NONE_UNSPECIFIED" : 0; - object.counterparty = null; - object.version = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.ibc.core.channel.v1.State[message.state] : message.state; - if (message.ordering != null && message.hasOwnProperty("ordering")) - object.ordering = options.enums === String ? $root.ibc.core.channel.v1.Order[message.ordering] : message.ordering; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.channel.v1.Counterparty.toObject(message.counterparty, options); - if (message.connection_hops && message.connection_hops.length) { - object.connection_hops = []; - for (let j = 0; j < message.connection_hops.length; ++j) - object.connection_hops[j] = message.connection_hops[j]; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this Channel to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.Channel - * @instance - * @returns {Object.} JSON object - */ - Channel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Channel; - })(); - - v1.IdentifiedChannel = (function() { - - /** - * Properties of an IdentifiedChannel. - * @memberof ibc.core.channel.v1 - * @interface IIdentifiedChannel - * @property {ibc.core.channel.v1.State|null} [state] IdentifiedChannel state - * @property {ibc.core.channel.v1.Order|null} [ordering] IdentifiedChannel ordering - * @property {ibc.core.channel.v1.ICounterparty|null} [counterparty] IdentifiedChannel counterparty - * @property {Array.|null} [connection_hops] IdentifiedChannel connection_hops - * @property {string|null} [version] IdentifiedChannel version - * @property {string|null} [port_id] IdentifiedChannel port_id - * @property {string|null} [channel_id] IdentifiedChannel channel_id - */ - - /** - * Constructs a new IdentifiedChannel. - * @memberof ibc.core.channel.v1 - * @classdesc Represents an IdentifiedChannel. - * @implements IIdentifiedChannel - * @constructor - * @param {ibc.core.channel.v1.IIdentifiedChannel=} [properties] Properties to set - */ - function IdentifiedChannel(properties) { - this.connection_hops = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedChannel state. - * @member {ibc.core.channel.v1.State} state - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.state = 0; - - /** - * IdentifiedChannel ordering. - * @member {ibc.core.channel.v1.Order} ordering - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.ordering = 0; - - /** - * IdentifiedChannel counterparty. - * @member {ibc.core.channel.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.counterparty = null; - - /** - * IdentifiedChannel connection_hops. - * @member {Array.} connection_hops - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.connection_hops = $util.emptyArray; - - /** - * IdentifiedChannel version. - * @member {string} version - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.version = ""; - - /** - * IdentifiedChannel port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.port_id = ""; - - /** - * IdentifiedChannel channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - */ - IdentifiedChannel.prototype.channel_id = ""; - - /** - * Encodes the specified IdentifiedChannel message. Does not implicitly {@link ibc.core.channel.v1.IdentifiedChannel.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {ibc.core.channel.v1.IIdentifiedChannel} message IdentifiedChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedChannel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.ordering != null && Object.hasOwnProperty.call(message, "ordering")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ordering); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.channel.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.connection_hops != null && message.connection_hops.length) - for (let i = 0; i < message.connection_hops.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.connection_hops[i]); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified IdentifiedChannel message, length delimited. Does not implicitly {@link ibc.core.channel.v1.IdentifiedChannel.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {ibc.core.channel.v1.IIdentifiedChannel} message IdentifiedChannel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedChannel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedChannel message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedChannel.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.IdentifiedChannel(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - case 2: - message.ordering = reader.int32(); - break; - case 3: - message.counterparty = $root.ibc.core.channel.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.connection_hops && message.connection_hops.length)) - message.connection_hops = []; - message.connection_hops.push(reader.string()); - break; - case 5: - message.version = reader.string(); - break; - case 6: - message.port_id = reader.string(); - break; - case 7: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedChannel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedChannel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedChannel message. - * @function verify - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedChannel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.ordering != null && message.hasOwnProperty("ordering")) - switch (message.ordering) { - default: - return "ordering: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - let error = $root.ibc.core.channel.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.connection_hops != null && message.hasOwnProperty("connection_hops")) { - if (!Array.isArray(message.connection_hops)) - return "connection_hops: array expected"; - for (let i = 0; i < message.connection_hops.length; ++i) - if (!$util.isString(message.connection_hops[i])) - return "connection_hops: string[] expected"; - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates an IdentifiedChannel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.IdentifiedChannel} IdentifiedChannel - */ - IdentifiedChannel.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.IdentifiedChannel) - return object; - let message = new $root.ibc.core.channel.v1.IdentifiedChannel(); - switch (object.state) { - case "STATE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STATE_INIT": - case 1: - message.state = 1; - break; - case "STATE_TRYOPEN": - case 2: - message.state = 2; - break; - case "STATE_OPEN": - case 3: - message.state = 3; - break; - case "STATE_CLOSED": - case 4: - message.state = 4; - break; - } - switch (object.ordering) { - case "ORDER_NONE_UNSPECIFIED": - case 0: - message.ordering = 0; - break; - case "ORDER_UNORDERED": - case 1: - message.ordering = 1; - break; - case "ORDER_ORDERED": - case 2: - message.ordering = 2; - break; - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.channel.v1.IdentifiedChannel.counterparty: object expected"); - message.counterparty = $root.ibc.core.channel.v1.Counterparty.fromObject(object.counterparty); - } - if (object.connection_hops) { - if (!Array.isArray(object.connection_hops)) - throw TypeError(".ibc.core.channel.v1.IdentifiedChannel.connection_hops: array expected"); - message.connection_hops = []; - for (let i = 0; i < object.connection_hops.length; ++i) - message.connection_hops[i] = String(object.connection_hops[i]); - } - if (object.version != null) - message.version = String(object.version); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from an IdentifiedChannel message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @static - * @param {ibc.core.channel.v1.IdentifiedChannel} message IdentifiedChannel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedChannel.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.connection_hops = []; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; - object.ordering = options.enums === String ? "ORDER_NONE_UNSPECIFIED" : 0; - object.counterparty = null; - object.version = ""; - object.port_id = ""; - object.channel_id = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.ibc.core.channel.v1.State[message.state] : message.state; - if (message.ordering != null && message.hasOwnProperty("ordering")) - object.ordering = options.enums === String ? $root.ibc.core.channel.v1.Order[message.ordering] : message.ordering; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.channel.v1.Counterparty.toObject(message.counterparty, options); - if (message.connection_hops && message.connection_hops.length) { - object.connection_hops = []; - for (let j = 0; j < message.connection_hops.length; ++j) - object.connection_hops[j] = message.connection_hops[j]; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this IdentifiedChannel to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.IdentifiedChannel - * @instance - * @returns {Object.} JSON object - */ - IdentifiedChannel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedChannel; - })(); - - /** - * State enum. - * @name ibc.core.channel.v1.State - * @enum {number} - * @property {number} STATE_UNINITIALIZED_UNSPECIFIED=0 STATE_UNINITIALIZED_UNSPECIFIED value - * @property {number} STATE_INIT=1 STATE_INIT value - * @property {number} STATE_TRYOPEN=2 STATE_TRYOPEN value - * @property {number} STATE_OPEN=3 STATE_OPEN value - * @property {number} STATE_CLOSED=4 STATE_CLOSED value - */ - v1.State = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNINITIALIZED_UNSPECIFIED"] = 0; - values[valuesById[1] = "STATE_INIT"] = 1; - values[valuesById[2] = "STATE_TRYOPEN"] = 2; - values[valuesById[3] = "STATE_OPEN"] = 3; - values[valuesById[4] = "STATE_CLOSED"] = 4; - return values; - })(); - - /** - * Order enum. - * @name ibc.core.channel.v1.Order - * @enum {number} - * @property {number} ORDER_NONE_UNSPECIFIED=0 ORDER_NONE_UNSPECIFIED value - * @property {number} ORDER_UNORDERED=1 ORDER_UNORDERED value - * @property {number} ORDER_ORDERED=2 ORDER_ORDERED value - */ - v1.Order = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ORDER_NONE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORDER_UNORDERED"] = 1; - values[valuesById[2] = "ORDER_ORDERED"] = 2; - return values; - })(); - - v1.Counterparty = (function() { - - /** - * Properties of a Counterparty. - * @memberof ibc.core.channel.v1 - * @interface ICounterparty - * @property {string|null} [port_id] Counterparty port_id - * @property {string|null} [channel_id] Counterparty channel_id - */ - - /** - * Constructs a new Counterparty. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Counterparty. - * @implements ICounterparty - * @constructor - * @param {ibc.core.channel.v1.ICounterparty=} [properties] Properties to set - */ - function Counterparty(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Counterparty port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.Counterparty - * @instance - */ - Counterparty.prototype.port_id = ""; - - /** - * Counterparty channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.Counterparty - * @instance - */ - Counterparty.prototype.channel_id = ""; - - /** - * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.channel.v1.Counterparty.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {ibc.core.channel.v1.ICounterparty} message Counterparty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counterparty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified Counterparty message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Counterparty.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {ibc.core.channel.v1.ICounterparty} message Counterparty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counterparty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Counterparty message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.Counterparty} Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counterparty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Counterparty(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Counterparty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.Counterparty} Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counterparty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Counterparty message. - * @function verify - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Counterparty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a Counterparty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.Counterparty} Counterparty - */ - Counterparty.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.Counterparty) - return object; - let message = new $root.ibc.core.channel.v1.Counterparty(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a Counterparty message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.Counterparty - * @static - * @param {ibc.core.channel.v1.Counterparty} message Counterparty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Counterparty.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this Counterparty to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.Counterparty - * @instance - * @returns {Object.} JSON object - */ - Counterparty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Counterparty; - })(); - - v1.Packet = (function() { - - /** - * Properties of a Packet. - * @memberof ibc.core.channel.v1 - * @interface IPacket - * @property {Long|null} [sequence] Packet sequence - * @property {string|null} [source_port] Packet source_port - * @property {string|null} [source_channel] Packet source_channel - * @property {string|null} [destination_port] Packet destination_port - * @property {string|null} [destination_channel] Packet destination_channel - * @property {Uint8Array|null} [data] Packet data - * @property {ibc.core.client.v1.IHeight|null} [timeout_height] Packet timeout_height - * @property {Long|null} [timeout_timestamp] Packet timeout_timestamp - */ - - /** - * Constructs a new Packet. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Packet. - * @implements IPacket - * @constructor - * @param {ibc.core.channel.v1.IPacket=} [properties] Properties to set - */ - function Packet(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Packet sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Packet source_port. - * @member {string} source_port - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.source_port = ""; - - /** - * Packet source_channel. - * @member {string} source_channel - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.source_channel = ""; - - /** - * Packet destination_port. - * @member {string} destination_port - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.destination_port = ""; - - /** - * Packet destination_channel. - * @member {string} destination_channel - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.destination_channel = ""; - - /** - * Packet data. - * @member {Uint8Array} data - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.data = $util.newBuffer([]); - - /** - * Packet timeout_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} timeout_height - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.timeout_height = null; - - /** - * Packet timeout_timestamp. - * @member {Long} timeout_timestamp - * @memberof ibc.core.channel.v1.Packet - * @instance - */ - Packet.prototype.timeout_timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Packet message. Does not implicitly {@link ibc.core.channel.v1.Packet.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {ibc.core.channel.v1.IPacket} message Packet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Packet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.source_port != null && Object.hasOwnProperty.call(message, "source_port")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_port); - if (message.source_channel != null && Object.hasOwnProperty.call(message, "source_channel")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.source_channel); - if (message.destination_port != null && Object.hasOwnProperty.call(message, "destination_port")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.destination_port); - if (message.destination_channel != null && Object.hasOwnProperty.call(message, "destination_channel")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.destination_channel); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.data); - if (message.timeout_height != null && Object.hasOwnProperty.call(message, "timeout_height")) - $root.ibc.core.client.v1.Height.encode(message.timeout_height, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.timeout_timestamp != null && Object.hasOwnProperty.call(message, "timeout_timestamp")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.timeout_timestamp); - return writer; - }; - - /** - * Encodes the specified Packet message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Packet.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {ibc.core.channel.v1.IPacket} message Packet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Packet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Packet message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.Packet} Packet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Packet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Packet(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.source_port = reader.string(); - break; - case 3: - message.source_channel = reader.string(); - break; - case 4: - message.destination_port = reader.string(); - break; - case 5: - message.destination_channel = reader.string(); - break; - case 6: - message.data = reader.bytes(); - break; - case 7: - message.timeout_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 8: - message.timeout_timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Packet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.Packet} Packet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Packet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Packet message. - * @function verify - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Packet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.source_port != null && message.hasOwnProperty("source_port")) - if (!$util.isString(message.source_port)) - return "source_port: string expected"; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - if (!$util.isString(message.source_channel)) - return "source_channel: string expected"; - if (message.destination_port != null && message.hasOwnProperty("destination_port")) - if (!$util.isString(message.destination_port)) - return "destination_port: string expected"; - if (message.destination_channel != null && message.hasOwnProperty("destination_channel")) - if (!$util.isString(message.destination_channel)) - return "destination_channel: string expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.timeout_height); - if (error) - return "timeout_height." + error; - } - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (!$util.isInteger(message.timeout_timestamp) && !(message.timeout_timestamp && $util.isInteger(message.timeout_timestamp.low) && $util.isInteger(message.timeout_timestamp.high))) - return "timeout_timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a Packet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.Packet} Packet - */ - Packet.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.Packet) - return object; - let message = new $root.ibc.core.channel.v1.Packet(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.source_port != null) - message.source_port = String(object.source_port); - if (object.source_channel != null) - message.source_channel = String(object.source_channel); - if (object.destination_port != null) - message.destination_port = String(object.destination_port); - if (object.destination_channel != null) - message.destination_channel = String(object.destination_channel); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.timeout_height != null) { - if (typeof object.timeout_height !== "object") - throw TypeError(".ibc.core.channel.v1.Packet.timeout_height: object expected"); - message.timeout_height = $root.ibc.core.client.v1.Height.fromObject(object.timeout_height); - } - if (object.timeout_timestamp != null) - if ($util.Long) - (message.timeout_timestamp = $util.Long.fromValue(object.timeout_timestamp)).unsigned = true; - else if (typeof object.timeout_timestamp === "string") - message.timeout_timestamp = parseInt(object.timeout_timestamp, 10); - else if (typeof object.timeout_timestamp === "number") - message.timeout_timestamp = object.timeout_timestamp; - else if (typeof object.timeout_timestamp === "object") - message.timeout_timestamp = new $util.LongBits(object.timeout_timestamp.low >>> 0, object.timeout_timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Packet message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.Packet - * @static - * @param {ibc.core.channel.v1.Packet} message Packet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Packet.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - object.source_port = ""; - object.source_channel = ""; - object.destination_port = ""; - object.destination_channel = ""; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.timeout_height = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timeout_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timeout_timestamp = options.longs === String ? "0" : 0; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.source_port != null && message.hasOwnProperty("source_port")) - object.source_port = message.source_port; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - object.source_channel = message.source_channel; - if (message.destination_port != null && message.hasOwnProperty("destination_port")) - object.destination_port = message.destination_port; - if (message.destination_channel != null && message.hasOwnProperty("destination_channel")) - object.destination_channel = message.destination_channel; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) - object.timeout_height = $root.ibc.core.client.v1.Height.toObject(message.timeout_height, options); - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (typeof message.timeout_timestamp === "number") - object.timeout_timestamp = options.longs === String ? String(message.timeout_timestamp) : message.timeout_timestamp; - else - object.timeout_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeout_timestamp) : options.longs === Number ? new $util.LongBits(message.timeout_timestamp.low >>> 0, message.timeout_timestamp.high >>> 0).toNumber(true) : message.timeout_timestamp; - return object; - }; - - /** - * Converts this Packet to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.Packet - * @instance - * @returns {Object.} JSON object - */ - Packet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Packet; - })(); - - v1.PacketState = (function() { - - /** - * Properties of a PacketState. - * @memberof ibc.core.channel.v1 - * @interface IPacketState - * @property {string|null} [port_id] PacketState port_id - * @property {string|null} [channel_id] PacketState channel_id - * @property {Long|null} [sequence] PacketState sequence - * @property {Uint8Array|null} [data] PacketState data - */ - - /** - * Constructs a new PacketState. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a PacketState. - * @implements IPacketState - * @constructor - * @param {ibc.core.channel.v1.IPacketState=} [properties] Properties to set - */ - function PacketState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketState port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.PacketState - * @instance - */ - PacketState.prototype.port_id = ""; - - /** - * PacketState channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.PacketState - * @instance - */ - PacketState.prototype.channel_id = ""; - - /** - * PacketState sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.PacketState - * @instance - */ - PacketState.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PacketState data. - * @member {Uint8Array} data - * @memberof ibc.core.channel.v1.PacketState - * @instance - */ - PacketState.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified PacketState message. Does not implicitly {@link ibc.core.channel.v1.PacketState.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {ibc.core.channel.v1.IPacketState} message PacketState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified PacketState message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {ibc.core.channel.v1.IPacketState} message PacketState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.PacketState} PacketState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.PacketState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - case 4: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.PacketState} PacketState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketState message. - * @function verify - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a PacketState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.PacketState} PacketState - */ - PacketState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.PacketState) - return object; - let message = new $root.ibc.core.channel.v1.PacketState(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a PacketState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.PacketState - * @static - * @param {ibc.core.channel.v1.PacketState} message PacketState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this PacketState to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.PacketState - * @instance - * @returns {Object.} JSON object - */ - PacketState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketState; - })(); - - v1.PacketId = (function() { - - /** - * Properties of a PacketId. - * @memberof ibc.core.channel.v1 - * @interface IPacketId - * @property {string|null} [port_id] PacketId port_id - * @property {string|null} [channel_id] PacketId channel_id - * @property {Long|null} [sequence] PacketId sequence - */ - - /** - * Constructs a new PacketId. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a PacketId. - * @implements IPacketId - * @constructor - * @param {ibc.core.channel.v1.IPacketId=} [properties] Properties to set - */ - function PacketId(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketId port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.PacketId - * @instance - */ - PacketId.prototype.port_id = ""; - - /** - * PacketId channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.PacketId - * @instance - */ - PacketId.prototype.channel_id = ""; - - /** - * PacketId sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.PacketId - * @instance - */ - PacketId.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified PacketId message. Does not implicitly {@link ibc.core.channel.v1.PacketId.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {ibc.core.channel.v1.IPacketId} message PacketId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified PacketId message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketId.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {ibc.core.channel.v1.IPacketId} message PacketId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketId message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.PacketId} PacketId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketId.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.PacketId(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.PacketId} PacketId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketId message. - * @function verify - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a PacketId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.PacketId} PacketId - */ - PacketId.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.PacketId) - return object; - let message = new $root.ibc.core.channel.v1.PacketId(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PacketId message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.PacketId - * @static - * @param {ibc.core.channel.v1.PacketId} message PacketId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketId.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this PacketId to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.PacketId - * @instance - * @returns {Object.} JSON object - */ - PacketId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketId; - })(); - - v1.Acknowledgement = (function() { - - /** - * Properties of an Acknowledgement. - * @memberof ibc.core.channel.v1 - * @interface IAcknowledgement - * @property {Uint8Array|null} [result] Acknowledgement result - * @property {string|null} [error] Acknowledgement error - */ - - /** - * Constructs a new Acknowledgement. - * @memberof ibc.core.channel.v1 - * @classdesc Represents an Acknowledgement. - * @implements IAcknowledgement - * @constructor - * @param {ibc.core.channel.v1.IAcknowledgement=} [properties] Properties to set - */ - function Acknowledgement(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Acknowledgement result. - * @member {Uint8Array|null|undefined} result - * @memberof ibc.core.channel.v1.Acknowledgement - * @instance - */ - Acknowledgement.prototype.result = null; - - /** - * Acknowledgement error. - * @member {string|null|undefined} error - * @memberof ibc.core.channel.v1.Acknowledgement - * @instance - */ - Acknowledgement.prototype.error = null; - - // OneOf field names bound to virtual getters and setters - let $oneOfFields; - - /** - * Acknowledgement response. - * @member {"result"|"error"|undefined} response - * @memberof ibc.core.channel.v1.Acknowledgement - * @instance - */ - Object.defineProperty(Acknowledgement.prototype, "response", { - get: $util.oneOfGetter($oneOfFields = ["result", "error"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified Acknowledgement message. Does not implicitly {@link ibc.core.channel.v1.Acknowledgement.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {ibc.core.channel.v1.IAcknowledgement} message Acknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Acknowledgement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.result); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.error); - return writer; - }; - - /** - * Encodes the specified Acknowledgement message, length delimited. Does not implicitly {@link ibc.core.channel.v1.Acknowledgement.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {ibc.core.channel.v1.IAcknowledgement} message Acknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Acknowledgement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Acknowledgement message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Acknowledgement.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.Acknowledgement(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 21: - message.result = reader.bytes(); - break; - case 22: - message.error = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Acknowledgement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Acknowledgement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Acknowledgement message. - * @function verify - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Acknowledgement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; - if (message.result != null && message.hasOwnProperty("result")) { - properties.response = 1; - if (!(message.result && typeof message.result.length === "number" || $util.isString(message.result))) - return "result: buffer expected"; - } - if (message.error != null && message.hasOwnProperty("error")) { - if (properties.response === 1) - return "response: multiple values"; - properties.response = 1; - if (!$util.isString(message.error)) - return "error: string expected"; - } - return null; - }; - - /** - * Creates an Acknowledgement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.Acknowledgement} Acknowledgement - */ - Acknowledgement.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.Acknowledgement) - return object; - let message = new $root.ibc.core.channel.v1.Acknowledgement(); - if (object.result != null) - if (typeof object.result === "string") - $util.base64.decode(object.result, message.result = $util.newBuffer($util.base64.length(object.result)), 0); - else if (object.result.length) - message.result = object.result; - if (object.error != null) - message.error = String(object.error); - return message; - }; - - /** - * Creates a plain object from an Acknowledgement message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.Acknowledgement - * @static - * @param {ibc.core.channel.v1.Acknowledgement} message Acknowledgement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Acknowledgement.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (message.result != null && message.hasOwnProperty("result")) { - object.result = options.bytes === String ? $util.base64.encode(message.result, 0, message.result.length) : options.bytes === Array ? Array.prototype.slice.call(message.result) : message.result; - if (options.oneofs) - object.response = "result"; - } - if (message.error != null && message.hasOwnProperty("error")) { - object.error = message.error; - if (options.oneofs) - object.response = "error"; - } - return object; - }; - - /** - * Converts this Acknowledgement to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.Acknowledgement - * @instance - * @returns {Object.} JSON object - */ - Acknowledgement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Acknowledgement; - })(); - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenInit}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelOpenInitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelOpenInitResponse} [response] MsgChannelOpenInitResponse - */ - - /** - * Calls ChannelOpenInit. - * @function channelOpenInit - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenInit} request MsgChannelOpenInit message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelOpenInitCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenInitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelOpenInit = function channelOpenInit(request, callback) { - return this.rpcCall(channelOpenInit, $root.ibc.core.channel.v1.MsgChannelOpenInit, $root.ibc.core.channel.v1.MsgChannelOpenInitResponse, request, callback); - }, "name", { value: "ChannelOpenInit" }); - - /** - * Calls ChannelOpenInit. - * @function channelOpenInit - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenInit} request MsgChannelOpenInit message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenTry}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelOpenTryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelOpenTryResponse} [response] MsgChannelOpenTryResponse - */ - - /** - * Calls ChannelOpenTry. - * @function channelOpenTry - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenTry} request MsgChannelOpenTry message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelOpenTryCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenTryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelOpenTry = function channelOpenTry(request, callback) { - return this.rpcCall(channelOpenTry, $root.ibc.core.channel.v1.MsgChannelOpenTry, $root.ibc.core.channel.v1.MsgChannelOpenTryResponse, request, callback); - }, "name", { value: "ChannelOpenTry" }); - - /** - * Calls ChannelOpenTry. - * @function channelOpenTry - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenTry} request MsgChannelOpenTry message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenAck}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelOpenAckCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelOpenAckResponse} [response] MsgChannelOpenAckResponse - */ - - /** - * Calls ChannelOpenAck. - * @function channelOpenAck - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenAck} request MsgChannelOpenAck message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelOpenAckCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenAckResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelOpenAck = function channelOpenAck(request, callback) { - return this.rpcCall(channelOpenAck, $root.ibc.core.channel.v1.MsgChannelOpenAck, $root.ibc.core.channel.v1.MsgChannelOpenAckResponse, request, callback); - }, "name", { value: "ChannelOpenAck" }); - - /** - * Calls ChannelOpenAck. - * @function channelOpenAck - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenAck} request MsgChannelOpenAck message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelOpenConfirm}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelOpenConfirmCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} [response] MsgChannelOpenConfirmResponse - */ - - /** - * Calls ChannelOpenConfirm. - * @function channelOpenConfirm - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} request MsgChannelOpenConfirm message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelOpenConfirmCallback} callback Node-style callback called with the error, if any, and MsgChannelOpenConfirmResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelOpenConfirm = function channelOpenConfirm(request, callback) { - return this.rpcCall(channelOpenConfirm, $root.ibc.core.channel.v1.MsgChannelOpenConfirm, $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse, request, callback); - }, "name", { value: "ChannelOpenConfirm" }); - - /** - * Calls ChannelOpenConfirm. - * @function channelOpenConfirm - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} request MsgChannelOpenConfirm message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelCloseInit}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelCloseInitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelCloseInitResponse} [response] MsgChannelCloseInitResponse - */ - - /** - * Calls ChannelCloseInit. - * @function channelCloseInit - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelCloseInit} request MsgChannelCloseInit message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelCloseInitCallback} callback Node-style callback called with the error, if any, and MsgChannelCloseInitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelCloseInit = function channelCloseInit(request, callback) { - return this.rpcCall(channelCloseInit, $root.ibc.core.channel.v1.MsgChannelCloseInit, $root.ibc.core.channel.v1.MsgChannelCloseInitResponse, request, callback); - }, "name", { value: "ChannelCloseInit" }); - - /** - * Calls ChannelCloseInit. - * @function channelCloseInit - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelCloseInit} request MsgChannelCloseInit message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#channelCloseConfirm}. - * @memberof ibc.core.channel.v1.Msg - * @typedef ChannelCloseConfirmCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} [response] MsgChannelCloseConfirmResponse - */ - - /** - * Calls ChannelCloseConfirm. - * @function channelCloseConfirm - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} request MsgChannelCloseConfirm message or plain object - * @param {ibc.core.channel.v1.Msg.ChannelCloseConfirmCallback} callback Node-style callback called with the error, if any, and MsgChannelCloseConfirmResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.channelCloseConfirm = function channelCloseConfirm(request, callback) { - return this.rpcCall(channelCloseConfirm, $root.ibc.core.channel.v1.MsgChannelCloseConfirm, $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse, request, callback); - }, "name", { value: "ChannelCloseConfirm" }); - - /** - * Calls ChannelCloseConfirm. - * @function channelCloseConfirm - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} request MsgChannelCloseConfirm message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#recvPacket}. - * @memberof ibc.core.channel.v1.Msg - * @typedef RecvPacketCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgRecvPacketResponse} [response] MsgRecvPacketResponse - */ - - /** - * Calls RecvPacket. - * @function recvPacket - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgRecvPacket} request MsgRecvPacket message or plain object - * @param {ibc.core.channel.v1.Msg.RecvPacketCallback} callback Node-style callback called with the error, if any, and MsgRecvPacketResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.recvPacket = function recvPacket(request, callback) { - return this.rpcCall(recvPacket, $root.ibc.core.channel.v1.MsgRecvPacket, $root.ibc.core.channel.v1.MsgRecvPacketResponse, request, callback); - }, "name", { value: "RecvPacket" }); - - /** - * Calls RecvPacket. - * @function recvPacket - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgRecvPacket} request MsgRecvPacket message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#timeout}. - * @memberof ibc.core.channel.v1.Msg - * @typedef TimeoutCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgTimeoutResponse} [response] MsgTimeoutResponse - */ - - /** - * Calls Timeout. - * @function timeout - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgTimeout} request MsgTimeout message or plain object - * @param {ibc.core.channel.v1.Msg.TimeoutCallback} callback Node-style callback called with the error, if any, and MsgTimeoutResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.timeout = function timeout(request, callback) { - return this.rpcCall(timeout, $root.ibc.core.channel.v1.MsgTimeout, $root.ibc.core.channel.v1.MsgTimeoutResponse, request, callback); - }, "name", { value: "Timeout" }); - - /** - * Calls Timeout. - * @function timeout - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgTimeout} request MsgTimeout message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#timeoutOnClose}. - * @memberof ibc.core.channel.v1.Msg - * @typedef TimeoutOnCloseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} [response] MsgTimeoutOnCloseResponse - */ - - /** - * Calls TimeoutOnClose. - * @function timeoutOnClose - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} request MsgTimeoutOnClose message or plain object - * @param {ibc.core.channel.v1.Msg.TimeoutOnCloseCallback} callback Node-style callback called with the error, if any, and MsgTimeoutOnCloseResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.timeoutOnClose = function timeoutOnClose(request, callback) { - return this.rpcCall(timeoutOnClose, $root.ibc.core.channel.v1.MsgTimeoutOnClose, $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse, request, callback); - }, "name", { value: "TimeoutOnClose" }); - - /** - * Calls TimeoutOnClose. - * @function timeoutOnClose - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} request MsgTimeoutOnClose message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Msg#acknowledgement}. - * @memberof ibc.core.channel.v1.Msg - * @typedef AcknowledgementCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.MsgAcknowledgementResponse} [response] MsgAcknowledgementResponse - */ - - /** - * Calls Acknowledgement. - * @function acknowledgement - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgAcknowledgement} request MsgAcknowledgement message or plain object - * @param {ibc.core.channel.v1.Msg.AcknowledgementCallback} callback Node-style callback called with the error, if any, and MsgAcknowledgementResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.acknowledgement = function acknowledgement(request, callback) { - return this.rpcCall(acknowledgement, $root.ibc.core.channel.v1.MsgAcknowledgement, $root.ibc.core.channel.v1.MsgAcknowledgementResponse, request, callback); - }, "name", { value: "Acknowledgement" }); - - /** - * Calls Acknowledgement. - * @function acknowledgement - * @memberof ibc.core.channel.v1.Msg - * @instance - * @param {ibc.core.channel.v1.IMsgAcknowledgement} request MsgAcknowledgement message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - /** - * ResponseResultType enum. - * @name ibc.core.channel.v1.ResponseResultType - * @enum {number} - * @property {number} RESPONSE_RESULT_TYPE_UNSPECIFIED=0 RESPONSE_RESULT_TYPE_UNSPECIFIED value - * @property {number} RESPONSE_RESULT_TYPE_NOOP=1 RESPONSE_RESULT_TYPE_NOOP value - * @property {number} RESPONSE_RESULT_TYPE_SUCCESS=2 RESPONSE_RESULT_TYPE_SUCCESS value - */ - v1.ResponseResultType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESPONSE_RESULT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESPONSE_RESULT_TYPE_NOOP"] = 1; - values[valuesById[2] = "RESPONSE_RESULT_TYPE_SUCCESS"] = 2; - return values; - })(); - - v1.MsgChannelOpenInit = (function() { - - /** - * Properties of a MsgChannelOpenInit. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenInit - * @property {string|null} [port_id] MsgChannelOpenInit port_id - * @property {ibc.core.channel.v1.IChannel|null} [channel] MsgChannelOpenInit channel - * @property {string|null} [signer] MsgChannelOpenInit signer - */ - - /** - * Constructs a new MsgChannelOpenInit. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenInit. - * @implements IMsgChannelOpenInit - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenInit=} [properties] Properties to set - */ - function MsgChannelOpenInit(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenInit port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @instance - */ - MsgChannelOpenInit.prototype.port_id = ""; - - /** - * MsgChannelOpenInit channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @instance - */ - MsgChannelOpenInit.prototype.channel = null; - - /** - * MsgChannelOpenInit signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @instance - */ - MsgChannelOpenInit.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelOpenInit message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInit.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenInit} message MsgChannelOpenInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenInit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenInit message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInit.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenInit} message MsgChannelOpenInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenInit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenInit message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenInit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenInit(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenInit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenInit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenInit message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenInit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - let error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenInit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenInit} MsgChannelOpenInit - */ - MsgChannelOpenInit.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenInit) - return object; - let message = new $root.ibc.core.channel.v1.MsgChannelOpenInit(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenInit.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenInit message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenInit} message MsgChannelOpenInit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenInit.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelOpenInit to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenInit - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenInit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenInit; - })(); - - v1.MsgChannelOpenInitResponse = (function() { - - /** - * Properties of a MsgChannelOpenInitResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenInitResponse - * @property {string|null} [channel_id] MsgChannelOpenInitResponse channel_id - * @property {string|null} [version] MsgChannelOpenInitResponse version - */ - - /** - * Constructs a new MsgChannelOpenInitResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenInitResponse. - * @implements IMsgChannelOpenInitResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse=} [properties] Properties to set - */ - function MsgChannelOpenInitResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenInitResponse channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @instance - */ - MsgChannelOpenInitResponse.prototype.channel_id = ""; - - /** - * MsgChannelOpenInitResponse version. - * @member {string} version - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @instance - */ - MsgChannelOpenInitResponse.prototype.version = ""; - - /** - * Encodes the specified MsgChannelOpenInitResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInitResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse} message MsgChannelOpenInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenInitResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenInitResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenInitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenInitResponse} message MsgChannelOpenInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenInitResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenInitResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenInitResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenInitResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenInitResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenInitResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenInitResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenInitResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenInitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenInitResponse} MsgChannelOpenInitResponse - */ - MsgChannelOpenInitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenInitResponse) - return object; - let message = new $root.ibc.core.channel.v1.MsgChannelOpenInitResponse(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenInitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenInitResponse} message MsgChannelOpenInitResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenInitResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.channel_id = ""; - object.version = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this MsgChannelOpenInitResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenInitResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenInitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenInitResponse; - })(); - - v1.MsgChannelOpenTry = (function() { - - /** - * Properties of a MsgChannelOpenTry. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenTry - * @property {string|null} [port_id] MsgChannelOpenTry port_id - * @property {string|null} [previous_channel_id] MsgChannelOpenTry previous_channel_id - * @property {ibc.core.channel.v1.IChannel|null} [channel] MsgChannelOpenTry channel - * @property {string|null} [counterparty_version] MsgChannelOpenTry counterparty_version - * @property {Uint8Array|null} [proof_init] MsgChannelOpenTry proof_init - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgChannelOpenTry proof_height - * @property {string|null} [signer] MsgChannelOpenTry signer - */ - - /** - * Constructs a new MsgChannelOpenTry. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenTry. - * @implements IMsgChannelOpenTry - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenTry=} [properties] Properties to set - */ - function MsgChannelOpenTry(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenTry port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.port_id = ""; - - /** - * MsgChannelOpenTry previous_channel_id. - * @member {string} previous_channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.previous_channel_id = ""; - - /** - * MsgChannelOpenTry channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.channel = null; - - /** - * MsgChannelOpenTry counterparty_version. - * @member {string} counterparty_version - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.counterparty_version = ""; - - /** - * MsgChannelOpenTry proof_init. - * @member {Uint8Array} proof_init - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.proof_init = $util.newBuffer([]); - - /** - * MsgChannelOpenTry proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.proof_height = null; - - /** - * MsgChannelOpenTry signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - */ - MsgChannelOpenTry.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelOpenTry message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTry.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenTry} message MsgChannelOpenTry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenTry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.previous_channel_id != null && Object.hasOwnProperty.call(message, "previous_channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.previous_channel_id); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.counterparty_version != null && Object.hasOwnProperty.call(message, "counterparty_version")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.counterparty_version); - if (message.proof_init != null && Object.hasOwnProperty.call(message, "proof_init")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proof_init); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenTry message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTry.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenTry} message MsgChannelOpenTry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenTry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenTry message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenTry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenTry(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.previous_channel_id = reader.string(); - break; - case 3: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - case 4: - message.counterparty_version = reader.string(); - break; - case 5: - message.proof_init = reader.bytes(); - break; - case 6: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 7: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenTry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenTry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenTry message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenTry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.previous_channel_id != null && message.hasOwnProperty("previous_channel_id")) - if (!$util.isString(message.previous_channel_id)) - return "previous_channel_id: string expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - let error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - if (message.counterparty_version != null && message.hasOwnProperty("counterparty_version")) - if (!$util.isString(message.counterparty_version)) - return "counterparty_version: string expected"; - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - if (!(message.proof_init && typeof message.proof_init.length === "number" || $util.isString(message.proof_init))) - return "proof_init: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenTry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenTry} MsgChannelOpenTry - */ - MsgChannelOpenTry.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenTry) - return object; - let message = new $root.ibc.core.channel.v1.MsgChannelOpenTry(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.previous_channel_id != null) - message.previous_channel_id = String(object.previous_channel_id); - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenTry.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - if (object.counterparty_version != null) - message.counterparty_version = String(object.counterparty_version); - if (object.proof_init != null) - if (typeof object.proof_init === "string") - $util.base64.decode(object.proof_init, message.proof_init = $util.newBuffer($util.base64.length(object.proof_init)), 0); - else if (object.proof_init.length) - message.proof_init = object.proof_init; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenTry.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenTry message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenTry} message MsgChannelOpenTry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenTry.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.previous_channel_id = ""; - object.channel = null; - object.counterparty_version = ""; - if (options.bytes === String) - object.proof_init = ""; - else { - object.proof_init = []; - if (options.bytes !== Array) - object.proof_init = $util.newBuffer(object.proof_init); - } - object.proof_height = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.previous_channel_id != null && message.hasOwnProperty("previous_channel_id")) - object.previous_channel_id = message.previous_channel_id; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - if (message.counterparty_version != null && message.hasOwnProperty("counterparty_version")) - object.counterparty_version = message.counterparty_version; - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - object.proof_init = options.bytes === String ? $util.base64.encode(message.proof_init, 0, message.proof_init.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_init) : message.proof_init; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelOpenTry to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenTry - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenTry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenTry; - })(); - - v1.MsgChannelOpenTryResponse = (function() { - - /** - * Properties of a MsgChannelOpenTryResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenTryResponse - * @property {string|null} [version] MsgChannelOpenTryResponse version - */ - - /** - * Constructs a new MsgChannelOpenTryResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenTryResponse. - * @implements IMsgChannelOpenTryResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse=} [properties] Properties to set - */ - function MsgChannelOpenTryResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenTryResponse version. - * @member {string} version - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @instance - */ - MsgChannelOpenTryResponse.prototype.version = ""; - - /** - * Encodes the specified MsgChannelOpenTryResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTryResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse} message MsgChannelOpenTryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenTryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenTryResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenTryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenTryResponse} message MsgChannelOpenTryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenTryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenTryResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenTryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenTryResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenTryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenTryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenTryResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenTryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenTryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenTryResponse} MsgChannelOpenTryResponse - */ - MsgChannelOpenTryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenTryResponse) - return object; - let message = new $root.ibc.core.channel.v1.MsgChannelOpenTryResponse(); - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenTryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenTryResponse} message MsgChannelOpenTryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenTryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.version = ""; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this MsgChannelOpenTryResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenTryResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenTryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenTryResponse; - })(); - - v1.MsgChannelOpenAck = (function() { - - /** - * Properties of a MsgChannelOpenAck. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenAck - * @property {string|null} [port_id] MsgChannelOpenAck port_id - * @property {string|null} [channel_id] MsgChannelOpenAck channel_id - * @property {string|null} [counterparty_channel_id] MsgChannelOpenAck counterparty_channel_id - * @property {string|null} [counterparty_version] MsgChannelOpenAck counterparty_version - * @property {Uint8Array|null} [proof_try] MsgChannelOpenAck proof_try - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgChannelOpenAck proof_height - * @property {string|null} [signer] MsgChannelOpenAck signer - */ - - /** - * Constructs a new MsgChannelOpenAck. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenAck. - * @implements IMsgChannelOpenAck - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenAck=} [properties] Properties to set - */ - function MsgChannelOpenAck(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenAck port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.port_id = ""; - - /** - * MsgChannelOpenAck channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.channel_id = ""; - - /** - * MsgChannelOpenAck counterparty_channel_id. - * @member {string} counterparty_channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.counterparty_channel_id = ""; - - /** - * MsgChannelOpenAck counterparty_version. - * @member {string} counterparty_version - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.counterparty_version = ""; - - /** - * MsgChannelOpenAck proof_try. - * @member {Uint8Array} proof_try - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.proof_try = $util.newBuffer([]); - - /** - * MsgChannelOpenAck proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.proof_height = null; - - /** - * MsgChannelOpenAck signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - */ - MsgChannelOpenAck.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelOpenAck message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAck.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenAck} message MsgChannelOpenAck message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenAck.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.counterparty_channel_id != null && Object.hasOwnProperty.call(message, "counterparty_channel_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.counterparty_channel_id); - if (message.counterparty_version != null && Object.hasOwnProperty.call(message, "counterparty_version")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.counterparty_version); - if (message.proof_try != null && Object.hasOwnProperty.call(message, "proof_try")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proof_try); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenAck message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAck.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenAck} message MsgChannelOpenAck message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenAck.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenAck message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenAck.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenAck(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.counterparty_channel_id = reader.string(); - break; - case 4: - message.counterparty_version = reader.string(); - break; - case 5: - message.proof_try = reader.bytes(); - break; - case 6: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 7: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenAck message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenAck.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenAck message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenAck.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.counterparty_channel_id != null && message.hasOwnProperty("counterparty_channel_id")) - if (!$util.isString(message.counterparty_channel_id)) - return "counterparty_channel_id: string expected"; - if (message.counterparty_version != null && message.hasOwnProperty("counterparty_version")) - if (!$util.isString(message.counterparty_version)) - return "counterparty_version: string expected"; - if (message.proof_try != null && message.hasOwnProperty("proof_try")) - if (!(message.proof_try && typeof message.proof_try.length === "number" || $util.isString(message.proof_try))) - return "proof_try: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenAck message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenAck} MsgChannelOpenAck - */ - MsgChannelOpenAck.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenAck) - return object; - let message = new $root.ibc.core.channel.v1.MsgChannelOpenAck(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.counterparty_channel_id != null) - message.counterparty_channel_id = String(object.counterparty_channel_id); - if (object.counterparty_version != null) - message.counterparty_version = String(object.counterparty_version); - if (object.proof_try != null) - if (typeof object.proof_try === "string") - $util.base64.decode(object.proof_try, message.proof_try = $util.newBuffer($util.base64.length(object.proof_try)), 0); - else if (object.proof_try.length) - message.proof_try = object.proof_try; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenAck.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenAck message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenAck} message MsgChannelOpenAck - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenAck.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.counterparty_channel_id = ""; - object.counterparty_version = ""; - if (options.bytes === String) - object.proof_try = ""; - else { - object.proof_try = []; - if (options.bytes !== Array) - object.proof_try = $util.newBuffer(object.proof_try); - } - object.proof_height = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.counterparty_channel_id != null && message.hasOwnProperty("counterparty_channel_id")) - object.counterparty_channel_id = message.counterparty_channel_id; - if (message.counterparty_version != null && message.hasOwnProperty("counterparty_version")) - object.counterparty_version = message.counterparty_version; - if (message.proof_try != null && message.hasOwnProperty("proof_try")) - object.proof_try = options.bytes === String ? $util.base64.encode(message.proof_try, 0, message.proof_try.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_try) : message.proof_try; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelOpenAck to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenAck - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenAck.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenAck; - })(); - - v1.MsgChannelOpenAckResponse = (function() { - - /** - * Properties of a MsgChannelOpenAckResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenAckResponse - */ - - /** - * Constructs a new MsgChannelOpenAckResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenAckResponse. - * @implements IMsgChannelOpenAckResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse=} [properties] Properties to set - */ - function MsgChannelOpenAckResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgChannelOpenAckResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAckResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse} message MsgChannelOpenAckResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenAckResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenAckResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenAckResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenAckResponse} message MsgChannelOpenAckResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenAckResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenAckResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenAckResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenAckResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenAckResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenAckResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenAckResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenAckResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenAckResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenAckResponse} MsgChannelOpenAckResponse - */ - MsgChannelOpenAckResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenAckResponse) - return object; - return new $root.ibc.core.channel.v1.MsgChannelOpenAckResponse(); - }; - - /** - * Creates a plain object from a MsgChannelOpenAckResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenAckResponse} message MsgChannelOpenAckResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenAckResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgChannelOpenAckResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenAckResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenAckResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenAckResponse; - })(); - - v1.MsgChannelOpenConfirm = (function() { - - /** - * Properties of a MsgChannelOpenConfirm. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenConfirm - * @property {string|null} [port_id] MsgChannelOpenConfirm port_id - * @property {string|null} [channel_id] MsgChannelOpenConfirm channel_id - * @property {Uint8Array|null} [proof_ack] MsgChannelOpenConfirm proof_ack - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgChannelOpenConfirm proof_height - * @property {string|null} [signer] MsgChannelOpenConfirm signer - */ - - /** - * Constructs a new MsgChannelOpenConfirm. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenConfirm. - * @implements IMsgChannelOpenConfirm - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm=} [properties] Properties to set - */ - function MsgChannelOpenConfirm(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelOpenConfirm port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.port_id = ""; - - /** - * MsgChannelOpenConfirm channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.channel_id = ""; - - /** - * MsgChannelOpenConfirm proof_ack. - * @member {Uint8Array} proof_ack - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.proof_ack = $util.newBuffer([]); - - /** - * MsgChannelOpenConfirm proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.proof_height = null; - - /** - * MsgChannelOpenConfirm signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - */ - MsgChannelOpenConfirm.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelOpenConfirm message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirm.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} message MsgChannelOpenConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenConfirm.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.proof_ack != null && Object.hasOwnProperty.call(message, "proof_ack")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof_ack); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenConfirm message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirm.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirm} message MsgChannelOpenConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenConfirm.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenConfirm message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenConfirm.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenConfirm(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.proof_ack = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenConfirm message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenConfirm.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenConfirm message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenConfirm.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.proof_ack != null && message.hasOwnProperty("proof_ack")) - if (!(message.proof_ack && typeof message.proof_ack.length === "number" || $util.isString(message.proof_ack))) - return "proof_ack: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenConfirm message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirm} MsgChannelOpenConfirm - */ - MsgChannelOpenConfirm.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenConfirm) - return object; - let message = new $root.ibc.core.channel.v1.MsgChannelOpenConfirm(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.proof_ack != null) - if (typeof object.proof_ack === "string") - $util.base64.decode(object.proof_ack, message.proof_ack = $util.newBuffer($util.base64.length(object.proof_ack)), 0); - else if (object.proof_ack.length) - message.proof_ack = object.proof_ack; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelOpenConfirm.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelOpenConfirm message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenConfirm} message MsgChannelOpenConfirm - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenConfirm.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if (options.bytes === String) - object.proof_ack = ""; - else { - object.proof_ack = []; - if (options.bytes !== Array) - object.proof_ack = $util.newBuffer(object.proof_ack); - } - object.proof_height = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.proof_ack != null && message.hasOwnProperty("proof_ack")) - object.proof_ack = options.bytes === String ? $util.base64.encode(message.proof_ack, 0, message.proof_ack.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_ack) : message.proof_ack; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelOpenConfirm to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirm - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenConfirm.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenConfirm; - })(); - - v1.MsgChannelOpenConfirmResponse = (function() { - - /** - * Properties of a MsgChannelOpenConfirmResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelOpenConfirmResponse - */ - - /** - * Constructs a new MsgChannelOpenConfirmResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelOpenConfirmResponse. - * @implements IMsgChannelOpenConfirmResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse=} [properties] Properties to set - */ - function MsgChannelOpenConfirmResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgChannelOpenConfirmResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirmResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse} message MsgChannelOpenConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenConfirmResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgChannelOpenConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelOpenConfirmResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelOpenConfirmResponse} message MsgChannelOpenConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelOpenConfirmResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelOpenConfirmResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenConfirmResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelOpenConfirmResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelOpenConfirmResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelOpenConfirmResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelOpenConfirmResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgChannelOpenConfirmResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} MsgChannelOpenConfirmResponse - */ - MsgChannelOpenConfirmResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse) - return object; - return new $root.ibc.core.channel.v1.MsgChannelOpenConfirmResponse(); - }; - - /** - * Creates a plain object from a MsgChannelOpenConfirmResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelOpenConfirmResponse} message MsgChannelOpenConfirmResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelOpenConfirmResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgChannelOpenConfirmResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelOpenConfirmResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelOpenConfirmResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelOpenConfirmResponse; - })(); - - v1.MsgChannelCloseInit = (function() { - - /** - * Properties of a MsgChannelCloseInit. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelCloseInit - * @property {string|null} [port_id] MsgChannelCloseInit port_id - * @property {string|null} [channel_id] MsgChannelCloseInit channel_id - * @property {string|null} [signer] MsgChannelCloseInit signer - */ - - /** - * Constructs a new MsgChannelCloseInit. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelCloseInit. - * @implements IMsgChannelCloseInit - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelCloseInit=} [properties] Properties to set - */ - function MsgChannelCloseInit(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelCloseInit port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @instance - */ - MsgChannelCloseInit.prototype.port_id = ""; - - /** - * MsgChannelCloseInit channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @instance - */ - MsgChannelCloseInit.prototype.channel_id = ""; - - /** - * MsgChannelCloseInit signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @instance - */ - MsgChannelCloseInit.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelCloseInit message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInit.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseInit} message MsgChannelCloseInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseInit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelCloseInit message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInit.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseInit} message MsgChannelCloseInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseInit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelCloseInit message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseInit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseInit(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelCloseInit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseInit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelCloseInit message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelCloseInit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelCloseInit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelCloseInit} MsgChannelCloseInit - */ - MsgChannelCloseInit.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseInit) - return object; - let message = new $root.ibc.core.channel.v1.MsgChannelCloseInit(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelCloseInit message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @static - * @param {ibc.core.channel.v1.MsgChannelCloseInit} message MsgChannelCloseInit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelCloseInit.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelCloseInit to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelCloseInit - * @instance - * @returns {Object.} JSON object - */ - MsgChannelCloseInit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelCloseInit; - })(); - - v1.MsgChannelCloseInitResponse = (function() { - - /** - * Properties of a MsgChannelCloseInitResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelCloseInitResponse - */ - - /** - * Constructs a new MsgChannelCloseInitResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelCloseInitResponse. - * @implements IMsgChannelCloseInitResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse=} [properties] Properties to set - */ - function MsgChannelCloseInitResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgChannelCloseInitResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInitResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse} message MsgChannelCloseInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseInitResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgChannelCloseInitResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseInitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseInitResponse} message MsgChannelCloseInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseInitResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelCloseInitResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseInitResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseInitResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelCloseInitResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseInitResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelCloseInitResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelCloseInitResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgChannelCloseInitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelCloseInitResponse} MsgChannelCloseInitResponse - */ - MsgChannelCloseInitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseInitResponse) - return object; - return new $root.ibc.core.channel.v1.MsgChannelCloseInitResponse(); - }; - - /** - * Creates a plain object from a MsgChannelCloseInitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelCloseInitResponse} message MsgChannelCloseInitResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelCloseInitResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgChannelCloseInitResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelCloseInitResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelCloseInitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelCloseInitResponse; - })(); - - v1.MsgChannelCloseConfirm = (function() { - - /** - * Properties of a MsgChannelCloseConfirm. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelCloseConfirm - * @property {string|null} [port_id] MsgChannelCloseConfirm port_id - * @property {string|null} [channel_id] MsgChannelCloseConfirm channel_id - * @property {Uint8Array|null} [proof_init] MsgChannelCloseConfirm proof_init - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgChannelCloseConfirm proof_height - * @property {string|null} [signer] MsgChannelCloseConfirm signer - */ - - /** - * Constructs a new MsgChannelCloseConfirm. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelCloseConfirm. - * @implements IMsgChannelCloseConfirm - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm=} [properties] Properties to set - */ - function MsgChannelCloseConfirm(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChannelCloseConfirm port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.port_id = ""; - - /** - * MsgChannelCloseConfirm channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.channel_id = ""; - - /** - * MsgChannelCloseConfirm proof_init. - * @member {Uint8Array} proof_init - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.proof_init = $util.newBuffer([]); - - /** - * MsgChannelCloseConfirm proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.proof_height = null; - - /** - * MsgChannelCloseConfirm signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - */ - MsgChannelCloseConfirm.prototype.signer = ""; - - /** - * Encodes the specified MsgChannelCloseConfirm message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirm.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} message MsgChannelCloseConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseConfirm.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.proof_init != null && Object.hasOwnProperty.call(message, "proof_init")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof_init); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgChannelCloseConfirm message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirm.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirm} message MsgChannelCloseConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseConfirm.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelCloseConfirm message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseConfirm.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseConfirm(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.proof_init = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelCloseConfirm message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseConfirm.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelCloseConfirm message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelCloseConfirm.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - if (!(message.proof_init && typeof message.proof_init.length === "number" || $util.isString(message.proof_init))) - return "proof_init: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgChannelCloseConfirm message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirm} MsgChannelCloseConfirm - */ - MsgChannelCloseConfirm.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseConfirm) - return object; - let message = new $root.ibc.core.channel.v1.MsgChannelCloseConfirm(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.proof_init != null) - if (typeof object.proof_init === "string") - $util.base64.decode(object.proof_init, message.proof_init = $util.newBuffer($util.base64.length(object.proof_init)), 0); - else if (object.proof_init.length) - message.proof_init = object.proof_init; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgChannelCloseConfirm.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgChannelCloseConfirm message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @static - * @param {ibc.core.channel.v1.MsgChannelCloseConfirm} message MsgChannelCloseConfirm - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelCloseConfirm.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if (options.bytes === String) - object.proof_init = ""; - else { - object.proof_init = []; - if (options.bytes !== Array) - object.proof_init = $util.newBuffer(object.proof_init); - } - object.proof_height = null; - object.signer = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - object.proof_init = options.bytes === String ? $util.base64.encode(message.proof_init, 0, message.proof_init.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_init) : message.proof_init; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgChannelCloseConfirm to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirm - * @instance - * @returns {Object.} JSON object - */ - MsgChannelCloseConfirm.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelCloseConfirm; - })(); - - v1.MsgChannelCloseConfirmResponse = (function() { - - /** - * Properties of a MsgChannelCloseConfirmResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgChannelCloseConfirmResponse - */ - - /** - * Constructs a new MsgChannelCloseConfirmResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgChannelCloseConfirmResponse. - * @implements IMsgChannelCloseConfirmResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse=} [properties] Properties to set - */ - function MsgChannelCloseConfirmResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgChannelCloseConfirmResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirmResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse} message MsgChannelCloseConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseConfirmResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgChannelCloseConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgChannelCloseConfirmResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {ibc.core.channel.v1.IMsgChannelCloseConfirmResponse} message MsgChannelCloseConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChannelCloseConfirmResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChannelCloseConfirmResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseConfirmResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChannelCloseConfirmResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChannelCloseConfirmResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChannelCloseConfirmResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChannelCloseConfirmResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgChannelCloseConfirmResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} MsgChannelCloseConfirmResponse - */ - MsgChannelCloseConfirmResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse) - return object; - return new $root.ibc.core.channel.v1.MsgChannelCloseConfirmResponse(); - }; - - /** - * Creates a plain object from a MsgChannelCloseConfirmResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @static - * @param {ibc.core.channel.v1.MsgChannelCloseConfirmResponse} message MsgChannelCloseConfirmResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChannelCloseConfirmResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgChannelCloseConfirmResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgChannelCloseConfirmResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChannelCloseConfirmResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChannelCloseConfirmResponse; - })(); - - v1.MsgRecvPacket = (function() { - - /** - * Properties of a MsgRecvPacket. - * @memberof ibc.core.channel.v1 - * @interface IMsgRecvPacket - * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgRecvPacket packet - * @property {Uint8Array|null} [proof_commitment] MsgRecvPacket proof_commitment - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgRecvPacket proof_height - * @property {string|null} [signer] MsgRecvPacket signer - */ - - /** - * Constructs a new MsgRecvPacket. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgRecvPacket. - * @implements IMsgRecvPacket - * @constructor - * @param {ibc.core.channel.v1.IMsgRecvPacket=} [properties] Properties to set - */ - function MsgRecvPacket(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRecvPacket packet. - * @member {ibc.core.channel.v1.IPacket|null|undefined} packet - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - */ - MsgRecvPacket.prototype.packet = null; - - /** - * MsgRecvPacket proof_commitment. - * @member {Uint8Array} proof_commitment - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - */ - MsgRecvPacket.prototype.proof_commitment = $util.newBuffer([]); - - /** - * MsgRecvPacket proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - */ - MsgRecvPacket.prototype.proof_height = null; - - /** - * MsgRecvPacket signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - */ - MsgRecvPacket.prototype.signer = ""; - - /** - * Encodes the specified MsgRecvPacket message. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacket.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {ibc.core.channel.v1.IMsgRecvPacket} message MsgRecvPacket message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRecvPacket.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) - $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof_commitment != null && Object.hasOwnProperty.call(message, "proof_commitment")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof_commitment); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgRecvPacket message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacket.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {ibc.core.channel.v1.IMsgRecvPacket} message MsgRecvPacket message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRecvPacket.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRecvPacket message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRecvPacket.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgRecvPacket(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); - break; - case 2: - message.proof_commitment = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 4: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRecvPacket message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRecvPacket.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRecvPacket message. - * @function verify - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRecvPacket.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet != null && message.hasOwnProperty("packet")) { - let error = $root.ibc.core.channel.v1.Packet.verify(message.packet); - if (error) - return "packet." + error; - } - if (message.proof_commitment != null && message.hasOwnProperty("proof_commitment")) - if (!(message.proof_commitment && typeof message.proof_commitment.length === "number" || $util.isString(message.proof_commitment))) - return "proof_commitment: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgRecvPacket message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgRecvPacket} MsgRecvPacket - */ - MsgRecvPacket.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgRecvPacket) - return object; - let message = new $root.ibc.core.channel.v1.MsgRecvPacket(); - if (object.packet != null) { - if (typeof object.packet !== "object") - throw TypeError(".ibc.core.channel.v1.MsgRecvPacket.packet: object expected"); - message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); - } - if (object.proof_commitment != null) - if (typeof object.proof_commitment === "string") - $util.base64.decode(object.proof_commitment, message.proof_commitment = $util.newBuffer($util.base64.length(object.proof_commitment)), 0); - else if (object.proof_commitment.length) - message.proof_commitment = object.proof_commitment; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgRecvPacket.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgRecvPacket message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @static - * @param {ibc.core.channel.v1.MsgRecvPacket} message MsgRecvPacket - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRecvPacket.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.packet = null; - if (options.bytes === String) - object.proof_commitment = ""; - else { - object.proof_commitment = []; - if (options.bytes !== Array) - object.proof_commitment = $util.newBuffer(object.proof_commitment); - } - object.proof_height = null; - object.signer = ""; - } - if (message.packet != null && message.hasOwnProperty("packet")) - object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); - if (message.proof_commitment != null && message.hasOwnProperty("proof_commitment")) - object.proof_commitment = options.bytes === String ? $util.base64.encode(message.proof_commitment, 0, message.proof_commitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_commitment) : message.proof_commitment; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgRecvPacket to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgRecvPacket - * @instance - * @returns {Object.} JSON object - */ - MsgRecvPacket.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRecvPacket; - })(); - - v1.MsgRecvPacketResponse = (function() { - - /** - * Properties of a MsgRecvPacketResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgRecvPacketResponse - * @property {ibc.core.channel.v1.ResponseResultType|null} [result] MsgRecvPacketResponse result - */ - - /** - * Constructs a new MsgRecvPacketResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgRecvPacketResponse. - * @implements IMsgRecvPacketResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgRecvPacketResponse=} [properties] Properties to set - */ - function MsgRecvPacketResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRecvPacketResponse result. - * @member {ibc.core.channel.v1.ResponseResultType} result - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @instance - */ - MsgRecvPacketResponse.prototype.result = 0; - - /** - * Encodes the specified MsgRecvPacketResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacketResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {ibc.core.channel.v1.IMsgRecvPacketResponse} message MsgRecvPacketResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRecvPacketResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - return writer; - }; - - /** - * Encodes the specified MsgRecvPacketResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgRecvPacketResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {ibc.core.channel.v1.IMsgRecvPacketResponse} message MsgRecvPacketResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRecvPacketResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRecvPacketResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRecvPacketResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgRecvPacketResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRecvPacketResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRecvPacketResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRecvPacketResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRecvPacketResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a MsgRecvPacketResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgRecvPacketResponse} MsgRecvPacketResponse - */ - MsgRecvPacketResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgRecvPacketResponse) - return object; - let message = new $root.ibc.core.channel.v1.MsgRecvPacketResponse(); - switch (object.result) { - case "RESPONSE_RESULT_TYPE_UNSPECIFIED": - case 0: - message.result = 0; - break; - case "RESPONSE_RESULT_TYPE_NOOP": - case 1: - message.result = 1; - break; - case "RESPONSE_RESULT_TYPE_SUCCESS": - case 2: - message.result = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a MsgRecvPacketResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @static - * @param {ibc.core.channel.v1.MsgRecvPacketResponse} message MsgRecvPacketResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRecvPacketResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.result = options.enums === String ? "RESPONSE_RESULT_TYPE_UNSPECIFIED" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.ibc.core.channel.v1.ResponseResultType[message.result] : message.result; - return object; - }; - - /** - * Converts this MsgRecvPacketResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgRecvPacketResponse - * @instance - * @returns {Object.} JSON object - */ - MsgRecvPacketResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRecvPacketResponse; - })(); - - v1.MsgTimeout = (function() { - - /** - * Properties of a MsgTimeout. - * @memberof ibc.core.channel.v1 - * @interface IMsgTimeout - * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgTimeout packet - * @property {Uint8Array|null} [proof_unreceived] MsgTimeout proof_unreceived - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgTimeout proof_height - * @property {Long|null} [next_sequence_recv] MsgTimeout next_sequence_recv - * @property {string|null} [signer] MsgTimeout signer - */ - - /** - * Constructs a new MsgTimeout. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgTimeout. - * @implements IMsgTimeout - * @constructor - * @param {ibc.core.channel.v1.IMsgTimeout=} [properties] Properties to set - */ - function MsgTimeout(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTimeout packet. - * @member {ibc.core.channel.v1.IPacket|null|undefined} packet - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.packet = null; - - /** - * MsgTimeout proof_unreceived. - * @member {Uint8Array} proof_unreceived - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.proof_unreceived = $util.newBuffer([]); - - /** - * MsgTimeout proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.proof_height = null; - - /** - * MsgTimeout next_sequence_recv. - * @member {Long} next_sequence_recv - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.next_sequence_recv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgTimeout signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - */ - MsgTimeout.prototype.signer = ""; - - /** - * Encodes the specified MsgTimeout message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeout.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {ibc.core.channel.v1.IMsgTimeout} message MsgTimeout message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeout.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) - $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof_unreceived != null && Object.hasOwnProperty.call(message, "proof_unreceived")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof_unreceived); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.next_sequence_recv != null && Object.hasOwnProperty.call(message, "next_sequence_recv")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.next_sequence_recv); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgTimeout message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeout.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {ibc.core.channel.v1.IMsgTimeout} message MsgTimeout message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeout.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTimeout message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeout.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeout(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); - break; - case 2: - message.proof_unreceived = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 4: - message.next_sequence_recv = reader.uint64(); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTimeout message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeout.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTimeout message. - * @function verify - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTimeout.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet != null && message.hasOwnProperty("packet")) { - let error = $root.ibc.core.channel.v1.Packet.verify(message.packet); - if (error) - return "packet." + error; - } - if (message.proof_unreceived != null && message.hasOwnProperty("proof_unreceived")) - if (!(message.proof_unreceived && typeof message.proof_unreceived.length === "number" || $util.isString(message.proof_unreceived))) - return "proof_unreceived: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.next_sequence_recv != null && message.hasOwnProperty("next_sequence_recv")) - if (!$util.isInteger(message.next_sequence_recv) && !(message.next_sequence_recv && $util.isInteger(message.next_sequence_recv.low) && $util.isInteger(message.next_sequence_recv.high))) - return "next_sequence_recv: integer|Long expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgTimeout message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgTimeout} MsgTimeout - */ - MsgTimeout.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgTimeout) - return object; - let message = new $root.ibc.core.channel.v1.MsgTimeout(); - if (object.packet != null) { - if (typeof object.packet !== "object") - throw TypeError(".ibc.core.channel.v1.MsgTimeout.packet: object expected"); - message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); - } - if (object.proof_unreceived != null) - if (typeof object.proof_unreceived === "string") - $util.base64.decode(object.proof_unreceived, message.proof_unreceived = $util.newBuffer($util.base64.length(object.proof_unreceived)), 0); - else if (object.proof_unreceived.length) - message.proof_unreceived = object.proof_unreceived; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgTimeout.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.next_sequence_recv != null) - if ($util.Long) - (message.next_sequence_recv = $util.Long.fromValue(object.next_sequence_recv)).unsigned = true; - else if (typeof object.next_sequence_recv === "string") - message.next_sequence_recv = parseInt(object.next_sequence_recv, 10); - else if (typeof object.next_sequence_recv === "number") - message.next_sequence_recv = object.next_sequence_recv; - else if (typeof object.next_sequence_recv === "object") - message.next_sequence_recv = new $util.LongBits(object.next_sequence_recv.low >>> 0, object.next_sequence_recv.high >>> 0).toNumber(true); - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgTimeout message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgTimeout - * @static - * @param {ibc.core.channel.v1.MsgTimeout} message MsgTimeout - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTimeout.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.packet = null; - if (options.bytes === String) - object.proof_unreceived = ""; - else { - object.proof_unreceived = []; - if (options.bytes !== Array) - object.proof_unreceived = $util.newBuffer(object.proof_unreceived); - } - object.proof_height = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.next_sequence_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_sequence_recv = options.longs === String ? "0" : 0; - object.signer = ""; - } - if (message.packet != null && message.hasOwnProperty("packet")) - object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); - if (message.proof_unreceived != null && message.hasOwnProperty("proof_unreceived")) - object.proof_unreceived = options.bytes === String ? $util.base64.encode(message.proof_unreceived, 0, message.proof_unreceived.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_unreceived) : message.proof_unreceived; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.next_sequence_recv != null && message.hasOwnProperty("next_sequence_recv")) - if (typeof message.next_sequence_recv === "number") - object.next_sequence_recv = options.longs === String ? String(message.next_sequence_recv) : message.next_sequence_recv; - else - object.next_sequence_recv = options.longs === String ? $util.Long.prototype.toString.call(message.next_sequence_recv) : options.longs === Number ? new $util.LongBits(message.next_sequence_recv.low >>> 0, message.next_sequence_recv.high >>> 0).toNumber(true) : message.next_sequence_recv; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgTimeout to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgTimeout - * @instance - * @returns {Object.} JSON object - */ - MsgTimeout.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTimeout; - })(); - - v1.MsgTimeoutResponse = (function() { - - /** - * Properties of a MsgTimeoutResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgTimeoutResponse - * @property {ibc.core.channel.v1.ResponseResultType|null} [result] MsgTimeoutResponse result - */ - - /** - * Constructs a new MsgTimeoutResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgTimeoutResponse. - * @implements IMsgTimeoutResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgTimeoutResponse=} [properties] Properties to set - */ - function MsgTimeoutResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTimeoutResponse result. - * @member {ibc.core.channel.v1.ResponseResultType} result - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @instance - */ - MsgTimeoutResponse.prototype.result = 0; - - /** - * Encodes the specified MsgTimeoutResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutResponse} message MsgTimeoutResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - return writer; - }; - - /** - * Encodes the specified MsgTimeoutResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutResponse} message MsgTimeoutResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTimeoutResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeoutResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTimeoutResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTimeoutResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTimeoutResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a MsgTimeoutResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgTimeoutResponse} MsgTimeoutResponse - */ - MsgTimeoutResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgTimeoutResponse) - return object; - let message = new $root.ibc.core.channel.v1.MsgTimeoutResponse(); - switch (object.result) { - case "RESPONSE_RESULT_TYPE_UNSPECIFIED": - case 0: - message.result = 0; - break; - case "RESPONSE_RESULT_TYPE_NOOP": - case 1: - message.result = 1; - break; - case "RESPONSE_RESULT_TYPE_SUCCESS": - case 2: - message.result = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a MsgTimeoutResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @static - * @param {ibc.core.channel.v1.MsgTimeoutResponse} message MsgTimeoutResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTimeoutResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.result = options.enums === String ? "RESPONSE_RESULT_TYPE_UNSPECIFIED" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.ibc.core.channel.v1.ResponseResultType[message.result] : message.result; - return object; - }; - - /** - * Converts this MsgTimeoutResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgTimeoutResponse - * @instance - * @returns {Object.} JSON object - */ - MsgTimeoutResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTimeoutResponse; - })(); - - v1.MsgTimeoutOnClose = (function() { - - /** - * Properties of a MsgTimeoutOnClose. - * @memberof ibc.core.channel.v1 - * @interface IMsgTimeoutOnClose - * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgTimeoutOnClose packet - * @property {Uint8Array|null} [proof_unreceived] MsgTimeoutOnClose proof_unreceived - * @property {Uint8Array|null} [proof_close] MsgTimeoutOnClose proof_close - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgTimeoutOnClose proof_height - * @property {Long|null} [next_sequence_recv] MsgTimeoutOnClose next_sequence_recv - * @property {string|null} [signer] MsgTimeoutOnClose signer - */ - - /** - * Constructs a new MsgTimeoutOnClose. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgTimeoutOnClose. - * @implements IMsgTimeoutOnClose - * @constructor - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose=} [properties] Properties to set - */ - function MsgTimeoutOnClose(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTimeoutOnClose packet. - * @member {ibc.core.channel.v1.IPacket|null|undefined} packet - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.packet = null; - - /** - * MsgTimeoutOnClose proof_unreceived. - * @member {Uint8Array} proof_unreceived - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.proof_unreceived = $util.newBuffer([]); - - /** - * MsgTimeoutOnClose proof_close. - * @member {Uint8Array} proof_close - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.proof_close = $util.newBuffer([]); - - /** - * MsgTimeoutOnClose proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.proof_height = null; - - /** - * MsgTimeoutOnClose next_sequence_recv. - * @member {Long} next_sequence_recv - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.next_sequence_recv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgTimeoutOnClose signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - */ - MsgTimeoutOnClose.prototype.signer = ""; - - /** - * Encodes the specified MsgTimeoutOnClose message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnClose.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} message MsgTimeoutOnClose message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutOnClose.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) - $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof_unreceived != null && Object.hasOwnProperty.call(message, "proof_unreceived")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof_unreceived); - if (message.proof_close != null && Object.hasOwnProperty.call(message, "proof_close")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof_close); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.next_sequence_recv != null && Object.hasOwnProperty.call(message, "next_sequence_recv")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.next_sequence_recv); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgTimeoutOnClose message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnClose.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutOnClose} message MsgTimeoutOnClose message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutOnClose.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTimeoutOnClose message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutOnClose.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeoutOnClose(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); - break; - case 2: - message.proof_unreceived = reader.bytes(); - break; - case 3: - message.proof_close = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 5: - message.next_sequence_recv = reader.uint64(); - break; - case 6: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTimeoutOnClose message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutOnClose.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTimeoutOnClose message. - * @function verify - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTimeoutOnClose.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet != null && message.hasOwnProperty("packet")) { - let error = $root.ibc.core.channel.v1.Packet.verify(message.packet); - if (error) - return "packet." + error; - } - if (message.proof_unreceived != null && message.hasOwnProperty("proof_unreceived")) - if (!(message.proof_unreceived && typeof message.proof_unreceived.length === "number" || $util.isString(message.proof_unreceived))) - return "proof_unreceived: buffer expected"; - if (message.proof_close != null && message.hasOwnProperty("proof_close")) - if (!(message.proof_close && typeof message.proof_close.length === "number" || $util.isString(message.proof_close))) - return "proof_close: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.next_sequence_recv != null && message.hasOwnProperty("next_sequence_recv")) - if (!$util.isInteger(message.next_sequence_recv) && !(message.next_sequence_recv && $util.isInteger(message.next_sequence_recv.low) && $util.isInteger(message.next_sequence_recv.high))) - return "next_sequence_recv: integer|Long expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgTimeoutOnClose message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgTimeoutOnClose} MsgTimeoutOnClose - */ - MsgTimeoutOnClose.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgTimeoutOnClose) - return object; - let message = new $root.ibc.core.channel.v1.MsgTimeoutOnClose(); - if (object.packet != null) { - if (typeof object.packet !== "object") - throw TypeError(".ibc.core.channel.v1.MsgTimeoutOnClose.packet: object expected"); - message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); - } - if (object.proof_unreceived != null) - if (typeof object.proof_unreceived === "string") - $util.base64.decode(object.proof_unreceived, message.proof_unreceived = $util.newBuffer($util.base64.length(object.proof_unreceived)), 0); - else if (object.proof_unreceived.length) - message.proof_unreceived = object.proof_unreceived; - if (object.proof_close != null) - if (typeof object.proof_close === "string") - $util.base64.decode(object.proof_close, message.proof_close = $util.newBuffer($util.base64.length(object.proof_close)), 0); - else if (object.proof_close.length) - message.proof_close = object.proof_close; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgTimeoutOnClose.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.next_sequence_recv != null) - if ($util.Long) - (message.next_sequence_recv = $util.Long.fromValue(object.next_sequence_recv)).unsigned = true; - else if (typeof object.next_sequence_recv === "string") - message.next_sequence_recv = parseInt(object.next_sequence_recv, 10); - else if (typeof object.next_sequence_recv === "number") - message.next_sequence_recv = object.next_sequence_recv; - else if (typeof object.next_sequence_recv === "object") - message.next_sequence_recv = new $util.LongBits(object.next_sequence_recv.low >>> 0, object.next_sequence_recv.high >>> 0).toNumber(true); - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgTimeoutOnClose message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @static - * @param {ibc.core.channel.v1.MsgTimeoutOnClose} message MsgTimeoutOnClose - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTimeoutOnClose.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.packet = null; - if (options.bytes === String) - object.proof_unreceived = ""; - else { - object.proof_unreceived = []; - if (options.bytes !== Array) - object.proof_unreceived = $util.newBuffer(object.proof_unreceived); - } - if (options.bytes === String) - object.proof_close = ""; - else { - object.proof_close = []; - if (options.bytes !== Array) - object.proof_close = $util.newBuffer(object.proof_close); - } - object.proof_height = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.next_sequence_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_sequence_recv = options.longs === String ? "0" : 0; - object.signer = ""; - } - if (message.packet != null && message.hasOwnProperty("packet")) - object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); - if (message.proof_unreceived != null && message.hasOwnProperty("proof_unreceived")) - object.proof_unreceived = options.bytes === String ? $util.base64.encode(message.proof_unreceived, 0, message.proof_unreceived.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_unreceived) : message.proof_unreceived; - if (message.proof_close != null && message.hasOwnProperty("proof_close")) - object.proof_close = options.bytes === String ? $util.base64.encode(message.proof_close, 0, message.proof_close.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_close) : message.proof_close; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.next_sequence_recv != null && message.hasOwnProperty("next_sequence_recv")) - if (typeof message.next_sequence_recv === "number") - object.next_sequence_recv = options.longs === String ? String(message.next_sequence_recv) : message.next_sequence_recv; - else - object.next_sequence_recv = options.longs === String ? $util.Long.prototype.toString.call(message.next_sequence_recv) : options.longs === Number ? new $util.LongBits(message.next_sequence_recv.low >>> 0, message.next_sequence_recv.high >>> 0).toNumber(true) : message.next_sequence_recv; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgTimeoutOnClose to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgTimeoutOnClose - * @instance - * @returns {Object.} JSON object - */ - MsgTimeoutOnClose.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTimeoutOnClose; - })(); - - v1.MsgTimeoutOnCloseResponse = (function() { - - /** - * Properties of a MsgTimeoutOnCloseResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgTimeoutOnCloseResponse - * @property {ibc.core.channel.v1.ResponseResultType|null} [result] MsgTimeoutOnCloseResponse result - */ - - /** - * Constructs a new MsgTimeoutOnCloseResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgTimeoutOnCloseResponse. - * @implements IMsgTimeoutOnCloseResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse=} [properties] Properties to set - */ - function MsgTimeoutOnCloseResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTimeoutOnCloseResponse result. - * @member {ibc.core.channel.v1.ResponseResultType} result - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @instance - */ - MsgTimeoutOnCloseResponse.prototype.result = 0; - - /** - * Encodes the specified MsgTimeoutOnCloseResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnCloseResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse} message MsgTimeoutOnCloseResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutOnCloseResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - return writer; - }; - - /** - * Encodes the specified MsgTimeoutOnCloseResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgTimeoutOnCloseResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {ibc.core.channel.v1.IMsgTimeoutOnCloseResponse} message MsgTimeoutOnCloseResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTimeoutOnCloseResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTimeoutOnCloseResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutOnCloseResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTimeoutOnCloseResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTimeoutOnCloseResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTimeoutOnCloseResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTimeoutOnCloseResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a MsgTimeoutOnCloseResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} MsgTimeoutOnCloseResponse - */ - MsgTimeoutOnCloseResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse) - return object; - let message = new $root.ibc.core.channel.v1.MsgTimeoutOnCloseResponse(); - switch (object.result) { - case "RESPONSE_RESULT_TYPE_UNSPECIFIED": - case 0: - message.result = 0; - break; - case "RESPONSE_RESULT_TYPE_NOOP": - case 1: - message.result = 1; - break; - case "RESPONSE_RESULT_TYPE_SUCCESS": - case 2: - message.result = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a MsgTimeoutOnCloseResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @static - * @param {ibc.core.channel.v1.MsgTimeoutOnCloseResponse} message MsgTimeoutOnCloseResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTimeoutOnCloseResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.result = options.enums === String ? "RESPONSE_RESULT_TYPE_UNSPECIFIED" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.ibc.core.channel.v1.ResponseResultType[message.result] : message.result; - return object; - }; - - /** - * Converts this MsgTimeoutOnCloseResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgTimeoutOnCloseResponse - * @instance - * @returns {Object.} JSON object - */ - MsgTimeoutOnCloseResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTimeoutOnCloseResponse; - })(); - - v1.MsgAcknowledgement = (function() { - - /** - * Properties of a MsgAcknowledgement. - * @memberof ibc.core.channel.v1 - * @interface IMsgAcknowledgement - * @property {ibc.core.channel.v1.IPacket|null} [packet] MsgAcknowledgement packet - * @property {Uint8Array|null} [acknowledgement] MsgAcknowledgement acknowledgement - * @property {Uint8Array|null} [proof_acked] MsgAcknowledgement proof_acked - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgAcknowledgement proof_height - * @property {string|null} [signer] MsgAcknowledgement signer - */ - - /** - * Constructs a new MsgAcknowledgement. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgAcknowledgement. - * @implements IMsgAcknowledgement - * @constructor - * @param {ibc.core.channel.v1.IMsgAcknowledgement=} [properties] Properties to set - */ - function MsgAcknowledgement(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgAcknowledgement packet. - * @member {ibc.core.channel.v1.IPacket|null|undefined} packet - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.packet = null; - - /** - * MsgAcknowledgement acknowledgement. - * @member {Uint8Array} acknowledgement - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.acknowledgement = $util.newBuffer([]); - - /** - * MsgAcknowledgement proof_acked. - * @member {Uint8Array} proof_acked - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.proof_acked = $util.newBuffer([]); - - /** - * MsgAcknowledgement proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.proof_height = null; - - /** - * MsgAcknowledgement signer. - * @member {string} signer - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - */ - MsgAcknowledgement.prototype.signer = ""; - - /** - * Encodes the specified MsgAcknowledgement message. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgement.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {ibc.core.channel.v1.IMsgAcknowledgement} message MsgAcknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAcknowledgement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.packet != null && Object.hasOwnProperty.call(message, "packet")) - $root.ibc.core.channel.v1.Packet.encode(message.packet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.acknowledgement); - if (message.proof_acked != null && Object.hasOwnProperty.call(message, "proof_acked")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof_acked); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgAcknowledgement message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgement.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {ibc.core.channel.v1.IMsgAcknowledgement} message MsgAcknowledgement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAcknowledgement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAcknowledgement message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAcknowledgement.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgAcknowledgement(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.packet = $root.ibc.core.channel.v1.Packet.decode(reader, reader.uint32()); - break; - case 2: - message.acknowledgement = reader.bytes(); - break; - case 3: - message.proof_acked = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAcknowledgement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAcknowledgement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAcknowledgement message. - * @function verify - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAcknowledgement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.packet != null && message.hasOwnProperty("packet")) { - let error = $root.ibc.core.channel.v1.Packet.verify(message.packet); - if (error) - return "packet." + error; - } - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) - return "acknowledgement: buffer expected"; - if (message.proof_acked != null && message.hasOwnProperty("proof_acked")) - if (!(message.proof_acked && typeof message.proof_acked.length === "number" || $util.isString(message.proof_acked))) - return "proof_acked: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgAcknowledgement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgAcknowledgement} MsgAcknowledgement - */ - MsgAcknowledgement.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgAcknowledgement) - return object; - let message = new $root.ibc.core.channel.v1.MsgAcknowledgement(); - if (object.packet != null) { - if (typeof object.packet !== "object") - throw TypeError(".ibc.core.channel.v1.MsgAcknowledgement.packet: object expected"); - message.packet = $root.ibc.core.channel.v1.Packet.fromObject(object.packet); - } - if (object.acknowledgement != null) - if (typeof object.acknowledgement === "string") - $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); - else if (object.acknowledgement.length) - message.acknowledgement = object.acknowledgement; - if (object.proof_acked != null) - if (typeof object.proof_acked === "string") - $util.base64.decode(object.proof_acked, message.proof_acked = $util.newBuffer($util.base64.length(object.proof_acked)), 0); - else if (object.proof_acked.length) - message.proof_acked = object.proof_acked; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.MsgAcknowledgement.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgAcknowledgement message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @static - * @param {ibc.core.channel.v1.MsgAcknowledgement} message MsgAcknowledgement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAcknowledgement.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.packet = null; - if (options.bytes === String) - object.acknowledgement = ""; - else { - object.acknowledgement = []; - if (options.bytes !== Array) - object.acknowledgement = $util.newBuffer(object.acknowledgement); - } - if (options.bytes === String) - object.proof_acked = ""; - else { - object.proof_acked = []; - if (options.bytes !== Array) - object.proof_acked = $util.newBuffer(object.proof_acked); - } - object.proof_height = null; - object.signer = ""; - } - if (message.packet != null && message.hasOwnProperty("packet")) - object.packet = $root.ibc.core.channel.v1.Packet.toObject(message.packet, options); - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; - if (message.proof_acked != null && message.hasOwnProperty("proof_acked")) - object.proof_acked = options.bytes === String ? $util.base64.encode(message.proof_acked, 0, message.proof_acked.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_acked) : message.proof_acked; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgAcknowledgement to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgAcknowledgement - * @instance - * @returns {Object.} JSON object - */ - MsgAcknowledgement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAcknowledgement; - })(); - - v1.MsgAcknowledgementResponse = (function() { - - /** - * Properties of a MsgAcknowledgementResponse. - * @memberof ibc.core.channel.v1 - * @interface IMsgAcknowledgementResponse - * @property {ibc.core.channel.v1.ResponseResultType|null} [result] MsgAcknowledgementResponse result - */ - - /** - * Constructs a new MsgAcknowledgementResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a MsgAcknowledgementResponse. - * @implements IMsgAcknowledgementResponse - * @constructor - * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse=} [properties] Properties to set - */ - function MsgAcknowledgementResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgAcknowledgementResponse result. - * @member {ibc.core.channel.v1.ResponseResultType} result - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @instance - */ - MsgAcknowledgementResponse.prototype.result = 0; - - /** - * Encodes the specified MsgAcknowledgementResponse message. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgementResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse} message MsgAcknowledgementResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAcknowledgementResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - return writer; - }; - - /** - * Encodes the specified MsgAcknowledgementResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.MsgAcknowledgementResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.IMsgAcknowledgementResponse} message MsgAcknowledgementResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgAcknowledgementResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgAcknowledgementResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAcknowledgementResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.MsgAcknowledgementResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgAcknowledgementResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgAcknowledgementResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgAcknowledgementResponse message. - * @function verify - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgAcknowledgementResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a MsgAcknowledgementResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.MsgAcknowledgementResponse} MsgAcknowledgementResponse - */ - MsgAcknowledgementResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.MsgAcknowledgementResponse) - return object; - let message = new $root.ibc.core.channel.v1.MsgAcknowledgementResponse(); - switch (object.result) { - case "RESPONSE_RESULT_TYPE_UNSPECIFIED": - case 0: - message.result = 0; - break; - case "RESPONSE_RESULT_TYPE_NOOP": - case 1: - message.result = 1; - break; - case "RESPONSE_RESULT_TYPE_SUCCESS": - case 2: - message.result = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a MsgAcknowledgementResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.MsgAcknowledgementResponse} message MsgAcknowledgementResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgAcknowledgementResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.result = options.enums === String ? "RESPONSE_RESULT_TYPE_UNSPECIFIED" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.ibc.core.channel.v1.ResponseResultType[message.result] : message.result; - return object; - }; - - /** - * Converts this MsgAcknowledgementResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.MsgAcknowledgementResponse - * @instance - * @returns {Object.} JSON object - */ - MsgAcknowledgementResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgAcknowledgementResponse; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channel}. - * @memberof ibc.core.channel.v1.Query - * @typedef ChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryChannelResponse} [response] QueryChannelResponse - */ - - /** - * Calls Channel. - * @function channel - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelRequest} request QueryChannelRequest message or plain object - * @param {ibc.core.channel.v1.Query.ChannelCallback} callback Node-style callback called with the error, if any, and QueryChannelResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.channel = function channel(request, callback) { - return this.rpcCall(channel, $root.ibc.core.channel.v1.QueryChannelRequest, $root.ibc.core.channel.v1.QueryChannelResponse, request, callback); - }, "name", { value: "Channel" }); - - /** - * Calls Channel. - * @function channel - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelRequest} request QueryChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channels}. - * @memberof ibc.core.channel.v1.Query - * @typedef ChannelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryChannelsResponse} [response] QueryChannelsResponse - */ - - /** - * Calls Channels. - * @function channels - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelsRequest} request QueryChannelsRequest message or plain object - * @param {ibc.core.channel.v1.Query.ChannelsCallback} callback Node-style callback called with the error, if any, and QueryChannelsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.channels = function channels(request, callback) { - return this.rpcCall(channels, $root.ibc.core.channel.v1.QueryChannelsRequest, $root.ibc.core.channel.v1.QueryChannelsResponse, request, callback); - }, "name", { value: "Channels" }); - - /** - * Calls Channels. - * @function channels - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelsRequest} request QueryChannelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#connectionChannels}. - * @memberof ibc.core.channel.v1.Query - * @typedef ConnectionChannelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryConnectionChannelsResponse} [response] QueryConnectionChannelsResponse - */ - - /** - * Calls ConnectionChannels. - * @function connectionChannels - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} request QueryConnectionChannelsRequest message or plain object - * @param {ibc.core.channel.v1.Query.ConnectionChannelsCallback} callback Node-style callback called with the error, if any, and QueryConnectionChannelsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connectionChannels = function connectionChannels(request, callback) { - return this.rpcCall(connectionChannels, $root.ibc.core.channel.v1.QueryConnectionChannelsRequest, $root.ibc.core.channel.v1.QueryConnectionChannelsResponse, request, callback); - }, "name", { value: "ConnectionChannels" }); - - /** - * Calls ConnectionChannels. - * @function connectionChannels - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} request QueryConnectionChannelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channelClientState}. - * @memberof ibc.core.channel.v1.Query - * @typedef ChannelClientStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryChannelClientStateResponse} [response] QueryChannelClientStateResponse - */ - - /** - * Calls ChannelClientState. - * @function channelClientState - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} request QueryChannelClientStateRequest message or plain object - * @param {ibc.core.channel.v1.Query.ChannelClientStateCallback} callback Node-style callback called with the error, if any, and QueryChannelClientStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.channelClientState = function channelClientState(request, callback) { - return this.rpcCall(channelClientState, $root.ibc.core.channel.v1.QueryChannelClientStateRequest, $root.ibc.core.channel.v1.QueryChannelClientStateResponse, request, callback); - }, "name", { value: "ChannelClientState" }); - - /** - * Calls ChannelClientState. - * @function channelClientState - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} request QueryChannelClientStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#channelConsensusState}. - * @memberof ibc.core.channel.v1.Query - * @typedef ChannelConsensusStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryChannelConsensusStateResponse} [response] QueryChannelConsensusStateResponse - */ - - /** - * Calls ChannelConsensusState. - * @function channelConsensusState - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} request QueryChannelConsensusStateRequest message or plain object - * @param {ibc.core.channel.v1.Query.ChannelConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryChannelConsensusStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.channelConsensusState = function channelConsensusState(request, callback) { - return this.rpcCall(channelConsensusState, $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest, $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse, request, callback); - }, "name", { value: "ChannelConsensusState" }); - - /** - * Calls ChannelConsensusState. - * @function channelConsensusState - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} request QueryChannelConsensusStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitment}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketCommitmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketCommitmentResponse} [response] QueryPacketCommitmentResponse - */ - - /** - * Calls PacketCommitment. - * @function packetCommitment - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} request QueryPacketCommitmentRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketCommitmentCallback} callback Node-style callback called with the error, if any, and QueryPacketCommitmentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetCommitment = function packetCommitment(request, callback) { - return this.rpcCall(packetCommitment, $root.ibc.core.channel.v1.QueryPacketCommitmentRequest, $root.ibc.core.channel.v1.QueryPacketCommitmentResponse, request, callback); - }, "name", { value: "PacketCommitment" }); - - /** - * Calls PacketCommitment. - * @function packetCommitment - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} request QueryPacketCommitmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetCommitments}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketCommitmentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketCommitmentsResponse} [response] QueryPacketCommitmentsResponse - */ - - /** - * Calls PacketCommitments. - * @function packetCommitments - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} request QueryPacketCommitmentsRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketCommitmentsCallback} callback Node-style callback called with the error, if any, and QueryPacketCommitmentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetCommitments = function packetCommitments(request, callback) { - return this.rpcCall(packetCommitments, $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest, $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse, request, callback); - }, "name", { value: "PacketCommitments" }); - - /** - * Calls PacketCommitments. - * @function packetCommitments - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} request QueryPacketCommitmentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetReceipt}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketReceiptCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketReceiptResponse} [response] QueryPacketReceiptResponse - */ - - /** - * Calls PacketReceipt. - * @function packetReceipt - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} request QueryPacketReceiptRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketReceiptCallback} callback Node-style callback called with the error, if any, and QueryPacketReceiptResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetReceipt = function packetReceipt(request, callback) { - return this.rpcCall(packetReceipt, $root.ibc.core.channel.v1.QueryPacketReceiptRequest, $root.ibc.core.channel.v1.QueryPacketReceiptResponse, request, callback); - }, "name", { value: "PacketReceipt" }); - - /** - * Calls PacketReceipt. - * @function packetReceipt - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} request QueryPacketReceiptRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgement}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketAcknowledgementCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} [response] QueryPacketAcknowledgementResponse - */ - - /** - * Calls PacketAcknowledgement. - * @function packetAcknowledgement - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} request QueryPacketAcknowledgementRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketAcknowledgementCallback} callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetAcknowledgement = function packetAcknowledgement(request, callback) { - return this.rpcCall(packetAcknowledgement, $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest, $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse, request, callback); - }, "name", { value: "PacketAcknowledgement" }); - - /** - * Calls PacketAcknowledgement. - * @function packetAcknowledgement - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} request QueryPacketAcknowledgementRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#packetAcknowledgements}. - * @memberof ibc.core.channel.v1.Query - * @typedef PacketAcknowledgementsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} [response] QueryPacketAcknowledgementsResponse - */ - - /** - * Calls PacketAcknowledgements. - * @function packetAcknowledgements - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} request QueryPacketAcknowledgementsRequest message or plain object - * @param {ibc.core.channel.v1.Query.PacketAcknowledgementsCallback} callback Node-style callback called with the error, if any, and QueryPacketAcknowledgementsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.packetAcknowledgements = function packetAcknowledgements(request, callback) { - return this.rpcCall(packetAcknowledgements, $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest, $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse, request, callback); - }, "name", { value: "PacketAcknowledgements" }); - - /** - * Calls PacketAcknowledgements. - * @function packetAcknowledgements - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} request QueryPacketAcknowledgementsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedPackets}. - * @memberof ibc.core.channel.v1.Query - * @typedef UnreceivedPacketsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} [response] QueryUnreceivedPacketsResponse - */ - - /** - * Calls UnreceivedPackets. - * @function unreceivedPackets - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} request QueryUnreceivedPacketsRequest message or plain object - * @param {ibc.core.channel.v1.Query.UnreceivedPacketsCallback} callback Node-style callback called with the error, if any, and QueryUnreceivedPacketsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.unreceivedPackets = function unreceivedPackets(request, callback) { - return this.rpcCall(unreceivedPackets, $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest, $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse, request, callback); - }, "name", { value: "UnreceivedPackets" }); - - /** - * Calls UnreceivedPackets. - * @function unreceivedPackets - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} request QueryUnreceivedPacketsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#unreceivedAcks}. - * @memberof ibc.core.channel.v1.Query - * @typedef UnreceivedAcksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryUnreceivedAcksResponse} [response] QueryUnreceivedAcksResponse - */ - - /** - * Calls UnreceivedAcks. - * @function unreceivedAcks - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} request QueryUnreceivedAcksRequest message or plain object - * @param {ibc.core.channel.v1.Query.UnreceivedAcksCallback} callback Node-style callback called with the error, if any, and QueryUnreceivedAcksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.unreceivedAcks = function unreceivedAcks(request, callback) { - return this.rpcCall(unreceivedAcks, $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest, $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse, request, callback); - }, "name", { value: "UnreceivedAcks" }); - - /** - * Calls UnreceivedAcks. - * @function unreceivedAcks - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} request QueryUnreceivedAcksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.channel.v1.Query#nextSequenceReceive}. - * @memberof ibc.core.channel.v1.Query - * @typedef NextSequenceReceiveCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} [response] QueryNextSequenceReceiveResponse - */ - - /** - * Calls NextSequenceReceive. - * @function nextSequenceReceive - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} request QueryNextSequenceReceiveRequest message or plain object - * @param {ibc.core.channel.v1.Query.NextSequenceReceiveCallback} callback Node-style callback called with the error, if any, and QueryNextSequenceReceiveResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.nextSequenceReceive = function nextSequenceReceive(request, callback) { - return this.rpcCall(nextSequenceReceive, $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest, $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse, request, callback); - }, "name", { value: "NextSequenceReceive" }); - - /** - * Calls NextSequenceReceive. - * @function nextSequenceReceive - * @memberof ibc.core.channel.v1.Query - * @instance - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} request QueryNextSequenceReceiveRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryChannelRequest = (function() { - - /** - * Properties of a QueryChannelRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelRequest - * @property {string|null} [port_id] QueryChannelRequest port_id - * @property {string|null} [channel_id] QueryChannelRequest channel_id - */ - - /** - * Constructs a new QueryChannelRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelRequest. - * @implements IQueryChannelRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelRequest=} [properties] Properties to set - */ - function QueryChannelRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @instance - */ - QueryChannelRequest.prototype.port_id = ""; - - /** - * QueryChannelRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @instance - */ - QueryChannelRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryChannelRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelRequest} message QueryChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryChannelRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelRequest} message QueryChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelRequest} QueryChannelRequest - */ - QueryChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryChannelRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @static - * @param {ibc.core.channel.v1.QueryChannelRequest} message QueryChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryChannelRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelRequest - * @instance - * @returns {Object.} JSON object - */ - QueryChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelRequest; - })(); - - v1.QueryChannelResponse = (function() { - - /** - * Properties of a QueryChannelResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelResponse - * @property {ibc.core.channel.v1.IChannel|null} [channel] QueryChannelResponse channel - * @property {Uint8Array|null} [proof] QueryChannelResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryChannelResponse proof_height - */ - - /** - * Constructs a new QueryChannelResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelResponse. - * @implements IQueryChannelResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelResponse=} [properties] Properties to set - */ - function QueryChannelResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelResponse channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @instance - */ - QueryChannelResponse.prototype.channel = null; - - /** - * QueryChannelResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @instance - */ - QueryChannelResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryChannelResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @instance - */ - QueryChannelResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryChannelResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelResponse} message QueryChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelResponse} message QueryChannelResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - let error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryChannelResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelResponse} QueryChannelResponse - */ - QueryChannelResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryChannelResponse(); - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelResponse.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @static - * @param {ibc.core.channel.v1.QueryChannelResponse} message QueryChannelResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.channel = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryChannelResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelResponse - * @instance - * @returns {Object.} JSON object - */ - QueryChannelResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelResponse; - })(); - - v1.QueryChannelsRequest = (function() { - - /** - * Properties of a QueryChannelsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelsRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryChannelsRequest pagination - */ - - /** - * Constructs a new QueryChannelsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelsRequest. - * @implements IQueryChannelsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelsRequest=} [properties] Properties to set - */ - function QueryChannelsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @instance - */ - QueryChannelsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelsRequest} message QueryChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelsRequest} message QueryChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelsRequest} QueryChannelsRequest - */ - QueryChannelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelsRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryChannelsRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @static - * @param {ibc.core.channel.v1.QueryChannelsRequest} message QueryChannelsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryChannelsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryChannelsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelsRequest; - })(); - - v1.QueryChannelsResponse = (function() { - - /** - * Properties of a QueryChannelsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelsResponse - * @property {Array.|null} [channels] QueryChannelsResponse channels - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryChannelsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryChannelsResponse height - */ - - /** - * Constructs a new QueryChannelsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelsResponse. - * @implements IQueryChannelsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelsResponse=} [properties] Properties to set - */ - function QueryChannelsResponse(properties) { - this.channels = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelsResponse channels. - * @member {Array.} channels - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @instance - */ - QueryChannelsResponse.prototype.channels = $util.emptyArray; - - /** - * QueryChannelsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @instance - */ - QueryChannelsResponse.prototype.pagination = null; - - /** - * QueryChannelsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @instance - */ - QueryChannelsResponse.prototype.height = null; - - /** - * Encodes the specified QueryChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelsResponse} message QueryChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channels != null && message.channels.length) - for (let i = 0; i < message.channels.length; ++i) - $root.ibc.core.channel.v1.IdentifiedChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelsResponse} message QueryChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.channels && message.channels.length)) - message.channels = []; - message.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channels != null && message.hasOwnProperty("channels")) { - if (!Array.isArray(message.channels)) - return "channels: array expected"; - for (let i = 0; i < message.channels.length; ++i) { - let error = $root.ibc.core.channel.v1.IdentifiedChannel.verify(message.channels[i]); - if (error) - return "channels." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelsResponse} QueryChannelsResponse - */ - QueryChannelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelsResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryChannelsResponse(); - if (object.channels) { - if (!Array.isArray(object.channels)) - throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.channels: array expected"); - message.channels = []; - for (let i = 0; i < object.channels.length; ++i) { - if (typeof object.channels[i] !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.channels: object expected"); - message.channels[i] = $root.ibc.core.channel.v1.IdentifiedChannel.fromObject(object.channels[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @static - * @param {ibc.core.channel.v1.QueryChannelsResponse} message QueryChannelsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.channels = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.channels && message.channels.length) { - object.channels = []; - for (let j = 0; j < message.channels.length; ++j) - object.channels[j] = $root.ibc.core.channel.v1.IdentifiedChannel.toObject(message.channels[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryChannelsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryChannelsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelsResponse; - })(); - - v1.QueryConnectionChannelsRequest = (function() { - - /** - * Properties of a QueryConnectionChannelsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryConnectionChannelsRequest - * @property {string|null} [connection] QueryConnectionChannelsRequest connection - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConnectionChannelsRequest pagination - */ - - /** - * Constructs a new QueryConnectionChannelsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryConnectionChannelsRequest. - * @implements IQueryConnectionChannelsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest=} [properties] Properties to set - */ - function QueryConnectionChannelsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionChannelsRequest connection. - * @member {string} connection - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @instance - */ - QueryConnectionChannelsRequest.prototype.connection = ""; - - /** - * QueryConnectionChannelsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @instance - */ - QueryConnectionChannelsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryConnectionChannelsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} message QueryConnectionChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionChannelsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionChannelsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {ibc.core.channel.v1.IQueryConnectionChannelsRequest} message QueryConnectionChannelsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionChannelsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionChannelsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryConnectionChannelsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection = reader.string(); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionChannelsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionChannelsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionChannelsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionChannelsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection != null && message.hasOwnProperty("connection")) - if (!$util.isString(message.connection)) - return "connection: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryConnectionChannelsRequest} QueryConnectionChannelsRequest - */ - QueryConnectionChannelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryConnectionChannelsRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryConnectionChannelsRequest(); - if (object.connection != null) - message.connection = String(object.connection); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionChannelsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @static - * @param {ibc.core.channel.v1.QueryConnectionChannelsRequest} message QueryConnectionChannelsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionChannelsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.connection = ""; - object.pagination = null; - } - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = message.connection; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConnectionChannelsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryConnectionChannelsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionChannelsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionChannelsRequest; - })(); - - v1.QueryConnectionChannelsResponse = (function() { - - /** - * Properties of a QueryConnectionChannelsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryConnectionChannelsResponse - * @property {Array.|null} [channels] QueryConnectionChannelsResponse channels - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConnectionChannelsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryConnectionChannelsResponse height - */ - - /** - * Constructs a new QueryConnectionChannelsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryConnectionChannelsResponse. - * @implements IQueryConnectionChannelsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse=} [properties] Properties to set - */ - function QueryConnectionChannelsResponse(properties) { - this.channels = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionChannelsResponse channels. - * @member {Array.} channels - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @instance - */ - QueryConnectionChannelsResponse.prototype.channels = $util.emptyArray; - - /** - * QueryConnectionChannelsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @instance - */ - QueryConnectionChannelsResponse.prototype.pagination = null; - - /** - * QueryConnectionChannelsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @instance - */ - QueryConnectionChannelsResponse.prototype.height = null; - - /** - * Encodes the specified QueryConnectionChannelsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse} message QueryConnectionChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionChannelsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channels != null && message.channels.length) - for (let i = 0; i < message.channels.length; ++i) - $root.ibc.core.channel.v1.IdentifiedChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionChannelsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryConnectionChannelsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {ibc.core.channel.v1.IQueryConnectionChannelsResponse} message QueryConnectionChannelsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionChannelsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionChannelsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryConnectionChannelsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.channels && message.channels.length)) - message.channels = []; - message.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionChannelsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionChannelsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionChannelsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionChannelsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channels != null && message.hasOwnProperty("channels")) { - if (!Array.isArray(message.channels)) - return "channels: array expected"; - for (let i = 0; i < message.channels.length; ++i) { - let error = $root.ibc.core.channel.v1.IdentifiedChannel.verify(message.channels[i]); - if (error) - return "channels." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionChannelsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryConnectionChannelsResponse} QueryConnectionChannelsResponse - */ - QueryConnectionChannelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryConnectionChannelsResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryConnectionChannelsResponse(); - if (object.channels) { - if (!Array.isArray(object.channels)) - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.channels: array expected"); - message.channels = []; - for (let i = 0; i < object.channels.length; ++i) { - if (typeof object.channels[i] !== "object") - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.channels: object expected"); - message.channels[i] = $root.ibc.core.channel.v1.IdentifiedChannel.fromObject(object.channels[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryConnectionChannelsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionChannelsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @static - * @param {ibc.core.channel.v1.QueryConnectionChannelsResponse} message QueryConnectionChannelsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionChannelsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.channels = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.channels && message.channels.length) { - object.channels = []; - for (let j = 0; j < message.channels.length; ++j) - object.channels[j] = $root.ibc.core.channel.v1.IdentifiedChannel.toObject(message.channels[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryConnectionChannelsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryConnectionChannelsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionChannelsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionChannelsResponse; - })(); - - v1.QueryChannelClientStateRequest = (function() { - - /** - * Properties of a QueryChannelClientStateRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelClientStateRequest - * @property {string|null} [port_id] QueryChannelClientStateRequest port_id - * @property {string|null} [channel_id] QueryChannelClientStateRequest channel_id - */ - - /** - * Constructs a new QueryChannelClientStateRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelClientStateRequest. - * @implements IQueryChannelClientStateRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest=} [properties] Properties to set - */ - function QueryChannelClientStateRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelClientStateRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @instance - */ - QueryChannelClientStateRequest.prototype.port_id = ""; - - /** - * QueryChannelClientStateRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @instance - */ - QueryChannelClientStateRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryChannelClientStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} message QueryChannelClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelClientStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryChannelClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelClientStateRequest} message QueryChannelClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelClientStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelClientStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelClientStateRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelClientStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelClientStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelClientStateRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelClientStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryChannelClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelClientStateRequest} QueryChannelClientStateRequest - */ - QueryChannelClientStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelClientStateRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryChannelClientStateRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryChannelClientStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @static - * @param {ibc.core.channel.v1.QueryChannelClientStateRequest} message QueryChannelClientStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelClientStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryChannelClientStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelClientStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryChannelClientStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelClientStateRequest; - })(); - - v1.QueryChannelClientStateResponse = (function() { - - /** - * Properties of a QueryChannelClientStateResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelClientStateResponse - * @property {ibc.core.client.v1.IIdentifiedClientState|null} [identified_client_state] QueryChannelClientStateResponse identified_client_state - * @property {Uint8Array|null} [proof] QueryChannelClientStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryChannelClientStateResponse proof_height - */ - - /** - * Constructs a new QueryChannelClientStateResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelClientStateResponse. - * @implements IQueryChannelClientStateResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse=} [properties] Properties to set - */ - function QueryChannelClientStateResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelClientStateResponse identified_client_state. - * @member {ibc.core.client.v1.IIdentifiedClientState|null|undefined} identified_client_state - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @instance - */ - QueryChannelClientStateResponse.prototype.identified_client_state = null; - - /** - * QueryChannelClientStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @instance - */ - QueryChannelClientStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryChannelClientStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @instance - */ - QueryChannelClientStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryChannelClientStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse} message QueryChannelClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelClientStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identified_client_state != null && Object.hasOwnProperty.call(message, "identified_client_state")) - $root.ibc.core.client.v1.IdentifiedClientState.encode(message.identified_client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelClientStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelClientStateResponse} message QueryChannelClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelClientStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelClientStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelClientStateResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelClientStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelClientStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelClientStateResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelClientStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identified_client_state != null && message.hasOwnProperty("identified_client_state")) { - let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.identified_client_state); - if (error) - return "identified_client_state." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryChannelClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelClientStateResponse} QueryChannelClientStateResponse - */ - QueryChannelClientStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelClientStateResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryChannelClientStateResponse(); - if (object.identified_client_state != null) { - if (typeof object.identified_client_state !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelClientStateResponse.identified_client_state: object expected"); - message.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.identified_client_state); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelClientStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelClientStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @static - * @param {ibc.core.channel.v1.QueryChannelClientStateResponse} message QueryChannelClientStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelClientStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.identified_client_state = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.identified_client_state != null && message.hasOwnProperty("identified_client_state")) - object.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.identified_client_state, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryChannelClientStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelClientStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryChannelClientStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelClientStateResponse; - })(); - - v1.QueryChannelConsensusStateRequest = (function() { - - /** - * Properties of a QueryChannelConsensusStateRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelConsensusStateRequest - * @property {string|null} [port_id] QueryChannelConsensusStateRequest port_id - * @property {string|null} [channel_id] QueryChannelConsensusStateRequest channel_id - * @property {Long|null} [revision_number] QueryChannelConsensusStateRequest revision_number - * @property {Long|null} [revision_height] QueryChannelConsensusStateRequest revision_height - */ - - /** - * Constructs a new QueryChannelConsensusStateRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelConsensusStateRequest. - * @implements IQueryChannelConsensusStateRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest=} [properties] Properties to set - */ - function QueryChannelConsensusStateRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelConsensusStateRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - */ - QueryChannelConsensusStateRequest.prototype.port_id = ""; - - /** - * QueryChannelConsensusStateRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - */ - QueryChannelConsensusStateRequest.prototype.channel_id = ""; - - /** - * QueryChannelConsensusStateRequest revision_number. - * @member {Long} revision_number - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - */ - QueryChannelConsensusStateRequest.prototype.revision_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryChannelConsensusStateRequest revision_height. - * @member {Long} revision_height - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - */ - QueryChannelConsensusStateRequest.prototype.revision_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryChannelConsensusStateRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} message QueryChannelConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelConsensusStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.revision_number != null && Object.hasOwnProperty.call(message, "revision_number")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revision_number); - if (message.revision_height != null && Object.hasOwnProperty.call(message, "revision_height")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.revision_height); - return writer; - }; - - /** - * Encodes the specified QueryChannelConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateRequest} message QueryChannelConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelConsensusStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelConsensusStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.revision_number = reader.uint64(); - break; - case 4: - message.revision_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelConsensusStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelConsensusStateRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelConsensusStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (!$util.isInteger(message.revision_number) && !(message.revision_number && $util.isInteger(message.revision_number.low) && $util.isInteger(message.revision_number.high))) - return "revision_number: integer|Long expected"; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (!$util.isInteger(message.revision_height) && !(message.revision_height && $util.isInteger(message.revision_height.low) && $util.isInteger(message.revision_height.high))) - return "revision_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryChannelConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateRequest} QueryChannelConsensusStateRequest - */ - QueryChannelConsensusStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.revision_number != null) - if ($util.Long) - (message.revision_number = $util.Long.fromValue(object.revision_number)).unsigned = true; - else if (typeof object.revision_number === "string") - message.revision_number = parseInt(object.revision_number, 10); - else if (typeof object.revision_number === "number") - message.revision_number = object.revision_number; - else if (typeof object.revision_number === "object") - message.revision_number = new $util.LongBits(object.revision_number.low >>> 0, object.revision_number.high >>> 0).toNumber(true); - if (object.revision_height != null) - if ($util.Long) - (message.revision_height = $util.Long.fromValue(object.revision_height)).unsigned = true; - else if (typeof object.revision_height === "string") - message.revision_height = parseInt(object.revision_height, 10); - else if (typeof object.revision_height === "number") - message.revision_height = object.revision_height; - else if (typeof object.revision_height === "object") - message.revision_height = new $util.LongBits(object.revision_height.low >>> 0, object.revision_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryChannelConsensusStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @static - * @param {ibc.core.channel.v1.QueryChannelConsensusStateRequest} message QueryChannelConsensusStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelConsensusStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.revision_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_number = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.revision_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_height = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (typeof message.revision_number === "number") - object.revision_number = options.longs === String ? String(message.revision_number) : message.revision_number; - else - object.revision_number = options.longs === String ? $util.Long.prototype.toString.call(message.revision_number) : options.longs === Number ? new $util.LongBits(message.revision_number.low >>> 0, message.revision_number.high >>> 0).toNumber(true) : message.revision_number; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (typeof message.revision_height === "number") - object.revision_height = options.longs === String ? String(message.revision_height) : message.revision_height; - else - object.revision_height = options.longs === String ? $util.Long.prototype.toString.call(message.revision_height) : options.longs === Number ? new $util.LongBits(message.revision_height.low >>> 0, message.revision_height.high >>> 0).toNumber(true) : message.revision_height; - return object; - }; - - /** - * Converts this QueryChannelConsensusStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryChannelConsensusStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelConsensusStateRequest; - })(); - - v1.QueryChannelConsensusStateResponse = (function() { - - /** - * Properties of a QueryChannelConsensusStateResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryChannelConsensusStateResponse - * @property {google.protobuf.IAny|null} [consensus_state] QueryChannelConsensusStateResponse consensus_state - * @property {string|null} [client_id] QueryChannelConsensusStateResponse client_id - * @property {Uint8Array|null} [proof] QueryChannelConsensusStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryChannelConsensusStateResponse proof_height - */ - - /** - * Constructs a new QueryChannelConsensusStateResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryChannelConsensusStateResponse. - * @implements IQueryChannelConsensusStateResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse=} [properties] Properties to set - */ - function QueryChannelConsensusStateResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryChannelConsensusStateResponse consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - */ - QueryChannelConsensusStateResponse.prototype.consensus_state = null; - - /** - * QueryChannelConsensusStateResponse client_id. - * @member {string} client_id - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - */ - QueryChannelConsensusStateResponse.prototype.client_id = ""; - - /** - * QueryChannelConsensusStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - */ - QueryChannelConsensusStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryChannelConsensusStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - */ - QueryChannelConsensusStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryChannelConsensusStateResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse} message QueryChannelConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelConsensusStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.client_id); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryChannelConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryChannelConsensusStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {ibc.core.channel.v1.IQueryChannelConsensusStateResponse} message QueryChannelConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryChannelConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryChannelConsensusStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelConsensusStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.client_id = reader.string(); - break; - case 3: - message.proof = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryChannelConsensusStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryChannelConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryChannelConsensusStateResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryChannelConsensusStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryChannelConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryChannelConsensusStateResponse} QueryChannelConsensusStateResponse - */ - QueryChannelConsensusStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryChannelConsensusStateResponse(); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelConsensusStateResponse.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryChannelConsensusStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryChannelConsensusStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @static - * @param {ibc.core.channel.v1.QueryChannelConsensusStateResponse} message QueryChannelConsensusStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryChannelConsensusStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.consensus_state = null; - object.client_id = ""; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryChannelConsensusStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryChannelConsensusStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryChannelConsensusStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryChannelConsensusStateResponse; - })(); - - v1.QueryPacketCommitmentRequest = (function() { - - /** - * Properties of a QueryPacketCommitmentRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketCommitmentRequest - * @property {string|null} [port_id] QueryPacketCommitmentRequest port_id - * @property {string|null} [channel_id] QueryPacketCommitmentRequest channel_id - * @property {Long|null} [sequence] QueryPacketCommitmentRequest sequence - */ - - /** - * Constructs a new QueryPacketCommitmentRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketCommitmentRequest. - * @implements IQueryPacketCommitmentRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest=} [properties] Properties to set - */ - function QueryPacketCommitmentRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketCommitmentRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @instance - */ - QueryPacketCommitmentRequest.prototype.port_id = ""; - - /** - * QueryPacketCommitmentRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @instance - */ - QueryPacketCommitmentRequest.prototype.channel_id = ""; - - /** - * QueryPacketCommitmentRequest sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @instance - */ - QueryPacketCommitmentRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryPacketCommitmentRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} message QueryPacketCommitmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified QueryPacketCommitmentRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentRequest} message QueryPacketCommitmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketCommitmentRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketCommitmentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketCommitmentRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketCommitmentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryPacketCommitmentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketCommitmentRequest} QueryPacketCommitmentRequest - */ - QueryPacketCommitmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketCommitmentRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryPacketCommitmentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketCommitmentRequest} message QueryPacketCommitmentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketCommitmentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this QueryPacketCommitmentRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketCommitmentRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketCommitmentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketCommitmentRequest; - })(); - - v1.QueryPacketCommitmentResponse = (function() { - - /** - * Properties of a QueryPacketCommitmentResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketCommitmentResponse - * @property {Uint8Array|null} [commitment] QueryPacketCommitmentResponse commitment - * @property {Uint8Array|null} [proof] QueryPacketCommitmentResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryPacketCommitmentResponse proof_height - */ - - /** - * Constructs a new QueryPacketCommitmentResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketCommitmentResponse. - * @implements IQueryPacketCommitmentResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse=} [properties] Properties to set - */ - function QueryPacketCommitmentResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketCommitmentResponse commitment. - * @member {Uint8Array} commitment - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @instance - */ - QueryPacketCommitmentResponse.prototype.commitment = $util.newBuffer([]); - - /** - * QueryPacketCommitmentResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @instance - */ - QueryPacketCommitmentResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryPacketCommitmentResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @instance - */ - QueryPacketCommitmentResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryPacketCommitmentResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse} message QueryPacketCommitmentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.commitment); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketCommitmentResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentResponse} message QueryPacketCommitmentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketCommitmentResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.commitment = reader.bytes(); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketCommitmentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketCommitmentResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketCommitmentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commitment != null && message.hasOwnProperty("commitment")) - if (!(message.commitment && typeof message.commitment.length === "number" || $util.isString(message.commitment))) - return "commitment: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketCommitmentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketCommitmentResponse} QueryPacketCommitmentResponse - */ - QueryPacketCommitmentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketCommitmentResponse(); - if (object.commitment != null) - if (typeof object.commitment === "string") - $util.base64.decode(object.commitment, message.commitment = $util.newBuffer($util.base64.length(object.commitment)), 0); - else if (object.commitment.length) - message.commitment = object.commitment; - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketCommitmentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketCommitmentResponse} message QueryPacketCommitmentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketCommitmentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.commitment = ""; - else { - object.commitment = []; - if (options.bytes !== Array) - object.commitment = $util.newBuffer(object.commitment); - } - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.commitment != null && message.hasOwnProperty("commitment")) - object.commitment = options.bytes === String ? $util.base64.encode(message.commitment, 0, message.commitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.commitment) : message.commitment; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryPacketCommitmentResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketCommitmentResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketCommitmentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketCommitmentResponse; - })(); - - v1.QueryPacketCommitmentsRequest = (function() { - - /** - * Properties of a QueryPacketCommitmentsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketCommitmentsRequest - * @property {string|null} [port_id] QueryPacketCommitmentsRequest port_id - * @property {string|null} [channel_id] QueryPacketCommitmentsRequest channel_id - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryPacketCommitmentsRequest pagination - */ - - /** - * Constructs a new QueryPacketCommitmentsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketCommitmentsRequest. - * @implements IQueryPacketCommitmentsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest=} [properties] Properties to set - */ - function QueryPacketCommitmentsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketCommitmentsRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @instance - */ - QueryPacketCommitmentsRequest.prototype.port_id = ""; - - /** - * QueryPacketCommitmentsRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @instance - */ - QueryPacketCommitmentsRequest.prototype.channel_id = ""; - - /** - * QueryPacketCommitmentsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @instance - */ - QueryPacketCommitmentsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryPacketCommitmentsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} message QueryPacketCommitmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketCommitmentsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsRequest} message QueryPacketCommitmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketCommitmentsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketCommitmentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketCommitmentsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketCommitmentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryPacketCommitmentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsRequest} QueryPacketCommitmentsRequest - */ - QueryPacketCommitmentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketCommitmentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketCommitmentsRequest} message QueryPacketCommitmentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketCommitmentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.pagination = null; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryPacketCommitmentsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketCommitmentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketCommitmentsRequest; - })(); - - v1.QueryPacketCommitmentsResponse = (function() { - - /** - * Properties of a QueryPacketCommitmentsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketCommitmentsResponse - * @property {Array.|null} [commitments] QueryPacketCommitmentsResponse commitments - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryPacketCommitmentsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryPacketCommitmentsResponse height - */ - - /** - * Constructs a new QueryPacketCommitmentsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketCommitmentsResponse. - * @implements IQueryPacketCommitmentsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse=} [properties] Properties to set - */ - function QueryPacketCommitmentsResponse(properties) { - this.commitments = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketCommitmentsResponse commitments. - * @member {Array.} commitments - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @instance - */ - QueryPacketCommitmentsResponse.prototype.commitments = $util.emptyArray; - - /** - * QueryPacketCommitmentsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @instance - */ - QueryPacketCommitmentsResponse.prototype.pagination = null; - - /** - * QueryPacketCommitmentsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @instance - */ - QueryPacketCommitmentsResponse.prototype.height = null; - - /** - * Encodes the specified QueryPacketCommitmentsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse} message QueryPacketCommitmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commitments != null && message.commitments.length) - for (let i = 0; i < message.commitments.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.commitments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketCommitmentsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketCommitmentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketCommitmentsResponse} message QueryPacketCommitmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketCommitmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketCommitmentsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.commitments && message.commitments.length)) - message.commitments = []; - message.commitments.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketCommitmentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketCommitmentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketCommitmentsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketCommitmentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commitments != null && message.hasOwnProperty("commitments")) { - if (!Array.isArray(message.commitments)) - return "commitments: array expected"; - for (let i = 0; i < message.commitments.length; ++i) { - let error = $root.ibc.core.channel.v1.PacketState.verify(message.commitments[i]); - if (error) - return "commitments." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketCommitmentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketCommitmentsResponse} QueryPacketCommitmentsResponse - */ - QueryPacketCommitmentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketCommitmentsResponse(); - if (object.commitments) { - if (!Array.isArray(object.commitments)) - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.commitments: array expected"); - message.commitments = []; - for (let i = 0; i < object.commitments.length; ++i) { - if (typeof object.commitments[i] !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.commitments: object expected"); - message.commitments[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.commitments[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketCommitmentsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketCommitmentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketCommitmentsResponse} message QueryPacketCommitmentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketCommitmentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.commitments = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.commitments && message.commitments.length) { - object.commitments = []; - for (let j = 0; j < message.commitments.length; ++j) - object.commitments[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.commitments[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryPacketCommitmentsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketCommitmentsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketCommitmentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketCommitmentsResponse; - })(); - - v1.QueryPacketReceiptRequest = (function() { - - /** - * Properties of a QueryPacketReceiptRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketReceiptRequest - * @property {string|null} [port_id] QueryPacketReceiptRequest port_id - * @property {string|null} [channel_id] QueryPacketReceiptRequest channel_id - * @property {Long|null} [sequence] QueryPacketReceiptRequest sequence - */ - - /** - * Constructs a new QueryPacketReceiptRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketReceiptRequest. - * @implements IQueryPacketReceiptRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest=} [properties] Properties to set - */ - function QueryPacketReceiptRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketReceiptRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @instance - */ - QueryPacketReceiptRequest.prototype.port_id = ""; - - /** - * QueryPacketReceiptRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @instance - */ - QueryPacketReceiptRequest.prototype.channel_id = ""; - - /** - * QueryPacketReceiptRequest sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @instance - */ - QueryPacketReceiptRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryPacketReceiptRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} message QueryPacketReceiptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketReceiptRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified QueryPacketReceiptRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketReceiptRequest} message QueryPacketReceiptRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketReceiptRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketReceiptRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketReceiptRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketReceiptRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketReceiptRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketReceiptRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketReceiptRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketReceiptRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryPacketReceiptRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketReceiptRequest} QueryPacketReceiptRequest - */ - QueryPacketReceiptRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketReceiptRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketReceiptRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryPacketReceiptRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketReceiptRequest} message QueryPacketReceiptRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketReceiptRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this QueryPacketReceiptRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketReceiptRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketReceiptRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketReceiptRequest; - })(); - - v1.QueryPacketReceiptResponse = (function() { - - /** - * Properties of a QueryPacketReceiptResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketReceiptResponse - * @property {boolean|null} [received] QueryPacketReceiptResponse received - * @property {Uint8Array|null} [proof] QueryPacketReceiptResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryPacketReceiptResponse proof_height - */ - - /** - * Constructs a new QueryPacketReceiptResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketReceiptResponse. - * @implements IQueryPacketReceiptResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse=} [properties] Properties to set - */ - function QueryPacketReceiptResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketReceiptResponse received. - * @member {boolean} received - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @instance - */ - QueryPacketReceiptResponse.prototype.received = false; - - /** - * QueryPacketReceiptResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @instance - */ - QueryPacketReceiptResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryPacketReceiptResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @instance - */ - QueryPacketReceiptResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryPacketReceiptResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse} message QueryPacketReceiptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketReceiptResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.received != null && Object.hasOwnProperty.call(message, "received")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.received); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketReceiptResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketReceiptResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketReceiptResponse} message QueryPacketReceiptResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketReceiptResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketReceiptResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketReceiptResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketReceiptResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.received = reader.bool(); - break; - case 3: - message.proof = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketReceiptResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketReceiptResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketReceiptResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketReceiptResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.received != null && message.hasOwnProperty("received")) - if (typeof message.received !== "boolean") - return "received: boolean expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketReceiptResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketReceiptResponse} QueryPacketReceiptResponse - */ - QueryPacketReceiptResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketReceiptResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketReceiptResponse(); - if (object.received != null) - message.received = Boolean(object.received); - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketReceiptResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketReceiptResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketReceiptResponse} message QueryPacketReceiptResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketReceiptResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.received = false; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.received != null && message.hasOwnProperty("received")) - object.received = message.received; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryPacketReceiptResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketReceiptResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketReceiptResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketReceiptResponse; - })(); - - v1.QueryPacketAcknowledgementRequest = (function() { - - /** - * Properties of a QueryPacketAcknowledgementRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketAcknowledgementRequest - * @property {string|null} [port_id] QueryPacketAcknowledgementRequest port_id - * @property {string|null} [channel_id] QueryPacketAcknowledgementRequest channel_id - * @property {Long|null} [sequence] QueryPacketAcknowledgementRequest sequence - */ - - /** - * Constructs a new QueryPacketAcknowledgementRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketAcknowledgementRequest. - * @implements IQueryPacketAcknowledgementRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest=} [properties] Properties to set - */ - function QueryPacketAcknowledgementRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketAcknowledgementRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @instance - */ - QueryPacketAcknowledgementRequest.prototype.port_id = ""; - - /** - * QueryPacketAcknowledgementRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @instance - */ - QueryPacketAcknowledgementRequest.prototype.channel_id = ""; - - /** - * QueryPacketAcknowledgementRequest sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @instance - */ - QueryPacketAcknowledgementRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryPacketAcknowledgementRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} message QueryPacketAcknowledgementRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified QueryPacketAcknowledgementRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementRequest} message QueryPacketAcknowledgementRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketAcknowledgementRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketAcknowledgementRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketAcknowledgementRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketAcknowledgementRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryPacketAcknowledgementRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} QueryPacketAcknowledgementRequest - */ - QueryPacketAcknowledgementRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryPacketAcknowledgementRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementRequest} message QueryPacketAcknowledgementRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketAcknowledgementRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this QueryPacketAcknowledgementRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketAcknowledgementRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketAcknowledgementRequest; - })(); - - v1.QueryPacketAcknowledgementResponse = (function() { - - /** - * Properties of a QueryPacketAcknowledgementResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketAcknowledgementResponse - * @property {Uint8Array|null} [acknowledgement] QueryPacketAcknowledgementResponse acknowledgement - * @property {Uint8Array|null} [proof] QueryPacketAcknowledgementResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryPacketAcknowledgementResponse proof_height - */ - - /** - * Constructs a new QueryPacketAcknowledgementResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketAcknowledgementResponse. - * @implements IQueryPacketAcknowledgementResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse=} [properties] Properties to set - */ - function QueryPacketAcknowledgementResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketAcknowledgementResponse acknowledgement. - * @member {Uint8Array} acknowledgement - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @instance - */ - QueryPacketAcknowledgementResponse.prototype.acknowledgement = $util.newBuffer([]); - - /** - * QueryPacketAcknowledgementResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @instance - */ - QueryPacketAcknowledgementResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryPacketAcknowledgementResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @instance - */ - QueryPacketAcknowledgementResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryPacketAcknowledgementResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse} message QueryPacketAcknowledgementResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.acknowledgement); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketAcknowledgementResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementResponse} message QueryPacketAcknowledgementResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketAcknowledgementResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.acknowledgement = reader.bytes(); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketAcknowledgementResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketAcknowledgementResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketAcknowledgementResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) - return "acknowledgement: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketAcknowledgementResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} QueryPacketAcknowledgementResponse - */ - QueryPacketAcknowledgementResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementResponse(); - if (object.acknowledgement != null) - if (typeof object.acknowledgement === "string") - $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); - else if (object.acknowledgement.length) - message.acknowledgement = object.acknowledgement; - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketAcknowledgementResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementResponse} message QueryPacketAcknowledgementResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketAcknowledgementResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.acknowledgement = ""; - else { - object.acknowledgement = []; - if (options.bytes !== Array) - object.acknowledgement = $util.newBuffer(object.acknowledgement); - } - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryPacketAcknowledgementResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketAcknowledgementResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketAcknowledgementResponse; - })(); - - v1.QueryPacketAcknowledgementsRequest = (function() { - - /** - * Properties of a QueryPacketAcknowledgementsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketAcknowledgementsRequest - * @property {string|null} [port_id] QueryPacketAcknowledgementsRequest port_id - * @property {string|null} [channel_id] QueryPacketAcknowledgementsRequest channel_id - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryPacketAcknowledgementsRequest pagination - * @property {Array.|null} [packet_commitment_sequences] QueryPacketAcknowledgementsRequest packet_commitment_sequences - */ - - /** - * Constructs a new QueryPacketAcknowledgementsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketAcknowledgementsRequest. - * @implements IQueryPacketAcknowledgementsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest=} [properties] Properties to set - */ - function QueryPacketAcknowledgementsRequest(properties) { - this.packet_commitment_sequences = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketAcknowledgementsRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - */ - QueryPacketAcknowledgementsRequest.prototype.port_id = ""; - - /** - * QueryPacketAcknowledgementsRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - */ - QueryPacketAcknowledgementsRequest.prototype.channel_id = ""; - - /** - * QueryPacketAcknowledgementsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - */ - QueryPacketAcknowledgementsRequest.prototype.pagination = null; - - /** - * QueryPacketAcknowledgementsRequest packet_commitment_sequences. - * @member {Array.} packet_commitment_sequences - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - */ - QueryPacketAcknowledgementsRequest.prototype.packet_commitment_sequences = $util.emptyArray; - - /** - * Encodes the specified QueryPacketAcknowledgementsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} message QueryPacketAcknowledgementsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.packet_commitment_sequences != null && message.packet_commitment_sequences.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (let i = 0; i < message.packet_commitment_sequences.length; ++i) - writer.uint64(message.packet_commitment_sequences[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified QueryPacketAcknowledgementsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsRequest} message QueryPacketAcknowledgementsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketAcknowledgementsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.packet_commitment_sequences && message.packet_commitment_sequences.length)) - message.packet_commitment_sequences = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.packet_commitment_sequences.push(reader.uint64()); - } else - message.packet_commitment_sequences.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketAcknowledgementsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketAcknowledgementsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketAcknowledgementsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.packet_commitment_sequences != null && message.hasOwnProperty("packet_commitment_sequences")) { - if (!Array.isArray(message.packet_commitment_sequences)) - return "packet_commitment_sequences: array expected"; - for (let i = 0; i < message.packet_commitment_sequences.length; ++i) - if (!$util.isInteger(message.packet_commitment_sequences[i]) && !(message.packet_commitment_sequences[i] && $util.isInteger(message.packet_commitment_sequences[i].low) && $util.isInteger(message.packet_commitment_sequences[i].high))) - return "packet_commitment_sequences: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a QueryPacketAcknowledgementsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} QueryPacketAcknowledgementsRequest - */ - QueryPacketAcknowledgementsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - if (object.packet_commitment_sequences) { - if (!Array.isArray(object.packet_commitment_sequences)) - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsRequest.packet_commitment_sequences: array expected"); - message.packet_commitment_sequences = []; - for (let i = 0; i < object.packet_commitment_sequences.length; ++i) - if ($util.Long) - (message.packet_commitment_sequences[i] = $util.Long.fromValue(object.packet_commitment_sequences[i])).unsigned = true; - else if (typeof object.packet_commitment_sequences[i] === "string") - message.packet_commitment_sequences[i] = parseInt(object.packet_commitment_sequences[i], 10); - else if (typeof object.packet_commitment_sequences[i] === "number") - message.packet_commitment_sequences[i] = object.packet_commitment_sequences[i]; - else if (typeof object.packet_commitment_sequences[i] === "object") - message.packet_commitment_sequences[i] = new $util.LongBits(object.packet_commitment_sequences[i].low >>> 0, object.packet_commitment_sequences[i].high >>> 0).toNumber(true); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketAcknowledgementsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @static - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementsRequest} message QueryPacketAcknowledgementsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketAcknowledgementsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.packet_commitment_sequences = []; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - object.pagination = null; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - if (message.packet_commitment_sequences && message.packet_commitment_sequences.length) { - object.packet_commitment_sequences = []; - for (let j = 0; j < message.packet_commitment_sequences.length; ++j) - if (typeof message.packet_commitment_sequences[j] === "number") - object.packet_commitment_sequences[j] = options.longs === String ? String(message.packet_commitment_sequences[j]) : message.packet_commitment_sequences[j]; - else - object.packet_commitment_sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.packet_commitment_sequences[j]) : options.longs === Number ? new $util.LongBits(message.packet_commitment_sequences[j].low >>> 0, message.packet_commitment_sequences[j].high >>> 0).toNumber(true) : message.packet_commitment_sequences[j]; - } - return object; - }; - - /** - * Converts this QueryPacketAcknowledgementsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryPacketAcknowledgementsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketAcknowledgementsRequest; - })(); - - v1.QueryPacketAcknowledgementsResponse = (function() { - - /** - * Properties of a QueryPacketAcknowledgementsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryPacketAcknowledgementsResponse - * @property {Array.|null} [acknowledgements] QueryPacketAcknowledgementsResponse acknowledgements - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryPacketAcknowledgementsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryPacketAcknowledgementsResponse height - */ - - /** - * Constructs a new QueryPacketAcknowledgementsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryPacketAcknowledgementsResponse. - * @implements IQueryPacketAcknowledgementsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse=} [properties] Properties to set - */ - function QueryPacketAcknowledgementsResponse(properties) { - this.acknowledgements = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryPacketAcknowledgementsResponse acknowledgements. - * @member {Array.} acknowledgements - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @instance - */ - QueryPacketAcknowledgementsResponse.prototype.acknowledgements = $util.emptyArray; - - /** - * QueryPacketAcknowledgementsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @instance - */ - QueryPacketAcknowledgementsResponse.prototype.pagination = null; - - /** - * QueryPacketAcknowledgementsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @instance - */ - QueryPacketAcknowledgementsResponse.prototype.height = null; - - /** - * Encodes the specified QueryPacketAcknowledgementsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse} message QueryPacketAcknowledgementsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.acknowledgements != null && message.acknowledgements.length) - for (let i = 0; i < message.acknowledgements.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.acknowledgements[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryPacketAcknowledgementsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse} message QueryPacketAcknowledgementsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryPacketAcknowledgementsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryPacketAcknowledgementsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.acknowledgements && message.acknowledgements.length)) - message.acknowledgements = []; - message.acknowledgements.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryPacketAcknowledgementsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryPacketAcknowledgementsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryPacketAcknowledgementsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryPacketAcknowledgementsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.acknowledgements != null && message.hasOwnProperty("acknowledgements")) { - if (!Array.isArray(message.acknowledgements)) - return "acknowledgements: array expected"; - for (let i = 0; i < message.acknowledgements.length; ++i) { - let error = $root.ibc.core.channel.v1.PacketState.verify(message.acknowledgements[i]); - if (error) - return "acknowledgements." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryPacketAcknowledgementsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} QueryPacketAcknowledgementsResponse - */ - QueryPacketAcknowledgementsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryPacketAcknowledgementsResponse(); - if (object.acknowledgements) { - if (!Array.isArray(object.acknowledgements)) - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.acknowledgements: array expected"); - message.acknowledgements = []; - for (let i = 0; i < object.acknowledgements.length; ++i) { - if (typeof object.acknowledgements[i] !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.acknowledgements: object expected"); - message.acknowledgements[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.acknowledgements[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryPacketAcknowledgementsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryPacketAcknowledgementsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @static - * @param {ibc.core.channel.v1.QueryPacketAcknowledgementsResponse} message QueryPacketAcknowledgementsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryPacketAcknowledgementsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.acknowledgements = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.acknowledgements && message.acknowledgements.length) { - object.acknowledgements = []; - for (let j = 0; j < message.acknowledgements.length; ++j) - object.acknowledgements[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.acknowledgements[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryPacketAcknowledgementsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryPacketAcknowledgementsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryPacketAcknowledgementsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryPacketAcknowledgementsResponse; - })(); - - v1.QueryUnreceivedPacketsRequest = (function() { - - /** - * Properties of a QueryUnreceivedPacketsRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryUnreceivedPacketsRequest - * @property {string|null} [port_id] QueryUnreceivedPacketsRequest port_id - * @property {string|null} [channel_id] QueryUnreceivedPacketsRequest channel_id - * @property {Array.|null} [packet_commitment_sequences] QueryUnreceivedPacketsRequest packet_commitment_sequences - */ - - /** - * Constructs a new QueryUnreceivedPacketsRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryUnreceivedPacketsRequest. - * @implements IQueryUnreceivedPacketsRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest=} [properties] Properties to set - */ - function QueryUnreceivedPacketsRequest(properties) { - this.packet_commitment_sequences = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUnreceivedPacketsRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @instance - */ - QueryUnreceivedPacketsRequest.prototype.port_id = ""; - - /** - * QueryUnreceivedPacketsRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @instance - */ - QueryUnreceivedPacketsRequest.prototype.channel_id = ""; - - /** - * QueryUnreceivedPacketsRequest packet_commitment_sequences. - * @member {Array.} packet_commitment_sequences - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @instance - */ - QueryUnreceivedPacketsRequest.prototype.packet_commitment_sequences = $util.emptyArray; - - /** - * Encodes the specified QueryUnreceivedPacketsRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} message QueryUnreceivedPacketsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedPacketsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.packet_commitment_sequences != null && message.packet_commitment_sequences.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (let i = 0; i < message.packet_commitment_sequences.length; ++i) - writer.uint64(message.packet_commitment_sequences[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified QueryUnreceivedPacketsRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsRequest} message QueryUnreceivedPacketsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedPacketsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUnreceivedPacketsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedPacketsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - if (!(message.packet_commitment_sequences && message.packet_commitment_sequences.length)) - message.packet_commitment_sequences = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.packet_commitment_sequences.push(reader.uint64()); - } else - message.packet_commitment_sequences.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUnreceivedPacketsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedPacketsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUnreceivedPacketsRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUnreceivedPacketsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.packet_commitment_sequences != null && message.hasOwnProperty("packet_commitment_sequences")) { - if (!Array.isArray(message.packet_commitment_sequences)) - return "packet_commitment_sequences: array expected"; - for (let i = 0; i < message.packet_commitment_sequences.length; ++i) - if (!$util.isInteger(message.packet_commitment_sequences[i]) && !(message.packet_commitment_sequences[i] && $util.isInteger(message.packet_commitment_sequences[i].low) && $util.isInteger(message.packet_commitment_sequences[i].high))) - return "packet_commitment_sequences: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a QueryUnreceivedPacketsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} QueryUnreceivedPacketsRequest - */ - QueryUnreceivedPacketsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.packet_commitment_sequences) { - if (!Array.isArray(object.packet_commitment_sequences)) - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedPacketsRequest.packet_commitment_sequences: array expected"); - message.packet_commitment_sequences = []; - for (let i = 0; i < object.packet_commitment_sequences.length; ++i) - if ($util.Long) - (message.packet_commitment_sequences[i] = $util.Long.fromValue(object.packet_commitment_sequences[i])).unsigned = true; - else if (typeof object.packet_commitment_sequences[i] === "string") - message.packet_commitment_sequences[i] = parseInt(object.packet_commitment_sequences[i], 10); - else if (typeof object.packet_commitment_sequences[i] === "number") - message.packet_commitment_sequences[i] = object.packet_commitment_sequences[i]; - else if (typeof object.packet_commitment_sequences[i] === "object") - message.packet_commitment_sequences[i] = new $util.LongBits(object.packet_commitment_sequences[i].low >>> 0, object.packet_commitment_sequences[i].high >>> 0).toNumber(true); - } - return message; - }; - - /** - * Creates a plain object from a QueryUnreceivedPacketsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @static - * @param {ibc.core.channel.v1.QueryUnreceivedPacketsRequest} message QueryUnreceivedPacketsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUnreceivedPacketsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.packet_commitment_sequences = []; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.packet_commitment_sequences && message.packet_commitment_sequences.length) { - object.packet_commitment_sequences = []; - for (let j = 0; j < message.packet_commitment_sequences.length; ++j) - if (typeof message.packet_commitment_sequences[j] === "number") - object.packet_commitment_sequences[j] = options.longs === String ? String(message.packet_commitment_sequences[j]) : message.packet_commitment_sequences[j]; - else - object.packet_commitment_sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.packet_commitment_sequences[j]) : options.longs === Number ? new $util.LongBits(message.packet_commitment_sequences[j].low >>> 0, message.packet_commitment_sequences[j].high >>> 0).toNumber(true) : message.packet_commitment_sequences[j]; - } - return object; - }; - - /** - * Converts this QueryUnreceivedPacketsRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryUnreceivedPacketsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUnreceivedPacketsRequest; - })(); - - v1.QueryUnreceivedPacketsResponse = (function() { - - /** - * Properties of a QueryUnreceivedPacketsResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryUnreceivedPacketsResponse - * @property {Array.|null} [sequences] QueryUnreceivedPacketsResponse sequences - * @property {ibc.core.client.v1.IHeight|null} [height] QueryUnreceivedPacketsResponse height - */ - - /** - * Constructs a new QueryUnreceivedPacketsResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryUnreceivedPacketsResponse. - * @implements IQueryUnreceivedPacketsResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse=} [properties] Properties to set - */ - function QueryUnreceivedPacketsResponse(properties) { - this.sequences = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUnreceivedPacketsResponse sequences. - * @member {Array.} sequences - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @instance - */ - QueryUnreceivedPacketsResponse.prototype.sequences = $util.emptyArray; - - /** - * QueryUnreceivedPacketsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @instance - */ - QueryUnreceivedPacketsResponse.prototype.height = null; - - /** - * Encodes the specified QueryUnreceivedPacketsResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse} message QueryUnreceivedPacketsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedPacketsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequences != null && message.sequences.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (let i = 0; i < message.sequences.length; ++i) - writer.uint64(message.sequences[i]); - writer.ldelim(); - } - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryUnreceivedPacketsResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedPacketsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedPacketsResponse} message QueryUnreceivedPacketsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedPacketsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUnreceivedPacketsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedPacketsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.sequences && message.sequences.length)) - message.sequences = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.sequences.push(reader.uint64()); - } else - message.sequences.push(reader.uint64()); - break; - case 2: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUnreceivedPacketsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedPacketsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUnreceivedPacketsResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUnreceivedPacketsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequences != null && message.hasOwnProperty("sequences")) { - if (!Array.isArray(message.sequences)) - return "sequences: array expected"; - for (let i = 0; i < message.sequences.length; ++i) - if (!$util.isInteger(message.sequences[i]) && !(message.sequences[i] && $util.isInteger(message.sequences[i].low) && $util.isInteger(message.sequences[i].high))) - return "sequences: integer|Long[] expected"; - } - if (message.height != null && message.hasOwnProperty("height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryUnreceivedPacketsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} QueryUnreceivedPacketsResponse - */ - QueryUnreceivedPacketsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryUnreceivedPacketsResponse(); - if (object.sequences) { - if (!Array.isArray(object.sequences)) - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedPacketsResponse.sequences: array expected"); - message.sequences = []; - for (let i = 0; i < object.sequences.length; ++i) - if ($util.Long) - (message.sequences[i] = $util.Long.fromValue(object.sequences[i])).unsigned = true; - else if (typeof object.sequences[i] === "string") - message.sequences[i] = parseInt(object.sequences[i], 10); - else if (typeof object.sequences[i] === "number") - message.sequences[i] = object.sequences[i]; - else if (typeof object.sequences[i] === "object") - message.sequences[i] = new $util.LongBits(object.sequences[i].low >>> 0, object.sequences[i].high >>> 0).toNumber(true); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedPacketsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryUnreceivedPacketsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @static - * @param {ibc.core.channel.v1.QueryUnreceivedPacketsResponse} message QueryUnreceivedPacketsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUnreceivedPacketsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.sequences = []; - if (options.defaults) - object.height = null; - if (message.sequences && message.sequences.length) { - object.sequences = []; - for (let j = 0; j < message.sequences.length; ++j) - if (typeof message.sequences[j] === "number") - object.sequences[j] = options.longs === String ? String(message.sequences[j]) : message.sequences[j]; - else - object.sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.sequences[j]) : options.longs === Number ? new $util.LongBits(message.sequences[j].low >>> 0, message.sequences[j].high >>> 0).toNumber(true) : message.sequences[j]; - } - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryUnreceivedPacketsResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryUnreceivedPacketsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryUnreceivedPacketsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUnreceivedPacketsResponse; - })(); - - v1.QueryUnreceivedAcksRequest = (function() { - - /** - * Properties of a QueryUnreceivedAcksRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryUnreceivedAcksRequest - * @property {string|null} [port_id] QueryUnreceivedAcksRequest port_id - * @property {string|null} [channel_id] QueryUnreceivedAcksRequest channel_id - * @property {Array.|null} [packet_ack_sequences] QueryUnreceivedAcksRequest packet_ack_sequences - */ - - /** - * Constructs a new QueryUnreceivedAcksRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryUnreceivedAcksRequest. - * @implements IQueryUnreceivedAcksRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest=} [properties] Properties to set - */ - function QueryUnreceivedAcksRequest(properties) { - this.packet_ack_sequences = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUnreceivedAcksRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @instance - */ - QueryUnreceivedAcksRequest.prototype.port_id = ""; - - /** - * QueryUnreceivedAcksRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @instance - */ - QueryUnreceivedAcksRequest.prototype.channel_id = ""; - - /** - * QueryUnreceivedAcksRequest packet_ack_sequences. - * @member {Array.} packet_ack_sequences - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @instance - */ - QueryUnreceivedAcksRequest.prototype.packet_ack_sequences = $util.emptyArray; - - /** - * Encodes the specified QueryUnreceivedAcksRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} message QueryUnreceivedAcksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedAcksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.packet_ack_sequences != null && message.packet_ack_sequences.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (let i = 0; i < message.packet_ack_sequences.length; ++i) - writer.uint64(message.packet_ack_sequences[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified QueryUnreceivedAcksRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksRequest} message QueryUnreceivedAcksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedAcksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUnreceivedAcksRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedAcksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - if (!(message.packet_ack_sequences && message.packet_ack_sequences.length)) - message.packet_ack_sequences = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.packet_ack_sequences.push(reader.uint64()); - } else - message.packet_ack_sequences.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUnreceivedAcksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedAcksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUnreceivedAcksRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUnreceivedAcksRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.packet_ack_sequences != null && message.hasOwnProperty("packet_ack_sequences")) { - if (!Array.isArray(message.packet_ack_sequences)) - return "packet_ack_sequences: array expected"; - for (let i = 0; i < message.packet_ack_sequences.length; ++i) - if (!$util.isInteger(message.packet_ack_sequences[i]) && !(message.packet_ack_sequences[i] && $util.isInteger(message.packet_ack_sequences[i].low) && $util.isInteger(message.packet_ack_sequences[i].high))) - return "packet_ack_sequences: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a QueryUnreceivedAcksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksRequest} QueryUnreceivedAcksRequest - */ - QueryUnreceivedAcksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.packet_ack_sequences) { - if (!Array.isArray(object.packet_ack_sequences)) - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedAcksRequest.packet_ack_sequences: array expected"); - message.packet_ack_sequences = []; - for (let i = 0; i < object.packet_ack_sequences.length; ++i) - if ($util.Long) - (message.packet_ack_sequences[i] = $util.Long.fromValue(object.packet_ack_sequences[i])).unsigned = true; - else if (typeof object.packet_ack_sequences[i] === "string") - message.packet_ack_sequences[i] = parseInt(object.packet_ack_sequences[i], 10); - else if (typeof object.packet_ack_sequences[i] === "number") - message.packet_ack_sequences[i] = object.packet_ack_sequences[i]; - else if (typeof object.packet_ack_sequences[i] === "object") - message.packet_ack_sequences[i] = new $util.LongBits(object.packet_ack_sequences[i].low >>> 0, object.packet_ack_sequences[i].high >>> 0).toNumber(true); - } - return message; - }; - - /** - * Creates a plain object from a QueryUnreceivedAcksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @static - * @param {ibc.core.channel.v1.QueryUnreceivedAcksRequest} message QueryUnreceivedAcksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUnreceivedAcksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.packet_ack_sequences = []; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.packet_ack_sequences && message.packet_ack_sequences.length) { - object.packet_ack_sequences = []; - for (let j = 0; j < message.packet_ack_sequences.length; ++j) - if (typeof message.packet_ack_sequences[j] === "number") - object.packet_ack_sequences[j] = options.longs === String ? String(message.packet_ack_sequences[j]) : message.packet_ack_sequences[j]; - else - object.packet_ack_sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.packet_ack_sequences[j]) : options.longs === Number ? new $util.LongBits(message.packet_ack_sequences[j].low >>> 0, message.packet_ack_sequences[j].high >>> 0).toNumber(true) : message.packet_ack_sequences[j]; - } - return object; - }; - - /** - * Converts this QueryUnreceivedAcksRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksRequest - * @instance - * @returns {Object.} JSON object - */ - QueryUnreceivedAcksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUnreceivedAcksRequest; - })(); - - v1.QueryUnreceivedAcksResponse = (function() { - - /** - * Properties of a QueryUnreceivedAcksResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryUnreceivedAcksResponse - * @property {Array.|null} [sequences] QueryUnreceivedAcksResponse sequences - * @property {ibc.core.client.v1.IHeight|null} [height] QueryUnreceivedAcksResponse height - */ - - /** - * Constructs a new QueryUnreceivedAcksResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryUnreceivedAcksResponse. - * @implements IQueryUnreceivedAcksResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse=} [properties] Properties to set - */ - function QueryUnreceivedAcksResponse(properties) { - this.sequences = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUnreceivedAcksResponse sequences. - * @member {Array.} sequences - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @instance - */ - QueryUnreceivedAcksResponse.prototype.sequences = $util.emptyArray; - - /** - * QueryUnreceivedAcksResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @instance - */ - QueryUnreceivedAcksResponse.prototype.height = null; - - /** - * Encodes the specified QueryUnreceivedAcksResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse} message QueryUnreceivedAcksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedAcksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequences != null && message.sequences.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (let i = 0; i < message.sequences.length; ++i) - writer.uint64(message.sequences[i]); - writer.ldelim(); - } - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryUnreceivedAcksResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryUnreceivedAcksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {ibc.core.channel.v1.IQueryUnreceivedAcksResponse} message QueryUnreceivedAcksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUnreceivedAcksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUnreceivedAcksResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedAcksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.sequences && message.sequences.length)) - message.sequences = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.sequences.push(reader.uint64()); - } else - message.sequences.push(reader.uint64()); - break; - case 2: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUnreceivedAcksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUnreceivedAcksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUnreceivedAcksResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUnreceivedAcksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequences != null && message.hasOwnProperty("sequences")) { - if (!Array.isArray(message.sequences)) - return "sequences: array expected"; - for (let i = 0; i < message.sequences.length; ++i) - if (!$util.isInteger(message.sequences[i]) && !(message.sequences[i] && $util.isInteger(message.sequences[i].low) && $util.isInteger(message.sequences[i].high))) - return "sequences: integer|Long[] expected"; - } - if (message.height != null && message.hasOwnProperty("height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryUnreceivedAcksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryUnreceivedAcksResponse} QueryUnreceivedAcksResponse - */ - QueryUnreceivedAcksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryUnreceivedAcksResponse(); - if (object.sequences) { - if (!Array.isArray(object.sequences)) - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedAcksResponse.sequences: array expected"); - message.sequences = []; - for (let i = 0; i < object.sequences.length; ++i) - if ($util.Long) - (message.sequences[i] = $util.Long.fromValue(object.sequences[i])).unsigned = true; - else if (typeof object.sequences[i] === "string") - message.sequences[i] = parseInt(object.sequences[i], 10); - else if (typeof object.sequences[i] === "number") - message.sequences[i] = object.sequences[i]; - else if (typeof object.sequences[i] === "object") - message.sequences[i] = new $util.LongBits(object.sequences[i].low >>> 0, object.sequences[i].high >>> 0).toNumber(true); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryUnreceivedAcksResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryUnreceivedAcksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @static - * @param {ibc.core.channel.v1.QueryUnreceivedAcksResponse} message QueryUnreceivedAcksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUnreceivedAcksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.sequences = []; - if (options.defaults) - object.height = null; - if (message.sequences && message.sequences.length) { - object.sequences = []; - for (let j = 0; j < message.sequences.length; ++j) - if (typeof message.sequences[j] === "number") - object.sequences[j] = options.longs === String ? String(message.sequences[j]) : message.sequences[j]; - else - object.sequences[j] = options.longs === String ? $util.Long.prototype.toString.call(message.sequences[j]) : options.longs === Number ? new $util.LongBits(message.sequences[j].low >>> 0, message.sequences[j].high >>> 0).toNumber(true) : message.sequences[j]; - } - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryUnreceivedAcksResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryUnreceivedAcksResponse - * @instance - * @returns {Object.} JSON object - */ - QueryUnreceivedAcksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUnreceivedAcksResponse; - })(); - - v1.QueryNextSequenceReceiveRequest = (function() { - - /** - * Properties of a QueryNextSequenceReceiveRequest. - * @memberof ibc.core.channel.v1 - * @interface IQueryNextSequenceReceiveRequest - * @property {string|null} [port_id] QueryNextSequenceReceiveRequest port_id - * @property {string|null} [channel_id] QueryNextSequenceReceiveRequest channel_id - */ - - /** - * Constructs a new QueryNextSequenceReceiveRequest. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryNextSequenceReceiveRequest. - * @implements IQueryNextSequenceReceiveRequest - * @constructor - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest=} [properties] Properties to set - */ - function QueryNextSequenceReceiveRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryNextSequenceReceiveRequest port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @instance - */ - QueryNextSequenceReceiveRequest.prototype.port_id = ""; - - /** - * QueryNextSequenceReceiveRequest channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @instance - */ - QueryNextSequenceReceiveRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryNextSequenceReceiveRequest message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} message QueryNextSequenceReceiveRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryNextSequenceReceiveRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryNextSequenceReceiveRequest message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveRequest} message QueryNextSequenceReceiveRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryNextSequenceReceiveRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryNextSequenceReceiveRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryNextSequenceReceiveRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryNextSequenceReceiveRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryNextSequenceReceiveRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryNextSequenceReceiveRequest message. - * @function verify - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryNextSequenceReceiveRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryNextSequenceReceiveRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} QueryNextSequenceReceiveRequest - */ - QueryNextSequenceReceiveRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest) - return object; - let message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryNextSequenceReceiveRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @static - * @param {ibc.core.channel.v1.QueryNextSequenceReceiveRequest} message QueryNextSequenceReceiveRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryNextSequenceReceiveRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryNextSequenceReceiveRequest to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveRequest - * @instance - * @returns {Object.} JSON object - */ - QueryNextSequenceReceiveRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryNextSequenceReceiveRequest; - })(); - - v1.QueryNextSequenceReceiveResponse = (function() { - - /** - * Properties of a QueryNextSequenceReceiveResponse. - * @memberof ibc.core.channel.v1 - * @interface IQueryNextSequenceReceiveResponse - * @property {Long|null} [next_sequence_receive] QueryNextSequenceReceiveResponse next_sequence_receive - * @property {Uint8Array|null} [proof] QueryNextSequenceReceiveResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryNextSequenceReceiveResponse proof_height - */ - - /** - * Constructs a new QueryNextSequenceReceiveResponse. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a QueryNextSequenceReceiveResponse. - * @implements IQueryNextSequenceReceiveResponse - * @constructor - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse=} [properties] Properties to set - */ - function QueryNextSequenceReceiveResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryNextSequenceReceiveResponse next_sequence_receive. - * @member {Long} next_sequence_receive - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @instance - */ - QueryNextSequenceReceiveResponse.prototype.next_sequence_receive = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryNextSequenceReceiveResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @instance - */ - QueryNextSequenceReceiveResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryNextSequenceReceiveResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @instance - */ - QueryNextSequenceReceiveResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryNextSequenceReceiveResponse message. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse} message QueryNextSequenceReceiveResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryNextSequenceReceiveResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.next_sequence_receive != null && Object.hasOwnProperty.call(message, "next_sequence_receive")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.next_sequence_receive); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryNextSequenceReceiveResponse message, length delimited. Does not implicitly {@link ibc.core.channel.v1.QueryNextSequenceReceiveResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {ibc.core.channel.v1.IQueryNextSequenceReceiveResponse} message QueryNextSequenceReceiveResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryNextSequenceReceiveResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryNextSequenceReceiveResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryNextSequenceReceiveResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_sequence_receive = reader.uint64(); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryNextSequenceReceiveResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryNextSequenceReceiveResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryNextSequenceReceiveResponse message. - * @function verify - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryNextSequenceReceiveResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.next_sequence_receive != null && message.hasOwnProperty("next_sequence_receive")) - if (!$util.isInteger(message.next_sequence_receive) && !(message.next_sequence_receive && $util.isInteger(message.next_sequence_receive.low) && $util.isInteger(message.next_sequence_receive.high))) - return "next_sequence_receive: integer|Long expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryNextSequenceReceiveResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} QueryNextSequenceReceiveResponse - */ - QueryNextSequenceReceiveResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse) - return object; - let message = new $root.ibc.core.channel.v1.QueryNextSequenceReceiveResponse(); - if (object.next_sequence_receive != null) - if ($util.Long) - (message.next_sequence_receive = $util.Long.fromValue(object.next_sequence_receive)).unsigned = true; - else if (typeof object.next_sequence_receive === "string") - message.next_sequence_receive = parseInt(object.next_sequence_receive, 10); - else if (typeof object.next_sequence_receive === "number") - message.next_sequence_receive = object.next_sequence_receive; - else if (typeof object.next_sequence_receive === "object") - message.next_sequence_receive = new $util.LongBits(object.next_sequence_receive.low >>> 0, object.next_sequence_receive.high >>> 0).toNumber(true); - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.channel.v1.QueryNextSequenceReceiveResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryNextSequenceReceiveResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @static - * @param {ibc.core.channel.v1.QueryNextSequenceReceiveResponse} message QueryNextSequenceReceiveResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryNextSequenceReceiveResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.next_sequence_receive = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_sequence_receive = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.next_sequence_receive != null && message.hasOwnProperty("next_sequence_receive")) - if (typeof message.next_sequence_receive === "number") - object.next_sequence_receive = options.longs === String ? String(message.next_sequence_receive) : message.next_sequence_receive; - else - object.next_sequence_receive = options.longs === String ? $util.Long.prototype.toString.call(message.next_sequence_receive) : options.longs === Number ? new $util.LongBits(message.next_sequence_receive.low >>> 0, message.next_sequence_receive.high >>> 0).toNumber(true) : message.next_sequence_receive; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryNextSequenceReceiveResponse to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.QueryNextSequenceReceiveResponse - * @instance - * @returns {Object.} JSON object - */ - QueryNextSequenceReceiveResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryNextSequenceReceiveResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.core.channel.v1 - * @interface IGenesisState - * @property {Array.|null} [channels] GenesisState channels - * @property {Array.|null} [acknowledgements] GenesisState acknowledgements - * @property {Array.|null} [commitments] GenesisState commitments - * @property {Array.|null} [receipts] GenesisState receipts - * @property {Array.|null} [send_sequences] GenesisState send_sequences - * @property {Array.|null} [recv_sequences] GenesisState recv_sequences - * @property {Array.|null} [ack_sequences] GenesisState ack_sequences - * @property {Long|null} [next_channel_sequence] GenesisState next_channel_sequence - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.core.channel.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.channels = []; - this.acknowledgements = []; - this.commitments = []; - this.receipts = []; - this.send_sequences = []; - this.recv_sequences = []; - this.ack_sequences = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState channels. - * @member {Array.} channels - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.channels = $util.emptyArray; - - /** - * GenesisState acknowledgements. - * @member {Array.} acknowledgements - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.acknowledgements = $util.emptyArray; - - /** - * GenesisState commitments. - * @member {Array.} commitments - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.commitments = $util.emptyArray; - - /** - * GenesisState receipts. - * @member {Array.} receipts - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.receipts = $util.emptyArray; - - /** - * GenesisState send_sequences. - * @member {Array.} send_sequences - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.send_sequences = $util.emptyArray; - - /** - * GenesisState recv_sequences. - * @member {Array.} recv_sequences - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.recv_sequences = $util.emptyArray; - - /** - * GenesisState ack_sequences. - * @member {Array.} ack_sequences - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.ack_sequences = $util.emptyArray; - - /** - * GenesisState next_channel_sequence. - * @member {Long} next_channel_sequence - * @memberof ibc.core.channel.v1.GenesisState - * @instance - */ - GenesisState.prototype.next_channel_sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.channel.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {ibc.core.channel.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channels != null && message.channels.length) - for (let i = 0; i < message.channels.length; ++i) - $root.ibc.core.channel.v1.IdentifiedChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.acknowledgements != null && message.acknowledgements.length) - for (let i = 0; i < message.acknowledgements.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.acknowledgements[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.commitments != null && message.commitments.length) - for (let i = 0; i < message.commitments.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.commitments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.receipts != null && message.receipts.length) - for (let i = 0; i < message.receipts.length; ++i) - $root.ibc.core.channel.v1.PacketState.encode(message.receipts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.send_sequences != null && message.send_sequences.length) - for (let i = 0; i < message.send_sequences.length; ++i) - $root.ibc.core.channel.v1.PacketSequence.encode(message.send_sequences[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.recv_sequences != null && message.recv_sequences.length) - for (let i = 0; i < message.recv_sequences.length; ++i) - $root.ibc.core.channel.v1.PacketSequence.encode(message.recv_sequences[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ack_sequences != null && message.ack_sequences.length) - for (let i = 0; i < message.ack_sequences.length; ++i) - $root.ibc.core.channel.v1.PacketSequence.encode(message.ack_sequences[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.next_channel_sequence != null && Object.hasOwnProperty.call(message, "next_channel_sequence")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.next_channel_sequence); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.channel.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {ibc.core.channel.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.GenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.channels && message.channels.length)) - message.channels = []; - message.channels.push($root.ibc.core.channel.v1.IdentifiedChannel.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.acknowledgements && message.acknowledgements.length)) - message.acknowledgements = []; - message.acknowledgements.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.commitments && message.commitments.length)) - message.commitments = []; - message.commitments.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.receipts && message.receipts.length)) - message.receipts = []; - message.receipts.push($root.ibc.core.channel.v1.PacketState.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.send_sequences && message.send_sequences.length)) - message.send_sequences = []; - message.send_sequences.push($root.ibc.core.channel.v1.PacketSequence.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.recv_sequences && message.recv_sequences.length)) - message.recv_sequences = []; - message.recv_sequences.push($root.ibc.core.channel.v1.PacketSequence.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.ack_sequences && message.ack_sequences.length)) - message.ack_sequences = []; - message.ack_sequences.push($root.ibc.core.channel.v1.PacketSequence.decode(reader, reader.uint32())); - break; - case 8: - message.next_channel_sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channels != null && message.hasOwnProperty("channels")) { - if (!Array.isArray(message.channels)) - return "channels: array expected"; - for (let i = 0; i < message.channels.length; ++i) { - let error = $root.ibc.core.channel.v1.IdentifiedChannel.verify(message.channels[i]); - if (error) - return "channels." + error; - } - } - if (message.acknowledgements != null && message.hasOwnProperty("acknowledgements")) { - if (!Array.isArray(message.acknowledgements)) - return "acknowledgements: array expected"; - for (let i = 0; i < message.acknowledgements.length; ++i) { - let error = $root.ibc.core.channel.v1.PacketState.verify(message.acknowledgements[i]); - if (error) - return "acknowledgements." + error; - } - } - if (message.commitments != null && message.hasOwnProperty("commitments")) { - if (!Array.isArray(message.commitments)) - return "commitments: array expected"; - for (let i = 0; i < message.commitments.length; ++i) { - let error = $root.ibc.core.channel.v1.PacketState.verify(message.commitments[i]); - if (error) - return "commitments." + error; - } - } - if (message.receipts != null && message.hasOwnProperty("receipts")) { - if (!Array.isArray(message.receipts)) - return "receipts: array expected"; - for (let i = 0; i < message.receipts.length; ++i) { - let error = $root.ibc.core.channel.v1.PacketState.verify(message.receipts[i]); - if (error) - return "receipts." + error; - } - } - if (message.send_sequences != null && message.hasOwnProperty("send_sequences")) { - if (!Array.isArray(message.send_sequences)) - return "send_sequences: array expected"; - for (let i = 0; i < message.send_sequences.length; ++i) { - let error = $root.ibc.core.channel.v1.PacketSequence.verify(message.send_sequences[i]); - if (error) - return "send_sequences." + error; - } - } - if (message.recv_sequences != null && message.hasOwnProperty("recv_sequences")) { - if (!Array.isArray(message.recv_sequences)) - return "recv_sequences: array expected"; - for (let i = 0; i < message.recv_sequences.length; ++i) { - let error = $root.ibc.core.channel.v1.PacketSequence.verify(message.recv_sequences[i]); - if (error) - return "recv_sequences." + error; - } - } - if (message.ack_sequences != null && message.hasOwnProperty("ack_sequences")) { - if (!Array.isArray(message.ack_sequences)) - return "ack_sequences: array expected"; - for (let i = 0; i < message.ack_sequences.length; ++i) { - let error = $root.ibc.core.channel.v1.PacketSequence.verify(message.ack_sequences[i]); - if (error) - return "ack_sequences." + error; - } - } - if (message.next_channel_sequence != null && message.hasOwnProperty("next_channel_sequence")) - if (!$util.isInteger(message.next_channel_sequence) && !(message.next_channel_sequence && $util.isInteger(message.next_channel_sequence.low) && $util.isInteger(message.next_channel_sequence.high))) - return "next_channel_sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.GenesisState) - return object; - let message = new $root.ibc.core.channel.v1.GenesisState(); - if (object.channels) { - if (!Array.isArray(object.channels)) - throw TypeError(".ibc.core.channel.v1.GenesisState.channels: array expected"); - message.channels = []; - for (let i = 0; i < object.channels.length; ++i) { - if (typeof object.channels[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.channels: object expected"); - message.channels[i] = $root.ibc.core.channel.v1.IdentifiedChannel.fromObject(object.channels[i]); - } - } - if (object.acknowledgements) { - if (!Array.isArray(object.acknowledgements)) - throw TypeError(".ibc.core.channel.v1.GenesisState.acknowledgements: array expected"); - message.acknowledgements = []; - for (let i = 0; i < object.acknowledgements.length; ++i) { - if (typeof object.acknowledgements[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.acknowledgements: object expected"); - message.acknowledgements[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.acknowledgements[i]); - } - } - if (object.commitments) { - if (!Array.isArray(object.commitments)) - throw TypeError(".ibc.core.channel.v1.GenesisState.commitments: array expected"); - message.commitments = []; - for (let i = 0; i < object.commitments.length; ++i) { - if (typeof object.commitments[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.commitments: object expected"); - message.commitments[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.commitments[i]); - } - } - if (object.receipts) { - if (!Array.isArray(object.receipts)) - throw TypeError(".ibc.core.channel.v1.GenesisState.receipts: array expected"); - message.receipts = []; - for (let i = 0; i < object.receipts.length; ++i) { - if (typeof object.receipts[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.receipts: object expected"); - message.receipts[i] = $root.ibc.core.channel.v1.PacketState.fromObject(object.receipts[i]); - } - } - if (object.send_sequences) { - if (!Array.isArray(object.send_sequences)) - throw TypeError(".ibc.core.channel.v1.GenesisState.send_sequences: array expected"); - message.send_sequences = []; - for (let i = 0; i < object.send_sequences.length; ++i) { - if (typeof object.send_sequences[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.send_sequences: object expected"); - message.send_sequences[i] = $root.ibc.core.channel.v1.PacketSequence.fromObject(object.send_sequences[i]); - } - } - if (object.recv_sequences) { - if (!Array.isArray(object.recv_sequences)) - throw TypeError(".ibc.core.channel.v1.GenesisState.recv_sequences: array expected"); - message.recv_sequences = []; - for (let i = 0; i < object.recv_sequences.length; ++i) { - if (typeof object.recv_sequences[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.recv_sequences: object expected"); - message.recv_sequences[i] = $root.ibc.core.channel.v1.PacketSequence.fromObject(object.recv_sequences[i]); - } - } - if (object.ack_sequences) { - if (!Array.isArray(object.ack_sequences)) - throw TypeError(".ibc.core.channel.v1.GenesisState.ack_sequences: array expected"); - message.ack_sequences = []; - for (let i = 0; i < object.ack_sequences.length; ++i) { - if (typeof object.ack_sequences[i] !== "object") - throw TypeError(".ibc.core.channel.v1.GenesisState.ack_sequences: object expected"); - message.ack_sequences[i] = $root.ibc.core.channel.v1.PacketSequence.fromObject(object.ack_sequences[i]); - } - } - if (object.next_channel_sequence != null) - if ($util.Long) - (message.next_channel_sequence = $util.Long.fromValue(object.next_channel_sequence)).unsigned = true; - else if (typeof object.next_channel_sequence === "string") - message.next_channel_sequence = parseInt(object.next_channel_sequence, 10); - else if (typeof object.next_channel_sequence === "number") - message.next_channel_sequence = object.next_channel_sequence; - else if (typeof object.next_channel_sequence === "object") - message.next_channel_sequence = new $util.LongBits(object.next_channel_sequence.low >>> 0, object.next_channel_sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.GenesisState - * @static - * @param {ibc.core.channel.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.channels = []; - object.acknowledgements = []; - object.commitments = []; - object.receipts = []; - object.send_sequences = []; - object.recv_sequences = []; - object.ack_sequences = []; - } - if (options.defaults) - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.next_channel_sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_channel_sequence = options.longs === String ? "0" : 0; - if (message.channels && message.channels.length) { - object.channels = []; - for (let j = 0; j < message.channels.length; ++j) - object.channels[j] = $root.ibc.core.channel.v1.IdentifiedChannel.toObject(message.channels[j], options); - } - if (message.acknowledgements && message.acknowledgements.length) { - object.acknowledgements = []; - for (let j = 0; j < message.acknowledgements.length; ++j) - object.acknowledgements[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.acknowledgements[j], options); - } - if (message.commitments && message.commitments.length) { - object.commitments = []; - for (let j = 0; j < message.commitments.length; ++j) - object.commitments[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.commitments[j], options); - } - if (message.receipts && message.receipts.length) { - object.receipts = []; - for (let j = 0; j < message.receipts.length; ++j) - object.receipts[j] = $root.ibc.core.channel.v1.PacketState.toObject(message.receipts[j], options); - } - if (message.send_sequences && message.send_sequences.length) { - object.send_sequences = []; - for (let j = 0; j < message.send_sequences.length; ++j) - object.send_sequences[j] = $root.ibc.core.channel.v1.PacketSequence.toObject(message.send_sequences[j], options); - } - if (message.recv_sequences && message.recv_sequences.length) { - object.recv_sequences = []; - for (let j = 0; j < message.recv_sequences.length; ++j) - object.recv_sequences[j] = $root.ibc.core.channel.v1.PacketSequence.toObject(message.recv_sequences[j], options); - } - if (message.ack_sequences && message.ack_sequences.length) { - object.ack_sequences = []; - for (let j = 0; j < message.ack_sequences.length; ++j) - object.ack_sequences[j] = $root.ibc.core.channel.v1.PacketSequence.toObject(message.ack_sequences[j], options); - } - if (message.next_channel_sequence != null && message.hasOwnProperty("next_channel_sequence")) - if (typeof message.next_channel_sequence === "number") - object.next_channel_sequence = options.longs === String ? String(message.next_channel_sequence) : message.next_channel_sequence; - else - object.next_channel_sequence = options.longs === String ? $util.Long.prototype.toString.call(message.next_channel_sequence) : options.longs === Number ? new $util.LongBits(message.next_channel_sequence.low >>> 0, message.next_channel_sequence.high >>> 0).toNumber(true) : message.next_channel_sequence; - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - v1.PacketSequence = (function() { - - /** - * Properties of a PacketSequence. - * @memberof ibc.core.channel.v1 - * @interface IPacketSequence - * @property {string|null} [port_id] PacketSequence port_id - * @property {string|null} [channel_id] PacketSequence channel_id - * @property {Long|null} [sequence] PacketSequence sequence - */ - - /** - * Constructs a new PacketSequence. - * @memberof ibc.core.channel.v1 - * @classdesc Represents a PacketSequence. - * @implements IPacketSequence - * @constructor - * @param {ibc.core.channel.v1.IPacketSequence=} [properties] Properties to set - */ - function PacketSequence(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketSequence port_id. - * @member {string} port_id - * @memberof ibc.core.channel.v1.PacketSequence - * @instance - */ - PacketSequence.prototype.port_id = ""; - - /** - * PacketSequence channel_id. - * @member {string} channel_id - * @memberof ibc.core.channel.v1.PacketSequence - * @instance - */ - PacketSequence.prototype.channel_id = ""; - - /** - * PacketSequence sequence. - * @member {Long} sequence - * @memberof ibc.core.channel.v1.PacketSequence - * @instance - */ - PacketSequence.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified PacketSequence message. Does not implicitly {@link ibc.core.channel.v1.PacketSequence.verify|verify} messages. - * @function encode - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {ibc.core.channel.v1.IPacketSequence} message PacketSequence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketSequence.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified PacketSequence message, length delimited. Does not implicitly {@link ibc.core.channel.v1.PacketSequence.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {ibc.core.channel.v1.IPacketSequence} message PacketSequence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketSequence.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketSequence message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketSequence.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.channel.v1.PacketSequence(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketSequence message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketSequence.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketSequence message. - * @function verify - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketSequence.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a PacketSequence message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.channel.v1.PacketSequence} PacketSequence - */ - PacketSequence.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.channel.v1.PacketSequence) - return object; - let message = new $root.ibc.core.channel.v1.PacketSequence(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PacketSequence message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.channel.v1.PacketSequence - * @static - * @param {ibc.core.channel.v1.PacketSequence} message PacketSequence - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketSequence.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this PacketSequence to JSON. - * @function toJSON - * @memberof ibc.core.channel.v1.PacketSequence - * @instance - * @returns {Object.} JSON object - */ - PacketSequence.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketSequence; - })(); - - return v1; - })(); - - return channel; - })(); - - core.client = (function() { - - /** - * Namespace client. - * @memberof ibc.core - * @namespace - */ - const client = {}; - - client.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.client - * @namespace - */ - const v1 = {}; - - v1.IdentifiedClientState = (function() { - - /** - * Properties of an IdentifiedClientState. - * @memberof ibc.core.client.v1 - * @interface IIdentifiedClientState - * @property {string|null} [client_id] IdentifiedClientState client_id - * @property {google.protobuf.IAny|null} [client_state] IdentifiedClientState client_state - */ - - /** - * Constructs a new IdentifiedClientState. - * @memberof ibc.core.client.v1 - * @classdesc Represents an IdentifiedClientState. - * @implements IIdentifiedClientState - * @constructor - * @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set - */ - function IdentifiedClientState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedClientState client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.IdentifiedClientState - * @instance - */ - IdentifiedClientState.prototype.client_id = ""; - - /** - * IdentifiedClientState client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.client.v1.IdentifiedClientState - * @instance - */ - IdentifiedClientState.prototype.client_state = null; - - /** - * Encodes the specified IdentifiedClientState message. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentifiedClientState message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedClientState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedClientState message. - * @function verify - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - let error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - return null; - }; - - /** - * Creates an IdentifiedClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState - */ - IdentifiedClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.IdentifiedClientState) - return object; - let message = new $root.ibc.core.client.v1.IdentifiedClientState(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.client.v1.IdentifiedClientState.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - return message; - }; - - /** - * Creates a plain object from an IdentifiedClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {ibc.core.client.v1.IdentifiedClientState} message IdentifiedClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - object.client_state = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - return object; - }; - - /** - * Converts this IdentifiedClientState to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.IdentifiedClientState - * @instance - * @returns {Object.} JSON object - */ - IdentifiedClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedClientState; - })(); - - v1.ConsensusStateWithHeight = (function() { - - /** - * Properties of a ConsensusStateWithHeight. - * @memberof ibc.core.client.v1 - * @interface IConsensusStateWithHeight - * @property {ibc.core.client.v1.IHeight|null} [height] ConsensusStateWithHeight height - * @property {google.protobuf.IAny|null} [consensus_state] ConsensusStateWithHeight consensus_state - */ - - /** - * Constructs a new ConsensusStateWithHeight. - * @memberof ibc.core.client.v1 - * @classdesc Represents a ConsensusStateWithHeight. - * @implements IConsensusStateWithHeight - * @constructor - * @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set - */ - function ConsensusStateWithHeight(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusStateWithHeight height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @instance - */ - ConsensusStateWithHeight.prototype.height = null; - - /** - * ConsensusStateWithHeight consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @instance - */ - ConsensusStateWithHeight.prototype.consensus_state = null; - - /** - * Encodes the specified ConsensusStateWithHeight message. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateWithHeight.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConsensusStateWithHeight message, length delimited. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateWithHeight.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateWithHeight.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateWithHeight.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusStateWithHeight message. - * @function verify - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusStateWithHeight.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - return null; - }; - - /** - * Creates a ConsensusStateWithHeight message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight - */ - ConsensusStateWithHeight.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.ConsensusStateWithHeight) - return object; - let message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - return message; - }; - - /** - * Creates a plain object from a ConsensusStateWithHeight message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {ibc.core.client.v1.ConsensusStateWithHeight} message ConsensusStateWithHeight - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusStateWithHeight.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.height = null; - object.consensus_state = null; - } - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - return object; - }; - - /** - * Converts this ConsensusStateWithHeight to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @instance - * @returns {Object.} JSON object - */ - ConsensusStateWithHeight.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusStateWithHeight; - })(); - - v1.ClientConsensusStates = (function() { - - /** - * Properties of a ClientConsensusStates. - * @memberof ibc.core.client.v1 - * @interface IClientConsensusStates - * @property {string|null} [client_id] ClientConsensusStates client_id - * @property {Array.|null} [consensus_states] ClientConsensusStates consensus_states - */ - - /** - * Constructs a new ClientConsensusStates. - * @memberof ibc.core.client.v1 - * @classdesc Represents a ClientConsensusStates. - * @implements IClientConsensusStates - * @constructor - * @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set - */ - function ClientConsensusStates(properties) { - this.consensus_states = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientConsensusStates client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.ClientConsensusStates - * @instance - */ - ClientConsensusStates.prototype.client_id = ""; - - /** - * ClientConsensusStates consensus_states. - * @member {Array.} consensus_states - * @memberof ibc.core.client.v1.ClientConsensusStates - * @instance - */ - ClientConsensusStates.prototype.consensus_states = $util.emptyArray; - - /** - * Encodes the specified ClientConsensusStates message. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConsensusStates.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.consensus_states != null && message.consensus_states.length) - for (let i = 0; i < message.consensus_states.length; ++i) - $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensus_states[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientConsensusStates message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConsensusStates.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConsensusStates.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientConsensusStates(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - if (!(message.consensus_states && message.consensus_states.length)) - message.consensus_states = []; - message.consensus_states.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConsensusStates.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientConsensusStates message. - * @function verify - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientConsensusStates.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.consensus_states != null && message.hasOwnProperty("consensus_states")) { - if (!Array.isArray(message.consensus_states)) - return "consensus_states: array expected"; - for (let i = 0; i < message.consensus_states.length; ++i) { - let error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensus_states[i]); - if (error) - return "consensus_states." + error; - } - } - return null; - }; - - /** - * Creates a ClientConsensusStates message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates - */ - ClientConsensusStates.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.ClientConsensusStates) - return object; - let message = new $root.ibc.core.client.v1.ClientConsensusStates(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.consensus_states) { - if (!Array.isArray(object.consensus_states)) - throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensus_states: array expected"); - message.consensus_states = []; - for (let i = 0; i < object.consensus_states.length; ++i) { - if (typeof object.consensus_states[i] !== "object") - throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensus_states: object expected"); - message.consensus_states[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensus_states[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ClientConsensusStates message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {ibc.core.client.v1.ClientConsensusStates} message ClientConsensusStates - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientConsensusStates.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.consensus_states = []; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.consensus_states && message.consensus_states.length) { - object.consensus_states = []; - for (let j = 0; j < message.consensus_states.length; ++j) - object.consensus_states[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensus_states[j], options); - } - return object; - }; - - /** - * Converts this ClientConsensusStates to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.ClientConsensusStates - * @instance - * @returns {Object.} JSON object - */ - ClientConsensusStates.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientConsensusStates; - })(); - - v1.ClientUpdateProposal = (function() { - - /** - * Properties of a ClientUpdateProposal. - * @memberof ibc.core.client.v1 - * @interface IClientUpdateProposal - * @property {string|null} [title] ClientUpdateProposal title - * @property {string|null} [description] ClientUpdateProposal description - * @property {string|null} [subject_client_id] ClientUpdateProposal subject_client_id - * @property {string|null} [substitute_client_id] ClientUpdateProposal substitute_client_id - */ - - /** - * Constructs a new ClientUpdateProposal. - * @memberof ibc.core.client.v1 - * @classdesc Represents a ClientUpdateProposal. - * @implements IClientUpdateProposal - * @constructor - * @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set - */ - function ClientUpdateProposal(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientUpdateProposal title. - * @member {string} title - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.title = ""; - - /** - * ClientUpdateProposal description. - * @member {string} description - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.description = ""; - - /** - * ClientUpdateProposal subject_client_id. - * @member {string} subject_client_id - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.subject_client_id = ""; - - /** - * ClientUpdateProposal substitute_client_id. - * @member {string} substitute_client_id - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.substitute_client_id = ""; - - /** - * Encodes the specified ClientUpdateProposal message. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientUpdateProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.subject_client_id != null && Object.hasOwnProperty.call(message, "subject_client_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.subject_client_id); - if (message.substitute_client_id != null && Object.hasOwnProperty.call(message, "substitute_client_id")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.substitute_client_id); - return writer; - }; - - /** - * Encodes the specified ClientUpdateProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientUpdateProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientUpdateProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientUpdateProposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.subject_client_id = reader.string(); - break; - case 4: - message.substitute_client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientUpdateProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientUpdateProposal message. - * @function verify - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientUpdateProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.subject_client_id != null && message.hasOwnProperty("subject_client_id")) - if (!$util.isString(message.subject_client_id)) - return "subject_client_id: string expected"; - if (message.substitute_client_id != null && message.hasOwnProperty("substitute_client_id")) - if (!$util.isString(message.substitute_client_id)) - return "substitute_client_id: string expected"; - return null; - }; - - /** - * Creates a ClientUpdateProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal - */ - ClientUpdateProposal.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.ClientUpdateProposal) - return object; - let message = new $root.ibc.core.client.v1.ClientUpdateProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.subject_client_id != null) - message.subject_client_id = String(object.subject_client_id); - if (object.substitute_client_id != null) - message.substitute_client_id = String(object.substitute_client_id); - return message; - }; - - /** - * Creates a plain object from a ClientUpdateProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {ibc.core.client.v1.ClientUpdateProposal} message ClientUpdateProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientUpdateProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.subject_client_id = ""; - object.substitute_client_id = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.subject_client_id != null && message.hasOwnProperty("subject_client_id")) - object.subject_client_id = message.subject_client_id; - if (message.substitute_client_id != null && message.hasOwnProperty("substitute_client_id")) - object.substitute_client_id = message.substitute_client_id; - return object; - }; - - /** - * Converts this ClientUpdateProposal to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - * @returns {Object.} JSON object - */ - ClientUpdateProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientUpdateProposal; - })(); - - v1.UpgradeProposal = (function() { - - /** - * Properties of an UpgradeProposal. - * @memberof ibc.core.client.v1 - * @interface IUpgradeProposal - * @property {string|null} [title] UpgradeProposal title - * @property {string|null} [description] UpgradeProposal description - * @property {cosmos.upgrade.v1beta1.IPlan|null} [plan] UpgradeProposal plan - * @property {google.protobuf.IAny|null} [upgraded_client_state] UpgradeProposal upgraded_client_state - */ - - /** - * Constructs a new UpgradeProposal. - * @memberof ibc.core.client.v1 - * @classdesc Represents an UpgradeProposal. - * @implements IUpgradeProposal - * @constructor - * @param {ibc.core.client.v1.IUpgradeProposal=} [properties] Properties to set - */ - function UpgradeProposal(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeProposal title. - * @member {string} title - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.title = ""; - - /** - * UpgradeProposal description. - * @member {string} description - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.description = ""; - - /** - * UpgradeProposal plan. - * @member {cosmos.upgrade.v1beta1.IPlan|null|undefined} plan - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.plan = null; - - /** - * UpgradeProposal upgraded_client_state. - * @member {google.protobuf.IAny|null|undefined} upgraded_client_state - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.upgraded_client_state = null; - - /** - * Encodes the specified UpgradeProposal message. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {ibc.core.client.v1.IUpgradeProposal} message UpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) - $root.cosmos.upgrade.v1beta1.Plan.encode(message.plan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.upgraded_client_state != null && Object.hasOwnProperty.call(message, "upgraded_client_state")) - $root.google.protobuf.Any.encode(message.upgraded_client_state, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpgradeProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {ibc.core.client.v1.IUpgradeProposal} message UpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.UpgradeProposal} UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.UpgradeProposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = $root.cosmos.upgrade.v1beta1.Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgraded_client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.UpgradeProposal} UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeProposal message. - * @function verify - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.plan != null && message.hasOwnProperty("plan")) { - let error = $root.cosmos.upgrade.v1beta1.Plan.verify(message.plan); - if (error) - return "plan." + error; - } - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) { - let error = $root.google.protobuf.Any.verify(message.upgraded_client_state); - if (error) - return "upgraded_client_state." + error; - } - return null; - }; - - /** - * Creates an UpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.UpgradeProposal} UpgradeProposal - */ - UpgradeProposal.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.UpgradeProposal) - return object; - let message = new $root.ibc.core.client.v1.UpgradeProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.plan != null) { - if (typeof object.plan !== "object") - throw TypeError(".ibc.core.client.v1.UpgradeProposal.plan: object expected"); - message.plan = $root.cosmos.upgrade.v1beta1.Plan.fromObject(object.plan); - } - if (object.upgraded_client_state != null) { - if (typeof object.upgraded_client_state !== "object") - throw TypeError(".ibc.core.client.v1.UpgradeProposal.upgraded_client_state: object expected"); - message.upgraded_client_state = $root.google.protobuf.Any.fromObject(object.upgraded_client_state); - } - return message; - }; - - /** - * Creates a plain object from an UpgradeProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {ibc.core.client.v1.UpgradeProposal} message UpgradeProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.plan = null; - object.upgraded_client_state = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.plan != null && message.hasOwnProperty("plan")) - object.plan = $root.cosmos.upgrade.v1beta1.Plan.toObject(message.plan, options); - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) - object.upgraded_client_state = $root.google.protobuf.Any.toObject(message.upgraded_client_state, options); - return object; - }; - - /** - * Converts this UpgradeProposal to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - * @returns {Object.} JSON object - */ - UpgradeProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpgradeProposal; - })(); - - v1.Height = (function() { - - /** - * Properties of an Height. - * @memberof ibc.core.client.v1 - * @interface IHeight - * @property {Long|null} [revision_number] Height revision_number - * @property {Long|null} [revision_height] Height revision_height - */ - - /** - * Constructs a new Height. - * @memberof ibc.core.client.v1 - * @classdesc Represents an Height. - * @implements IHeight - * @constructor - * @param {ibc.core.client.v1.IHeight=} [properties] Properties to set - */ - function Height(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Height revision_number. - * @member {Long} revision_number - * @memberof ibc.core.client.v1.Height - * @instance - */ - Height.prototype.revision_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Height revision_height. - * @member {Long} revision_height - * @memberof ibc.core.client.v1.Height - * @instance - */ - Height.prototype.revision_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Height message. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.Height - * @static - * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Height.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision_number != null && Object.hasOwnProperty.call(message, "revision_number")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.revision_number); - if (message.revision_height != null && Object.hasOwnProperty.call(message, "revision_height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision_height); - return writer; - }; - - /** - * Encodes the specified Height message, length delimited. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.Height - * @static - * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Height.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Height message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.Height - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.Height} Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Height.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Height(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revision_number = reader.uint64(); - break; - case 2: - message.revision_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Height message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.Height - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.Height} Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Height.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Height message. - * @function verify - * @memberof ibc.core.client.v1.Height - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Height.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (!$util.isInteger(message.revision_number) && !(message.revision_number && $util.isInteger(message.revision_number.low) && $util.isInteger(message.revision_number.high))) - return "revision_number: integer|Long expected"; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (!$util.isInteger(message.revision_height) && !(message.revision_height && $util.isInteger(message.revision_height.low) && $util.isInteger(message.revision_height.high))) - return "revision_height: integer|Long expected"; - return null; - }; - - /** - * Creates an Height message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.Height - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.Height} Height - */ - Height.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.Height) - return object; - let message = new $root.ibc.core.client.v1.Height(); - if (object.revision_number != null) - if ($util.Long) - (message.revision_number = $util.Long.fromValue(object.revision_number)).unsigned = true; - else if (typeof object.revision_number === "string") - message.revision_number = parseInt(object.revision_number, 10); - else if (typeof object.revision_number === "number") - message.revision_number = object.revision_number; - else if (typeof object.revision_number === "object") - message.revision_number = new $util.LongBits(object.revision_number.low >>> 0, object.revision_number.high >>> 0).toNumber(true); - if (object.revision_height != null) - if ($util.Long) - (message.revision_height = $util.Long.fromValue(object.revision_height)).unsigned = true; - else if (typeof object.revision_height === "string") - message.revision_height = parseInt(object.revision_height, 10); - else if (typeof object.revision_height === "number") - message.revision_height = object.revision_height; - else if (typeof object.revision_height === "object") - message.revision_height = new $util.LongBits(object.revision_height.low >>> 0, object.revision_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an Height message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.Height - * @static - * @param {ibc.core.client.v1.Height} message Height - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Height.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.revision_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_number = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.revision_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_height = options.longs === String ? "0" : 0; - } - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (typeof message.revision_number === "number") - object.revision_number = options.longs === String ? String(message.revision_number) : message.revision_number; - else - object.revision_number = options.longs === String ? $util.Long.prototype.toString.call(message.revision_number) : options.longs === Number ? new $util.LongBits(message.revision_number.low >>> 0, message.revision_number.high >>> 0).toNumber(true) : message.revision_number; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (typeof message.revision_height === "number") - object.revision_height = options.longs === String ? String(message.revision_height) : message.revision_height; - else - object.revision_height = options.longs === String ? $util.Long.prototype.toString.call(message.revision_height) : options.longs === Number ? new $util.LongBits(message.revision_height.low >>> 0, message.revision_height.high >>> 0).toNumber(true) : message.revision_height; - return object; - }; - - /** - * Converts this Height to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.Height - * @instance - * @returns {Object.} JSON object - */ - Height.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Height; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.core.client.v1 - * @interface IParams - * @property {Array.|null} [allowed_clients] Params allowed_clients - */ - - /** - * Constructs a new Params. - * @memberof ibc.core.client.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.core.client.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - this.allowed_clients = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params allowed_clients. - * @member {Array.} allowed_clients - * @memberof ibc.core.client.v1.Params - * @instance - */ - Params.prototype.allowed_clients = $util.emptyArray; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.Params - * @static - * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowed_clients != null && message.allowed_clients.length) - for (let i = 0; i < message.allowed_clients.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowed_clients[i]); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.Params - * @static - * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Params(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.allowed_clients && message.allowed_clients.length)) - message.allowed_clients = []; - message.allowed_clients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.core.client.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowed_clients != null && message.hasOwnProperty("allowed_clients")) { - if (!Array.isArray(message.allowed_clients)) - return "allowed_clients: array expected"; - for (let i = 0; i < message.allowed_clients.length; ++i) - if (!$util.isString(message.allowed_clients[i])) - return "allowed_clients: string[] expected"; - } - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.Params) - return object; - let message = new $root.ibc.core.client.v1.Params(); - if (object.allowed_clients) { - if (!Array.isArray(object.allowed_clients)) - throw TypeError(".ibc.core.client.v1.Params.allowed_clients: array expected"); - message.allowed_clients = []; - for (let i = 0; i < object.allowed_clients.length; ++i) - message.allowed_clients[i] = String(object.allowed_clients[i]); - } - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.Params - * @static - * @param {ibc.core.client.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.allowed_clients = []; - if (message.allowed_clients && message.allowed_clients.length) { - object.allowed_clients = []; - for (let j = 0; j < message.allowed_clients.length; ++j) - object.allowed_clients[j] = message.allowed_clients[j]; - } - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.core.client.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#createClient}. - * @memberof ibc.core.client.v1.Msg - * @typedef CreateClientCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.MsgCreateClientResponse} [response] MsgCreateClientResponse - */ - - /** - * Calls CreateClient. - * @function createClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object - * @param {ibc.core.client.v1.Msg.CreateClientCallback} callback Node-style callback called with the error, if any, and MsgCreateClientResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.createClient = function createClient(request, callback) { - return this.rpcCall(createClient, $root.ibc.core.client.v1.MsgCreateClient, $root.ibc.core.client.v1.MsgCreateClientResponse, request, callback); - }, "name", { value: "CreateClient" }); - - /** - * Calls CreateClient. - * @function createClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgCreateClient} request MsgCreateClient message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#updateClient}. - * @memberof ibc.core.client.v1.Msg - * @typedef UpdateClientCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.MsgUpdateClientResponse} [response] MsgUpdateClientResponse - */ - - /** - * Calls UpdateClient. - * @function updateClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object - * @param {ibc.core.client.v1.Msg.UpdateClientCallback} callback Node-style callback called with the error, if any, and MsgUpdateClientResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.updateClient = function updateClient(request, callback) { - return this.rpcCall(updateClient, $root.ibc.core.client.v1.MsgUpdateClient, $root.ibc.core.client.v1.MsgUpdateClientResponse, request, callback); - }, "name", { value: "UpdateClient" }); - - /** - * Calls UpdateClient. - * @function updateClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgUpdateClient} request MsgUpdateClient message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#upgradeClient}. - * @memberof ibc.core.client.v1.Msg - * @typedef UpgradeClientCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.MsgUpgradeClientResponse} [response] MsgUpgradeClientResponse - */ - - /** - * Calls UpgradeClient. - * @function upgradeClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object - * @param {ibc.core.client.v1.Msg.UpgradeClientCallback} callback Node-style callback called with the error, if any, and MsgUpgradeClientResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.upgradeClient = function upgradeClient(request, callback) { - return this.rpcCall(upgradeClient, $root.ibc.core.client.v1.MsgUpgradeClient, $root.ibc.core.client.v1.MsgUpgradeClientResponse, request, callback); - }, "name", { value: "UpgradeClient" }); - - /** - * Calls UpgradeClient. - * @function upgradeClient - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgUpgradeClient} request MsgUpgradeClient message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Msg#submitMisbehaviour}. - * @memberof ibc.core.client.v1.Msg - * @typedef SubmitMisbehaviourCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} [response] MsgSubmitMisbehaviourResponse - */ - - /** - * Calls SubmitMisbehaviour. - * @function submitMisbehaviour - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object - * @param {ibc.core.client.v1.Msg.SubmitMisbehaviourCallback} callback Node-style callback called with the error, if any, and MsgSubmitMisbehaviourResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.submitMisbehaviour = function submitMisbehaviour(request, callback) { - return this.rpcCall(submitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviour, $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse, request, callback); - }, "name", { value: "SubmitMisbehaviour" }); - - /** - * Calls SubmitMisbehaviour. - * @function submitMisbehaviour - * @memberof ibc.core.client.v1.Msg - * @instance - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} request MsgSubmitMisbehaviour message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1.MsgCreateClient = (function() { - - /** - * Properties of a MsgCreateClient. - * @memberof ibc.core.client.v1 - * @interface IMsgCreateClient - * @property {google.protobuf.IAny|null} [client_state] MsgCreateClient client_state - * @property {google.protobuf.IAny|null} [consensus_state] MsgCreateClient consensus_state - * @property {string|null} [signer] MsgCreateClient signer - */ - - /** - * Constructs a new MsgCreateClient. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgCreateClient. - * @implements IMsgCreateClient - * @constructor - * @param {ibc.core.client.v1.IMsgCreateClient=} [properties] Properties to set - */ - function MsgCreateClient(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgCreateClient client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.client.v1.MsgCreateClient - * @instance - */ - MsgCreateClient.prototype.client_state = null; - - /** - * MsgCreateClient consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.client.v1.MsgCreateClient - * @instance - */ - MsgCreateClient.prototype.consensus_state = null; - - /** - * MsgCreateClient signer. - * @member {string} signer - * @memberof ibc.core.client.v1.MsgCreateClient - * @instance - */ - MsgCreateClient.prototype.signer = ""; - - /** - * Encodes the specified MsgCreateClient message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateClient.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgCreateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClient.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {ibc.core.client.v1.IMsgCreateClient} message MsgCreateClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateClient.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgCreateClient message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateClient.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClient(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgCreateClient message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateClient.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgCreateClient message. - * @function verify - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgCreateClient.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - let error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgCreateClient message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient - */ - MsgCreateClient.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgCreateClient) - return object; - let message = new $root.ibc.core.client.v1.MsgCreateClient(); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.client.v1.MsgCreateClient.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.MsgCreateClient.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgCreateClient message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgCreateClient - * @static - * @param {ibc.core.client.v1.MsgCreateClient} message MsgCreateClient - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgCreateClient.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_state = null; - object.consensus_state = null; - object.signer = ""; - } - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgCreateClient to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgCreateClient - * @instance - * @returns {Object.} JSON object - */ - MsgCreateClient.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgCreateClient; - })(); - - v1.MsgCreateClientResponse = (function() { - - /** - * Properties of a MsgCreateClientResponse. - * @memberof ibc.core.client.v1 - * @interface IMsgCreateClientResponse - */ - - /** - * Constructs a new MsgCreateClientResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgCreateClientResponse. - * @implements IMsgCreateClientResponse - * @constructor - * @param {ibc.core.client.v1.IMsgCreateClientResponse=} [properties] Properties to set - */ - function MsgCreateClientResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgCreateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateClientResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgCreateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgCreateClientResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {ibc.core.client.v1.IMsgCreateClientResponse} message MsgCreateClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgCreateClientResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateClientResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgCreateClientResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgCreateClientResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateClientResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgCreateClientResponse message. - * @function verify - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgCreateClientResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgCreateClientResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse - */ - MsgCreateClientResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgCreateClientResponse) - return object; - return new $root.ibc.core.client.v1.MsgCreateClientResponse(); - }; - - /** - * Creates a plain object from a MsgCreateClientResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @static - * @param {ibc.core.client.v1.MsgCreateClientResponse} message MsgCreateClientResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgCreateClientResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgCreateClientResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgCreateClientResponse - * @instance - * @returns {Object.} JSON object - */ - MsgCreateClientResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgCreateClientResponse; - })(); - - v1.MsgUpdateClient = (function() { - - /** - * Properties of a MsgUpdateClient. - * @memberof ibc.core.client.v1 - * @interface IMsgUpdateClient - * @property {string|null} [client_id] MsgUpdateClient client_id - * @property {google.protobuf.IAny|null} [header] MsgUpdateClient header - * @property {string|null} [signer] MsgUpdateClient signer - */ - - /** - * Constructs a new MsgUpdateClient. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgUpdateClient. - * @implements IMsgUpdateClient - * @constructor - * @param {ibc.core.client.v1.IMsgUpdateClient=} [properties] Properties to set - */ - function MsgUpdateClient(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgUpdateClient client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.MsgUpdateClient - * @instance - */ - MsgUpdateClient.prototype.client_id = ""; - - /** - * MsgUpdateClient header. - * @member {google.protobuf.IAny|null|undefined} header - * @memberof ibc.core.client.v1.MsgUpdateClient - * @instance - */ - MsgUpdateClient.prototype.header = null; - - /** - * MsgUpdateClient signer. - * @member {string} signer - * @memberof ibc.core.client.v1.MsgUpdateClient - * @instance - */ - MsgUpdateClient.prototype.signer = ""; - - /** - * Encodes the specified MsgUpdateClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateClient.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgUpdateClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClient.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {ibc.core.client.v1.IMsgUpdateClient} message MsgUpdateClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateClient.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpdateClient message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateClient.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClient(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.header = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpdateClient message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateClient.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpdateClient message. - * @function verify - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpdateClient.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.header != null && message.hasOwnProperty("header")) { - let error = $root.google.protobuf.Any.verify(message.header); - if (error) - return "header." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgUpdateClient message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient - */ - MsgUpdateClient.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgUpdateClient) - return object; - let message = new $root.ibc.core.client.v1.MsgUpdateClient(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".ibc.core.client.v1.MsgUpdateClient.header: object expected"); - message.header = $root.google.protobuf.Any.fromObject(object.header); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgUpdateClient message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgUpdateClient - * @static - * @param {ibc.core.client.v1.MsgUpdateClient} message MsgUpdateClient - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpdateClient.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - object.header = null; - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.google.protobuf.Any.toObject(message.header, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgUpdateClient to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgUpdateClient - * @instance - * @returns {Object.} JSON object - */ - MsgUpdateClient.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpdateClient; - })(); - - v1.MsgUpdateClientResponse = (function() { - - /** - * Properties of a MsgUpdateClientResponse. - * @memberof ibc.core.client.v1 - * @interface IMsgUpdateClientResponse - */ - - /** - * Constructs a new MsgUpdateClientResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgUpdateClientResponse. - * @implements IMsgUpdateClientResponse - * @constructor - * @param {ibc.core.client.v1.IMsgUpdateClientResponse=} [properties] Properties to set - */ - function MsgUpdateClientResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgUpdateClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateClientResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgUpdateClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpdateClientResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {ibc.core.client.v1.IMsgUpdateClientResponse} message MsgUpdateClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateClientResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpdateClientResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateClientResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpdateClientResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpdateClientResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateClientResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpdateClientResponse message. - * @function verify - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpdateClientResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgUpdateClientResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse - */ - MsgUpdateClientResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgUpdateClientResponse) - return object; - return new $root.ibc.core.client.v1.MsgUpdateClientResponse(); - }; - - /** - * Creates a plain object from a MsgUpdateClientResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @static - * @param {ibc.core.client.v1.MsgUpdateClientResponse} message MsgUpdateClientResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpdateClientResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgUpdateClientResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgUpdateClientResponse - * @instance - * @returns {Object.} JSON object - */ - MsgUpdateClientResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpdateClientResponse; - })(); - - v1.MsgUpgradeClient = (function() { - - /** - * Properties of a MsgUpgradeClient. - * @memberof ibc.core.client.v1 - * @interface IMsgUpgradeClient - * @property {string|null} [client_id] MsgUpgradeClient client_id - * @property {google.protobuf.IAny|null} [client_state] MsgUpgradeClient client_state - * @property {google.protobuf.IAny|null} [consensus_state] MsgUpgradeClient consensus_state - * @property {Uint8Array|null} [proof_upgrade_client] MsgUpgradeClient proof_upgrade_client - * @property {Uint8Array|null} [proof_upgrade_consensus_state] MsgUpgradeClient proof_upgrade_consensus_state - * @property {string|null} [signer] MsgUpgradeClient signer - */ - - /** - * Constructs a new MsgUpgradeClient. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgUpgradeClient. - * @implements IMsgUpgradeClient - * @constructor - * @param {ibc.core.client.v1.IMsgUpgradeClient=} [properties] Properties to set - */ - function MsgUpgradeClient(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgUpgradeClient client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.client_id = ""; - - /** - * MsgUpgradeClient client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.client_state = null; - - /** - * MsgUpgradeClient consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.consensus_state = null; - - /** - * MsgUpgradeClient proof_upgrade_client. - * @member {Uint8Array} proof_upgrade_client - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.proof_upgrade_client = $util.newBuffer([]); - - /** - * MsgUpgradeClient proof_upgrade_consensus_state. - * @member {Uint8Array} proof_upgrade_consensus_state - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.proof_upgrade_consensus_state = $util.newBuffer([]); - - /** - * MsgUpgradeClient signer. - * @member {string} signer - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - */ - MsgUpgradeClient.prototype.signer = ""; - - /** - * Encodes the specified MsgUpgradeClient message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpgradeClient.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.proof_upgrade_client != null && Object.hasOwnProperty.call(message, "proof_upgrade_client")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.proof_upgrade_client); - if (message.proof_upgrade_consensus_state != null && Object.hasOwnProperty.call(message, "proof_upgrade_consensus_state")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proof_upgrade_consensus_state); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgUpgradeClient message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClient.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {ibc.core.client.v1.IMsgUpgradeClient} message MsgUpgradeClient message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpgradeClient.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpgradeClient message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpgradeClient.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClient(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 4: - message.proof_upgrade_client = reader.bytes(); - break; - case 5: - message.proof_upgrade_consensus_state = reader.bytes(); - break; - case 6: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpgradeClient message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpgradeClient.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpgradeClient message. - * @function verify - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpgradeClient.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - let error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.proof_upgrade_client != null && message.hasOwnProperty("proof_upgrade_client")) - if (!(message.proof_upgrade_client && typeof message.proof_upgrade_client.length === "number" || $util.isString(message.proof_upgrade_client))) - return "proof_upgrade_client: buffer expected"; - if (message.proof_upgrade_consensus_state != null && message.hasOwnProperty("proof_upgrade_consensus_state")) - if (!(message.proof_upgrade_consensus_state && typeof message.proof_upgrade_consensus_state.length === "number" || $util.isString(message.proof_upgrade_consensus_state))) - return "proof_upgrade_consensus_state: buffer expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgUpgradeClient message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient - */ - MsgUpgradeClient.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClient) - return object; - let message = new $root.ibc.core.client.v1.MsgUpgradeClient(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.proof_upgrade_client != null) - if (typeof object.proof_upgrade_client === "string") - $util.base64.decode(object.proof_upgrade_client, message.proof_upgrade_client = $util.newBuffer($util.base64.length(object.proof_upgrade_client)), 0); - else if (object.proof_upgrade_client.length) - message.proof_upgrade_client = object.proof_upgrade_client; - if (object.proof_upgrade_consensus_state != null) - if (typeof object.proof_upgrade_consensus_state === "string") - $util.base64.decode(object.proof_upgrade_consensus_state, message.proof_upgrade_consensus_state = $util.newBuffer($util.base64.length(object.proof_upgrade_consensus_state)), 0); - else if (object.proof_upgrade_consensus_state.length) - message.proof_upgrade_consensus_state = object.proof_upgrade_consensus_state; - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgUpgradeClient message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @static - * @param {ibc.core.client.v1.MsgUpgradeClient} message MsgUpgradeClient - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpgradeClient.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - object.client_state = null; - object.consensus_state = null; - if (options.bytes === String) - object.proof_upgrade_client = ""; - else { - object.proof_upgrade_client = []; - if (options.bytes !== Array) - object.proof_upgrade_client = $util.newBuffer(object.proof_upgrade_client); - } - if (options.bytes === String) - object.proof_upgrade_consensus_state = ""; - else { - object.proof_upgrade_consensus_state = []; - if (options.bytes !== Array) - object.proof_upgrade_consensus_state = $util.newBuffer(object.proof_upgrade_consensus_state); - } - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.proof_upgrade_client != null && message.hasOwnProperty("proof_upgrade_client")) - object.proof_upgrade_client = options.bytes === String ? $util.base64.encode(message.proof_upgrade_client, 0, message.proof_upgrade_client.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_upgrade_client) : message.proof_upgrade_client; - if (message.proof_upgrade_consensus_state != null && message.hasOwnProperty("proof_upgrade_consensus_state")) - object.proof_upgrade_consensus_state = options.bytes === String ? $util.base64.encode(message.proof_upgrade_consensus_state, 0, message.proof_upgrade_consensus_state.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_upgrade_consensus_state) : message.proof_upgrade_consensus_state; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgUpgradeClient to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgUpgradeClient - * @instance - * @returns {Object.} JSON object - */ - MsgUpgradeClient.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpgradeClient; - })(); - - v1.MsgUpgradeClientResponse = (function() { - - /** - * Properties of a MsgUpgradeClientResponse. - * @memberof ibc.core.client.v1 - * @interface IMsgUpgradeClientResponse - */ - - /** - * Constructs a new MsgUpgradeClientResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgUpgradeClientResponse. - * @implements IMsgUpgradeClientResponse - * @constructor - * @param {ibc.core.client.v1.IMsgUpgradeClientResponse=} [properties] Properties to set - */ - function MsgUpgradeClientResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgUpgradeClientResponse message. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpgradeClientResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgUpgradeClientResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgUpgradeClientResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {ibc.core.client.v1.IMsgUpgradeClientResponse} message MsgUpgradeClientResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpgradeClientResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpgradeClientResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpgradeClientResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpgradeClientResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpgradeClientResponse message. - * @function verify - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpgradeClientResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgUpgradeClientResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse - */ - MsgUpgradeClientResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgUpgradeClientResponse) - return object; - return new $root.ibc.core.client.v1.MsgUpgradeClientResponse(); - }; - - /** - * Creates a plain object from a MsgUpgradeClientResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @static - * @param {ibc.core.client.v1.MsgUpgradeClientResponse} message MsgUpgradeClientResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpgradeClientResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgUpgradeClientResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgUpgradeClientResponse - * @instance - * @returns {Object.} JSON object - */ - MsgUpgradeClientResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpgradeClientResponse; - })(); - - v1.MsgSubmitMisbehaviour = (function() { - - /** - * Properties of a MsgSubmitMisbehaviour. - * @memberof ibc.core.client.v1 - * @interface IMsgSubmitMisbehaviour - * @property {string|null} [client_id] MsgSubmitMisbehaviour client_id - * @property {google.protobuf.IAny|null} [misbehaviour] MsgSubmitMisbehaviour misbehaviour - * @property {string|null} [signer] MsgSubmitMisbehaviour signer - */ - - /** - * Constructs a new MsgSubmitMisbehaviour. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgSubmitMisbehaviour. - * @implements IMsgSubmitMisbehaviour - * @constructor - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour=} [properties] Properties to set - */ - function MsgSubmitMisbehaviour(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitMisbehaviour client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @instance - */ - MsgSubmitMisbehaviour.prototype.client_id = ""; - - /** - * MsgSubmitMisbehaviour misbehaviour. - * @member {google.protobuf.IAny|null|undefined} misbehaviour - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @instance - */ - MsgSubmitMisbehaviour.prototype.misbehaviour = null; - - /** - * MsgSubmitMisbehaviour signer. - * @member {string} signer - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @instance - */ - MsgSubmitMisbehaviour.prototype.signer = ""; - - /** - * Encodes the specified MsgSubmitMisbehaviour message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitMisbehaviour.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.misbehaviour != null && Object.hasOwnProperty.call(message, "misbehaviour")) - $root.google.protobuf.Any.encode(message.misbehaviour, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgSubmitMisbehaviour message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviour.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviour} message MsgSubmitMisbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitMisbehaviour.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitMisbehaviour.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.misbehaviour = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitMisbehaviour message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitMisbehaviour.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitMisbehaviour message. - * @function verify - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitMisbehaviour.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) { - let error = $root.google.protobuf.Any.verify(message.misbehaviour); - if (error) - return "misbehaviour." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgSubmitMisbehaviour message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour - */ - MsgSubmitMisbehaviour.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviour) - return object; - let message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviour(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.misbehaviour != null) { - if (typeof object.misbehaviour !== "object") - throw TypeError(".ibc.core.client.v1.MsgSubmitMisbehaviour.misbehaviour: object expected"); - message.misbehaviour = $root.google.protobuf.Any.fromObject(object.misbehaviour); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitMisbehaviour message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @static - * @param {ibc.core.client.v1.MsgSubmitMisbehaviour} message MsgSubmitMisbehaviour - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitMisbehaviour.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - object.misbehaviour = null; - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.misbehaviour != null && message.hasOwnProperty("misbehaviour")) - object.misbehaviour = $root.google.protobuf.Any.toObject(message.misbehaviour, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgSubmitMisbehaviour to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviour - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitMisbehaviour.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitMisbehaviour; - })(); - - v1.MsgSubmitMisbehaviourResponse = (function() { - - /** - * Properties of a MsgSubmitMisbehaviourResponse. - * @memberof ibc.core.client.v1 - * @interface IMsgSubmitMisbehaviourResponse - */ - - /** - * Constructs a new MsgSubmitMisbehaviourResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a MsgSubmitMisbehaviourResponse. - * @implements IMsgSubmitMisbehaviourResponse - * @constructor - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse=} [properties] Properties to set - */ - function MsgSubmitMisbehaviourResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgSubmitMisbehaviourResponse message. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitMisbehaviourResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgSubmitMisbehaviourResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.MsgSubmitMisbehaviourResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitMisbehaviourResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitMisbehaviourResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitMisbehaviourResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitMisbehaviourResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitMisbehaviourResponse message. - * @function verify - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitMisbehaviourResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgSubmitMisbehaviourResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse - */ - MsgSubmitMisbehaviourResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse) - return object; - return new $root.ibc.core.client.v1.MsgSubmitMisbehaviourResponse(); - }; - - /** - * Creates a plain object from a MsgSubmitMisbehaviourResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @static - * @param {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} message MsgSubmitMisbehaviourResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitMisbehaviourResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgSubmitMisbehaviourResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitMisbehaviourResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitMisbehaviourResponse; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.core.client.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientState}. - * @memberof ibc.core.client.v1.Query - * @typedef ClientStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryClientStateResponse} [response] QueryClientStateResponse - */ - - /** - * Calls ClientState. - * @function clientState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object - * @param {ibc.core.client.v1.Query.ClientStateCallback} callback Node-style callback called with the error, if any, and QueryClientStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientState = function clientState(request, callback) { - return this.rpcCall(clientState, $root.ibc.core.client.v1.QueryClientStateRequest, $root.ibc.core.client.v1.QueryClientStateResponse, request, callback); - }, "name", { value: "ClientState" }); - - /** - * Calls ClientState. - * @function clientState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStateRequest} request QueryClientStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientStates}. - * @memberof ibc.core.client.v1.Query - * @typedef ClientStatesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryClientStatesResponse} [response] QueryClientStatesResponse - */ - - /** - * Calls ClientStates. - * @function clientStates - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object - * @param {ibc.core.client.v1.Query.ClientStatesCallback} callback Node-style callback called with the error, if any, and QueryClientStatesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientStates = function clientStates(request, callback) { - return this.rpcCall(clientStates, $root.ibc.core.client.v1.QueryClientStatesRequest, $root.ibc.core.client.v1.QueryClientStatesResponse, request, callback); - }, "name", { value: "ClientStates" }); - - /** - * Calls ClientStates. - * @function clientStates - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStatesRequest} request QueryClientStatesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#consensusState}. - * @memberof ibc.core.client.v1.Query - * @typedef ConsensusStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryConsensusStateResponse} [response] QueryConsensusStateResponse - */ - - /** - * Calls ConsensusState. - * @function consensusState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object - * @param {ibc.core.client.v1.Query.ConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryConsensusStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.consensusState = function consensusState(request, callback) { - return this.rpcCall(consensusState, $root.ibc.core.client.v1.QueryConsensusStateRequest, $root.ibc.core.client.v1.QueryConsensusStateResponse, request, callback); - }, "name", { value: "ConsensusState" }); - - /** - * Calls ConsensusState. - * @function consensusState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStateRequest} request QueryConsensusStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#consensusStates}. - * @memberof ibc.core.client.v1.Query - * @typedef ConsensusStatesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryConsensusStatesResponse} [response] QueryConsensusStatesResponse - */ - - /** - * Calls ConsensusStates. - * @function consensusStates - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object - * @param {ibc.core.client.v1.Query.ConsensusStatesCallback} callback Node-style callback called with the error, if any, and QueryConsensusStatesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.consensusStates = function consensusStates(request, callback) { - return this.rpcCall(consensusStates, $root.ibc.core.client.v1.QueryConsensusStatesRequest, $root.ibc.core.client.v1.QueryConsensusStatesResponse, request, callback); - }, "name", { value: "ConsensusStates" }); - - /** - * Calls ConsensusStates. - * @function consensusStates - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} request QueryConsensusStatesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#consensusStateHeights}. - * @memberof ibc.core.client.v1.Query - * @typedef ConsensusStateHeightsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryConsensusStateHeightsResponse} [response] QueryConsensusStateHeightsResponse - */ - - /** - * Calls ConsensusStateHeights. - * @function consensusStateHeights - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest} request QueryConsensusStateHeightsRequest message or plain object - * @param {ibc.core.client.v1.Query.ConsensusStateHeightsCallback} callback Node-style callback called with the error, if any, and QueryConsensusStateHeightsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.consensusStateHeights = function consensusStateHeights(request, callback) { - return this.rpcCall(consensusStateHeights, $root.ibc.core.client.v1.QueryConsensusStateHeightsRequest, $root.ibc.core.client.v1.QueryConsensusStateHeightsResponse, request, callback); - }, "name", { value: "ConsensusStateHeights" }); - - /** - * Calls ConsensusStateHeights. - * @function consensusStateHeights - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest} request QueryConsensusStateHeightsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientStatus}. - * @memberof ibc.core.client.v1.Query - * @typedef ClientStatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryClientStatusResponse} [response] QueryClientStatusResponse - */ - - /** - * Calls ClientStatus. - * @function clientStatus - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStatusRequest} request QueryClientStatusRequest message or plain object - * @param {ibc.core.client.v1.Query.ClientStatusCallback} callback Node-style callback called with the error, if any, and QueryClientStatusResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientStatus = function clientStatus(request, callback) { - return this.rpcCall(clientStatus, $root.ibc.core.client.v1.QueryClientStatusRequest, $root.ibc.core.client.v1.QueryClientStatusResponse, request, callback); - }, "name", { value: "ClientStatus" }); - - /** - * Calls ClientStatus. - * @function clientStatus - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientStatusRequest} request QueryClientStatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#clientParams}. - * @memberof ibc.core.client.v1.Query - * @typedef ClientParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryClientParamsResponse} [response] QueryClientParamsResponse - */ - - /** - * Calls ClientParams. - * @function clientParams - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object - * @param {ibc.core.client.v1.Query.ClientParamsCallback} callback Node-style callback called with the error, if any, and QueryClientParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientParams = function clientParams(request, callback) { - return this.rpcCall(clientParams, $root.ibc.core.client.v1.QueryClientParamsRequest, $root.ibc.core.client.v1.QueryClientParamsResponse, request, callback); - }, "name", { value: "ClientParams" }); - - /** - * Calls ClientParams. - * @function clientParams - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryClientParamsRequest} request QueryClientParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#upgradedClientState}. - * @memberof ibc.core.client.v1.Query - * @typedef UpgradedClientStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryUpgradedClientStateResponse} [response] QueryUpgradedClientStateResponse - */ - - /** - * Calls UpgradedClientState. - * @function upgradedClientState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest} request QueryUpgradedClientStateRequest message or plain object - * @param {ibc.core.client.v1.Query.UpgradedClientStateCallback} callback Node-style callback called with the error, if any, and QueryUpgradedClientStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.upgradedClientState = function upgradedClientState(request, callback) { - return this.rpcCall(upgradedClientState, $root.ibc.core.client.v1.QueryUpgradedClientStateRequest, $root.ibc.core.client.v1.QueryUpgradedClientStateResponse, request, callback); - }, "name", { value: "UpgradedClientState" }); - - /** - * Calls UpgradedClientState. - * @function upgradedClientState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest} request QueryUpgradedClientStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.client.v1.Query#upgradedConsensusState}. - * @memberof ibc.core.client.v1.Query - * @typedef UpgradedConsensusStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} [response] QueryUpgradedConsensusStateResponse - */ - - /** - * Calls UpgradedConsensusState. - * @function upgradedConsensusState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest} request QueryUpgradedConsensusStateRequest message or plain object - * @param {ibc.core.client.v1.Query.UpgradedConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryUpgradedConsensusStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.upgradedConsensusState = function upgradedConsensusState(request, callback) { - return this.rpcCall(upgradedConsensusState, $root.ibc.core.client.v1.QueryUpgradedConsensusStateRequest, $root.ibc.core.client.v1.QueryUpgradedConsensusStateResponse, request, callback); - }, "name", { value: "UpgradedConsensusState" }); - - /** - * Calls UpgradedConsensusState. - * @function upgradedConsensusState - * @memberof ibc.core.client.v1.Query - * @instance - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest} request QueryUpgradedConsensusStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryClientStateRequest = (function() { - - /** - * Properties of a QueryClientStateRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStateRequest - * @property {string|null} [client_id] QueryClientStateRequest client_id - */ - - /** - * Constructs a new QueryClientStateRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStateRequest. - * @implements IQueryClientStateRequest - * @constructor - * @param {ibc.core.client.v1.IQueryClientStateRequest=} [properties] Properties to set - */ - function QueryClientStateRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStateRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @instance - */ - QueryClientStateRequest.prototype.client_id = ""; - - /** - * Encodes the specified QueryClientStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - return writer; - }; - - /** - * Encodes the specified QueryClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStateRequest} message QueryClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStateRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - return null; - }; - - /** - * Creates a QueryClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest - */ - QueryClientStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStateRequest) - return object; - let message = new $root.ibc.core.client.v1.QueryClientStateRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - return message; - }; - - /** - * Creates a plain object from a QueryClientStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @static - * @param {ibc.core.client.v1.QueryClientStateRequest} message QueryClientStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - return object; - }; - - /** - * Converts this QueryClientStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStateRequest; - })(); - - v1.QueryClientStateResponse = (function() { - - /** - * Properties of a QueryClientStateResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStateResponse - * @property {google.protobuf.IAny|null} [client_state] QueryClientStateResponse client_state - * @property {Uint8Array|null} [proof] QueryClientStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryClientStateResponse proof_height - */ - - /** - * Constructs a new QueryClientStateResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStateResponse. - * @implements IQueryClientStateResponse - * @constructor - * @param {ibc.core.client.v1.IQueryClientStateResponse=} [properties] Properties to set - */ - function QueryClientStateResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStateResponse client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @instance - */ - QueryClientStateResponse.prototype.client_state = null; - - /** - * QueryClientStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @instance - */ - QueryClientStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryClientStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @instance - */ - QueryClientStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryClientStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStateResponse} message QueryClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStateResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStateResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - let error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse - */ - QueryClientStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStateResponse) - return object; - let message = new $root.ibc.core.client.v1.QueryClientStateResponse(); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @static - * @param {ibc.core.client.v1.QueryClientStateResponse} message QueryClientStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_state = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryClientStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStateResponse; - })(); - - v1.QueryClientStatesRequest = (function() { - - /** - * Properties of a QueryClientStatesRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStatesRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryClientStatesRequest pagination - */ - - /** - * Constructs a new QueryClientStatesRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStatesRequest. - * @implements IQueryClientStatesRequest - * @constructor - * @param {ibc.core.client.v1.IQueryClientStatesRequest=} [properties] Properties to set - */ - function QueryClientStatesRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStatesRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @instance - */ - QueryClientStatesRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryClientStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStatesRequest} message QueryClientStatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStatesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStatesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStatesRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStatesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryClientStatesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest - */ - QueryClientStatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStatesRequest) - return object; - let message = new $root.ibc.core.client.v1.QueryClientStatesRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStatesRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientStatesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @static - * @param {ibc.core.client.v1.QueryClientStatesRequest} message QueryClientStatesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStatesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryClientStatesRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStatesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientStatesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStatesRequest; - })(); - - v1.QueryClientStatesResponse = (function() { - - /** - * Properties of a QueryClientStatesResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStatesResponse - * @property {Array.|null} [client_states] QueryClientStatesResponse client_states - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryClientStatesResponse pagination - */ - - /** - * Constructs a new QueryClientStatesResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStatesResponse. - * @implements IQueryClientStatesResponse - * @constructor - * @param {ibc.core.client.v1.IQueryClientStatesResponse=} [properties] Properties to set - */ - function QueryClientStatesResponse(properties) { - this.client_states = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStatesResponse client_states. - * @member {Array.} client_states - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @instance - */ - QueryClientStatesResponse.prototype.client_states = $util.emptyArray; - - /** - * QueryClientStatesResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @instance - */ - QueryClientStatesResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryClientStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_states != null && message.client_states.length) - for (let i = 0; i < message.client_states.length; ++i) - $root.ibc.core.client.v1.IdentifiedClientState.encode(message.client_states[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStatesResponse} message QueryClientStatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStatesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.client_states && message.client_states.length)) - message.client_states = []; - message.client_states.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStatesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStatesResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStatesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_states != null && message.hasOwnProperty("client_states")) { - if (!Array.isArray(message.client_states)) - return "client_states: array expected"; - for (let i = 0; i < message.client_states.length; ++i) { - let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.client_states[i]); - if (error) - return "client_states." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryClientStatesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse - */ - QueryClientStatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStatesResponse) - return object; - let message = new $root.ibc.core.client.v1.QueryClientStatesResponse(); - if (object.client_states) { - if (!Array.isArray(object.client_states)) - throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.client_states: array expected"); - message.client_states = []; - for (let i = 0; i < object.client_states.length; ++i) { - if (typeof object.client_states[i] !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.client_states: object expected"); - message.client_states[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.client_states[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientStatesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @static - * @param {ibc.core.client.v1.QueryClientStatesResponse} message QueryClientStatesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStatesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.client_states = []; - if (options.defaults) - object.pagination = null; - if (message.client_states && message.client_states.length) { - object.client_states = []; - for (let j = 0; j < message.client_states.length; ++j) - object.client_states[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.client_states[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryClientStatesResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStatesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientStatesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStatesResponse; - })(); - - v1.QueryConsensusStateRequest = (function() { - - /** - * Properties of a QueryConsensusStateRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStateRequest - * @property {string|null} [client_id] QueryConsensusStateRequest client_id - * @property {Long|null} [revision_number] QueryConsensusStateRequest revision_number - * @property {Long|null} [revision_height] QueryConsensusStateRequest revision_height - * @property {boolean|null} [latest_height] QueryConsensusStateRequest latest_height - */ - - /** - * Constructs a new QueryConsensusStateRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStateRequest. - * @implements IQueryConsensusStateRequest - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStateRequest=} [properties] Properties to set - */ - function QueryConsensusStateRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStateRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - */ - QueryConsensusStateRequest.prototype.client_id = ""; - - /** - * QueryConsensusStateRequest revision_number. - * @member {Long} revision_number - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - */ - QueryConsensusStateRequest.prototype.revision_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryConsensusStateRequest revision_height. - * @member {Long} revision_height - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - */ - QueryConsensusStateRequest.prototype.revision_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryConsensusStateRequest latest_height. - * @member {boolean} latest_height - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - */ - QueryConsensusStateRequest.prototype.latest_height = false; - - /** - * Encodes the specified QueryConsensusStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.revision_number != null && Object.hasOwnProperty.call(message, "revision_number")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision_number); - if (message.revision_height != null && Object.hasOwnProperty.call(message, "revision_height")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revision_height); - if (message.latest_height != null && Object.hasOwnProperty.call(message, "latest_height")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.latest_height); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateRequest} message QueryConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.revision_number = reader.uint64(); - break; - case 3: - message.revision_height = reader.uint64(); - break; - case 4: - message.latest_height = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStateRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (!$util.isInteger(message.revision_number) && !(message.revision_number && $util.isInteger(message.revision_number.low) && $util.isInteger(message.revision_number.high))) - return "revision_number: integer|Long expected"; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (!$util.isInteger(message.revision_height) && !(message.revision_height && $util.isInteger(message.revision_height.low) && $util.isInteger(message.revision_height.high))) - return "revision_height: integer|Long expected"; - if (message.latest_height != null && message.hasOwnProperty("latest_height")) - if (typeof message.latest_height !== "boolean") - return "latest_height: boolean expected"; - return null; - }; - - /** - * Creates a QueryConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest - */ - QueryConsensusStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateRequest) - return object; - let message = new $root.ibc.core.client.v1.QueryConsensusStateRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.revision_number != null) - if ($util.Long) - (message.revision_number = $util.Long.fromValue(object.revision_number)).unsigned = true; - else if (typeof object.revision_number === "string") - message.revision_number = parseInt(object.revision_number, 10); - else if (typeof object.revision_number === "number") - message.revision_number = object.revision_number; - else if (typeof object.revision_number === "object") - message.revision_number = new $util.LongBits(object.revision_number.low >>> 0, object.revision_number.high >>> 0).toNumber(true); - if (object.revision_height != null) - if ($util.Long) - (message.revision_height = $util.Long.fromValue(object.revision_height)).unsigned = true; - else if (typeof object.revision_height === "string") - message.revision_height = parseInt(object.revision_height, 10); - else if (typeof object.revision_height === "number") - message.revision_height = object.revision_height; - else if (typeof object.revision_height === "object") - message.revision_height = new $util.LongBits(object.revision_height.low >>> 0, object.revision_height.high >>> 0).toNumber(true); - if (object.latest_height != null) - message.latest_height = Boolean(object.latest_height); - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @static - * @param {ibc.core.client.v1.QueryConsensusStateRequest} message QueryConsensusStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.revision_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_number = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.revision_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_height = options.longs === String ? "0" : 0; - object.latest_height = false; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (typeof message.revision_number === "number") - object.revision_number = options.longs === String ? String(message.revision_number) : message.revision_number; - else - object.revision_number = options.longs === String ? $util.Long.prototype.toString.call(message.revision_number) : options.longs === Number ? new $util.LongBits(message.revision_number.low >>> 0, message.revision_number.high >>> 0).toNumber(true) : message.revision_number; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (typeof message.revision_height === "number") - object.revision_height = options.longs === String ? String(message.revision_height) : message.revision_height; - else - object.revision_height = options.longs === String ? $util.Long.prototype.toString.call(message.revision_height) : options.longs === Number ? new $util.LongBits(message.revision_height.low >>> 0, message.revision_height.high >>> 0).toNumber(true) : message.revision_height; - if (message.latest_height != null && message.hasOwnProperty("latest_height")) - object.latest_height = message.latest_height; - return object; - }; - - /** - * Converts this QueryConsensusStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStateRequest; - })(); - - v1.QueryConsensusStateResponse = (function() { - - /** - * Properties of a QueryConsensusStateResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStateResponse - * @property {google.protobuf.IAny|null} [consensus_state] QueryConsensusStateResponse consensus_state - * @property {Uint8Array|null} [proof] QueryConsensusStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryConsensusStateResponse proof_height - */ - - /** - * Constructs a new QueryConsensusStateResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStateResponse. - * @implements IQueryConsensusStateResponse - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStateResponse=} [properties] Properties to set - */ - function QueryConsensusStateResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStateResponse consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @instance - */ - QueryConsensusStateResponse.prototype.consensus_state = null; - - /** - * QueryConsensusStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @instance - */ - QueryConsensusStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryConsensusStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @instance - */ - QueryConsensusStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryConsensusStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateResponse} message QueryConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStateResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse - */ - QueryConsensusStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateResponse) - return object; - let message = new $root.ibc.core.client.v1.QueryConsensusStateResponse(); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @static - * @param {ibc.core.client.v1.QueryConsensusStateResponse} message QueryConsensusStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.consensus_state = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryConsensusStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStateResponse; - })(); - - v1.QueryConsensusStatesRequest = (function() { - - /** - * Properties of a QueryConsensusStatesRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStatesRequest - * @property {string|null} [client_id] QueryConsensusStatesRequest client_id - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConsensusStatesRequest pagination - */ - - /** - * Constructs a new QueryConsensusStatesRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStatesRequest. - * @implements IQueryConsensusStatesRequest - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest=} [properties] Properties to set - */ - function QueryConsensusStatesRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStatesRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @instance - */ - QueryConsensusStatesRequest.prototype.client_id = ""; - - /** - * QueryConsensusStatesRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @instance - */ - QueryConsensusStatesRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryConsensusStatesRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStatesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStatesRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStatesRequest} message QueryConsensusStatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStatesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStatesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStatesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStatesRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStatesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStatesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest - */ - QueryConsensusStatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesRequest) - return object; - let message = new $root.ibc.core.client.v1.QueryConsensusStatesRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStatesRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStatesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @static - * @param {ibc.core.client.v1.QueryConsensusStatesRequest} message QueryConsensusStatesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStatesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - object.pagination = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConsensusStatesRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStatesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStatesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStatesRequest; - })(); - - v1.QueryConsensusStatesResponse = (function() { - - /** - * Properties of a QueryConsensusStatesResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStatesResponse - * @property {Array.|null} [consensus_states] QueryConsensusStatesResponse consensus_states - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConsensusStatesResponse pagination - */ - - /** - * Constructs a new QueryConsensusStatesResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStatesResponse. - * @implements IQueryConsensusStatesResponse - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStatesResponse=} [properties] Properties to set - */ - function QueryConsensusStatesResponse(properties) { - this.consensus_states = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStatesResponse consensus_states. - * @member {Array.} consensus_states - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @instance - */ - QueryConsensusStatesResponse.prototype.consensus_states = $util.emptyArray; - - /** - * QueryConsensusStatesResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @instance - */ - QueryConsensusStatesResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryConsensusStatesResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStatesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_states != null && message.consensus_states.length) - for (let i = 0; i < message.consensus_states.length; ++i) - $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensus_states[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStatesResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStatesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStatesResponse} message QueryConsensusStatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStatesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.consensus_states && message.consensus_states.length)) - message.consensus_states = []; - message.consensus_states.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStatesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStatesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStatesResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStatesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_states != null && message.hasOwnProperty("consensus_states")) { - if (!Array.isArray(message.consensus_states)) - return "consensus_states: array expected"; - for (let i = 0; i < message.consensus_states.length; ++i) { - let error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensus_states[i]); - if (error) - return "consensus_states." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStatesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse - */ - QueryConsensusStatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStatesResponse) - return object; - let message = new $root.ibc.core.client.v1.QueryConsensusStatesResponse(); - if (object.consensus_states) { - if (!Array.isArray(object.consensus_states)) - throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensus_states: array expected"); - message.consensus_states = []; - for (let i = 0; i < object.consensus_states.length; ++i) { - if (typeof object.consensus_states[i] !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensus_states: object expected"); - message.consensus_states[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensus_states[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStatesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @static - * @param {ibc.core.client.v1.QueryConsensusStatesResponse} message QueryConsensusStatesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStatesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.consensus_states = []; - if (options.defaults) - object.pagination = null; - if (message.consensus_states && message.consensus_states.length) { - object.consensus_states = []; - for (let j = 0; j < message.consensus_states.length; ++j) - object.consensus_states[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensus_states[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConsensusStatesResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStatesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStatesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStatesResponse; - })(); - - v1.QueryConsensusStateHeightsRequest = (function() { - - /** - * Properties of a QueryConsensusStateHeightsRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStateHeightsRequest - * @property {string|null} [client_id] QueryConsensusStateHeightsRequest client_id - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConsensusStateHeightsRequest pagination - */ - - /** - * Constructs a new QueryConsensusStateHeightsRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStateHeightsRequest. - * @implements IQueryConsensusStateHeightsRequest - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest=} [properties] Properties to set - */ - function QueryConsensusStateHeightsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStateHeightsRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @instance - */ - QueryConsensusStateHeightsRequest.prototype.client_id = ""; - - /** - * QueryConsensusStateHeightsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @instance - */ - QueryConsensusStateHeightsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryConsensusStateHeightsRequest message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest} message QueryConsensusStateHeightsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateHeightsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStateHeightsRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsRequest} message QueryConsensusStateHeightsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateHeightsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStateHeightsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsRequest} QueryConsensusStateHeightsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateHeightsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateHeightsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStateHeightsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsRequest} QueryConsensusStateHeightsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateHeightsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStateHeightsRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStateHeightsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStateHeightsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsRequest} QueryConsensusStateHeightsRequest - */ - QueryConsensusStateHeightsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateHeightsRequest) - return object; - let message = new $root.ibc.core.client.v1.QueryConsensusStateHeightsRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateHeightsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStateHeightsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @static - * @param {ibc.core.client.v1.QueryConsensusStateHeightsRequest} message QueryConsensusStateHeightsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStateHeightsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - object.pagination = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConsensusStateHeightsRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStateHeightsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStateHeightsRequest; - })(); - - v1.QueryConsensusStateHeightsResponse = (function() { - - /** - * Properties of a QueryConsensusStateHeightsResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryConsensusStateHeightsResponse - * @property {Array.|null} [consensus_state_heights] QueryConsensusStateHeightsResponse consensus_state_heights - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConsensusStateHeightsResponse pagination - */ - - /** - * Constructs a new QueryConsensusStateHeightsResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryConsensusStateHeightsResponse. - * @implements IQueryConsensusStateHeightsResponse - * @constructor - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsResponse=} [properties] Properties to set - */ - function QueryConsensusStateHeightsResponse(properties) { - this.consensus_state_heights = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConsensusStateHeightsResponse consensus_state_heights. - * @member {Array.} consensus_state_heights - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @instance - */ - QueryConsensusStateHeightsResponse.prototype.consensus_state_heights = $util.emptyArray; - - /** - * QueryConsensusStateHeightsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @instance - */ - QueryConsensusStateHeightsResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryConsensusStateHeightsResponse message. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsResponse} message QueryConsensusStateHeightsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateHeightsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_state_heights != null && message.consensus_state_heights.length) - for (let i = 0; i < message.consensus_state_heights.length; ++i) - $root.ibc.core.client.v1.Height.encode(message.consensus_state_heights[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConsensusStateHeightsResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryConsensusStateHeightsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {ibc.core.client.v1.IQueryConsensusStateHeightsResponse} message QueryConsensusStateHeightsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConsensusStateHeightsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConsensusStateHeightsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsResponse} QueryConsensusStateHeightsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateHeightsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryConsensusStateHeightsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.consensus_state_heights && message.consensus_state_heights.length)) - message.consensus_state_heights = []; - message.consensus_state_heights.push($root.ibc.core.client.v1.Height.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConsensusStateHeightsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsResponse} QueryConsensusStateHeightsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConsensusStateHeightsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConsensusStateHeightsResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConsensusStateHeightsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_state_heights != null && message.hasOwnProperty("consensus_state_heights")) { - if (!Array.isArray(message.consensus_state_heights)) - return "consensus_state_heights: array expected"; - for (let i = 0; i < message.consensus_state_heights.length; ++i) { - let error = $root.ibc.core.client.v1.Height.verify(message.consensus_state_heights[i]); - if (error) - return "consensus_state_heights." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConsensusStateHeightsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryConsensusStateHeightsResponse} QueryConsensusStateHeightsResponse - */ - QueryConsensusStateHeightsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryConsensusStateHeightsResponse) - return object; - let message = new $root.ibc.core.client.v1.QueryConsensusStateHeightsResponse(); - if (object.consensus_state_heights) { - if (!Array.isArray(object.consensus_state_heights)) - throw TypeError(".ibc.core.client.v1.QueryConsensusStateHeightsResponse.consensus_state_heights: array expected"); - message.consensus_state_heights = []; - for (let i = 0; i < object.consensus_state_heights.length; ++i) { - if (typeof object.consensus_state_heights[i] !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateHeightsResponse.consensus_state_heights: object expected"); - message.consensus_state_heights[i] = $root.ibc.core.client.v1.Height.fromObject(object.consensus_state_heights[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.client.v1.QueryConsensusStateHeightsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConsensusStateHeightsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @static - * @param {ibc.core.client.v1.QueryConsensusStateHeightsResponse} message QueryConsensusStateHeightsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConsensusStateHeightsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.consensus_state_heights = []; - if (options.defaults) - object.pagination = null; - if (message.consensus_state_heights && message.consensus_state_heights.length) { - object.consensus_state_heights = []; - for (let j = 0; j < message.consensus_state_heights.length; ++j) - object.consensus_state_heights[j] = $root.ibc.core.client.v1.Height.toObject(message.consensus_state_heights[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConsensusStateHeightsResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryConsensusStateHeightsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConsensusStateHeightsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConsensusStateHeightsResponse; - })(); - - v1.QueryClientStatusRequest = (function() { - - /** - * Properties of a QueryClientStatusRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStatusRequest - * @property {string|null} [client_id] QueryClientStatusRequest client_id - */ - - /** - * Constructs a new QueryClientStatusRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStatusRequest. - * @implements IQueryClientStatusRequest - * @constructor - * @param {ibc.core.client.v1.IQueryClientStatusRequest=} [properties] Properties to set - */ - function QueryClientStatusRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStatusRequest client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @instance - */ - QueryClientStatusRequest.prototype.client_id = ""; - - /** - * Encodes the specified QueryClientStatusRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStatusRequest} message QueryClientStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatusRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - return writer; - }; - - /** - * Encodes the specified QueryClientStatusRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {ibc.core.client.v1.IQueryClientStatusRequest} message QueryClientStatusRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStatusRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStatusRequest} QueryClientStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatusRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatusRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStatusRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStatusRequest} QueryClientStatusRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatusRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStatusRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStatusRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - return null; - }; - - /** - * Creates a QueryClientStatusRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStatusRequest} QueryClientStatusRequest - */ - QueryClientStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStatusRequest) - return object; - let message = new $root.ibc.core.client.v1.QueryClientStatusRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - return message; - }; - - /** - * Creates a plain object from a QueryClientStatusRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @static - * @param {ibc.core.client.v1.QueryClientStatusRequest} message QueryClientStatusRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStatusRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - return object; - }; - - /** - * Converts this QueryClientStatusRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStatusRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientStatusRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStatusRequest; - })(); - - v1.QueryClientStatusResponse = (function() { - - /** - * Properties of a QueryClientStatusResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryClientStatusResponse - * @property {string|null} [status] QueryClientStatusResponse status - */ - - /** - * Constructs a new QueryClientStatusResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientStatusResponse. - * @implements IQueryClientStatusResponse - * @constructor - * @param {ibc.core.client.v1.IQueryClientStatusResponse=} [properties] Properties to set - */ - function QueryClientStatusResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientStatusResponse status. - * @member {string} status - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @instance - */ - QueryClientStatusResponse.prototype.status = ""; - - /** - * Encodes the specified QueryClientStatusResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStatusResponse} message QueryClientStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatusResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.status); - return writer; - }; - - /** - * Encodes the specified QueryClientStatusResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientStatusResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {ibc.core.client.v1.IQueryClientStatusResponse} message QueryClientStatusResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientStatusResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientStatusResponse} QueryClientStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatusResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientStatusResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.status = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientStatusResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientStatusResponse} QueryClientStatusResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientStatusResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientStatusResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientStatusResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) - if (!$util.isString(message.status)) - return "status: string expected"; - return null; - }; - - /** - * Creates a QueryClientStatusResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientStatusResponse} QueryClientStatusResponse - */ - QueryClientStatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientStatusResponse) - return object; - let message = new $root.ibc.core.client.v1.QueryClientStatusResponse(); - if (object.status != null) - message.status = String(object.status); - return message; - }; - - /** - * Creates a plain object from a QueryClientStatusResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @static - * @param {ibc.core.client.v1.QueryClientStatusResponse} message QueryClientStatusResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientStatusResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.status = ""; - if (message.status != null && message.hasOwnProperty("status")) - object.status = message.status; - return object; - }; - - /** - * Converts this QueryClientStatusResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientStatusResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientStatusResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientStatusResponse; - })(); - - v1.QueryClientParamsRequest = (function() { - - /** - * Properties of a QueryClientParamsRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryClientParamsRequest - */ - - /** - * Constructs a new QueryClientParamsRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientParamsRequest. - * @implements IQueryClientParamsRequest - * @constructor - * @param {ibc.core.client.v1.IQueryClientParamsRequest=} [properties] Properties to set - */ - function QueryClientParamsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryClientParamsRequest message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryClientParamsRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {ibc.core.client.v1.IQueryClientParamsRequest} message QueryClientParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientParamsRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryClientParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest - */ - QueryClientParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientParamsRequest) - return object; - return new $root.ibc.core.client.v1.QueryClientParamsRequest(); - }; - - /** - * Creates a plain object from a QueryClientParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @static - * @param {ibc.core.client.v1.QueryClientParamsRequest} message QueryClientParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryClientParamsRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientParamsRequest; - })(); - - v1.QueryClientParamsResponse = (function() { - - /** - * Properties of a QueryClientParamsResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryClientParamsResponse - * @property {ibc.core.client.v1.IParams|null} [params] QueryClientParamsResponse params - */ - - /** - * Constructs a new QueryClientParamsResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryClientParamsResponse. - * @implements IQueryClientParamsResponse - * @constructor - * @param {ibc.core.client.v1.IQueryClientParamsResponse=} [properties] Properties to set - */ - function QueryClientParamsResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientParamsResponse params. - * @member {ibc.core.client.v1.IParams|null|undefined} params - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @instance - */ - QueryClientParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryClientParamsResponse message. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientParamsResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryClientParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {ibc.core.client.v1.IQueryClientParamsResponse} message QueryClientParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientParamsResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - let error = $root.ibc.core.client.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryClientParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse - */ - QueryClientParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryClientParamsResponse) - return object; - let message = new $root.ibc.core.client.v1.QueryClientParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.core.client.v1.QueryClientParamsResponse.params: object expected"); - message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @static - * @param {ibc.core.client.v1.QueryClientParamsResponse} message QueryClientParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryClientParamsResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryClientParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientParamsResponse; - })(); - - v1.QueryUpgradedClientStateRequest = (function() { - - /** - * Properties of a QueryUpgradedClientStateRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryUpgradedClientStateRequest - */ - - /** - * Constructs a new QueryUpgradedClientStateRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryUpgradedClientStateRequest. - * @implements IQueryUpgradedClientStateRequest - * @constructor - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest=} [properties] Properties to set - */ - function QueryUpgradedClientStateRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryUpgradedClientStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest} message QueryUpgradedClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedClientStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryUpgradedClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {ibc.core.client.v1.IQueryUpgradedClientStateRequest} message QueryUpgradedClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUpgradedClientStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryUpgradedClientStateRequest} QueryUpgradedClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedClientStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryUpgradedClientStateRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUpgradedClientStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryUpgradedClientStateRequest} QueryUpgradedClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedClientStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUpgradedClientStateRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUpgradedClientStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryUpgradedClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryUpgradedClientStateRequest} QueryUpgradedClientStateRequest - */ - QueryUpgradedClientStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryUpgradedClientStateRequest) - return object; - return new $root.ibc.core.client.v1.QueryUpgradedClientStateRequest(); - }; - - /** - * Creates a plain object from a QueryUpgradedClientStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @static - * @param {ibc.core.client.v1.QueryUpgradedClientStateRequest} message QueryUpgradedClientStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUpgradedClientStateRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryUpgradedClientStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryUpgradedClientStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryUpgradedClientStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUpgradedClientStateRequest; - })(); - - v1.QueryUpgradedClientStateResponse = (function() { - - /** - * Properties of a QueryUpgradedClientStateResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryUpgradedClientStateResponse - * @property {google.protobuf.IAny|null} [upgraded_client_state] QueryUpgradedClientStateResponse upgraded_client_state - */ - - /** - * Constructs a new QueryUpgradedClientStateResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryUpgradedClientStateResponse. - * @implements IQueryUpgradedClientStateResponse - * @constructor - * @param {ibc.core.client.v1.IQueryUpgradedClientStateResponse=} [properties] Properties to set - */ - function QueryUpgradedClientStateResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUpgradedClientStateResponse upgraded_client_state. - * @member {google.protobuf.IAny|null|undefined} upgraded_client_state - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @instance - */ - QueryUpgradedClientStateResponse.prototype.upgraded_client_state = null; - - /** - * Encodes the specified QueryUpgradedClientStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {ibc.core.client.v1.IQueryUpgradedClientStateResponse} message QueryUpgradedClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedClientStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.upgraded_client_state != null && Object.hasOwnProperty.call(message, "upgraded_client_state")) - $root.google.protobuf.Any.encode(message.upgraded_client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryUpgradedClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedClientStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {ibc.core.client.v1.IQueryUpgradedClientStateResponse} message QueryUpgradedClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUpgradedClientStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryUpgradedClientStateResponse} QueryUpgradedClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedClientStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryUpgradedClientStateResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.upgraded_client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUpgradedClientStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryUpgradedClientStateResponse} QueryUpgradedClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedClientStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUpgradedClientStateResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUpgradedClientStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) { - let error = $root.google.protobuf.Any.verify(message.upgraded_client_state); - if (error) - return "upgraded_client_state." + error; - } - return null; - }; - - /** - * Creates a QueryUpgradedClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryUpgradedClientStateResponse} QueryUpgradedClientStateResponse - */ - QueryUpgradedClientStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryUpgradedClientStateResponse) - return object; - let message = new $root.ibc.core.client.v1.QueryUpgradedClientStateResponse(); - if (object.upgraded_client_state != null) { - if (typeof object.upgraded_client_state !== "object") - throw TypeError(".ibc.core.client.v1.QueryUpgradedClientStateResponse.upgraded_client_state: object expected"); - message.upgraded_client_state = $root.google.protobuf.Any.fromObject(object.upgraded_client_state); - } - return message; - }; - - /** - * Creates a plain object from a QueryUpgradedClientStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @static - * @param {ibc.core.client.v1.QueryUpgradedClientStateResponse} message QueryUpgradedClientStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUpgradedClientStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.upgraded_client_state = null; - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) - object.upgraded_client_state = $root.google.protobuf.Any.toObject(message.upgraded_client_state, options); - return object; - }; - - /** - * Converts this QueryUpgradedClientStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryUpgradedClientStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryUpgradedClientStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUpgradedClientStateResponse; - })(); - - v1.QueryUpgradedConsensusStateRequest = (function() { - - /** - * Properties of a QueryUpgradedConsensusStateRequest. - * @memberof ibc.core.client.v1 - * @interface IQueryUpgradedConsensusStateRequest - */ - - /** - * Constructs a new QueryUpgradedConsensusStateRequest. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryUpgradedConsensusStateRequest. - * @implements IQueryUpgradedConsensusStateRequest - * @constructor - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest=} [properties] Properties to set - */ - function QueryUpgradedConsensusStateRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryUpgradedConsensusStateRequest message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest} message QueryUpgradedConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedConsensusStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryUpgradedConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateRequest} message QueryUpgradedConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUpgradedConsensusStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedConsensusStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryUpgradedConsensusStateRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUpgradedConsensusStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUpgradedConsensusStateRequest message. - * @function verify - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUpgradedConsensusStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryUpgradedConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateRequest} QueryUpgradedConsensusStateRequest - */ - QueryUpgradedConsensusStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryUpgradedConsensusStateRequest) - return object; - return new $root.ibc.core.client.v1.QueryUpgradedConsensusStateRequest(); - }; - - /** - * Creates a plain object from a QueryUpgradedConsensusStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @static - * @param {ibc.core.client.v1.QueryUpgradedConsensusStateRequest} message QueryUpgradedConsensusStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUpgradedConsensusStateRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryUpgradedConsensusStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryUpgradedConsensusStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUpgradedConsensusStateRequest; - })(); - - v1.QueryUpgradedConsensusStateResponse = (function() { - - /** - * Properties of a QueryUpgradedConsensusStateResponse. - * @memberof ibc.core.client.v1 - * @interface IQueryUpgradedConsensusStateResponse - * @property {google.protobuf.IAny|null} [upgraded_consensus_state] QueryUpgradedConsensusStateResponse upgraded_consensus_state - */ - - /** - * Constructs a new QueryUpgradedConsensusStateResponse. - * @memberof ibc.core.client.v1 - * @classdesc Represents a QueryUpgradedConsensusStateResponse. - * @implements IQueryUpgradedConsensusStateResponse - * @constructor - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateResponse=} [properties] Properties to set - */ - function QueryUpgradedConsensusStateResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryUpgradedConsensusStateResponse upgraded_consensus_state. - * @member {google.protobuf.IAny|null|undefined} upgraded_consensus_state - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @instance - */ - QueryUpgradedConsensusStateResponse.prototype.upgraded_consensus_state = null; - - /** - * Encodes the specified QueryUpgradedConsensusStateResponse message. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateResponse} message QueryUpgradedConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedConsensusStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.upgraded_consensus_state != null && Object.hasOwnProperty.call(message, "upgraded_consensus_state")) - $root.google.protobuf.Any.encode(message.upgraded_consensus_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryUpgradedConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.client.v1.QueryUpgradedConsensusStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {ibc.core.client.v1.IQueryUpgradedConsensusStateResponse} message QueryUpgradedConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryUpgradedConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryUpgradedConsensusStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedConsensusStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.QueryUpgradedConsensusStateResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.upgraded_consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryUpgradedConsensusStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryUpgradedConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryUpgradedConsensusStateResponse message. - * @function verify - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryUpgradedConsensusStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.upgraded_consensus_state != null && message.hasOwnProperty("upgraded_consensus_state")) { - let error = $root.google.protobuf.Any.verify(message.upgraded_consensus_state); - if (error) - return "upgraded_consensus_state." + error; - } - return null; - }; - - /** - * Creates a QueryUpgradedConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} QueryUpgradedConsensusStateResponse - */ - QueryUpgradedConsensusStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.QueryUpgradedConsensusStateResponse) - return object; - let message = new $root.ibc.core.client.v1.QueryUpgradedConsensusStateResponse(); - if (object.upgraded_consensus_state != null) { - if (typeof object.upgraded_consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.QueryUpgradedConsensusStateResponse.upgraded_consensus_state: object expected"); - message.upgraded_consensus_state = $root.google.protobuf.Any.fromObject(object.upgraded_consensus_state); - } - return message; - }; - - /** - * Creates a plain object from a QueryUpgradedConsensusStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @static - * @param {ibc.core.client.v1.QueryUpgradedConsensusStateResponse} message QueryUpgradedConsensusStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryUpgradedConsensusStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.upgraded_consensus_state = null; - if (message.upgraded_consensus_state != null && message.hasOwnProperty("upgraded_consensus_state")) - object.upgraded_consensus_state = $root.google.protobuf.Any.toObject(message.upgraded_consensus_state, options); - return object; - }; - - /** - * Converts this QueryUpgradedConsensusStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.QueryUpgradedConsensusStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryUpgradedConsensusStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryUpgradedConsensusStateResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.core.client.v1 - * @interface IGenesisState - * @property {Array.|null} [clients] GenesisState clients - * @property {Array.|null} [clients_consensus] GenesisState clients_consensus - * @property {Array.|null} [clients_metadata] GenesisState clients_metadata - * @property {ibc.core.client.v1.IParams|null} [params] GenesisState params - * @property {boolean|null} [create_localhost] GenesisState create_localhost - * @property {Long|null} [next_client_sequence] GenesisState next_client_sequence - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.core.client.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.core.client.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.clients = []; - this.clients_consensus = []; - this.clients_metadata = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState clients. - * @member {Array.} clients - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.clients = $util.emptyArray; - - /** - * GenesisState clients_consensus. - * @member {Array.} clients_consensus - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.clients_consensus = $util.emptyArray; - - /** - * GenesisState clients_metadata. - * @member {Array.} clients_metadata - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.clients_metadata = $util.emptyArray; - - /** - * GenesisState params. - * @member {ibc.core.client.v1.IParams|null|undefined} params - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * GenesisState create_localhost. - * @member {boolean} create_localhost - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.create_localhost = false; - - /** - * GenesisState next_client_sequence. - * @member {Long} next_client_sequence - * @memberof ibc.core.client.v1.GenesisState - * @instance - */ - GenesisState.prototype.next_client_sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clients != null && message.clients.length) - for (let i = 0; i < message.clients.length; ++i) - $root.ibc.core.client.v1.IdentifiedClientState.encode(message.clients[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.clients_consensus != null && message.clients_consensus.length) - for (let i = 0; i < message.clients_consensus.length; ++i) - $root.ibc.core.client.v1.ClientConsensusStates.encode(message.clients_consensus[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.clients_metadata != null && message.clients_metadata.length) - for (let i = 0; i < message.clients_metadata.length; ++i) - $root.ibc.core.client.v1.IdentifiedGenesisMetadata.encode(message.clients_metadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.core.client.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.create_localhost != null && Object.hasOwnProperty.call(message, "create_localhost")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.create_localhost); - if (message.next_client_sequence != null && Object.hasOwnProperty.call(message, "next_client_sequence")) - writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.next_client_sequence); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {ibc.core.client.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.clients && message.clients.length)) - message.clients = []; - message.clients.push($root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.clients_consensus && message.clients_consensus.length)) - message.clients_consensus = []; - message.clients_consensus.push($root.ibc.core.client.v1.ClientConsensusStates.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.clients_metadata && message.clients_metadata.length)) - message.clients_metadata = []; - message.clients_metadata.push($root.ibc.core.client.v1.IdentifiedGenesisMetadata.decode(reader, reader.uint32())); - break; - case 4: - message.params = $root.ibc.core.client.v1.Params.decode(reader, reader.uint32()); - break; - case 5: - message.create_localhost = reader.bool(); - break; - case 6: - message.next_client_sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clients != null && message.hasOwnProperty("clients")) { - if (!Array.isArray(message.clients)) - return "clients: array expected"; - for (let i = 0; i < message.clients.length; ++i) { - let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.clients[i]); - if (error) - return "clients." + error; - } - } - if (message.clients_consensus != null && message.hasOwnProperty("clients_consensus")) { - if (!Array.isArray(message.clients_consensus)) - return "clients_consensus: array expected"; - for (let i = 0; i < message.clients_consensus.length; ++i) { - let error = $root.ibc.core.client.v1.ClientConsensusStates.verify(message.clients_consensus[i]); - if (error) - return "clients_consensus." + error; - } - } - if (message.clients_metadata != null && message.hasOwnProperty("clients_metadata")) { - if (!Array.isArray(message.clients_metadata)) - return "clients_metadata: array expected"; - for (let i = 0; i < message.clients_metadata.length; ++i) { - let error = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.verify(message.clients_metadata[i]); - if (error) - return "clients_metadata." + error; - } - } - if (message.params != null && message.hasOwnProperty("params")) { - let error = $root.ibc.core.client.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - if (message.create_localhost != null && message.hasOwnProperty("create_localhost")) - if (typeof message.create_localhost !== "boolean") - return "create_localhost: boolean expected"; - if (message.next_client_sequence != null && message.hasOwnProperty("next_client_sequence")) - if (!$util.isInteger(message.next_client_sequence) && !(message.next_client_sequence && $util.isInteger(message.next_client_sequence.low) && $util.isInteger(message.next_client_sequence.high))) - return "next_client_sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.GenesisState) - return object; - let message = new $root.ibc.core.client.v1.GenesisState(); - if (object.clients) { - if (!Array.isArray(object.clients)) - throw TypeError(".ibc.core.client.v1.GenesisState.clients: array expected"); - message.clients = []; - for (let i = 0; i < object.clients.length; ++i) { - if (typeof object.clients[i] !== "object") - throw TypeError(".ibc.core.client.v1.GenesisState.clients: object expected"); - message.clients[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.clients[i]); - } - } - if (object.clients_consensus) { - if (!Array.isArray(object.clients_consensus)) - throw TypeError(".ibc.core.client.v1.GenesisState.clients_consensus: array expected"); - message.clients_consensus = []; - for (let i = 0; i < object.clients_consensus.length; ++i) { - if (typeof object.clients_consensus[i] !== "object") - throw TypeError(".ibc.core.client.v1.GenesisState.clients_consensus: object expected"); - message.clients_consensus[i] = $root.ibc.core.client.v1.ClientConsensusStates.fromObject(object.clients_consensus[i]); - } - } - if (object.clients_metadata) { - if (!Array.isArray(object.clients_metadata)) - throw TypeError(".ibc.core.client.v1.GenesisState.clients_metadata: array expected"); - message.clients_metadata = []; - for (let i = 0; i < object.clients_metadata.length; ++i) { - if (typeof object.clients_metadata[i] !== "object") - throw TypeError(".ibc.core.client.v1.GenesisState.clients_metadata: object expected"); - message.clients_metadata[i] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.fromObject(object.clients_metadata[i]); - } - } - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.core.client.v1.GenesisState.params: object expected"); - message.params = $root.ibc.core.client.v1.Params.fromObject(object.params); - } - if (object.create_localhost != null) - message.create_localhost = Boolean(object.create_localhost); - if (object.next_client_sequence != null) - if ($util.Long) - (message.next_client_sequence = $util.Long.fromValue(object.next_client_sequence)).unsigned = true; - else if (typeof object.next_client_sequence === "string") - message.next_client_sequence = parseInt(object.next_client_sequence, 10); - else if (typeof object.next_client_sequence === "number") - message.next_client_sequence = object.next_client_sequence; - else if (typeof object.next_client_sequence === "object") - message.next_client_sequence = new $util.LongBits(object.next_client_sequence.low >>> 0, object.next_client_sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.GenesisState - * @static - * @param {ibc.core.client.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.clients = []; - object.clients_consensus = []; - object.clients_metadata = []; - } - if (options.defaults) { - object.params = null; - object.create_localhost = false; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.next_client_sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_client_sequence = options.longs === String ? "0" : 0; - } - if (message.clients && message.clients.length) { - object.clients = []; - for (let j = 0; j < message.clients.length; ++j) - object.clients[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.clients[j], options); - } - if (message.clients_consensus && message.clients_consensus.length) { - object.clients_consensus = []; - for (let j = 0; j < message.clients_consensus.length; ++j) - object.clients_consensus[j] = $root.ibc.core.client.v1.ClientConsensusStates.toObject(message.clients_consensus[j], options); - } - if (message.clients_metadata && message.clients_metadata.length) { - object.clients_metadata = []; - for (let j = 0; j < message.clients_metadata.length; ++j) - object.clients_metadata[j] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.toObject(message.clients_metadata[j], options); - } - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options); - if (message.create_localhost != null && message.hasOwnProperty("create_localhost")) - object.create_localhost = message.create_localhost; - if (message.next_client_sequence != null && message.hasOwnProperty("next_client_sequence")) - if (typeof message.next_client_sequence === "number") - object.next_client_sequence = options.longs === String ? String(message.next_client_sequence) : message.next_client_sequence; - else - object.next_client_sequence = options.longs === String ? $util.Long.prototype.toString.call(message.next_client_sequence) : options.longs === Number ? new $util.LongBits(message.next_client_sequence.low >>> 0, message.next_client_sequence.high >>> 0).toNumber(true) : message.next_client_sequence; - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - v1.GenesisMetadata = (function() { - - /** - * Properties of a GenesisMetadata. - * @memberof ibc.core.client.v1 - * @interface IGenesisMetadata - * @property {Uint8Array|null} [key] GenesisMetadata key - * @property {Uint8Array|null} [value] GenesisMetadata value - */ - - /** - * Constructs a new GenesisMetadata. - * @memberof ibc.core.client.v1 - * @classdesc Represents a GenesisMetadata. - * @implements IGenesisMetadata - * @constructor - * @param {ibc.core.client.v1.IGenesisMetadata=} [properties] Properties to set - */ - function GenesisMetadata(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisMetadata key. - * @member {Uint8Array} key - * @memberof ibc.core.client.v1.GenesisMetadata - * @instance - */ - GenesisMetadata.prototype.key = $util.newBuffer([]); - - /** - * GenesisMetadata value. - * @member {Uint8Array} value - * @memberof ibc.core.client.v1.GenesisMetadata - * @instance - */ - GenesisMetadata.prototype.value = $util.newBuffer([]); - - /** - * Encodes the specified GenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified GenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.GenesisMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {ibc.core.client.v1.IGenesisMetadata} message GenesisMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisMetadata message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.GenesisMetadata(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisMetadata message. - * @function verify - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a GenesisMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata - */ - GenesisMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.GenesisMetadata) - return object; - let message = new $root.ibc.core.client.v1.GenesisMetadata(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a GenesisMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.GenesisMetadata - * @static - * @param {ibc.core.client.v1.GenesisMetadata} message GenesisMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this GenesisMetadata to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.GenesisMetadata - * @instance - * @returns {Object.} JSON object - */ - GenesisMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisMetadata; - })(); - - v1.IdentifiedGenesisMetadata = (function() { - - /** - * Properties of an IdentifiedGenesisMetadata. - * @memberof ibc.core.client.v1 - * @interface IIdentifiedGenesisMetadata - * @property {string|null} [client_id] IdentifiedGenesisMetadata client_id - * @property {Array.|null} [client_metadata] IdentifiedGenesisMetadata client_metadata - */ - - /** - * Constructs a new IdentifiedGenesisMetadata. - * @memberof ibc.core.client.v1 - * @classdesc Represents an IdentifiedGenesisMetadata. - * @implements IIdentifiedGenesisMetadata - * @constructor - * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata=} [properties] Properties to set - */ - function IdentifiedGenesisMetadata(properties) { - this.client_metadata = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedGenesisMetadata client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @instance - */ - IdentifiedGenesisMetadata.prototype.client_id = ""; - - /** - * IdentifiedGenesisMetadata client_metadata. - * @member {Array.} client_metadata - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @instance - */ - IdentifiedGenesisMetadata.prototype.client_metadata = $util.emptyArray; - - /** - * Encodes the specified IdentifiedGenesisMetadata message. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedGenesisMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.client_metadata != null && message.client_metadata.length) - for (let i = 0; i < message.client_metadata.length; ++i) - $root.ibc.core.client.v1.GenesisMetadata.encode(message.client_metadata[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentifiedGenesisMetadata message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedGenesisMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {ibc.core.client.v1.IIdentifiedGenesisMetadata} message IdentifiedGenesisMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedGenesisMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedGenesisMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - if (!(message.client_metadata && message.client_metadata.length)) - message.client_metadata = []; - message.client_metadata.push($root.ibc.core.client.v1.GenesisMetadata.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedGenesisMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedGenesisMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedGenesisMetadata message. - * @function verify - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedGenesisMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.client_metadata != null && message.hasOwnProperty("client_metadata")) { - if (!Array.isArray(message.client_metadata)) - return "client_metadata: array expected"; - for (let i = 0; i < message.client_metadata.length; ++i) { - let error = $root.ibc.core.client.v1.GenesisMetadata.verify(message.client_metadata[i]); - if (error) - return "client_metadata." + error; - } - } - return null; - }; - - /** - * Creates an IdentifiedGenesisMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata - */ - IdentifiedGenesisMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.IdentifiedGenesisMetadata) - return object; - let message = new $root.ibc.core.client.v1.IdentifiedGenesisMetadata(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.client_metadata) { - if (!Array.isArray(object.client_metadata)) - throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.client_metadata: array expected"); - message.client_metadata = []; - for (let i = 0; i < object.client_metadata.length; ++i) { - if (typeof object.client_metadata[i] !== "object") - throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.client_metadata: object expected"); - message.client_metadata[i] = $root.ibc.core.client.v1.GenesisMetadata.fromObject(object.client_metadata[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IdentifiedGenesisMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @static - * @param {ibc.core.client.v1.IdentifiedGenesisMetadata} message IdentifiedGenesisMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedGenesisMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.client_metadata = []; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.client_metadata && message.client_metadata.length) { - object.client_metadata = []; - for (let j = 0; j < message.client_metadata.length; ++j) - object.client_metadata[j] = $root.ibc.core.client.v1.GenesisMetadata.toObject(message.client_metadata[j], options); - } - return object; - }; - - /** - * Converts this IdentifiedGenesisMetadata to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.IdentifiedGenesisMetadata - * @instance - * @returns {Object.} JSON object - */ - IdentifiedGenesisMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedGenesisMetadata; - })(); - - return v1; - })(); - - return client; - })(); - - core.commitment = (function() { - - /** - * Namespace commitment. - * @memberof ibc.core - * @namespace - */ - const commitment = {}; - - commitment.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.commitment - * @namespace - */ - const v1 = {}; - - v1.MerkleRoot = (function() { - - /** - * Properties of a MerkleRoot. - * @memberof ibc.core.commitment.v1 - * @interface IMerkleRoot - * @property {Uint8Array|null} [hash] MerkleRoot hash - */ - - /** - * Constructs a new MerkleRoot. - * @memberof ibc.core.commitment.v1 - * @classdesc Represents a MerkleRoot. - * @implements IMerkleRoot - * @constructor - * @param {ibc.core.commitment.v1.IMerkleRoot=} [properties] Properties to set - */ - function MerkleRoot(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MerkleRoot hash. - * @member {Uint8Array} hash - * @memberof ibc.core.commitment.v1.MerkleRoot - * @instance - */ - MerkleRoot.prototype.hash = $util.newBuffer([]); - - /** - * Encodes the specified MerkleRoot message. Does not implicitly {@link ibc.core.commitment.v1.MerkleRoot.verify|verify} messages. - * @function encode - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {ibc.core.commitment.v1.IMerkleRoot} message MerkleRoot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerkleRoot.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); - return writer; - }; - - /** - * Encodes the specified MerkleRoot message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerkleRoot.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {ibc.core.commitment.v1.IMerkleRoot} message MerkleRoot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerkleRoot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MerkleRoot message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerkleRoot.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerkleRoot(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MerkleRoot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerkleRoot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerkleRoot message. - * @function verify - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerkleRoot.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - return null; - }; - - /** - * Creates a MerkleRoot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.commitment.v1.MerkleRoot} MerkleRoot - */ - MerkleRoot.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.commitment.v1.MerkleRoot) - return object; - let message = new $root.ibc.core.commitment.v1.MerkleRoot(); - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - return message; - }; - - /** - * Creates a plain object from a MerkleRoot message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.commitment.v1.MerkleRoot - * @static - * @param {ibc.core.commitment.v1.MerkleRoot} message MerkleRoot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerkleRoot.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - return object; - }; - - /** - * Converts this MerkleRoot to JSON. - * @function toJSON - * @memberof ibc.core.commitment.v1.MerkleRoot - * @instance - * @returns {Object.} JSON object - */ - MerkleRoot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MerkleRoot; - })(); - - v1.MerklePrefix = (function() { - - /** - * Properties of a MerklePrefix. - * @memberof ibc.core.commitment.v1 - * @interface IMerklePrefix - * @property {Uint8Array|null} [key_prefix] MerklePrefix key_prefix - */ - - /** - * Constructs a new MerklePrefix. - * @memberof ibc.core.commitment.v1 - * @classdesc Represents a MerklePrefix. - * @implements IMerklePrefix - * @constructor - * @param {ibc.core.commitment.v1.IMerklePrefix=} [properties] Properties to set - */ - function MerklePrefix(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MerklePrefix key_prefix. - * @member {Uint8Array} key_prefix - * @memberof ibc.core.commitment.v1.MerklePrefix - * @instance - */ - MerklePrefix.prototype.key_prefix = $util.newBuffer([]); - - /** - * Encodes the specified MerklePrefix message. Does not implicitly {@link ibc.core.commitment.v1.MerklePrefix.verify|verify} messages. - * @function encode - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {ibc.core.commitment.v1.IMerklePrefix} message MerklePrefix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerklePrefix.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key_prefix != null && Object.hasOwnProperty.call(message, "key_prefix")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key_prefix); - return writer; - }; - - /** - * Encodes the specified MerklePrefix message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerklePrefix.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {ibc.core.commitment.v1.IMerklePrefix} message MerklePrefix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerklePrefix.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MerklePrefix message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerklePrefix.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerklePrefix(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key_prefix = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MerklePrefix message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerklePrefix.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerklePrefix message. - * @function verify - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerklePrefix.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key_prefix != null && message.hasOwnProperty("key_prefix")) - if (!(message.key_prefix && typeof message.key_prefix.length === "number" || $util.isString(message.key_prefix))) - return "key_prefix: buffer expected"; - return null; - }; - - /** - * Creates a MerklePrefix message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.commitment.v1.MerklePrefix} MerklePrefix - */ - MerklePrefix.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.commitment.v1.MerklePrefix) - return object; - let message = new $root.ibc.core.commitment.v1.MerklePrefix(); - if (object.key_prefix != null) - if (typeof object.key_prefix === "string") - $util.base64.decode(object.key_prefix, message.key_prefix = $util.newBuffer($util.base64.length(object.key_prefix)), 0); - else if (object.key_prefix.length) - message.key_prefix = object.key_prefix; - return message; - }; - - /** - * Creates a plain object from a MerklePrefix message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.commitment.v1.MerklePrefix - * @static - * @param {ibc.core.commitment.v1.MerklePrefix} message MerklePrefix - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerklePrefix.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - if (options.bytes === String) - object.key_prefix = ""; - else { - object.key_prefix = []; - if (options.bytes !== Array) - object.key_prefix = $util.newBuffer(object.key_prefix); - } - if (message.key_prefix != null && message.hasOwnProperty("key_prefix")) - object.key_prefix = options.bytes === String ? $util.base64.encode(message.key_prefix, 0, message.key_prefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.key_prefix) : message.key_prefix; - return object; - }; - - /** - * Converts this MerklePrefix to JSON. - * @function toJSON - * @memberof ibc.core.commitment.v1.MerklePrefix - * @instance - * @returns {Object.} JSON object - */ - MerklePrefix.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MerklePrefix; - })(); - - v1.MerklePath = (function() { - - /** - * Properties of a MerklePath. - * @memberof ibc.core.commitment.v1 - * @interface IMerklePath - * @property {Array.|null} [key_path] MerklePath key_path - */ - - /** - * Constructs a new MerklePath. - * @memberof ibc.core.commitment.v1 - * @classdesc Represents a MerklePath. - * @implements IMerklePath - * @constructor - * @param {ibc.core.commitment.v1.IMerklePath=} [properties] Properties to set - */ - function MerklePath(properties) { - this.key_path = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MerklePath key_path. - * @member {Array.} key_path - * @memberof ibc.core.commitment.v1.MerklePath - * @instance - */ - MerklePath.prototype.key_path = $util.emptyArray; - - /** - * Encodes the specified MerklePath message. Does not implicitly {@link ibc.core.commitment.v1.MerklePath.verify|verify} messages. - * @function encode - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {ibc.core.commitment.v1.IMerklePath} message MerklePath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerklePath.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key_path != null && message.key_path.length) - for (let i = 0; i < message.key_path.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key_path[i]); - return writer; - }; - - /** - * Encodes the specified MerklePath message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerklePath.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {ibc.core.commitment.v1.IMerklePath} message MerklePath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerklePath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MerklePath message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.commitment.v1.MerklePath} MerklePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerklePath.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerklePath(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.key_path && message.key_path.length)) - message.key_path = []; - message.key_path.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MerklePath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.commitment.v1.MerklePath} MerklePath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerklePath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerklePath message. - * @function verify - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerklePath.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key_path != null && message.hasOwnProperty("key_path")) { - if (!Array.isArray(message.key_path)) - return "key_path: array expected"; - for (let i = 0; i < message.key_path.length; ++i) - if (!$util.isString(message.key_path[i])) - return "key_path: string[] expected"; - } - return null; - }; - - /** - * Creates a MerklePath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.commitment.v1.MerklePath} MerklePath - */ - MerklePath.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.commitment.v1.MerklePath) - return object; - let message = new $root.ibc.core.commitment.v1.MerklePath(); - if (object.key_path) { - if (!Array.isArray(object.key_path)) - throw TypeError(".ibc.core.commitment.v1.MerklePath.key_path: array expected"); - message.key_path = []; - for (let i = 0; i < object.key_path.length; ++i) - message.key_path[i] = String(object.key_path[i]); - } - return message; - }; - - /** - * Creates a plain object from a MerklePath message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.commitment.v1.MerklePath - * @static - * @param {ibc.core.commitment.v1.MerklePath} message MerklePath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerklePath.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.key_path = []; - if (message.key_path && message.key_path.length) { - object.key_path = []; - for (let j = 0; j < message.key_path.length; ++j) - object.key_path[j] = message.key_path[j]; - } - return object; - }; - - /** - * Converts this MerklePath to JSON. - * @function toJSON - * @memberof ibc.core.commitment.v1.MerklePath - * @instance - * @returns {Object.} JSON object - */ - MerklePath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MerklePath; - })(); - - v1.MerkleProof = (function() { - - /** - * Properties of a MerkleProof. - * @memberof ibc.core.commitment.v1 - * @interface IMerkleProof - * @property {Array.|null} [proofs] MerkleProof proofs - */ - - /** - * Constructs a new MerkleProof. - * @memberof ibc.core.commitment.v1 - * @classdesc Represents a MerkleProof. - * @implements IMerkleProof - * @constructor - * @param {ibc.core.commitment.v1.IMerkleProof=} [properties] Properties to set - */ - function MerkleProof(properties) { - this.proofs = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MerkleProof proofs. - * @member {Array.} proofs - * @memberof ibc.core.commitment.v1.MerkleProof - * @instance - */ - MerkleProof.prototype.proofs = $util.emptyArray; - - /** - * Encodes the specified MerkleProof message. Does not implicitly {@link ibc.core.commitment.v1.MerkleProof.verify|verify} messages. - * @function encode - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {ibc.core.commitment.v1.IMerkleProof} message MerkleProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerkleProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.proofs != null && message.proofs.length) - for (let i = 0; i < message.proofs.length; ++i) - $root.ics23.CommitmentProof.encode(message.proofs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MerkleProof message, length delimited. Does not implicitly {@link ibc.core.commitment.v1.MerkleProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {ibc.core.commitment.v1.IMerkleProof} message MerkleProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerkleProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MerkleProof message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerkleProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.commitment.v1.MerkleProof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.proofs && message.proofs.length)) - message.proofs = []; - message.proofs.push($root.ics23.CommitmentProof.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MerkleProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerkleProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerkleProof message. - * @function verify - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerkleProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.proofs != null && message.hasOwnProperty("proofs")) { - if (!Array.isArray(message.proofs)) - return "proofs: array expected"; - for (let i = 0; i < message.proofs.length; ++i) { - let error = $root.ics23.CommitmentProof.verify(message.proofs[i]); - if (error) - return "proofs." + error; - } - } - return null; - }; - - /** - * Creates a MerkleProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.commitment.v1.MerkleProof} MerkleProof - */ - MerkleProof.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.commitment.v1.MerkleProof) - return object; - let message = new $root.ibc.core.commitment.v1.MerkleProof(); - if (object.proofs) { - if (!Array.isArray(object.proofs)) - throw TypeError(".ibc.core.commitment.v1.MerkleProof.proofs: array expected"); - message.proofs = []; - for (let i = 0; i < object.proofs.length; ++i) { - if (typeof object.proofs[i] !== "object") - throw TypeError(".ibc.core.commitment.v1.MerkleProof.proofs: object expected"); - message.proofs[i] = $root.ics23.CommitmentProof.fromObject(object.proofs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MerkleProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.commitment.v1.MerkleProof - * @static - * @param {ibc.core.commitment.v1.MerkleProof} message MerkleProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerkleProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.proofs = []; - if (message.proofs && message.proofs.length) { - object.proofs = []; - for (let j = 0; j < message.proofs.length; ++j) - object.proofs[j] = $root.ics23.CommitmentProof.toObject(message.proofs[j], options); - } - return object; - }; - - /** - * Converts this MerkleProof to JSON. - * @function toJSON - * @memberof ibc.core.commitment.v1.MerkleProof - * @instance - * @returns {Object.} JSON object - */ - MerkleProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MerkleProof; - })(); - - return v1; - })(); - - return commitment; - })(); - - core.connection = (function() { - - /** - * Namespace connection. - * @memberof ibc.core - * @namespace - */ - const connection = {}; - - connection.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.connection - * @namespace - */ - const v1 = {}; - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenInit}. - * @memberof ibc.core.connection.v1.Msg - * @typedef ConnectionOpenInitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.MsgConnectionOpenInitResponse} [response] MsgConnectionOpenInitResponse - */ - - /** - * Calls ConnectionOpenInit. - * @function connectionOpenInit - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} request MsgConnectionOpenInit message or plain object - * @param {ibc.core.connection.v1.Msg.ConnectionOpenInitCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenInitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.connectionOpenInit = function connectionOpenInit(request, callback) { - return this.rpcCall(connectionOpenInit, $root.ibc.core.connection.v1.MsgConnectionOpenInit, $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse, request, callback); - }, "name", { value: "ConnectionOpenInit" }); - - /** - * Calls ConnectionOpenInit. - * @function connectionOpenInit - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} request MsgConnectionOpenInit message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenTry}. - * @memberof ibc.core.connection.v1.Msg - * @typedef ConnectionOpenTryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.MsgConnectionOpenTryResponse} [response] MsgConnectionOpenTryResponse - */ - - /** - * Calls ConnectionOpenTry. - * @function connectionOpenTry - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} request MsgConnectionOpenTry message or plain object - * @param {ibc.core.connection.v1.Msg.ConnectionOpenTryCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenTryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.connectionOpenTry = function connectionOpenTry(request, callback) { - return this.rpcCall(connectionOpenTry, $root.ibc.core.connection.v1.MsgConnectionOpenTry, $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse, request, callback); - }, "name", { value: "ConnectionOpenTry" }); - - /** - * Calls ConnectionOpenTry. - * @function connectionOpenTry - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} request MsgConnectionOpenTry message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenAck}. - * @memberof ibc.core.connection.v1.Msg - * @typedef ConnectionOpenAckCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.MsgConnectionOpenAckResponse} [response] MsgConnectionOpenAckResponse - */ - - /** - * Calls ConnectionOpenAck. - * @function connectionOpenAck - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} request MsgConnectionOpenAck message or plain object - * @param {ibc.core.connection.v1.Msg.ConnectionOpenAckCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenAckResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.connectionOpenAck = function connectionOpenAck(request, callback) { - return this.rpcCall(connectionOpenAck, $root.ibc.core.connection.v1.MsgConnectionOpenAck, $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse, request, callback); - }, "name", { value: "ConnectionOpenAck" }); - - /** - * Calls ConnectionOpenAck. - * @function connectionOpenAck - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} request MsgConnectionOpenAck message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Msg#connectionOpenConfirm}. - * @memberof ibc.core.connection.v1.Msg - * @typedef ConnectionOpenConfirmCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} [response] MsgConnectionOpenConfirmResponse - */ - - /** - * Calls ConnectionOpenConfirm. - * @function connectionOpenConfirm - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} request MsgConnectionOpenConfirm message or plain object - * @param {ibc.core.connection.v1.Msg.ConnectionOpenConfirmCallback} callback Node-style callback called with the error, if any, and MsgConnectionOpenConfirmResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.connectionOpenConfirm = function connectionOpenConfirm(request, callback) { - return this.rpcCall(connectionOpenConfirm, $root.ibc.core.connection.v1.MsgConnectionOpenConfirm, $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse, request, callback); - }, "name", { value: "ConnectionOpenConfirm" }); - - /** - * Calls ConnectionOpenConfirm. - * @function connectionOpenConfirm - * @memberof ibc.core.connection.v1.Msg - * @instance - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} request MsgConnectionOpenConfirm message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1.MsgConnectionOpenInit = (function() { - - /** - * Properties of a MsgConnectionOpenInit. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenInit - * @property {string|null} [client_id] MsgConnectionOpenInit client_id - * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] MsgConnectionOpenInit counterparty - * @property {ibc.core.connection.v1.IVersion|null} [version] MsgConnectionOpenInit version - * @property {Long|null} [delay_period] MsgConnectionOpenInit delay_period - * @property {string|null} [signer] MsgConnectionOpenInit signer - */ - - /** - * Constructs a new MsgConnectionOpenInit. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenInit. - * @implements IMsgConnectionOpenInit - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit=} [properties] Properties to set - */ - function MsgConnectionOpenInit(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgConnectionOpenInit client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.client_id = ""; - - /** - * MsgConnectionOpenInit counterparty. - * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.counterparty = null; - - /** - * MsgConnectionOpenInit version. - * @member {ibc.core.connection.v1.IVersion|null|undefined} version - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.version = null; - - /** - * MsgConnectionOpenInit delay_period. - * @member {Long} delay_period - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.delay_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgConnectionOpenInit signer. - * @member {string} signer - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - */ - MsgConnectionOpenInit.prototype.signer = ""; - - /** - * Encodes the specified MsgConnectionOpenInit message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInit.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} message MsgConnectionOpenInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenInit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.ibc.core.connection.v1.Version.encode(message.version, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.delay_period != null && Object.hasOwnProperty.call(message, "delay_period")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.delay_period); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenInit message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInit.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenInit} message MsgConnectionOpenInit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenInit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenInit message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenInit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenInit(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 3: - message.version = $root.ibc.core.connection.v1.Version.decode(reader, reader.uint32()); - break; - case 4: - message.delay_period = reader.uint64(); - break; - case 5: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenInit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenInit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenInit message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenInit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - let error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.version != null && message.hasOwnProperty("version")) { - let error = $root.ibc.core.connection.v1.Version.verify(message.version); - if (error) - return "version." + error; - } - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (!$util.isInteger(message.delay_period) && !(message.delay_period && $util.isInteger(message.delay_period.low) && $util.isInteger(message.delay_period.high))) - return "delay_period: integer|Long expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenInit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenInit} MsgConnectionOpenInit - */ - MsgConnectionOpenInit.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenInit) - return object; - let message = new $root.ibc.core.connection.v1.MsgConnectionOpenInit(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenInit.counterparty: object expected"); - message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); - } - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenInit.version: object expected"); - message.version = $root.ibc.core.connection.v1.Version.fromObject(object.version); - } - if (object.delay_period != null) - if ($util.Long) - (message.delay_period = $util.Long.fromValue(object.delay_period)).unsigned = true; - else if (typeof object.delay_period === "string") - message.delay_period = parseInt(object.delay_period, 10); - else if (typeof object.delay_period === "number") - message.delay_period = object.delay_period; - else if (typeof object.delay_period === "object") - message.delay_period = new $util.LongBits(object.delay_period.low >>> 0, object.delay_period.high >>> 0).toNumber(true); - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgConnectionOpenInit message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenInit} message MsgConnectionOpenInit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenInit.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - object.counterparty = null; - object.version = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.delay_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.delay_period = options.longs === String ? "0" : 0; - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.ibc.core.connection.v1.Version.toObject(message.version, options); - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (typeof message.delay_period === "number") - object.delay_period = options.longs === String ? String(message.delay_period) : message.delay_period; - else - object.delay_period = options.longs === String ? $util.Long.prototype.toString.call(message.delay_period) : options.longs === Number ? new $util.LongBits(message.delay_period.low >>> 0, message.delay_period.high >>> 0).toNumber(true) : message.delay_period; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgConnectionOpenInit to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenInit - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenInit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenInit; - })(); - - v1.MsgConnectionOpenInitResponse = (function() { - - /** - * Properties of a MsgConnectionOpenInitResponse. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenInitResponse - */ - - /** - * Constructs a new MsgConnectionOpenInitResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenInitResponse. - * @implements IMsgConnectionOpenInitResponse - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse=} [properties] Properties to set - */ - function MsgConnectionOpenInitResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgConnectionOpenInitResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInitResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse} message MsgConnectionOpenInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenInitResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenInitResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenInitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenInitResponse} message MsgConnectionOpenInitResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenInitResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenInitResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenInitResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenInitResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenInitResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenInitResponse message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenInitResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenInitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenInitResponse} MsgConnectionOpenInitResponse - */ - MsgConnectionOpenInitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse) - return object; - return new $root.ibc.core.connection.v1.MsgConnectionOpenInitResponse(); - }; - - /** - * Creates a plain object from a MsgConnectionOpenInitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenInitResponse} message MsgConnectionOpenInitResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenInitResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgConnectionOpenInitResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenInitResponse - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenInitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenInitResponse; - })(); - - v1.MsgConnectionOpenTry = (function() { - - /** - * Properties of a MsgConnectionOpenTry. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenTry - * @property {string|null} [client_id] MsgConnectionOpenTry client_id - * @property {string|null} [previous_connection_id] MsgConnectionOpenTry previous_connection_id - * @property {google.protobuf.IAny|null} [client_state] MsgConnectionOpenTry client_state - * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] MsgConnectionOpenTry counterparty - * @property {Long|null} [delay_period] MsgConnectionOpenTry delay_period - * @property {Array.|null} [counterparty_versions] MsgConnectionOpenTry counterparty_versions - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgConnectionOpenTry proof_height - * @property {Uint8Array|null} [proof_init] MsgConnectionOpenTry proof_init - * @property {Uint8Array|null} [proof_client] MsgConnectionOpenTry proof_client - * @property {Uint8Array|null} [proof_consensus] MsgConnectionOpenTry proof_consensus - * @property {ibc.core.client.v1.IHeight|null} [consensus_height] MsgConnectionOpenTry consensus_height - * @property {string|null} [signer] MsgConnectionOpenTry signer - */ - - /** - * Constructs a new MsgConnectionOpenTry. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenTry. - * @implements IMsgConnectionOpenTry - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry=} [properties] Properties to set - */ - function MsgConnectionOpenTry(properties) { - this.counterparty_versions = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgConnectionOpenTry client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.client_id = ""; - - /** - * MsgConnectionOpenTry previous_connection_id. - * @member {string} previous_connection_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.previous_connection_id = ""; - - /** - * MsgConnectionOpenTry client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.client_state = null; - - /** - * MsgConnectionOpenTry counterparty. - * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.counterparty = null; - - /** - * MsgConnectionOpenTry delay_period. - * @member {Long} delay_period - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.delay_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgConnectionOpenTry counterparty_versions. - * @member {Array.} counterparty_versions - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.counterparty_versions = $util.emptyArray; - - /** - * MsgConnectionOpenTry proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.proof_height = null; - - /** - * MsgConnectionOpenTry proof_init. - * @member {Uint8Array} proof_init - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.proof_init = $util.newBuffer([]); - - /** - * MsgConnectionOpenTry proof_client. - * @member {Uint8Array} proof_client - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.proof_client = $util.newBuffer([]); - - /** - * MsgConnectionOpenTry proof_consensus. - * @member {Uint8Array} proof_consensus - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.proof_consensus = $util.newBuffer([]); - - /** - * MsgConnectionOpenTry consensus_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} consensus_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.consensus_height = null; - - /** - * MsgConnectionOpenTry signer. - * @member {string} signer - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - */ - MsgConnectionOpenTry.prototype.signer = ""; - - /** - * Encodes the specified MsgConnectionOpenTry message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTry.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} message MsgConnectionOpenTry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenTry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.previous_connection_id != null && Object.hasOwnProperty.call(message, "previous_connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.previous_connection_id); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.delay_period != null && Object.hasOwnProperty.call(message, "delay_period")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.delay_period); - if (message.counterparty_versions != null && message.counterparty_versions.length) - for (let i = 0; i < message.counterparty_versions.length; ++i) - $root.ibc.core.connection.v1.Version.encode(message.counterparty_versions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.proof_init != null && Object.hasOwnProperty.call(message, "proof_init")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.proof_init); - if (message.proof_client != null && Object.hasOwnProperty.call(message, "proof_client")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.proof_client); - if (message.proof_consensus != null && Object.hasOwnProperty.call(message, "proof_consensus")) - writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.proof_consensus); - if (message.consensus_height != null && Object.hasOwnProperty.call(message, "consensus_height")) - $root.ibc.core.client.v1.Height.encode(message.consensus_height, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenTry message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTry.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenTry} message MsgConnectionOpenTry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenTry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenTry message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenTry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenTry(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.previous_connection_id = reader.string(); - break; - case 3: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 4: - message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 5: - message.delay_period = reader.uint64(); - break; - case 6: - if (!(message.counterparty_versions && message.counterparty_versions.length)) - message.counterparty_versions = []; - message.counterparty_versions.push($root.ibc.core.connection.v1.Version.decode(reader, reader.uint32())); - break; - case 7: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 8: - message.proof_init = reader.bytes(); - break; - case 9: - message.proof_client = reader.bytes(); - break; - case 10: - message.proof_consensus = reader.bytes(); - break; - case 11: - message.consensus_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 12: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenTry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenTry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenTry message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenTry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.previous_connection_id != null && message.hasOwnProperty("previous_connection_id")) - if (!$util.isString(message.previous_connection_id)) - return "previous_connection_id: string expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - let error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - let error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (!$util.isInteger(message.delay_period) && !(message.delay_period && $util.isInteger(message.delay_period.low) && $util.isInteger(message.delay_period.high))) - return "delay_period: integer|Long expected"; - if (message.counterparty_versions != null && message.hasOwnProperty("counterparty_versions")) { - if (!Array.isArray(message.counterparty_versions)) - return "counterparty_versions: array expected"; - for (let i = 0; i < message.counterparty_versions.length; ++i) { - let error = $root.ibc.core.connection.v1.Version.verify(message.counterparty_versions[i]); - if (error) - return "counterparty_versions." + error; - } - } - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - if (!(message.proof_init && typeof message.proof_init.length === "number" || $util.isString(message.proof_init))) - return "proof_init: buffer expected"; - if (message.proof_client != null && message.hasOwnProperty("proof_client")) - if (!(message.proof_client && typeof message.proof_client.length === "number" || $util.isString(message.proof_client))) - return "proof_client: buffer expected"; - if (message.proof_consensus != null && message.hasOwnProperty("proof_consensus")) - if (!(message.proof_consensus && typeof message.proof_consensus.length === "number" || $util.isString(message.proof_consensus))) - return "proof_consensus: buffer expected"; - if (message.consensus_height != null && message.hasOwnProperty("consensus_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.consensus_height); - if (error) - return "consensus_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenTry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenTry} MsgConnectionOpenTry - */ - MsgConnectionOpenTry.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenTry) - return object; - let message = new $root.ibc.core.connection.v1.MsgConnectionOpenTry(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.previous_connection_id != null) - message.previous_connection_id = String(object.previous_connection_id); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.counterparty: object expected"); - message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); - } - if (object.delay_period != null) - if ($util.Long) - (message.delay_period = $util.Long.fromValue(object.delay_period)).unsigned = true; - else if (typeof object.delay_period === "string") - message.delay_period = parseInt(object.delay_period, 10); - else if (typeof object.delay_period === "number") - message.delay_period = object.delay_period; - else if (typeof object.delay_period === "object") - message.delay_period = new $util.LongBits(object.delay_period.low >>> 0, object.delay_period.high >>> 0).toNumber(true); - if (object.counterparty_versions) { - if (!Array.isArray(object.counterparty_versions)) - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.counterparty_versions: array expected"); - message.counterparty_versions = []; - for (let i = 0; i < object.counterparty_versions.length; ++i) { - if (typeof object.counterparty_versions[i] !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.counterparty_versions: object expected"); - message.counterparty_versions[i] = $root.ibc.core.connection.v1.Version.fromObject(object.counterparty_versions[i]); - } - } - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.proof_init != null) - if (typeof object.proof_init === "string") - $util.base64.decode(object.proof_init, message.proof_init = $util.newBuffer($util.base64.length(object.proof_init)), 0); - else if (object.proof_init.length) - message.proof_init = object.proof_init; - if (object.proof_client != null) - if (typeof object.proof_client === "string") - $util.base64.decode(object.proof_client, message.proof_client = $util.newBuffer($util.base64.length(object.proof_client)), 0); - else if (object.proof_client.length) - message.proof_client = object.proof_client; - if (object.proof_consensus != null) - if (typeof object.proof_consensus === "string") - $util.base64.decode(object.proof_consensus, message.proof_consensus = $util.newBuffer($util.base64.length(object.proof_consensus)), 0); - else if (object.proof_consensus.length) - message.proof_consensus = object.proof_consensus; - if (object.consensus_height != null) { - if (typeof object.consensus_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenTry.consensus_height: object expected"); - message.consensus_height = $root.ibc.core.client.v1.Height.fromObject(object.consensus_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgConnectionOpenTry message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenTry} message MsgConnectionOpenTry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenTry.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.counterparty_versions = []; - if (options.defaults) { - object.client_id = ""; - object.previous_connection_id = ""; - object.client_state = null; - object.counterparty = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.delay_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.delay_period = options.longs === String ? "0" : 0; - object.proof_height = null; - if (options.bytes === String) - object.proof_init = ""; - else { - object.proof_init = []; - if (options.bytes !== Array) - object.proof_init = $util.newBuffer(object.proof_init); - } - if (options.bytes === String) - object.proof_client = ""; - else { - object.proof_client = []; - if (options.bytes !== Array) - object.proof_client = $util.newBuffer(object.proof_client); - } - if (options.bytes === String) - object.proof_consensus = ""; - else { - object.proof_consensus = []; - if (options.bytes !== Array) - object.proof_consensus = $util.newBuffer(object.proof_consensus); - } - object.consensus_height = null; - object.signer = ""; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.previous_connection_id != null && message.hasOwnProperty("previous_connection_id")) - object.previous_connection_id = message.previous_connection_id; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (typeof message.delay_period === "number") - object.delay_period = options.longs === String ? String(message.delay_period) : message.delay_period; - else - object.delay_period = options.longs === String ? $util.Long.prototype.toString.call(message.delay_period) : options.longs === Number ? new $util.LongBits(message.delay_period.low >>> 0, message.delay_period.high >>> 0).toNumber(true) : message.delay_period; - if (message.counterparty_versions && message.counterparty_versions.length) { - object.counterparty_versions = []; - for (let j = 0; j < message.counterparty_versions.length; ++j) - object.counterparty_versions[j] = $root.ibc.core.connection.v1.Version.toObject(message.counterparty_versions[j], options); - } - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.proof_init != null && message.hasOwnProperty("proof_init")) - object.proof_init = options.bytes === String ? $util.base64.encode(message.proof_init, 0, message.proof_init.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_init) : message.proof_init; - if (message.proof_client != null && message.hasOwnProperty("proof_client")) - object.proof_client = options.bytes === String ? $util.base64.encode(message.proof_client, 0, message.proof_client.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_client) : message.proof_client; - if (message.proof_consensus != null && message.hasOwnProperty("proof_consensus")) - object.proof_consensus = options.bytes === String ? $util.base64.encode(message.proof_consensus, 0, message.proof_consensus.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_consensus) : message.proof_consensus; - if (message.consensus_height != null && message.hasOwnProperty("consensus_height")) - object.consensus_height = $root.ibc.core.client.v1.Height.toObject(message.consensus_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgConnectionOpenTry to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenTry - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenTry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenTry; - })(); - - v1.MsgConnectionOpenTryResponse = (function() { - - /** - * Properties of a MsgConnectionOpenTryResponse. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenTryResponse - */ - - /** - * Constructs a new MsgConnectionOpenTryResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenTryResponse. - * @implements IMsgConnectionOpenTryResponse - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse=} [properties] Properties to set - */ - function MsgConnectionOpenTryResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgConnectionOpenTryResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTryResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse} message MsgConnectionOpenTryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenTryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenTryResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenTryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenTryResponse} message MsgConnectionOpenTryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenTryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenTryResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenTryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenTryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenTryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenTryResponse message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenTryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenTryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenTryResponse} MsgConnectionOpenTryResponse - */ - MsgConnectionOpenTryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse) - return object; - return new $root.ibc.core.connection.v1.MsgConnectionOpenTryResponse(); - }; - - /** - * Creates a plain object from a MsgConnectionOpenTryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenTryResponse} message MsgConnectionOpenTryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenTryResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgConnectionOpenTryResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenTryResponse - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenTryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenTryResponse; - })(); - - v1.MsgConnectionOpenAck = (function() { - - /** - * Properties of a MsgConnectionOpenAck. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenAck - * @property {string|null} [connection_id] MsgConnectionOpenAck connection_id - * @property {string|null} [counterparty_connection_id] MsgConnectionOpenAck counterparty_connection_id - * @property {ibc.core.connection.v1.IVersion|null} [version] MsgConnectionOpenAck version - * @property {google.protobuf.IAny|null} [client_state] MsgConnectionOpenAck client_state - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgConnectionOpenAck proof_height - * @property {Uint8Array|null} [proof_try] MsgConnectionOpenAck proof_try - * @property {Uint8Array|null} [proof_client] MsgConnectionOpenAck proof_client - * @property {Uint8Array|null} [proof_consensus] MsgConnectionOpenAck proof_consensus - * @property {ibc.core.client.v1.IHeight|null} [consensus_height] MsgConnectionOpenAck consensus_height - * @property {string|null} [signer] MsgConnectionOpenAck signer - */ - - /** - * Constructs a new MsgConnectionOpenAck. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenAck. - * @implements IMsgConnectionOpenAck - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck=} [properties] Properties to set - */ - function MsgConnectionOpenAck(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgConnectionOpenAck connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.connection_id = ""; - - /** - * MsgConnectionOpenAck counterparty_connection_id. - * @member {string} counterparty_connection_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.counterparty_connection_id = ""; - - /** - * MsgConnectionOpenAck version. - * @member {ibc.core.connection.v1.IVersion|null|undefined} version - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.version = null; - - /** - * MsgConnectionOpenAck client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.client_state = null; - - /** - * MsgConnectionOpenAck proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.proof_height = null; - - /** - * MsgConnectionOpenAck proof_try. - * @member {Uint8Array} proof_try - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.proof_try = $util.newBuffer([]); - - /** - * MsgConnectionOpenAck proof_client. - * @member {Uint8Array} proof_client - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.proof_client = $util.newBuffer([]); - - /** - * MsgConnectionOpenAck proof_consensus. - * @member {Uint8Array} proof_consensus - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.proof_consensus = $util.newBuffer([]); - - /** - * MsgConnectionOpenAck consensus_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} consensus_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.consensus_height = null; - - /** - * MsgConnectionOpenAck signer. - * @member {string} signer - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - */ - MsgConnectionOpenAck.prototype.signer = ""; - - /** - * Encodes the specified MsgConnectionOpenAck message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAck.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} message MsgConnectionOpenAck message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenAck.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.counterparty_connection_id != null && Object.hasOwnProperty.call(message, "counterparty_connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_connection_id); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.ibc.core.connection.v1.Version.encode(message.version, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.proof_try != null && Object.hasOwnProperty.call(message, "proof_try")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.proof_try); - if (message.proof_client != null && Object.hasOwnProperty.call(message, "proof_client")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.proof_client); - if (message.proof_consensus != null && Object.hasOwnProperty.call(message, "proof_consensus")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.proof_consensus); - if (message.consensus_height != null && Object.hasOwnProperty.call(message, "consensus_height")) - $root.ibc.core.client.v1.Height.encode(message.consensus_height, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenAck message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAck.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenAck} message MsgConnectionOpenAck message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenAck.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenAck message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenAck.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenAck(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.counterparty_connection_id = reader.string(); - break; - case 3: - message.version = $root.ibc.core.connection.v1.Version.decode(reader, reader.uint32()); - break; - case 4: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 5: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 6: - message.proof_try = reader.bytes(); - break; - case 7: - message.proof_client = reader.bytes(); - break; - case 8: - message.proof_consensus = reader.bytes(); - break; - case 9: - message.consensus_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 10: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenAck message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenAck.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenAck message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenAck.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.counterparty_connection_id != null && message.hasOwnProperty("counterparty_connection_id")) - if (!$util.isString(message.counterparty_connection_id)) - return "counterparty_connection_id: string expected"; - if (message.version != null && message.hasOwnProperty("version")) { - let error = $root.ibc.core.connection.v1.Version.verify(message.version); - if (error) - return "version." + error; - } - if (message.client_state != null && message.hasOwnProperty("client_state")) { - let error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.proof_try != null && message.hasOwnProperty("proof_try")) - if (!(message.proof_try && typeof message.proof_try.length === "number" || $util.isString(message.proof_try))) - return "proof_try: buffer expected"; - if (message.proof_client != null && message.hasOwnProperty("proof_client")) - if (!(message.proof_client && typeof message.proof_client.length === "number" || $util.isString(message.proof_client))) - return "proof_client: buffer expected"; - if (message.proof_consensus != null && message.hasOwnProperty("proof_consensus")) - if (!(message.proof_consensus && typeof message.proof_consensus.length === "number" || $util.isString(message.proof_consensus))) - return "proof_consensus: buffer expected"; - if (message.consensus_height != null && message.hasOwnProperty("consensus_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.consensus_height); - if (error) - return "consensus_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenAck message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenAck} MsgConnectionOpenAck - */ - MsgConnectionOpenAck.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenAck) - return object; - let message = new $root.ibc.core.connection.v1.MsgConnectionOpenAck(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.counterparty_connection_id != null) - message.counterparty_connection_id = String(object.counterparty_connection_id); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.version: object expected"); - message.version = $root.ibc.core.connection.v1.Version.fromObject(object.version); - } - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.proof_try != null) - if (typeof object.proof_try === "string") - $util.base64.decode(object.proof_try, message.proof_try = $util.newBuffer($util.base64.length(object.proof_try)), 0); - else if (object.proof_try.length) - message.proof_try = object.proof_try; - if (object.proof_client != null) - if (typeof object.proof_client === "string") - $util.base64.decode(object.proof_client, message.proof_client = $util.newBuffer($util.base64.length(object.proof_client)), 0); - else if (object.proof_client.length) - message.proof_client = object.proof_client; - if (object.proof_consensus != null) - if (typeof object.proof_consensus === "string") - $util.base64.decode(object.proof_consensus, message.proof_consensus = $util.newBuffer($util.base64.length(object.proof_consensus)), 0); - else if (object.proof_consensus.length) - message.proof_consensus = object.proof_consensus; - if (object.consensus_height != null) { - if (typeof object.consensus_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenAck.consensus_height: object expected"); - message.consensus_height = $root.ibc.core.client.v1.Height.fromObject(object.consensus_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgConnectionOpenAck message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenAck} message MsgConnectionOpenAck - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenAck.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.connection_id = ""; - object.counterparty_connection_id = ""; - object.version = null; - object.client_state = null; - object.proof_height = null; - if (options.bytes === String) - object.proof_try = ""; - else { - object.proof_try = []; - if (options.bytes !== Array) - object.proof_try = $util.newBuffer(object.proof_try); - } - if (options.bytes === String) - object.proof_client = ""; - else { - object.proof_client = []; - if (options.bytes !== Array) - object.proof_client = $util.newBuffer(object.proof_client); - } - if (options.bytes === String) - object.proof_consensus = ""; - else { - object.proof_consensus = []; - if (options.bytes !== Array) - object.proof_consensus = $util.newBuffer(object.proof_consensus); - } - object.consensus_height = null; - object.signer = ""; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.counterparty_connection_id != null && message.hasOwnProperty("counterparty_connection_id")) - object.counterparty_connection_id = message.counterparty_connection_id; - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.ibc.core.connection.v1.Version.toObject(message.version, options); - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.proof_try != null && message.hasOwnProperty("proof_try")) - object.proof_try = options.bytes === String ? $util.base64.encode(message.proof_try, 0, message.proof_try.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_try) : message.proof_try; - if (message.proof_client != null && message.hasOwnProperty("proof_client")) - object.proof_client = options.bytes === String ? $util.base64.encode(message.proof_client, 0, message.proof_client.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_client) : message.proof_client; - if (message.proof_consensus != null && message.hasOwnProperty("proof_consensus")) - object.proof_consensus = options.bytes === String ? $util.base64.encode(message.proof_consensus, 0, message.proof_consensus.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_consensus) : message.proof_consensus; - if (message.consensus_height != null && message.hasOwnProperty("consensus_height")) - object.consensus_height = $root.ibc.core.client.v1.Height.toObject(message.consensus_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgConnectionOpenAck to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenAck - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenAck.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenAck; - })(); - - v1.MsgConnectionOpenAckResponse = (function() { - - /** - * Properties of a MsgConnectionOpenAckResponse. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenAckResponse - */ - - /** - * Constructs a new MsgConnectionOpenAckResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenAckResponse. - * @implements IMsgConnectionOpenAckResponse - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse=} [properties] Properties to set - */ - function MsgConnectionOpenAckResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgConnectionOpenAckResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAckResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse} message MsgConnectionOpenAckResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenAckResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenAckResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenAckResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenAckResponse} message MsgConnectionOpenAckResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenAckResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenAckResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenAckResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenAckResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenAckResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenAckResponse message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenAckResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenAckResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenAckResponse} MsgConnectionOpenAckResponse - */ - MsgConnectionOpenAckResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse) - return object; - return new $root.ibc.core.connection.v1.MsgConnectionOpenAckResponse(); - }; - - /** - * Creates a plain object from a MsgConnectionOpenAckResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenAckResponse} message MsgConnectionOpenAckResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenAckResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgConnectionOpenAckResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenAckResponse - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenAckResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenAckResponse; - })(); - - v1.MsgConnectionOpenConfirm = (function() { - - /** - * Properties of a MsgConnectionOpenConfirm. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenConfirm - * @property {string|null} [connection_id] MsgConnectionOpenConfirm connection_id - * @property {Uint8Array|null} [proof_ack] MsgConnectionOpenConfirm proof_ack - * @property {ibc.core.client.v1.IHeight|null} [proof_height] MsgConnectionOpenConfirm proof_height - * @property {string|null} [signer] MsgConnectionOpenConfirm signer - */ - - /** - * Constructs a new MsgConnectionOpenConfirm. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenConfirm. - * @implements IMsgConnectionOpenConfirm - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm=} [properties] Properties to set - */ - function MsgConnectionOpenConfirm(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgConnectionOpenConfirm connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - */ - MsgConnectionOpenConfirm.prototype.connection_id = ""; - - /** - * MsgConnectionOpenConfirm proof_ack. - * @member {Uint8Array} proof_ack - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - */ - MsgConnectionOpenConfirm.prototype.proof_ack = $util.newBuffer([]); - - /** - * MsgConnectionOpenConfirm proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - */ - MsgConnectionOpenConfirm.prototype.proof_height = null; - - /** - * MsgConnectionOpenConfirm signer. - * @member {string} signer - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - */ - MsgConnectionOpenConfirm.prototype.signer = ""; - - /** - * Encodes the specified MsgConnectionOpenConfirm message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirm.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} message MsgConnectionOpenConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenConfirm.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.proof_ack != null && Object.hasOwnProperty.call(message, "proof_ack")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof_ack); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenConfirm message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirm.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirm} message MsgConnectionOpenConfirm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenConfirm.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenConfirm message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenConfirm.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenConfirm(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.proof_ack = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 4: - message.signer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenConfirm message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenConfirm.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenConfirm message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenConfirm.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.proof_ack != null && message.hasOwnProperty("proof_ack")) - if (!(message.proof_ack && typeof message.proof_ack.length === "number" || $util.isString(message.proof_ack))) - return "proof_ack: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - if (message.signer != null && message.hasOwnProperty("signer")) - if (!$util.isString(message.signer)) - return "signer: string expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenConfirm message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirm} MsgConnectionOpenConfirm - */ - MsgConnectionOpenConfirm.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenConfirm) - return object; - let message = new $root.ibc.core.connection.v1.MsgConnectionOpenConfirm(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.proof_ack != null) - if (typeof object.proof_ack === "string") - $util.base64.decode(object.proof_ack, message.proof_ack = $util.newBuffer($util.base64.length(object.proof_ack)), 0); - else if (object.proof_ack.length) - message.proof_ack = object.proof_ack; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.MsgConnectionOpenConfirm.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - if (object.signer != null) - message.signer = String(object.signer); - return message; - }; - - /** - * Creates a plain object from a MsgConnectionOpenConfirm message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenConfirm} message MsgConnectionOpenConfirm - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenConfirm.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.connection_id = ""; - if (options.bytes === String) - object.proof_ack = ""; - else { - object.proof_ack = []; - if (options.bytes !== Array) - object.proof_ack = $util.newBuffer(object.proof_ack); - } - object.proof_height = null; - object.signer = ""; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.proof_ack != null && message.hasOwnProperty("proof_ack")) - object.proof_ack = options.bytes === String ? $util.base64.encode(message.proof_ack, 0, message.proof_ack.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof_ack) : message.proof_ack; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = message.signer; - return object; - }; - - /** - * Converts this MsgConnectionOpenConfirm to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirm - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenConfirm.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenConfirm; - })(); - - v1.MsgConnectionOpenConfirmResponse = (function() { - - /** - * Properties of a MsgConnectionOpenConfirmResponse. - * @memberof ibc.core.connection.v1 - * @interface IMsgConnectionOpenConfirmResponse - */ - - /** - * Constructs a new MsgConnectionOpenConfirmResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a MsgConnectionOpenConfirmResponse. - * @implements IMsgConnectionOpenConfirmResponse - * @constructor - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse=} [properties] Properties to set - */ - function MsgConnectionOpenConfirmResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgConnectionOpenConfirmResponse message. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirmResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse} message MsgConnectionOpenConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenConfirmResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgConnectionOpenConfirmResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.MsgConnectionOpenConfirmResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {ibc.core.connection.v1.IMsgConnectionOpenConfirmResponse} message MsgConnectionOpenConfirmResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgConnectionOpenConfirmResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgConnectionOpenConfirmResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenConfirmResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgConnectionOpenConfirmResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgConnectionOpenConfirmResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgConnectionOpenConfirmResponse message. - * @function verify - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgConnectionOpenConfirmResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgConnectionOpenConfirmResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} MsgConnectionOpenConfirmResponse - */ - MsgConnectionOpenConfirmResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse) - return object; - return new $root.ibc.core.connection.v1.MsgConnectionOpenConfirmResponse(); - }; - - /** - * Creates a plain object from a MsgConnectionOpenConfirmResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @static - * @param {ibc.core.connection.v1.MsgConnectionOpenConfirmResponse} message MsgConnectionOpenConfirmResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgConnectionOpenConfirmResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgConnectionOpenConfirmResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.MsgConnectionOpenConfirmResponse - * @instance - * @returns {Object.} JSON object - */ - MsgConnectionOpenConfirmResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgConnectionOpenConfirmResponse; - })(); - - v1.ConnectionEnd = (function() { - - /** - * Properties of a ConnectionEnd. - * @memberof ibc.core.connection.v1 - * @interface IConnectionEnd - * @property {string|null} [client_id] ConnectionEnd client_id - * @property {Array.|null} [versions] ConnectionEnd versions - * @property {ibc.core.connection.v1.State|null} [state] ConnectionEnd state - * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] ConnectionEnd counterparty - * @property {Long|null} [delay_period] ConnectionEnd delay_period - */ - - /** - * Constructs a new ConnectionEnd. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a ConnectionEnd. - * @implements IConnectionEnd - * @constructor - * @param {ibc.core.connection.v1.IConnectionEnd=} [properties] Properties to set - */ - function ConnectionEnd(properties) { - this.versions = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionEnd client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.client_id = ""; - - /** - * ConnectionEnd versions. - * @member {Array.} versions - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.versions = $util.emptyArray; - - /** - * ConnectionEnd state. - * @member {ibc.core.connection.v1.State} state - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.state = 0; - - /** - * ConnectionEnd counterparty. - * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.counterparty = null; - - /** - * ConnectionEnd delay_period. - * @member {Long} delay_period - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - */ - ConnectionEnd.prototype.delay_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified ConnectionEnd message. Does not implicitly {@link ibc.core.connection.v1.ConnectionEnd.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {ibc.core.connection.v1.IConnectionEnd} message ConnectionEnd message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionEnd.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.versions != null && message.versions.length) - for (let i = 0; i < message.versions.length; ++i) - $root.ibc.core.connection.v1.Version.encode(message.versions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.delay_period != null && Object.hasOwnProperty.call(message, "delay_period")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.delay_period); - return writer; - }; - - /** - * Encodes the specified ConnectionEnd message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ConnectionEnd.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {ibc.core.connection.v1.IConnectionEnd} message ConnectionEnd message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionEnd.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionEnd message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionEnd.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.ConnectionEnd(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - if (!(message.versions && message.versions.length)) - message.versions = []; - message.versions.push($root.ibc.core.connection.v1.Version.decode(reader, reader.uint32())); - break; - case 3: - message.state = reader.int32(); - break; - case 4: - message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 5: - message.delay_period = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionEnd message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionEnd.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionEnd message. - * @function verify - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionEnd.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.versions != null && message.hasOwnProperty("versions")) { - if (!Array.isArray(message.versions)) - return "versions: array expected"; - for (let i = 0; i < message.versions.length; ++i) { - let error = $root.ibc.core.connection.v1.Version.verify(message.versions[i]); - if (error) - return "versions." + error; - } - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - let error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (!$util.isInteger(message.delay_period) && !(message.delay_period && $util.isInteger(message.delay_period.low) && $util.isInteger(message.delay_period.high))) - return "delay_period: integer|Long expected"; - return null; - }; - - /** - * Creates a ConnectionEnd message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.ConnectionEnd} ConnectionEnd - */ - ConnectionEnd.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.ConnectionEnd) - return object; - let message = new $root.ibc.core.connection.v1.ConnectionEnd(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.versions) { - if (!Array.isArray(object.versions)) - throw TypeError(".ibc.core.connection.v1.ConnectionEnd.versions: array expected"); - message.versions = []; - for (let i = 0; i < object.versions.length; ++i) { - if (typeof object.versions[i] !== "object") - throw TypeError(".ibc.core.connection.v1.ConnectionEnd.versions: object expected"); - message.versions[i] = $root.ibc.core.connection.v1.Version.fromObject(object.versions[i]); - } - } - switch (object.state) { - case "STATE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STATE_INIT": - case 1: - message.state = 1; - break; - case "STATE_TRYOPEN": - case 2: - message.state = 2; - break; - case "STATE_OPEN": - case 3: - message.state = 3; - break; - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.connection.v1.ConnectionEnd.counterparty: object expected"); - message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); - } - if (object.delay_period != null) - if ($util.Long) - (message.delay_period = $util.Long.fromValue(object.delay_period)).unsigned = true; - else if (typeof object.delay_period === "string") - message.delay_period = parseInt(object.delay_period, 10); - else if (typeof object.delay_period === "number") - message.delay_period = object.delay_period; - else if (typeof object.delay_period === "object") - message.delay_period = new $util.LongBits(object.delay_period.low >>> 0, object.delay_period.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a ConnectionEnd message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.ConnectionEnd - * @static - * @param {ibc.core.connection.v1.ConnectionEnd} message ConnectionEnd - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionEnd.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.versions = []; - if (options.defaults) { - object.client_id = ""; - object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; - object.counterparty = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.delay_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.delay_period = options.longs === String ? "0" : 0; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.versions && message.versions.length) { - object.versions = []; - for (let j = 0; j < message.versions.length; ++j) - object.versions[j] = $root.ibc.core.connection.v1.Version.toObject(message.versions[j], options); - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.ibc.core.connection.v1.State[message.state] : message.state; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (typeof message.delay_period === "number") - object.delay_period = options.longs === String ? String(message.delay_period) : message.delay_period; - else - object.delay_period = options.longs === String ? $util.Long.prototype.toString.call(message.delay_period) : options.longs === Number ? new $util.LongBits(message.delay_period.low >>> 0, message.delay_period.high >>> 0).toNumber(true) : message.delay_period; - return object; - }; - - /** - * Converts this ConnectionEnd to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.ConnectionEnd - * @instance - * @returns {Object.} JSON object - */ - ConnectionEnd.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConnectionEnd; - })(); - - v1.IdentifiedConnection = (function() { - - /** - * Properties of an IdentifiedConnection. - * @memberof ibc.core.connection.v1 - * @interface IIdentifiedConnection - * @property {string|null} [id] IdentifiedConnection id - * @property {string|null} [client_id] IdentifiedConnection client_id - * @property {Array.|null} [versions] IdentifiedConnection versions - * @property {ibc.core.connection.v1.State|null} [state] IdentifiedConnection state - * @property {ibc.core.connection.v1.ICounterparty|null} [counterparty] IdentifiedConnection counterparty - * @property {Long|null} [delay_period] IdentifiedConnection delay_period - */ - - /** - * Constructs a new IdentifiedConnection. - * @memberof ibc.core.connection.v1 - * @classdesc Represents an IdentifiedConnection. - * @implements IIdentifiedConnection - * @constructor - * @param {ibc.core.connection.v1.IIdentifiedConnection=} [properties] Properties to set - */ - function IdentifiedConnection(properties) { - this.versions = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedConnection id. - * @member {string} id - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.id = ""; - - /** - * IdentifiedConnection client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.client_id = ""; - - /** - * IdentifiedConnection versions. - * @member {Array.} versions - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.versions = $util.emptyArray; - - /** - * IdentifiedConnection state. - * @member {ibc.core.connection.v1.State} state - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.state = 0; - - /** - * IdentifiedConnection counterparty. - * @member {ibc.core.connection.v1.ICounterparty|null|undefined} counterparty - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.counterparty = null; - - /** - * IdentifiedConnection delay_period. - * @member {Long} delay_period - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - */ - IdentifiedConnection.prototype.delay_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified IdentifiedConnection message. Does not implicitly {@link ibc.core.connection.v1.IdentifiedConnection.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {ibc.core.connection.v1.IIdentifiedConnection} message IdentifiedConnection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedConnection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.client_id); - if (message.versions != null && message.versions.length) - for (let i = 0; i < message.versions.length; ++i) - $root.ibc.core.connection.v1.Version.encode(message.versions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.counterparty != null && Object.hasOwnProperty.call(message, "counterparty")) - $root.ibc.core.connection.v1.Counterparty.encode(message.counterparty, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.delay_period != null && Object.hasOwnProperty.call(message, "delay_period")) - writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.delay_period); - return writer; - }; - - /** - * Encodes the specified IdentifiedConnection message, length delimited. Does not implicitly {@link ibc.core.connection.v1.IdentifiedConnection.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {ibc.core.connection.v1.IIdentifiedConnection} message IdentifiedConnection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedConnection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedConnection message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedConnection.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.IdentifiedConnection(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.client_id = reader.string(); - break; - case 3: - if (!(message.versions && message.versions.length)) - message.versions = []; - message.versions.push($root.ibc.core.connection.v1.Version.decode(reader, reader.uint32())); - break; - case 4: - message.state = reader.int32(); - break; - case 5: - message.counterparty = $root.ibc.core.connection.v1.Counterparty.decode(reader, reader.uint32()); - break; - case 6: - message.delay_period = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedConnection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedConnection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedConnection message. - * @function verify - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedConnection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.versions != null && message.hasOwnProperty("versions")) { - if (!Array.isArray(message.versions)) - return "versions: array expected"; - for (let i = 0; i < message.versions.length; ++i) { - let error = $root.ibc.core.connection.v1.Version.verify(message.versions[i]); - if (error) - return "versions." + error; - } - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.counterparty != null && message.hasOwnProperty("counterparty")) { - let error = $root.ibc.core.connection.v1.Counterparty.verify(message.counterparty); - if (error) - return "counterparty." + error; - } - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (!$util.isInteger(message.delay_period) && !(message.delay_period && $util.isInteger(message.delay_period.low) && $util.isInteger(message.delay_period.high))) - return "delay_period: integer|Long expected"; - return null; - }; - - /** - * Creates an IdentifiedConnection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.IdentifiedConnection} IdentifiedConnection - */ - IdentifiedConnection.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.IdentifiedConnection) - return object; - let message = new $root.ibc.core.connection.v1.IdentifiedConnection(); - if (object.id != null) - message.id = String(object.id); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.versions) { - if (!Array.isArray(object.versions)) - throw TypeError(".ibc.core.connection.v1.IdentifiedConnection.versions: array expected"); - message.versions = []; - for (let i = 0; i < object.versions.length; ++i) { - if (typeof object.versions[i] !== "object") - throw TypeError(".ibc.core.connection.v1.IdentifiedConnection.versions: object expected"); - message.versions[i] = $root.ibc.core.connection.v1.Version.fromObject(object.versions[i]); - } - } - switch (object.state) { - case "STATE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STATE_INIT": - case 1: - message.state = 1; - break; - case "STATE_TRYOPEN": - case 2: - message.state = 2; - break; - case "STATE_OPEN": - case 3: - message.state = 3; - break; - } - if (object.counterparty != null) { - if (typeof object.counterparty !== "object") - throw TypeError(".ibc.core.connection.v1.IdentifiedConnection.counterparty: object expected"); - message.counterparty = $root.ibc.core.connection.v1.Counterparty.fromObject(object.counterparty); - } - if (object.delay_period != null) - if ($util.Long) - (message.delay_period = $util.Long.fromValue(object.delay_period)).unsigned = true; - else if (typeof object.delay_period === "string") - message.delay_period = parseInt(object.delay_period, 10); - else if (typeof object.delay_period === "number") - message.delay_period = object.delay_period; - else if (typeof object.delay_period === "object") - message.delay_period = new $util.LongBits(object.delay_period.low >>> 0, object.delay_period.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an IdentifiedConnection message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @static - * @param {ibc.core.connection.v1.IdentifiedConnection} message IdentifiedConnection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedConnection.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.versions = []; - if (options.defaults) { - object.id = ""; - object.client_id = ""; - object.state = options.enums === String ? "STATE_UNINITIALIZED_UNSPECIFIED" : 0; - object.counterparty = null; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.delay_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.delay_period = options.longs === String ? "0" : 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.versions && message.versions.length) { - object.versions = []; - for (let j = 0; j < message.versions.length; ++j) - object.versions[j] = $root.ibc.core.connection.v1.Version.toObject(message.versions[j], options); - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.ibc.core.connection.v1.State[message.state] : message.state; - if (message.counterparty != null && message.hasOwnProperty("counterparty")) - object.counterparty = $root.ibc.core.connection.v1.Counterparty.toObject(message.counterparty, options); - if (message.delay_period != null && message.hasOwnProperty("delay_period")) - if (typeof message.delay_period === "number") - object.delay_period = options.longs === String ? String(message.delay_period) : message.delay_period; - else - object.delay_period = options.longs === String ? $util.Long.prototype.toString.call(message.delay_period) : options.longs === Number ? new $util.LongBits(message.delay_period.low >>> 0, message.delay_period.high >>> 0).toNumber(true) : message.delay_period; - return object; - }; - - /** - * Converts this IdentifiedConnection to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.IdentifiedConnection - * @instance - * @returns {Object.} JSON object - */ - IdentifiedConnection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedConnection; - })(); - - /** - * State enum. - * @name ibc.core.connection.v1.State - * @enum {number} - * @property {number} STATE_UNINITIALIZED_UNSPECIFIED=0 STATE_UNINITIALIZED_UNSPECIFIED value - * @property {number} STATE_INIT=1 STATE_INIT value - * @property {number} STATE_TRYOPEN=2 STATE_TRYOPEN value - * @property {number} STATE_OPEN=3 STATE_OPEN value - */ - v1.State = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNINITIALIZED_UNSPECIFIED"] = 0; - values[valuesById[1] = "STATE_INIT"] = 1; - values[valuesById[2] = "STATE_TRYOPEN"] = 2; - values[valuesById[3] = "STATE_OPEN"] = 3; - return values; - })(); - - v1.Counterparty = (function() { - - /** - * Properties of a Counterparty. - * @memberof ibc.core.connection.v1 - * @interface ICounterparty - * @property {string|null} [client_id] Counterparty client_id - * @property {string|null} [connection_id] Counterparty connection_id - * @property {ibc.core.commitment.v1.IMerklePrefix|null} [prefix] Counterparty prefix - */ - - /** - * Constructs a new Counterparty. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Counterparty. - * @implements ICounterparty - * @constructor - * @param {ibc.core.connection.v1.ICounterparty=} [properties] Properties to set - */ - function Counterparty(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Counterparty client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.Counterparty - * @instance - */ - Counterparty.prototype.client_id = ""; - - /** - * Counterparty connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.Counterparty - * @instance - */ - Counterparty.prototype.connection_id = ""; - - /** - * Counterparty prefix. - * @member {ibc.core.commitment.v1.IMerklePrefix|null|undefined} prefix - * @memberof ibc.core.connection.v1.Counterparty - * @instance - */ - Counterparty.prototype.prefix = null; - - /** - * Encodes the specified Counterparty message. Does not implicitly {@link ibc.core.connection.v1.Counterparty.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {ibc.core.connection.v1.ICounterparty} message Counterparty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counterparty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.connection_id); - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) - $root.ibc.core.commitment.v1.MerklePrefix.encode(message.prefix, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Counterparty message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Counterparty.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {ibc.core.connection.v1.ICounterparty} message Counterparty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counterparty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Counterparty message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.Counterparty} Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counterparty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.Counterparty(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.connection_id = reader.string(); - break; - case 3: - message.prefix = $root.ibc.core.commitment.v1.MerklePrefix.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Counterparty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.Counterparty} Counterparty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counterparty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Counterparty message. - * @function verify - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Counterparty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.prefix != null && message.hasOwnProperty("prefix")) { - let error = $root.ibc.core.commitment.v1.MerklePrefix.verify(message.prefix); - if (error) - return "prefix." + error; - } - return null; - }; - - /** - * Creates a Counterparty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.Counterparty} Counterparty - */ - Counterparty.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.Counterparty) - return object; - let message = new $root.ibc.core.connection.v1.Counterparty(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.prefix != null) { - if (typeof object.prefix !== "object") - throw TypeError(".ibc.core.connection.v1.Counterparty.prefix: object expected"); - message.prefix = $root.ibc.core.commitment.v1.MerklePrefix.fromObject(object.prefix); - } - return message; - }; - - /** - * Creates a plain object from a Counterparty message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.Counterparty - * @static - * @param {ibc.core.connection.v1.Counterparty} message Counterparty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Counterparty.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - object.connection_id = ""; - object.prefix = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.prefix != null && message.hasOwnProperty("prefix")) - object.prefix = $root.ibc.core.commitment.v1.MerklePrefix.toObject(message.prefix, options); - return object; - }; - - /** - * Converts this Counterparty to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.Counterparty - * @instance - * @returns {Object.} JSON object - */ - Counterparty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Counterparty; - })(); - - v1.ClientPaths = (function() { - - /** - * Properties of a ClientPaths. - * @memberof ibc.core.connection.v1 - * @interface IClientPaths - * @property {Array.|null} [paths] ClientPaths paths - */ - - /** - * Constructs a new ClientPaths. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a ClientPaths. - * @implements IClientPaths - * @constructor - * @param {ibc.core.connection.v1.IClientPaths=} [properties] Properties to set - */ - function ClientPaths(properties) { - this.paths = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientPaths paths. - * @member {Array.} paths - * @memberof ibc.core.connection.v1.ClientPaths - * @instance - */ - ClientPaths.prototype.paths = $util.emptyArray; - - /** - * Encodes the specified ClientPaths message. Does not implicitly {@link ibc.core.connection.v1.ClientPaths.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {ibc.core.connection.v1.IClientPaths} message ClientPaths message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientPaths.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (let i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified ClientPaths message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ClientPaths.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {ibc.core.connection.v1.IClientPaths} message ClientPaths message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientPaths.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientPaths message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientPaths.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.ClientPaths(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientPaths message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientPaths.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientPaths message. - * @function verify - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientPaths.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (let i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a ClientPaths message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.ClientPaths} ClientPaths - */ - ClientPaths.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.ClientPaths) - return object; - let message = new $root.ibc.core.connection.v1.ClientPaths(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".ibc.core.connection.v1.ClientPaths.paths: array expected"); - message.paths = []; - for (let i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a ClientPaths message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.ClientPaths - * @static - * @param {ibc.core.connection.v1.ClientPaths} message ClientPaths - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientPaths.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (let j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this ClientPaths to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.ClientPaths - * @instance - * @returns {Object.} JSON object - */ - ClientPaths.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientPaths; - })(); - - v1.ConnectionPaths = (function() { - - /** - * Properties of a ConnectionPaths. - * @memberof ibc.core.connection.v1 - * @interface IConnectionPaths - * @property {string|null} [client_id] ConnectionPaths client_id - * @property {Array.|null} [paths] ConnectionPaths paths - */ - - /** - * Constructs a new ConnectionPaths. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a ConnectionPaths. - * @implements IConnectionPaths - * @constructor - * @param {ibc.core.connection.v1.IConnectionPaths=} [properties] Properties to set - */ - function ConnectionPaths(properties) { - this.paths = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionPaths client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.ConnectionPaths - * @instance - */ - ConnectionPaths.prototype.client_id = ""; - - /** - * ConnectionPaths paths. - * @member {Array.} paths - * @memberof ibc.core.connection.v1.ConnectionPaths - * @instance - */ - ConnectionPaths.prototype.paths = $util.emptyArray; - - /** - * Encodes the specified ConnectionPaths message. Does not implicitly {@link ibc.core.connection.v1.ConnectionPaths.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {ibc.core.connection.v1.IConnectionPaths} message ConnectionPaths message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPaths.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.paths != null && message.paths.length) - for (let i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified ConnectionPaths message, length delimited. Does not implicitly {@link ibc.core.connection.v1.ConnectionPaths.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {ibc.core.connection.v1.IConnectionPaths} message ConnectionPaths message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionPaths.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionPaths message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPaths.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.ConnectionPaths(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionPaths message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionPaths.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionPaths message. - * @function verify - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionPaths.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (let i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a ConnectionPaths message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.ConnectionPaths} ConnectionPaths - */ - ConnectionPaths.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.ConnectionPaths) - return object; - let message = new $root.ibc.core.connection.v1.ConnectionPaths(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".ibc.core.connection.v1.ConnectionPaths.paths: array expected"); - message.paths = []; - for (let i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a ConnectionPaths message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.ConnectionPaths - * @static - * @param {ibc.core.connection.v1.ConnectionPaths} message ConnectionPaths - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionPaths.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.paths && message.paths.length) { - object.paths = []; - for (let j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this ConnectionPaths to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.ConnectionPaths - * @instance - * @returns {Object.} JSON object - */ - ConnectionPaths.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConnectionPaths; - })(); - - v1.Version = (function() { - - /** - * Properties of a Version. - * @memberof ibc.core.connection.v1 - * @interface IVersion - * @property {string|null} [identifier] Version identifier - * @property {Array.|null} [features] Version features - */ - - /** - * Constructs a new Version. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Version. - * @implements IVersion - * @constructor - * @param {ibc.core.connection.v1.IVersion=} [properties] Properties to set - */ - function Version(properties) { - this.features = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Version identifier. - * @member {string} identifier - * @memberof ibc.core.connection.v1.Version - * @instance - */ - Version.prototype.identifier = ""; - - /** - * Version features. - * @member {Array.} features - * @memberof ibc.core.connection.v1.Version - * @instance - */ - Version.prototype.features = $util.emptyArray; - - /** - * Encodes the specified Version message. Does not implicitly {@link ibc.core.connection.v1.Version.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.Version - * @static - * @param {ibc.core.connection.v1.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.identifier); - if (message.features != null && message.features.length) - for (let i = 0; i < message.features.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.features[i]); - return writer; - }; - - /** - * Encodes the specified Version message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Version.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.Version - * @static - * @param {ibc.core.connection.v1.IVersion} message Version message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Version.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Version message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.Version(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identifier = reader.string(); - break; - case 2: - if (!(message.features && message.features.length)) - message.features = []; - message.features.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Version message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.Version - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.Version} Version - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Version.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Version message. - * @function verify - * @memberof ibc.core.connection.v1.Version - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Version.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identifier != null && message.hasOwnProperty("identifier")) - if (!$util.isString(message.identifier)) - return "identifier: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - if (!Array.isArray(message.features)) - return "features: array expected"; - for (let i = 0; i < message.features.length; ++i) - if (!$util.isString(message.features[i])) - return "features: string[] expected"; - } - return null; - }; - - /** - * Creates a Version message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.Version - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.Version} Version - */ - Version.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.Version) - return object; - let message = new $root.ibc.core.connection.v1.Version(); - if (object.identifier != null) - message.identifier = String(object.identifier); - if (object.features) { - if (!Array.isArray(object.features)) - throw TypeError(".ibc.core.connection.v1.Version.features: array expected"); - message.features = []; - for (let i = 0; i < object.features.length; ++i) - message.features[i] = String(object.features[i]); - } - return message; - }; - - /** - * Creates a plain object from a Version message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.Version - * @static - * @param {ibc.core.connection.v1.Version} message Version - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Version.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.features = []; - if (options.defaults) - object.identifier = ""; - if (message.identifier != null && message.hasOwnProperty("identifier")) - object.identifier = message.identifier; - if (message.features && message.features.length) { - object.features = []; - for (let j = 0; j < message.features.length; ++j) - object.features[j] = message.features[j]; - } - return object; - }; - - /** - * Converts this Version to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.Version - * @instance - * @returns {Object.} JSON object - */ - Version.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Version; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.core.connection.v1 - * @interface IParams - * @property {Long|null} [max_expected_time_per_block] Params max_expected_time_per_block - */ - - /** - * Constructs a new Params. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.core.connection.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params max_expected_time_per_block. - * @member {Long} max_expected_time_per_block - * @memberof ibc.core.connection.v1.Params - * @instance - */ - Params.prototype.max_expected_time_per_block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.core.connection.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.Params - * @static - * @param {ibc.core.connection.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.max_expected_time_per_block != null && Object.hasOwnProperty.call(message, "max_expected_time_per_block")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.max_expected_time_per_block); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.connection.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.Params - * @static - * @param {ibc.core.connection.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.Params(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_expected_time_per_block = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.core.connection.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.max_expected_time_per_block != null && message.hasOwnProperty("max_expected_time_per_block")) - if (!$util.isInteger(message.max_expected_time_per_block) && !(message.max_expected_time_per_block && $util.isInteger(message.max_expected_time_per_block.low) && $util.isInteger(message.max_expected_time_per_block.high))) - return "max_expected_time_per_block: integer|Long expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.Params) - return object; - let message = new $root.ibc.core.connection.v1.Params(); - if (object.max_expected_time_per_block != null) - if ($util.Long) - (message.max_expected_time_per_block = $util.Long.fromValue(object.max_expected_time_per_block)).unsigned = true; - else if (typeof object.max_expected_time_per_block === "string") - message.max_expected_time_per_block = parseInt(object.max_expected_time_per_block, 10); - else if (typeof object.max_expected_time_per_block === "number") - message.max_expected_time_per_block = object.max_expected_time_per_block; - else if (typeof object.max_expected_time_per_block === "object") - message.max_expected_time_per_block = new $util.LongBits(object.max_expected_time_per_block.low >>> 0, object.max_expected_time_per_block.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.Params - * @static - * @param {ibc.core.connection.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.max_expected_time_per_block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_expected_time_per_block = options.longs === String ? "0" : 0; - if (message.max_expected_time_per_block != null && message.hasOwnProperty("max_expected_time_per_block")) - if (typeof message.max_expected_time_per_block === "number") - object.max_expected_time_per_block = options.longs === String ? String(message.max_expected_time_per_block) : message.max_expected_time_per_block; - else - object.max_expected_time_per_block = options.longs === String ? $util.Long.prototype.toString.call(message.max_expected_time_per_block) : options.longs === Number ? new $util.LongBits(message.max_expected_time_per_block.low >>> 0, message.max_expected_time_per_block.high >>> 0).toNumber(true) : message.max_expected_time_per_block; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connection}. - * @memberof ibc.core.connection.v1.Query - * @typedef ConnectionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryConnectionResponse} [response] QueryConnectionResponse - */ - - /** - * Calls Connection. - * @function connection - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionRequest} request QueryConnectionRequest message or plain object - * @param {ibc.core.connection.v1.Query.ConnectionCallback} callback Node-style callback called with the error, if any, and QueryConnectionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connection = function connection(request, callback) { - return this.rpcCall(connection, $root.ibc.core.connection.v1.QueryConnectionRequest, $root.ibc.core.connection.v1.QueryConnectionResponse, request, callback); - }, "name", { value: "Connection" }); - - /** - * Calls Connection. - * @function connection - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionRequest} request QueryConnectionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connections}. - * @memberof ibc.core.connection.v1.Query - * @typedef ConnectionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryConnectionsResponse} [response] QueryConnectionsResponse - */ - - /** - * Calls Connections. - * @function connections - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionsRequest} request QueryConnectionsRequest message or plain object - * @param {ibc.core.connection.v1.Query.ConnectionsCallback} callback Node-style callback called with the error, if any, and QueryConnectionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connections = function connections(request, callback) { - return this.rpcCall(connections, $root.ibc.core.connection.v1.QueryConnectionsRequest, $root.ibc.core.connection.v1.QueryConnectionsResponse, request, callback); - }, "name", { value: "Connections" }); - - /** - * Calls Connections. - * @function connections - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionsRequest} request QueryConnectionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#clientConnections}. - * @memberof ibc.core.connection.v1.Query - * @typedef ClientConnectionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryClientConnectionsResponse} [response] QueryClientConnectionsResponse - */ - - /** - * Calls ClientConnections. - * @function clientConnections - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} request QueryClientConnectionsRequest message or plain object - * @param {ibc.core.connection.v1.Query.ClientConnectionsCallback} callback Node-style callback called with the error, if any, and QueryClientConnectionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.clientConnections = function clientConnections(request, callback) { - return this.rpcCall(clientConnections, $root.ibc.core.connection.v1.QueryClientConnectionsRequest, $root.ibc.core.connection.v1.QueryClientConnectionsResponse, request, callback); - }, "name", { value: "ClientConnections" }); - - /** - * Calls ClientConnections. - * @function clientConnections - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} request QueryClientConnectionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connectionClientState}. - * @memberof ibc.core.connection.v1.Query - * @typedef ConnectionClientStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryConnectionClientStateResponse} [response] QueryConnectionClientStateResponse - */ - - /** - * Calls ConnectionClientState. - * @function connectionClientState - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} request QueryConnectionClientStateRequest message or plain object - * @param {ibc.core.connection.v1.Query.ConnectionClientStateCallback} callback Node-style callback called with the error, if any, and QueryConnectionClientStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connectionClientState = function connectionClientState(request, callback) { - return this.rpcCall(connectionClientState, $root.ibc.core.connection.v1.QueryConnectionClientStateRequest, $root.ibc.core.connection.v1.QueryConnectionClientStateResponse, request, callback); - }, "name", { value: "ConnectionClientState" }); - - /** - * Calls ConnectionClientState. - * @function connectionClientState - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} request QueryConnectionClientStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.core.connection.v1.Query#connectionConsensusState}. - * @memberof ibc.core.connection.v1.Query - * @typedef ConnectionConsensusStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} [response] QueryConnectionConsensusStateResponse - */ - - /** - * Calls ConnectionConsensusState. - * @function connectionConsensusState - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} request QueryConnectionConsensusStateRequest message or plain object - * @param {ibc.core.connection.v1.Query.ConnectionConsensusStateCallback} callback Node-style callback called with the error, if any, and QueryConnectionConsensusStateResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.connectionConsensusState = function connectionConsensusState(request, callback) { - return this.rpcCall(connectionConsensusState, $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest, $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse, request, callback); - }, "name", { value: "ConnectionConsensusState" }); - - /** - * Calls ConnectionConsensusState. - * @function connectionConsensusState - * @memberof ibc.core.connection.v1.Query - * @instance - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} request QueryConnectionConsensusStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryConnectionRequest = (function() { - - /** - * Properties of a QueryConnectionRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionRequest - * @property {string|null} [connection_id] QueryConnectionRequest connection_id - */ - - /** - * Constructs a new QueryConnectionRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionRequest. - * @implements IQueryConnectionRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionRequest=} [properties] Properties to set - */ - function QueryConnectionRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionRequest connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @instance - */ - QueryConnectionRequest.prototype.connection_id = ""; - - /** - * Encodes the specified QueryConnectionRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionRequest} message QueryConnectionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - return writer; - }; - - /** - * Encodes the specified QueryConnectionRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionRequest} message QueryConnectionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - return null; - }; - - /** - * Creates a QueryConnectionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionRequest} QueryConnectionRequest - */ - QueryConnectionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionRequest) - return object; - let message = new $root.ibc.core.connection.v1.QueryConnectionRequest(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - return message; - }; - - /** - * Creates a plain object from a QueryConnectionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @static - * @param {ibc.core.connection.v1.QueryConnectionRequest} message QueryConnectionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.connection_id = ""; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - return object; - }; - - /** - * Converts this QueryConnectionRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionRequest; - })(); - - v1.QueryConnectionResponse = (function() { - - /** - * Properties of a QueryConnectionResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionResponse - * @property {ibc.core.connection.v1.IConnectionEnd|null} [connection] QueryConnectionResponse connection - * @property {Uint8Array|null} [proof] QueryConnectionResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryConnectionResponse proof_height - */ - - /** - * Constructs a new QueryConnectionResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionResponse. - * @implements IQueryConnectionResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionResponse=} [properties] Properties to set - */ - function QueryConnectionResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionResponse connection. - * @member {ibc.core.connection.v1.IConnectionEnd|null|undefined} connection - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @instance - */ - QueryConnectionResponse.prototype.connection = null; - - /** - * QueryConnectionResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @instance - */ - QueryConnectionResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryConnectionResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @instance - */ - QueryConnectionResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryConnectionResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionResponse} message QueryConnectionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - $root.ibc.core.connection.v1.ConnectionEnd.encode(message.connection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionResponse} message QueryConnectionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection != null && message.hasOwnProperty("connection")) { - let error = $root.ibc.core.connection.v1.ConnectionEnd.verify(message.connection); - if (error) - return "connection." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionResponse} QueryConnectionResponse - */ - QueryConnectionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionResponse) - return object; - let message = new $root.ibc.core.connection.v1.QueryConnectionResponse(); - if (object.connection != null) { - if (typeof object.connection !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionResponse.connection: object expected"); - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.fromObject(object.connection); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @static - * @param {ibc.core.connection.v1.QueryConnectionResponse} message QueryConnectionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.connection = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = $root.ibc.core.connection.v1.ConnectionEnd.toObject(message.connection, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryConnectionResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionResponse; - })(); - - v1.QueryConnectionsRequest = (function() { - - /** - * Properties of a QueryConnectionsRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionsRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryConnectionsRequest pagination - */ - - /** - * Constructs a new QueryConnectionsRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionsRequest. - * @implements IQueryConnectionsRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionsRequest=} [properties] Properties to set - */ - function QueryConnectionsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionsRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @instance - */ - QueryConnectionsRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionsRequest} message QueryConnectionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionsRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionsRequest} message QueryConnectionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionsRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionsRequest} QueryConnectionsRequest - */ - QueryConnectionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionsRequest) - return object; - let message = new $root.ibc.core.connection.v1.QueryConnectionsRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionsRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @static - * @param {ibc.core.connection.v1.QueryConnectionsRequest} message QueryConnectionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryConnectionsRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionsRequest; - })(); - - v1.QueryConnectionsResponse = (function() { - - /** - * Properties of a QueryConnectionsResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionsResponse - * @property {Array.|null} [connections] QueryConnectionsResponse connections - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryConnectionsResponse pagination - * @property {ibc.core.client.v1.IHeight|null} [height] QueryConnectionsResponse height - */ - - /** - * Constructs a new QueryConnectionsResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionsResponse. - * @implements IQueryConnectionsResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionsResponse=} [properties] Properties to set - */ - function QueryConnectionsResponse(properties) { - this.connections = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionsResponse connections. - * @member {Array.} connections - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @instance - */ - QueryConnectionsResponse.prototype.connections = $util.emptyArray; - - /** - * QueryConnectionsResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @instance - */ - QueryConnectionsResponse.prototype.pagination = null; - - /** - * QueryConnectionsResponse height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @instance - */ - QueryConnectionsResponse.prototype.height = null; - - /** - * Encodes the specified QueryConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionsResponse} message QueryConnectionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connections != null && message.connections.length) - for (let i = 0; i < message.connections.length; ++i) - $root.ibc.core.connection.v1.IdentifiedConnection.encode(message.connections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionsResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionsResponse} message QueryConnectionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.connections && message.connections.length)) - message.connections = []; - message.connections.push($root.ibc.core.connection.v1.IdentifiedConnection.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - case 3: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionsResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connections != null && message.hasOwnProperty("connections")) { - if (!Array.isArray(message.connections)) - return "connections: array expected"; - for (let i = 0; i < message.connections.length; ++i) { - let error = $root.ibc.core.connection.v1.IdentifiedConnection.verify(message.connections[i]); - if (error) - return "connections." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - let error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - if (message.height != null && message.hasOwnProperty("height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionsResponse} QueryConnectionsResponse - */ - QueryConnectionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionsResponse) - return object; - let message = new $root.ibc.core.connection.v1.QueryConnectionsResponse(); - if (object.connections) { - if (!Array.isArray(object.connections)) - throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.connections: array expected"); - message.connections = []; - for (let i = 0; i < object.connections.length; ++i) { - if (typeof object.connections[i] !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.connections: object expected"); - message.connections[i] = $root.ibc.core.connection.v1.IdentifiedConnection.fromObject(object.connections[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionsResponse.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @static - * @param {ibc.core.connection.v1.QueryConnectionsResponse} message QueryConnectionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.connections = []; - if (options.defaults) { - object.pagination = null; - object.height = null; - } - if (message.connections && message.connections.length) { - object.connections = []; - for (let j = 0; j < message.connections.length; ++j) - object.connections[j] = $root.ibc.core.connection.v1.IdentifiedConnection.toObject(message.connections[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this QueryConnectionsResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionsResponse; - })(); - - v1.QueryClientConnectionsRequest = (function() { - - /** - * Properties of a QueryClientConnectionsRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryClientConnectionsRequest - * @property {string|null} [client_id] QueryClientConnectionsRequest client_id - */ - - /** - * Constructs a new QueryClientConnectionsRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryClientConnectionsRequest. - * @implements IQueryClientConnectionsRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest=} [properties] Properties to set - */ - function QueryClientConnectionsRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientConnectionsRequest client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @instance - */ - QueryClientConnectionsRequest.prototype.client_id = ""; - - /** - * Encodes the specified QueryClientConnectionsRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} message QueryClientConnectionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientConnectionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - return writer; - }; - - /** - * Encodes the specified QueryClientConnectionsRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {ibc.core.connection.v1.IQueryClientConnectionsRequest} message QueryClientConnectionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientConnectionsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientConnectionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryClientConnectionsRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientConnectionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientConnectionsRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientConnectionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - return null; - }; - - /** - * Creates a QueryClientConnectionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryClientConnectionsRequest} QueryClientConnectionsRequest - */ - QueryClientConnectionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryClientConnectionsRequest) - return object; - let message = new $root.ibc.core.connection.v1.QueryClientConnectionsRequest(); - if (object.client_id != null) - message.client_id = String(object.client_id); - return message; - }; - - /** - * Creates a plain object from a QueryClientConnectionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @static - * @param {ibc.core.connection.v1.QueryClientConnectionsRequest} message QueryClientConnectionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientConnectionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - return object; - }; - - /** - * Converts this QueryClientConnectionsRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryClientConnectionsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryClientConnectionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientConnectionsRequest; - })(); - - v1.QueryClientConnectionsResponse = (function() { - - /** - * Properties of a QueryClientConnectionsResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryClientConnectionsResponse - * @property {Array.|null} [connection_paths] QueryClientConnectionsResponse connection_paths - * @property {Uint8Array|null} [proof] QueryClientConnectionsResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryClientConnectionsResponse proof_height - */ - - /** - * Constructs a new QueryClientConnectionsResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryClientConnectionsResponse. - * @implements IQueryClientConnectionsResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse=} [properties] Properties to set - */ - function QueryClientConnectionsResponse(properties) { - this.connection_paths = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryClientConnectionsResponse connection_paths. - * @member {Array.} connection_paths - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @instance - */ - QueryClientConnectionsResponse.prototype.connection_paths = $util.emptyArray; - - /** - * QueryClientConnectionsResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @instance - */ - QueryClientConnectionsResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryClientConnectionsResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @instance - */ - QueryClientConnectionsResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryClientConnectionsResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse} message QueryClientConnectionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientConnectionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_paths != null && message.connection_paths.length) - for (let i = 0; i < message.connection_paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_paths[i]); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryClientConnectionsResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryClientConnectionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {ibc.core.connection.v1.IQueryClientConnectionsResponse} message QueryClientConnectionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryClientConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryClientConnectionsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientConnectionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryClientConnectionsResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.connection_paths && message.connection_paths.length)) - message.connection_paths = []; - message.connection_paths.push(reader.string()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryClientConnectionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryClientConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryClientConnectionsResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryClientConnectionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_paths != null && message.hasOwnProperty("connection_paths")) { - if (!Array.isArray(message.connection_paths)) - return "connection_paths: array expected"; - for (let i = 0; i < message.connection_paths.length; ++i) - if (!$util.isString(message.connection_paths[i])) - return "connection_paths: string[] expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryClientConnectionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryClientConnectionsResponse} QueryClientConnectionsResponse - */ - QueryClientConnectionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryClientConnectionsResponse) - return object; - let message = new $root.ibc.core.connection.v1.QueryClientConnectionsResponse(); - if (object.connection_paths) { - if (!Array.isArray(object.connection_paths)) - throw TypeError(".ibc.core.connection.v1.QueryClientConnectionsResponse.connection_paths: array expected"); - message.connection_paths = []; - for (let i = 0; i < object.connection_paths.length; ++i) - message.connection_paths[i] = String(object.connection_paths[i]); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryClientConnectionsResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryClientConnectionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @static - * @param {ibc.core.connection.v1.QueryClientConnectionsResponse} message QueryClientConnectionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryClientConnectionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.connection_paths = []; - if (options.defaults) { - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.connection_paths && message.connection_paths.length) { - object.connection_paths = []; - for (let j = 0; j < message.connection_paths.length; ++j) - object.connection_paths[j] = message.connection_paths[j]; - } - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryClientConnectionsResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryClientConnectionsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryClientConnectionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryClientConnectionsResponse; - })(); - - v1.QueryConnectionClientStateRequest = (function() { - - /** - * Properties of a QueryConnectionClientStateRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionClientStateRequest - * @property {string|null} [connection_id] QueryConnectionClientStateRequest connection_id - */ - - /** - * Constructs a new QueryConnectionClientStateRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionClientStateRequest. - * @implements IQueryConnectionClientStateRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest=} [properties] Properties to set - */ - function QueryConnectionClientStateRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionClientStateRequest connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @instance - */ - QueryConnectionClientStateRequest.prototype.connection_id = ""; - - /** - * Encodes the specified QueryConnectionClientStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} message QueryConnectionClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionClientStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - return writer; - }; - - /** - * Encodes the specified QueryConnectionClientStateRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionClientStateRequest} message QueryConnectionClientStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionClientStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionClientStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionClientStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionClientStateRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionClientStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionClientStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionClientStateRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionClientStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - return null; - }; - - /** - * Creates a QueryConnectionClientStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionClientStateRequest} QueryConnectionClientStateRequest - */ - QueryConnectionClientStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionClientStateRequest) - return object; - let message = new $root.ibc.core.connection.v1.QueryConnectionClientStateRequest(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - return message; - }; - - /** - * Creates a plain object from a QueryConnectionClientStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @static - * @param {ibc.core.connection.v1.QueryConnectionClientStateRequest} message QueryConnectionClientStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionClientStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.connection_id = ""; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - return object; - }; - - /** - * Converts this QueryConnectionClientStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionClientStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionClientStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionClientStateRequest; - })(); - - v1.QueryConnectionClientStateResponse = (function() { - - /** - * Properties of a QueryConnectionClientStateResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionClientStateResponse - * @property {ibc.core.client.v1.IIdentifiedClientState|null} [identified_client_state] QueryConnectionClientStateResponse identified_client_state - * @property {Uint8Array|null} [proof] QueryConnectionClientStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryConnectionClientStateResponse proof_height - */ - - /** - * Constructs a new QueryConnectionClientStateResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionClientStateResponse. - * @implements IQueryConnectionClientStateResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse=} [properties] Properties to set - */ - function QueryConnectionClientStateResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionClientStateResponse identified_client_state. - * @member {ibc.core.client.v1.IIdentifiedClientState|null|undefined} identified_client_state - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @instance - */ - QueryConnectionClientStateResponse.prototype.identified_client_state = null; - - /** - * QueryConnectionClientStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @instance - */ - QueryConnectionClientStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryConnectionClientStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @instance - */ - QueryConnectionClientStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryConnectionClientStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse} message QueryConnectionClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionClientStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identified_client_state != null && Object.hasOwnProperty.call(message, "identified_client_state")) - $root.ibc.core.client.v1.IdentifiedClientState.encode(message.identified_client_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionClientStateResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionClientStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionClientStateResponse} message QueryConnectionClientStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionClientStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionClientStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionClientStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionClientStateResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.decode(reader, reader.uint32()); - break; - case 2: - message.proof = reader.bytes(); - break; - case 3: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionClientStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionClientStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionClientStateResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionClientStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identified_client_state != null && message.hasOwnProperty("identified_client_state")) { - let error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.identified_client_state); - if (error) - return "identified_client_state." + error; - } - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionClientStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionClientStateResponse} QueryConnectionClientStateResponse - */ - QueryConnectionClientStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionClientStateResponse) - return object; - let message = new $root.ibc.core.connection.v1.QueryConnectionClientStateResponse(); - if (object.identified_client_state != null) { - if (typeof object.identified_client_state !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionClientStateResponse.identified_client_state: object expected"); - message.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.identified_client_state); - } - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionClientStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionClientStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @static - * @param {ibc.core.connection.v1.QueryConnectionClientStateResponse} message QueryConnectionClientStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionClientStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.identified_client_state = null; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.identified_client_state != null && message.hasOwnProperty("identified_client_state")) - object.identified_client_state = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.identified_client_state, options); - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryConnectionClientStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionClientStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionClientStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionClientStateResponse; - })(); - - v1.QueryConnectionConsensusStateRequest = (function() { - - /** - * Properties of a QueryConnectionConsensusStateRequest. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionConsensusStateRequest - * @property {string|null} [connection_id] QueryConnectionConsensusStateRequest connection_id - * @property {Long|null} [revision_number] QueryConnectionConsensusStateRequest revision_number - * @property {Long|null} [revision_height] QueryConnectionConsensusStateRequest revision_height - */ - - /** - * Constructs a new QueryConnectionConsensusStateRequest. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionConsensusStateRequest. - * @implements IQueryConnectionConsensusStateRequest - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest=} [properties] Properties to set - */ - function QueryConnectionConsensusStateRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionConsensusStateRequest connection_id. - * @member {string} connection_id - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @instance - */ - QueryConnectionConsensusStateRequest.prototype.connection_id = ""; - - /** - * QueryConnectionConsensusStateRequest revision_number. - * @member {Long} revision_number - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @instance - */ - QueryConnectionConsensusStateRequest.prototype.revision_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryConnectionConsensusStateRequest revision_height. - * @member {Long} revision_height - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @instance - */ - QueryConnectionConsensusStateRequest.prototype.revision_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryConnectionConsensusStateRequest message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateRequest.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} message QueryConnectionConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionConsensusStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - if (message.revision_number != null && Object.hasOwnProperty.call(message, "revision_number")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision_number); - if (message.revision_height != null && Object.hasOwnProperty.call(message, "revision_height")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revision_height); - return writer; - }; - - /** - * Encodes the specified QueryConnectionConsensusStateRequest message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateRequest} message QueryConnectionConsensusStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionConsensusStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionConsensusStateRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionConsensusStateRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - case 2: - message.revision_number = reader.uint64(); - break; - case 3: - message.revision_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionConsensusStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionConsensusStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionConsensusStateRequest message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionConsensusStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (!$util.isInteger(message.revision_number) && !(message.revision_number && $util.isInteger(message.revision_number.low) && $util.isInteger(message.revision_number.high))) - return "revision_number: integer|Long expected"; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (!$util.isInteger(message.revision_height) && !(message.revision_height && $util.isInteger(message.revision_height.low) && $util.isInteger(message.revision_height.high))) - return "revision_height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryConnectionConsensusStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} QueryConnectionConsensusStateRequest - */ - QueryConnectionConsensusStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest) - return object; - let message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateRequest(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.revision_number != null) - if ($util.Long) - (message.revision_number = $util.Long.fromValue(object.revision_number)).unsigned = true; - else if (typeof object.revision_number === "string") - message.revision_number = parseInt(object.revision_number, 10); - else if (typeof object.revision_number === "number") - message.revision_number = object.revision_number; - else if (typeof object.revision_number === "object") - message.revision_number = new $util.LongBits(object.revision_number.low >>> 0, object.revision_number.high >>> 0).toNumber(true); - if (object.revision_height != null) - if ($util.Long) - (message.revision_height = $util.Long.fromValue(object.revision_height)).unsigned = true; - else if (typeof object.revision_height === "string") - message.revision_height = parseInt(object.revision_height, 10); - else if (typeof object.revision_height === "number") - message.revision_height = object.revision_height; - else if (typeof object.revision_height === "object") - message.revision_height = new $util.LongBits(object.revision_height.low >>> 0, object.revision_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryConnectionConsensusStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @static - * @param {ibc.core.connection.v1.QueryConnectionConsensusStateRequest} message QueryConnectionConsensusStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionConsensusStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.connection_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.revision_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_number = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.revision_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_height = options.longs === String ? "0" : 0; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (typeof message.revision_number === "number") - object.revision_number = options.longs === String ? String(message.revision_number) : message.revision_number; - else - object.revision_number = options.longs === String ? $util.Long.prototype.toString.call(message.revision_number) : options.longs === Number ? new $util.LongBits(message.revision_number.low >>> 0, message.revision_number.high >>> 0).toNumber(true) : message.revision_number; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (typeof message.revision_height === "number") - object.revision_height = options.longs === String ? String(message.revision_height) : message.revision_height; - else - object.revision_height = options.longs === String ? $util.Long.prototype.toString.call(message.revision_height) : options.longs === Number ? new $util.LongBits(message.revision_height.low >>> 0, message.revision_height.high >>> 0).toNumber(true) : message.revision_height; - return object; - }; - - /** - * Converts this QueryConnectionConsensusStateRequest to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateRequest - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionConsensusStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionConsensusStateRequest; - })(); - - v1.QueryConnectionConsensusStateResponse = (function() { - - /** - * Properties of a QueryConnectionConsensusStateResponse. - * @memberof ibc.core.connection.v1 - * @interface IQueryConnectionConsensusStateResponse - * @property {google.protobuf.IAny|null} [consensus_state] QueryConnectionConsensusStateResponse consensus_state - * @property {string|null} [client_id] QueryConnectionConsensusStateResponse client_id - * @property {Uint8Array|null} [proof] QueryConnectionConsensusStateResponse proof - * @property {ibc.core.client.v1.IHeight|null} [proof_height] QueryConnectionConsensusStateResponse proof_height - */ - - /** - * Constructs a new QueryConnectionConsensusStateResponse. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a QueryConnectionConsensusStateResponse. - * @implements IQueryConnectionConsensusStateResponse - * @constructor - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse=} [properties] Properties to set - */ - function QueryConnectionConsensusStateResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryConnectionConsensusStateResponse consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - */ - QueryConnectionConsensusStateResponse.prototype.consensus_state = null; - - /** - * QueryConnectionConsensusStateResponse client_id. - * @member {string} client_id - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - */ - QueryConnectionConsensusStateResponse.prototype.client_id = ""; - - /** - * QueryConnectionConsensusStateResponse proof. - * @member {Uint8Array} proof - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - */ - QueryConnectionConsensusStateResponse.prototype.proof = $util.newBuffer([]); - - /** - * QueryConnectionConsensusStateResponse proof_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} proof_height - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - */ - QueryConnectionConsensusStateResponse.prototype.proof_height = null; - - /** - * Encodes the specified QueryConnectionConsensusStateResponse message. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateResponse.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse} message QueryConnectionConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionConsensusStateResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.client_id); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.proof); - if (message.proof_height != null && Object.hasOwnProperty.call(message, "proof_height")) - $root.ibc.core.client.v1.Height.encode(message.proof_height, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryConnectionConsensusStateResponse message, length delimited. Does not implicitly {@link ibc.core.connection.v1.QueryConnectionConsensusStateResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {ibc.core.connection.v1.IQueryConnectionConsensusStateResponse} message QueryConnectionConsensusStateResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryConnectionConsensusStateResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryConnectionConsensusStateResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionConsensusStateResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.client_id = reader.string(); - break; - case 3: - message.proof = reader.bytes(); - break; - case 4: - message.proof_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryConnectionConsensusStateResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryConnectionConsensusStateResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryConnectionConsensusStateResponse message. - * @function verify - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryConnectionConsensusStateResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.proof != null && message.hasOwnProperty("proof")) - if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof))) - return "proof: buffer expected"; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.proof_height); - if (error) - return "proof_height." + error; - } - return null; - }; - - /** - * Creates a QueryConnectionConsensusStateResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} QueryConnectionConsensusStateResponse - */ - QueryConnectionConsensusStateResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse) - return object; - let message = new $root.ibc.core.connection.v1.QueryConnectionConsensusStateResponse(); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionConsensusStateResponse.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.proof != null) - if (typeof object.proof === "string") - $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0); - else if (object.proof.length) - message.proof = object.proof; - if (object.proof_height != null) { - if (typeof object.proof_height !== "object") - throw TypeError(".ibc.core.connection.v1.QueryConnectionConsensusStateResponse.proof_height: object expected"); - message.proof_height = $root.ibc.core.client.v1.Height.fromObject(object.proof_height); - } - return message; - }; - - /** - * Creates a plain object from a QueryConnectionConsensusStateResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @static - * @param {ibc.core.connection.v1.QueryConnectionConsensusStateResponse} message QueryConnectionConsensusStateResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryConnectionConsensusStateResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.consensus_state = null; - object.client_id = ""; - if (options.bytes === String) - object.proof = ""; - else { - object.proof = []; - if (options.bytes !== Array) - object.proof = $util.newBuffer(object.proof); - } - object.proof_height = null; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof; - if (message.proof_height != null && message.hasOwnProperty("proof_height")) - object.proof_height = $root.ibc.core.client.v1.Height.toObject(message.proof_height, options); - return object; - }; - - /** - * Converts this QueryConnectionConsensusStateResponse to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.QueryConnectionConsensusStateResponse - * @instance - * @returns {Object.} JSON object - */ - QueryConnectionConsensusStateResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryConnectionConsensusStateResponse; - })(); - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.core.connection.v1 - * @interface IGenesisState - * @property {Array.|null} [connections] GenesisState connections - * @property {Array.|null} [client_connection_paths] GenesisState client_connection_paths - * @property {Long|null} [next_connection_sequence] GenesisState next_connection_sequence - * @property {ibc.core.connection.v1.IParams|null} [params] GenesisState params - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.core.connection.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.core.connection.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.connections = []; - this.client_connection_paths = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState connections. - * @member {Array.} connections - * @memberof ibc.core.connection.v1.GenesisState - * @instance - */ - GenesisState.prototype.connections = $util.emptyArray; - - /** - * GenesisState client_connection_paths. - * @member {Array.} client_connection_paths - * @memberof ibc.core.connection.v1.GenesisState - * @instance - */ - GenesisState.prototype.client_connection_paths = $util.emptyArray; - - /** - * GenesisState next_connection_sequence. - * @member {Long} next_connection_sequence - * @memberof ibc.core.connection.v1.GenesisState - * @instance - */ - GenesisState.prototype.next_connection_sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * GenesisState params. - * @member {ibc.core.connection.v1.IParams|null|undefined} params - * @memberof ibc.core.connection.v1.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.connection.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {ibc.core.connection.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connections != null && message.connections.length) - for (let i = 0; i < message.connections.length; ++i) - $root.ibc.core.connection.v1.IdentifiedConnection.encode(message.connections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.client_connection_paths != null && message.client_connection_paths.length) - for (let i = 0; i < message.client_connection_paths.length; ++i) - $root.ibc.core.connection.v1.ConnectionPaths.encode(message.client_connection_paths[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.next_connection_sequence != null && Object.hasOwnProperty.call(message, "next_connection_sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.next_connection_sequence); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.core.connection.v1.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.connection.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {ibc.core.connection.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.connection.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.connection.v1.GenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.connections && message.connections.length)) - message.connections = []; - message.connections.push($root.ibc.core.connection.v1.IdentifiedConnection.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.client_connection_paths && message.client_connection_paths.length)) - message.client_connection_paths = []; - message.client_connection_paths.push($root.ibc.core.connection.v1.ConnectionPaths.decode(reader, reader.uint32())); - break; - case 3: - message.next_connection_sequence = reader.uint64(); - break; - case 4: - message.params = $root.ibc.core.connection.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.connection.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connections != null && message.hasOwnProperty("connections")) { - if (!Array.isArray(message.connections)) - return "connections: array expected"; - for (let i = 0; i < message.connections.length; ++i) { - let error = $root.ibc.core.connection.v1.IdentifiedConnection.verify(message.connections[i]); - if (error) - return "connections." + error; - } - } - if (message.client_connection_paths != null && message.hasOwnProperty("client_connection_paths")) { - if (!Array.isArray(message.client_connection_paths)) - return "client_connection_paths: array expected"; - for (let i = 0; i < message.client_connection_paths.length; ++i) { - let error = $root.ibc.core.connection.v1.ConnectionPaths.verify(message.client_connection_paths[i]); - if (error) - return "client_connection_paths." + error; - } - } - if (message.next_connection_sequence != null && message.hasOwnProperty("next_connection_sequence")) - if (!$util.isInteger(message.next_connection_sequence) && !(message.next_connection_sequence && $util.isInteger(message.next_connection_sequence.low) && $util.isInteger(message.next_connection_sequence.high))) - return "next_connection_sequence: integer|Long expected"; - if (message.params != null && message.hasOwnProperty("params")) { - let error = $root.ibc.core.connection.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.connection.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.connection.v1.GenesisState) - return object; - let message = new $root.ibc.core.connection.v1.GenesisState(); - if (object.connections) { - if (!Array.isArray(object.connections)) - throw TypeError(".ibc.core.connection.v1.GenesisState.connections: array expected"); - message.connections = []; - for (let i = 0; i < object.connections.length; ++i) { - if (typeof object.connections[i] !== "object") - throw TypeError(".ibc.core.connection.v1.GenesisState.connections: object expected"); - message.connections[i] = $root.ibc.core.connection.v1.IdentifiedConnection.fromObject(object.connections[i]); - } - } - if (object.client_connection_paths) { - if (!Array.isArray(object.client_connection_paths)) - throw TypeError(".ibc.core.connection.v1.GenesisState.client_connection_paths: array expected"); - message.client_connection_paths = []; - for (let i = 0; i < object.client_connection_paths.length; ++i) { - if (typeof object.client_connection_paths[i] !== "object") - throw TypeError(".ibc.core.connection.v1.GenesisState.client_connection_paths: object expected"); - message.client_connection_paths[i] = $root.ibc.core.connection.v1.ConnectionPaths.fromObject(object.client_connection_paths[i]); - } - } - if (object.next_connection_sequence != null) - if ($util.Long) - (message.next_connection_sequence = $util.Long.fromValue(object.next_connection_sequence)).unsigned = true; - else if (typeof object.next_connection_sequence === "string") - message.next_connection_sequence = parseInt(object.next_connection_sequence, 10); - else if (typeof object.next_connection_sequence === "number") - message.next_connection_sequence = object.next_connection_sequence; - else if (typeof object.next_connection_sequence === "object") - message.next_connection_sequence = new $util.LongBits(object.next_connection_sequence.low >>> 0, object.next_connection_sequence.high >>> 0).toNumber(true); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.core.connection.v1.GenesisState.params: object expected"); - message.params = $root.ibc.core.connection.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.connection.v1.GenesisState - * @static - * @param {ibc.core.connection.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.connections = []; - object.client_connection_paths = []; - } - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.next_connection_sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_connection_sequence = options.longs === String ? "0" : 0; - object.params = null; - } - if (message.connections && message.connections.length) { - object.connections = []; - for (let j = 0; j < message.connections.length; ++j) - object.connections[j] = $root.ibc.core.connection.v1.IdentifiedConnection.toObject(message.connections[j], options); - } - if (message.client_connection_paths && message.client_connection_paths.length) { - object.client_connection_paths = []; - for (let j = 0; j < message.client_connection_paths.length; ++j) - object.client_connection_paths[j] = $root.ibc.core.connection.v1.ConnectionPaths.toObject(message.client_connection_paths[j], options); - } - if (message.next_connection_sequence != null && message.hasOwnProperty("next_connection_sequence")) - if (typeof message.next_connection_sequence === "number") - object.next_connection_sequence = options.longs === String ? String(message.next_connection_sequence) : message.next_connection_sequence; - else - object.next_connection_sequence = options.longs === String ? $util.Long.prototype.toString.call(message.next_connection_sequence) : options.longs === Number ? new $util.LongBits(message.next_connection_sequence.low >>> 0, message.next_connection_sequence.high >>> 0).toNumber(true) : message.next_connection_sequence; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.core.connection.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.core.connection.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return v1; - })(); - - return connection; - })(); - - core.types = (function() { - - /** - * Namespace types. - * @memberof ibc.core - * @namespace - */ - const types = {}; - - types.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.types - * @namespace - */ - const v1 = {}; - - v1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof ibc.core.types.v1 - * @interface IGenesisState - * @property {ibc.core.client.v1.IGenesisState|null} [client_genesis] GenesisState client_genesis - * @property {ibc.core.connection.v1.IGenesisState|null} [connection_genesis] GenesisState connection_genesis - * @property {ibc.core.channel.v1.IGenesisState|null} [channel_genesis] GenesisState channel_genesis - */ - - /** - * Constructs a new GenesisState. - * @memberof ibc.core.types.v1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {ibc.core.types.v1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState client_genesis. - * @member {ibc.core.client.v1.IGenesisState|null|undefined} client_genesis - * @memberof ibc.core.types.v1.GenesisState - * @instance - */ - GenesisState.prototype.client_genesis = null; - - /** - * GenesisState connection_genesis. - * @member {ibc.core.connection.v1.IGenesisState|null|undefined} connection_genesis - * @memberof ibc.core.types.v1.GenesisState - * @instance - */ - GenesisState.prototype.connection_genesis = null; - - /** - * GenesisState channel_genesis. - * @member {ibc.core.channel.v1.IGenesisState|null|undefined} channel_genesis - * @memberof ibc.core.types.v1.GenesisState - * @instance - */ - GenesisState.prototype.channel_genesis = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link ibc.core.types.v1.GenesisState.verify|verify} messages. - * @function encode - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {ibc.core.types.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_genesis != null && Object.hasOwnProperty.call(message, "client_genesis")) - $root.ibc.core.client.v1.GenesisState.encode(message.client_genesis, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.connection_genesis != null && Object.hasOwnProperty.call(message, "connection_genesis")) - $root.ibc.core.connection.v1.GenesisState.encode(message.connection_genesis, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.channel_genesis != null && Object.hasOwnProperty.call(message, "channel_genesis")) - $root.ibc.core.channel.v1.GenesisState.encode(message.channel_genesis, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link ibc.core.types.v1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {ibc.core.types.v1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.types.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.types.v1.GenesisState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_genesis = $root.ibc.core.client.v1.GenesisState.decode(reader, reader.uint32()); - break; - case 2: - message.connection_genesis = $root.ibc.core.connection.v1.GenesisState.decode(reader, reader.uint32()); - break; - case 3: - message.channel_genesis = $root.ibc.core.channel.v1.GenesisState.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.types.v1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_genesis != null && message.hasOwnProperty("client_genesis")) { - let error = $root.ibc.core.client.v1.GenesisState.verify(message.client_genesis); - if (error) - return "client_genesis." + error; - } - if (message.connection_genesis != null && message.hasOwnProperty("connection_genesis")) { - let error = $root.ibc.core.connection.v1.GenesisState.verify(message.connection_genesis); - if (error) - return "connection_genesis." + error; - } - if (message.channel_genesis != null && message.hasOwnProperty("channel_genesis")) { - let error = $root.ibc.core.channel.v1.GenesisState.verify(message.channel_genesis); - if (error) - return "channel_genesis." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.types.v1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.types.v1.GenesisState) - return object; - let message = new $root.ibc.core.types.v1.GenesisState(); - if (object.client_genesis != null) { - if (typeof object.client_genesis !== "object") - throw TypeError(".ibc.core.types.v1.GenesisState.client_genesis: object expected"); - message.client_genesis = $root.ibc.core.client.v1.GenesisState.fromObject(object.client_genesis); - } - if (object.connection_genesis != null) { - if (typeof object.connection_genesis !== "object") - throw TypeError(".ibc.core.types.v1.GenesisState.connection_genesis: object expected"); - message.connection_genesis = $root.ibc.core.connection.v1.GenesisState.fromObject(object.connection_genesis); - } - if (object.channel_genesis != null) { - if (typeof object.channel_genesis !== "object") - throw TypeError(".ibc.core.types.v1.GenesisState.channel_genesis: object expected"); - message.channel_genesis = $root.ibc.core.channel.v1.GenesisState.fromObject(object.channel_genesis); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.types.v1.GenesisState - * @static - * @param {ibc.core.types.v1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_genesis = null; - object.connection_genesis = null; - object.channel_genesis = null; - } - if (message.client_genesis != null && message.hasOwnProperty("client_genesis")) - object.client_genesis = $root.ibc.core.client.v1.GenesisState.toObject(message.client_genesis, options); - if (message.connection_genesis != null && message.hasOwnProperty("connection_genesis")) - object.connection_genesis = $root.ibc.core.connection.v1.GenesisState.toObject(message.connection_genesis, options); - if (message.channel_genesis != null && message.hasOwnProperty("channel_genesis")) - object.channel_genesis = $root.ibc.core.channel.v1.GenesisState.toObject(message.channel_genesis, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof ibc.core.types.v1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - return v1; - })(); - - return types; - })(); - - return core; - })(); - - ibc.lightclients = (function() { - - /** - * Namespace lightclients. - * @memberof ibc - * @namespace - */ - const lightclients = {}; - - lightclients.localhost = (function() { - - /** - * Namespace localhost. - * @memberof ibc.lightclients - * @namespace - */ - const localhost = {}; - - localhost.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.lightclients.localhost - * @namespace - */ - const v1 = {}; - - v1.ClientState = (function() { - - /** - * Properties of a ClientState. - * @memberof ibc.lightclients.localhost.v1 - * @interface IClientState - * @property {string|null} [chain_id] ClientState chain_id - * @property {ibc.core.client.v1.IHeight|null} [height] ClientState height - */ - - /** - * Constructs a new ClientState. - * @memberof ibc.lightclients.localhost.v1 - * @classdesc Represents a ClientState. - * @implements IClientState - * @constructor - * @param {ibc.lightclients.localhost.v1.IClientState=} [properties] Properties to set - */ - function ClientState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientState chain_id. - * @member {string} chain_id - * @memberof ibc.lightclients.localhost.v1.ClientState - * @instance - */ - ClientState.prototype.chain_id = ""; - - /** - * ClientState height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.lightclients.localhost.v1.ClientState - * @instance - */ - ClientState.prototype.height = null; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.localhost.v1.ClientState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {ibc.lightclients.localhost.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chain_id != null && Object.hasOwnProperty.call(message, "chain_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.chain_id); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.localhost.v1.ClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {ibc.lightclients.localhost.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.localhost.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.localhost.v1.ClientState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.chain_id = reader.string(); - break; - case 2: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.localhost.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientState message. - * @function verify - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - if (!$util.isString(message.chain_id)) - return "chain_id: string expected"; - if (message.height != null && message.hasOwnProperty("height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - return null; - }; - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.localhost.v1.ClientState} ClientState - */ - ClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.localhost.v1.ClientState) - return object; - let message = new $root.ibc.lightclients.localhost.v1.ClientState(); - if (object.chain_id != null) - message.chain_id = String(object.chain_id); - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.lightclients.localhost.v1.ClientState.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - return message; - }; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.localhost.v1.ClientState - * @static - * @param {ibc.lightclients.localhost.v1.ClientState} message ClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.chain_id = ""; - object.height = null; - } - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - object.chain_id = message.chain_id; - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - return object; - }; - - /** - * Converts this ClientState to JSON. - * @function toJSON - * @memberof ibc.lightclients.localhost.v1.ClientState - * @instance - * @returns {Object.} JSON object - */ - ClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientState; - })(); - - return v1; - })(); - - return localhost; - })(); - - lightclients.solomachine = (function() { - - /** - * Namespace solomachine. - * @memberof ibc.lightclients - * @namespace - */ - const solomachine = {}; - - solomachine.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.lightclients.solomachine - * @namespace - */ - const v1 = {}; - - v1.ClientState = (function() { - - /** - * Properties of a ClientState. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IClientState - * @property {Long|null} [sequence] ClientState sequence - * @property {Long|null} [frozen_sequence] ClientState frozen_sequence - * @property {ibc.lightclients.solomachine.v1.IConsensusState|null} [consensus_state] ClientState consensus_state - * @property {boolean|null} [allow_update_after_proposal] ClientState allow_update_after_proposal - */ - - /** - * Constructs a new ClientState. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ClientState. - * @implements IClientState - * @constructor - * @param {ibc.lightclients.solomachine.v1.IClientState=} [properties] Properties to set - */ - function ClientState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientState sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - */ - ClientState.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ClientState frozen_sequence. - * @member {Long} frozen_sequence - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - */ - ClientState.prototype.frozen_sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ClientState consensus_state. - * @member {ibc.lightclients.solomachine.v1.IConsensusState|null|undefined} consensus_state - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - */ - ClientState.prototype.consensus_state = null; - - /** - * ClientState allow_update_after_proposal. - * @member {boolean} allow_update_after_proposal - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - */ - ClientState.prototype.allow_update_after_proposal = false; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {ibc.lightclients.solomachine.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.frozen_sequence != null && Object.hasOwnProperty.call(message, "frozen_sequence")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.frozen_sequence); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.ibc.lightclients.solomachine.v1.ConsensusState.encode(message.consensus_state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.allow_update_after_proposal != null && Object.hasOwnProperty.call(message, "allow_update_after_proposal")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allow_update_after_proposal); - return writer; - }; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {ibc.lightclients.solomachine.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ClientState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.frozen_sequence = reader.uint64(); - break; - case 3: - message.consensus_state = $root.ibc.lightclients.solomachine.v1.ConsensusState.decode(reader, reader.uint32()); - break; - case 4: - message.allow_update_after_proposal = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientState message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.frozen_sequence != null && message.hasOwnProperty("frozen_sequence")) - if (!$util.isInteger(message.frozen_sequence) && !(message.frozen_sequence && $util.isInteger(message.frozen_sequence.low) && $util.isInteger(message.frozen_sequence.high))) - return "frozen_sequence: integer|Long expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.ibc.lightclients.solomachine.v1.ConsensusState.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.allow_update_after_proposal != null && message.hasOwnProperty("allow_update_after_proposal")) - if (typeof message.allow_update_after_proposal !== "boolean") - return "allow_update_after_proposal: boolean expected"; - return null; - }; - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ClientState} ClientState - */ - ClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ClientState) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.ClientState(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.frozen_sequence != null) - if ($util.Long) - (message.frozen_sequence = $util.Long.fromValue(object.frozen_sequence)).unsigned = true; - else if (typeof object.frozen_sequence === "string") - message.frozen_sequence = parseInt(object.frozen_sequence, 10); - else if (typeof object.frozen_sequence === "number") - message.frozen_sequence = object.frozen_sequence; - else if (typeof object.frozen_sequence === "object") - message.frozen_sequence = new $util.LongBits(object.frozen_sequence.low >>> 0, object.frozen_sequence.high >>> 0).toNumber(true); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ClientState.consensus_state: object expected"); - message.consensus_state = $root.ibc.lightclients.solomachine.v1.ConsensusState.fromObject(object.consensus_state); - } - if (object.allow_update_after_proposal != null) - message.allow_update_after_proposal = Boolean(object.allow_update_after_proposal); - return message; - }; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @static - * @param {ibc.lightclients.solomachine.v1.ClientState} message ClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.frozen_sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.frozen_sequence = options.longs === String ? "0" : 0; - object.consensus_state = null; - object.allow_update_after_proposal = false; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.frozen_sequence != null && message.hasOwnProperty("frozen_sequence")) - if (typeof message.frozen_sequence === "number") - object.frozen_sequence = options.longs === String ? String(message.frozen_sequence) : message.frozen_sequence; - else - object.frozen_sequence = options.longs === String ? $util.Long.prototype.toString.call(message.frozen_sequence) : options.longs === Number ? new $util.LongBits(message.frozen_sequence.low >>> 0, message.frozen_sequence.high >>> 0).toNumber(true) : message.frozen_sequence; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.ibc.lightclients.solomachine.v1.ConsensusState.toObject(message.consensus_state, options); - if (message.allow_update_after_proposal != null && message.hasOwnProperty("allow_update_after_proposal")) - object.allow_update_after_proposal = message.allow_update_after_proposal; - return object; - }; - - /** - * Converts this ClientState to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ClientState - * @instance - * @returns {Object.} JSON object - */ - ClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientState; - })(); - - v1.ConsensusState = (function() { - - /** - * Properties of a ConsensusState. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IConsensusState - * @property {google.protobuf.IAny|null} [public_key] ConsensusState public_key - * @property {string|null} [diversifier] ConsensusState diversifier - * @property {Long|null} [timestamp] ConsensusState timestamp - */ - - /** - * Constructs a new ConsensusState. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ConsensusState. - * @implements IConsensusState - * @constructor - * @param {ibc.lightclients.solomachine.v1.IConsensusState=} [properties] Properties to set - */ - function ConsensusState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusState public_key. - * @member {google.protobuf.IAny|null|undefined} public_key - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.public_key = null; - - /** - * ConsensusState diversifier. - * @member {string} diversifier - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.diversifier = ""; - - /** - * ConsensusState timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified ConsensusState message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v1.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.public_key != null && Object.hasOwnProperty.call(message, "public_key")) - $root.google.protobuf.Any.encode(message.public_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.diversifier != null && Object.hasOwnProperty.call(message, "diversifier")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.diversifier); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified ConsensusState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v1.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ConsensusState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.public_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.diversifier = reader.string(); - break; - case 3: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusState message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.public_key != null && message.hasOwnProperty("public_key")) { - let error = $root.google.protobuf.Any.verify(message.public_key); - if (error) - return "public_key." + error; - } - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - if (!$util.isString(message.diversifier)) - return "diversifier: string expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a ConsensusState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ConsensusState} ConsensusState - */ - ConsensusState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ConsensusState) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.ConsensusState(); - if (object.public_key != null) { - if (typeof object.public_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ConsensusState.public_key: object expected"); - message.public_key = $root.google.protobuf.Any.fromObject(object.public_key); - } - if (object.diversifier != null) - message.diversifier = String(object.diversifier); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a ConsensusState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v1.ConsensusState} message ConsensusState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.public_key = null; - object.diversifier = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.public_key != null && message.hasOwnProperty("public_key")) - object.public_key = $root.google.protobuf.Any.toObject(message.public_key, options); - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - object.diversifier = message.diversifier; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this ConsensusState to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ConsensusState - * @instance - * @returns {Object.} JSON object - */ - ConsensusState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusState; - })(); - - v1.Header = (function() { - - /** - * Properties of a Header. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IHeader - * @property {Long|null} [sequence] Header sequence - * @property {Long|null} [timestamp] Header timestamp - * @property {Uint8Array|null} [signature] Header signature - * @property {google.protobuf.IAny|null} [new_public_key] Header new_public_key - * @property {string|null} [new_diversifier] Header new_diversifier - */ - - /** - * Constructs a new Header. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a Header. - * @implements IHeader - * @constructor - * @param {ibc.lightclients.solomachine.v1.IHeader=} [properties] Properties to set - */ - function Header(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Header sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Header timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Header signature. - * @member {Uint8Array} signature - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.signature = $util.newBuffer([]); - - /** - * Header new_public_key. - * @member {google.protobuf.IAny|null|undefined} new_public_key - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.new_public_key = null; - - /** - * Header new_diversifier. - * @member {string} new_diversifier - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - */ - Header.prototype.new_diversifier = ""; - - /** - * Encodes the specified Header message. Does not implicitly {@link ibc.lightclients.solomachine.v1.Header.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {ibc.lightclients.solomachine.v1.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature); - if (message.new_public_key != null && Object.hasOwnProperty.call(message, "new_public_key")) - $root.google.protobuf.Any.encode(message.new_public_key, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.new_diversifier != null && Object.hasOwnProperty.call(message, "new_diversifier")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.new_diversifier); - return writer; - }; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.Header.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {ibc.lightclients.solomachine.v1.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Header message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.Header(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - case 3: - message.signature = reader.bytes(); - break; - case 4: - message.new_public_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 5: - message.new_diversifier = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Header message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Header.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.new_public_key != null && message.hasOwnProperty("new_public_key")) { - let error = $root.google.protobuf.Any.verify(message.new_public_key); - if (error) - return "new_public_key." + error; - } - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - if (!$util.isString(message.new_diversifier)) - return "new_diversifier: string expected"; - return null; - }; - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.Header} Header - */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.Header) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.Header(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - if (object.new_public_key != null) { - if (typeof object.new_public_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.Header.new_public_key: object expected"); - message.new_public_key = $root.google.protobuf.Any.fromObject(object.new_public_key); - } - if (object.new_diversifier != null) - message.new_diversifier = String(object.new_diversifier); - return message; - }; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.Header - * @static - * @param {ibc.lightclients.solomachine.v1.Header} message Header - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Header.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.new_public_key = null; - object.new_diversifier = ""; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.new_public_key != null && message.hasOwnProperty("new_public_key")) - object.new_public_key = $root.google.protobuf.Any.toObject(message.new_public_key, options); - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - object.new_diversifier = message.new_diversifier; - return object; - }; - - /** - * Converts this Header to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.Header - * @instance - * @returns {Object.} JSON object - */ - Header.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Header; - })(); - - v1.Misbehaviour = (function() { - - /** - * Properties of a Misbehaviour. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IMisbehaviour - * @property {string|null} [client_id] Misbehaviour client_id - * @property {Long|null} [sequence] Misbehaviour sequence - * @property {ibc.lightclients.solomachine.v1.ISignatureAndData|null} [signature_one] Misbehaviour signature_one - * @property {ibc.lightclients.solomachine.v1.ISignatureAndData|null} [signature_two] Misbehaviour signature_two - */ - - /** - * Constructs a new Misbehaviour. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a Misbehaviour. - * @implements IMisbehaviour - * @constructor - * @param {ibc.lightclients.solomachine.v1.IMisbehaviour=} [properties] Properties to set - */ - function Misbehaviour(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Misbehaviour client_id. - * @member {string} client_id - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.client_id = ""; - - /** - * Misbehaviour sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Misbehaviour signature_one. - * @member {ibc.lightclients.solomachine.v1.ISignatureAndData|null|undefined} signature_one - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.signature_one = null; - - /** - * Misbehaviour signature_two. - * @member {ibc.lightclients.solomachine.v1.ISignatureAndData|null|undefined} signature_two - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.signature_two = null; - - /** - * Encodes the specified Misbehaviour message. Does not implicitly {@link ibc.lightclients.solomachine.v1.Misbehaviour.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v1.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.sequence); - if (message.signature_one != null && Object.hasOwnProperty.call(message, "signature_one")) - $root.ibc.lightclients.solomachine.v1.SignatureAndData.encode(message.signature_one, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signature_two != null && Object.hasOwnProperty.call(message, "signature_two")) - $root.ibc.lightclients.solomachine.v1.SignatureAndData.encode(message.signature_two, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Misbehaviour message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.Misbehaviour.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v1.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.Misbehaviour(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.sequence = reader.uint64(); - break; - case 3: - message.signature_one = $root.ibc.lightclients.solomachine.v1.SignatureAndData.decode(reader, reader.uint32()); - break; - case 4: - message.signature_two = $root.ibc.lightclients.solomachine.v1.SignatureAndData.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Misbehaviour message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Misbehaviour.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.signature_one != null && message.hasOwnProperty("signature_one")) { - let error = $root.ibc.lightclients.solomachine.v1.SignatureAndData.verify(message.signature_one); - if (error) - return "signature_one." + error; - } - if (message.signature_two != null && message.hasOwnProperty("signature_two")) { - let error = $root.ibc.lightclients.solomachine.v1.SignatureAndData.verify(message.signature_two); - if (error) - return "signature_two." + error; - } - return null; - }; - - /** - * Creates a Misbehaviour message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.Misbehaviour} Misbehaviour - */ - Misbehaviour.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.Misbehaviour) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.Misbehaviour(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.signature_one != null) { - if (typeof object.signature_one !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.Misbehaviour.signature_one: object expected"); - message.signature_one = $root.ibc.lightclients.solomachine.v1.SignatureAndData.fromObject(object.signature_one); - } - if (object.signature_two != null) { - if (typeof object.signature_two !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.Misbehaviour.signature_two: object expected"); - message.signature_two = $root.ibc.lightclients.solomachine.v1.SignatureAndData.fromObject(object.signature_two); - } - return message; - }; - - /** - * Creates a plain object from a Misbehaviour message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v1.Misbehaviour} message Misbehaviour - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Misbehaviour.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - object.signature_one = null; - object.signature_two = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.signature_one != null && message.hasOwnProperty("signature_one")) - object.signature_one = $root.ibc.lightclients.solomachine.v1.SignatureAndData.toObject(message.signature_one, options); - if (message.signature_two != null && message.hasOwnProperty("signature_two")) - object.signature_two = $root.ibc.lightclients.solomachine.v1.SignatureAndData.toObject(message.signature_two, options); - return object; - }; - - /** - * Converts this Misbehaviour to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.Misbehaviour - * @instance - * @returns {Object.} JSON object - */ - Misbehaviour.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Misbehaviour; - })(); - - v1.SignatureAndData = (function() { - - /** - * Properties of a SignatureAndData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface ISignatureAndData - * @property {Uint8Array|null} [signature] SignatureAndData signature - * @property {ibc.lightclients.solomachine.v1.DataType|null} [data_type] SignatureAndData data_type - * @property {Uint8Array|null} [data] SignatureAndData data - * @property {Long|null} [timestamp] SignatureAndData timestamp - */ - - /** - * Constructs a new SignatureAndData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a SignatureAndData. - * @implements ISignatureAndData - * @constructor - * @param {ibc.lightclients.solomachine.v1.ISignatureAndData=} [properties] Properties to set - */ - function SignatureAndData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignatureAndData signature. - * @member {Uint8Array} signature - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - */ - SignatureAndData.prototype.signature = $util.newBuffer([]); - - /** - * SignatureAndData data_type. - * @member {ibc.lightclients.solomachine.v1.DataType} data_type - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - */ - SignatureAndData.prototype.data_type = 0; - - /** - * SignatureAndData data. - * @member {Uint8Array} data - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - */ - SignatureAndData.prototype.data = $util.newBuffer([]); - - /** - * SignatureAndData timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - */ - SignatureAndData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified SignatureAndData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignatureAndData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v1.ISignatureAndData} message SignatureAndData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignatureAndData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature); - if (message.data_type != null && Object.hasOwnProperty.call(message, "data_type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.data_type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified SignatureAndData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignatureAndData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v1.ISignatureAndData} message SignatureAndData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignatureAndData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.SignatureAndData} SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignatureAndData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.SignatureAndData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature = reader.bytes(); - break; - case 2: - message.data_type = reader.int32(); - break; - case 3: - message.data = reader.bytes(); - break; - case 4: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.SignatureAndData} SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignatureAndData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignatureAndData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignatureAndData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.data_type != null && message.hasOwnProperty("data_type")) - switch (message.data_type) { - default: - return "data_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a SignatureAndData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.SignatureAndData} SignatureAndData - */ - SignatureAndData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.SignatureAndData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.SignatureAndData(); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - switch (object.data_type) { - case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.data_type = 0; - break; - case "DATA_TYPE_CLIENT_STATE": - case 1: - message.data_type = 1; - break; - case "DATA_TYPE_CONSENSUS_STATE": - case 2: - message.data_type = 2; - break; - case "DATA_TYPE_CONNECTION_STATE": - case 3: - message.data_type = 3; - break; - case "DATA_TYPE_CHANNEL_STATE": - case 4: - message.data_type = 4; - break; - case "DATA_TYPE_PACKET_COMMITMENT": - case 5: - message.data_type = 5; - break; - case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": - case 6: - message.data_type = 6; - break; - case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": - case 7: - message.data_type = 7; - break; - case "DATA_TYPE_NEXT_SEQUENCE_RECV": - case 8: - message.data_type = 8; - break; - case "DATA_TYPE_HEADER": - case 9: - message.data_type = 9; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a SignatureAndData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v1.SignatureAndData} message SignatureAndData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignatureAndData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.data_type = options.enums === String ? "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.data_type != null && message.hasOwnProperty("data_type")) - object.data_type = options.enums === String ? $root.ibc.lightclients.solomachine.v1.DataType[message.data_type] : message.data_type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this SignatureAndData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.SignatureAndData - * @instance - * @returns {Object.} JSON object - */ - SignatureAndData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignatureAndData; - })(); - - v1.TimestampedSignatureData = (function() { - - /** - * Properties of a TimestampedSignatureData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface ITimestampedSignatureData - * @property {Uint8Array|null} [signature_data] TimestampedSignatureData signature_data - * @property {Long|null} [timestamp] TimestampedSignatureData timestamp - */ - - /** - * Constructs a new TimestampedSignatureData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a TimestampedSignatureData. - * @implements ITimestampedSignatureData - * @constructor - * @param {ibc.lightclients.solomachine.v1.ITimestampedSignatureData=} [properties] Properties to set - */ - function TimestampedSignatureData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimestampedSignatureData signature_data. - * @member {Uint8Array} signature_data - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @instance - */ - TimestampedSignatureData.prototype.signature_data = $util.newBuffer([]); - - /** - * TimestampedSignatureData timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @instance - */ - TimestampedSignatureData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified TimestampedSignatureData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.TimestampedSignatureData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v1.ITimestampedSignatureData} message TimestampedSignatureData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampedSignatureData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature_data != null && Object.hasOwnProperty.call(message, "signature_data")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature_data); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified TimestampedSignatureData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.TimestampedSignatureData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v1.ITimestampedSignatureData} message TimestampedSignatureData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampedSignatureData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.TimestampedSignatureData} TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampedSignatureData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.TimestampedSignatureData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature_data = reader.bytes(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.TimestampedSignatureData} TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampedSignatureData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimestampedSignatureData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimestampedSignatureData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signature_data != null && message.hasOwnProperty("signature_data")) - if (!(message.signature_data && typeof message.signature_data.length === "number" || $util.isString(message.signature_data))) - return "signature_data: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a TimestampedSignatureData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.TimestampedSignatureData} TimestampedSignatureData - */ - TimestampedSignatureData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.TimestampedSignatureData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.TimestampedSignatureData(); - if (object.signature_data != null) - if (typeof object.signature_data === "string") - $util.base64.decode(object.signature_data, message.signature_data = $util.newBuffer($util.base64.length(object.signature_data)), 0); - else if (object.signature_data.length) - message.signature_data = object.signature_data; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TimestampedSignatureData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v1.TimestampedSignatureData} message TimestampedSignatureData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimestampedSignatureData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature_data = ""; - else { - object.signature_data = []; - if (options.bytes !== Array) - object.signature_data = $util.newBuffer(object.signature_data); - } - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.signature_data != null && message.hasOwnProperty("signature_data")) - object.signature_data = options.bytes === String ? $util.base64.encode(message.signature_data, 0, message.signature_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature_data) : message.signature_data; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this TimestampedSignatureData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.TimestampedSignatureData - * @instance - * @returns {Object.} JSON object - */ - TimestampedSignatureData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TimestampedSignatureData; - })(); - - v1.SignBytes = (function() { - - /** - * Properties of a SignBytes. - * @memberof ibc.lightclients.solomachine.v1 - * @interface ISignBytes - * @property {Long|null} [sequence] SignBytes sequence - * @property {Long|null} [timestamp] SignBytes timestamp - * @property {string|null} [diversifier] SignBytes diversifier - * @property {ibc.lightclients.solomachine.v1.DataType|null} [data_type] SignBytes data_type - * @property {Uint8Array|null} [data] SignBytes data - */ - - /** - * Constructs a new SignBytes. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a SignBytes. - * @implements ISignBytes - * @constructor - * @param {ibc.lightclients.solomachine.v1.ISignBytes=} [properties] Properties to set - */ - function SignBytes(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignBytes sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SignBytes timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SignBytes diversifier. - * @member {string} diversifier - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.diversifier = ""; - - /** - * SignBytes data_type. - * @member {ibc.lightclients.solomachine.v1.DataType} data_type - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.data_type = 0; - - /** - * SignBytes data. - * @member {Uint8Array} data - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - */ - SignBytes.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified SignBytes message. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignBytes.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v1.ISignBytes} message SignBytes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignBytes.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.diversifier != null && Object.hasOwnProperty.call(message, "diversifier")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.diversifier); - if (message.data_type != null && Object.hasOwnProperty.call(message, "data_type")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.data_type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified SignBytes message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.SignBytes.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v1.ISignBytes} message SignBytes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignBytes.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignBytes message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.SignBytes} SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignBytes.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.SignBytes(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - case 3: - message.diversifier = reader.string(); - break; - case 4: - message.data_type = reader.int32(); - break; - case 5: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignBytes message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.SignBytes} SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignBytes.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignBytes message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignBytes.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - if (!$util.isString(message.diversifier)) - return "diversifier: string expected"; - if (message.data_type != null && message.hasOwnProperty("data_type")) - switch (message.data_type) { - default: - return "data_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a SignBytes message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.SignBytes} SignBytes - */ - SignBytes.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.SignBytes) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.SignBytes(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.diversifier != null) - message.diversifier = String(object.diversifier); - switch (object.data_type) { - case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.data_type = 0; - break; - case "DATA_TYPE_CLIENT_STATE": - case 1: - message.data_type = 1; - break; - case "DATA_TYPE_CONSENSUS_STATE": - case 2: - message.data_type = 2; - break; - case "DATA_TYPE_CONNECTION_STATE": - case 3: - message.data_type = 3; - break; - case "DATA_TYPE_CHANNEL_STATE": - case 4: - message.data_type = 4; - break; - case "DATA_TYPE_PACKET_COMMITMENT": - case 5: - message.data_type = 5; - break; - case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": - case 6: - message.data_type = 6; - break; - case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": - case 7: - message.data_type = 7; - break; - case "DATA_TYPE_NEXT_SEQUENCE_RECV": - case 8: - message.data_type = 8; - break; - case "DATA_TYPE_HEADER": - case 9: - message.data_type = 9; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a SignBytes message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v1.SignBytes} message SignBytes - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignBytes.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - object.diversifier = ""; - object.data_type = options.enums === String ? "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - object.diversifier = message.diversifier; - if (message.data_type != null && message.hasOwnProperty("data_type")) - object.data_type = options.enums === String ? $root.ibc.lightclients.solomachine.v1.DataType[message.data_type] : message.data_type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this SignBytes to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.SignBytes - * @instance - * @returns {Object.} JSON object - */ - SignBytes.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignBytes; - })(); - - /** - * DataType enum. - * @name ibc.lightclients.solomachine.v1.DataType - * @enum {number} - * @property {number} DATA_TYPE_UNINITIALIZED_UNSPECIFIED=0 DATA_TYPE_UNINITIALIZED_UNSPECIFIED value - * @property {number} DATA_TYPE_CLIENT_STATE=1 DATA_TYPE_CLIENT_STATE value - * @property {number} DATA_TYPE_CONSENSUS_STATE=2 DATA_TYPE_CONSENSUS_STATE value - * @property {number} DATA_TYPE_CONNECTION_STATE=3 DATA_TYPE_CONNECTION_STATE value - * @property {number} DATA_TYPE_CHANNEL_STATE=4 DATA_TYPE_CHANNEL_STATE value - * @property {number} DATA_TYPE_PACKET_COMMITMENT=5 DATA_TYPE_PACKET_COMMITMENT value - * @property {number} DATA_TYPE_PACKET_ACKNOWLEDGEMENT=6 DATA_TYPE_PACKET_ACKNOWLEDGEMENT value - * @property {number} DATA_TYPE_PACKET_RECEIPT_ABSENCE=7 DATA_TYPE_PACKET_RECEIPT_ABSENCE value - * @property {number} DATA_TYPE_NEXT_SEQUENCE_RECV=8 DATA_TYPE_NEXT_SEQUENCE_RECV value - * @property {number} DATA_TYPE_HEADER=9 DATA_TYPE_HEADER value - */ - v1.DataType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_TYPE_UNINITIALIZED_UNSPECIFIED"] = 0; - values[valuesById[1] = "DATA_TYPE_CLIENT_STATE"] = 1; - values[valuesById[2] = "DATA_TYPE_CONSENSUS_STATE"] = 2; - values[valuesById[3] = "DATA_TYPE_CONNECTION_STATE"] = 3; - values[valuesById[4] = "DATA_TYPE_CHANNEL_STATE"] = 4; - values[valuesById[5] = "DATA_TYPE_PACKET_COMMITMENT"] = 5; - values[valuesById[6] = "DATA_TYPE_PACKET_ACKNOWLEDGEMENT"] = 6; - values[valuesById[7] = "DATA_TYPE_PACKET_RECEIPT_ABSENCE"] = 7; - values[valuesById[8] = "DATA_TYPE_NEXT_SEQUENCE_RECV"] = 8; - values[valuesById[9] = "DATA_TYPE_HEADER"] = 9; - return values; - })(); - - v1.HeaderData = (function() { - - /** - * Properties of a HeaderData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IHeaderData - * @property {google.protobuf.IAny|null} [new_pub_key] HeaderData new_pub_key - * @property {string|null} [new_diversifier] HeaderData new_diversifier - */ - - /** - * Constructs a new HeaderData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a HeaderData. - * @implements IHeaderData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IHeaderData=} [properties] Properties to set - */ - function HeaderData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HeaderData new_pub_key. - * @member {google.protobuf.IAny|null|undefined} new_pub_key - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @instance - */ - HeaderData.prototype.new_pub_key = null; - - /** - * HeaderData new_diversifier. - * @member {string} new_diversifier - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @instance - */ - HeaderData.prototype.new_diversifier = ""; - - /** - * Encodes the specified HeaderData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.HeaderData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v1.IHeaderData} message HeaderData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeaderData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.new_pub_key != null && Object.hasOwnProperty.call(message, "new_pub_key")) - $root.google.protobuf.Any.encode(message.new_pub_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.new_diversifier != null && Object.hasOwnProperty.call(message, "new_diversifier")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.new_diversifier); - return writer; - }; - - /** - * Encodes the specified HeaderData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.HeaderData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v1.IHeaderData} message HeaderData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeaderData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HeaderData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.HeaderData} HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeaderData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.HeaderData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.new_pub_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.new_diversifier = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HeaderData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.HeaderData} HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeaderData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HeaderData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HeaderData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.new_pub_key != null && message.hasOwnProperty("new_pub_key")) { - let error = $root.google.protobuf.Any.verify(message.new_pub_key); - if (error) - return "new_pub_key." + error; - } - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - if (!$util.isString(message.new_diversifier)) - return "new_diversifier: string expected"; - return null; - }; - - /** - * Creates a HeaderData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.HeaderData} HeaderData - */ - HeaderData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.HeaderData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.HeaderData(); - if (object.new_pub_key != null) { - if (typeof object.new_pub_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.HeaderData.new_pub_key: object expected"); - message.new_pub_key = $root.google.protobuf.Any.fromObject(object.new_pub_key); - } - if (object.new_diversifier != null) - message.new_diversifier = String(object.new_diversifier); - return message; - }; - - /** - * Creates a plain object from a HeaderData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v1.HeaderData} message HeaderData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HeaderData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.new_pub_key = null; - object.new_diversifier = ""; - } - if (message.new_pub_key != null && message.hasOwnProperty("new_pub_key")) - object.new_pub_key = $root.google.protobuf.Any.toObject(message.new_pub_key, options); - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - object.new_diversifier = message.new_diversifier; - return object; - }; - - /** - * Converts this HeaderData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.HeaderData - * @instance - * @returns {Object.} JSON object - */ - HeaderData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HeaderData; - })(); - - v1.ClientStateData = (function() { - - /** - * Properties of a ClientStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IClientStateData - * @property {Uint8Array|null} [path] ClientStateData path - * @property {google.protobuf.IAny|null} [client_state] ClientStateData client_state - */ - - /** - * Constructs a new ClientStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ClientStateData. - * @implements IClientStateData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IClientStateData=} [properties] Properties to set - */ - function ClientStateData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @instance - */ - ClientStateData.prototype.path = $util.newBuffer([]); - - /** - * ClientStateData client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @instance - */ - ClientStateData.prototype.client_state = null; - - /** - * Encodes the specified ClientStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IClientStateData} message ClientStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ClientStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IClientStateData} message ClientStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ClientStateData} ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ClientStateData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ClientStateData} ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - let error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - return null; - }; - - /** - * Creates a ClientStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ClientStateData} ClientStateData - */ - ClientStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ClientStateData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.ClientStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ClientStateData.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - return message; - }; - - /** - * Creates a plain object from a ClientStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v1.ClientStateData} message ClientStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.client_state = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - return object; - }; - - /** - * Converts this ClientStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ClientStateData - * @instance - * @returns {Object.} JSON object - */ - ClientStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientStateData; - })(); - - v1.ConsensusStateData = (function() { - - /** - * Properties of a ConsensusStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IConsensusStateData - * @property {Uint8Array|null} [path] ConsensusStateData path - * @property {google.protobuf.IAny|null} [consensus_state] ConsensusStateData consensus_state - */ - - /** - * Constructs a new ConsensusStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ConsensusStateData. - * @implements IConsensusStateData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IConsensusStateData=} [properties] Properties to set - */ - function ConsensusStateData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @instance - */ - ConsensusStateData.prototype.path = $util.newBuffer([]); - - /** - * ConsensusStateData consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @instance - */ - ConsensusStateData.prototype.consensus_state = null; - - /** - * Encodes the specified ConsensusStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IConsensusStateData} message ConsensusStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConsensusStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConsensusStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IConsensusStateData} message ConsensusStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ConsensusStateData} ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ConsensusStateData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ConsensusStateData} ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - return null; - }; - - /** - * Creates a ConsensusStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ConsensusStateData} ConsensusStateData - */ - ConsensusStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ConsensusStateData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.ConsensusStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ConsensusStateData.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - return message; - }; - - /** - * Creates a plain object from a ConsensusStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v1.ConsensusStateData} message ConsensusStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.consensus_state = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - return object; - }; - - /** - * Converts this ConsensusStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ConsensusStateData - * @instance - * @returns {Object.} JSON object - */ - ConsensusStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusStateData; - })(); - - v1.ConnectionStateData = (function() { - - /** - * Properties of a ConnectionStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IConnectionStateData - * @property {Uint8Array|null} [path] ConnectionStateData path - * @property {ibc.core.connection.v1.IConnectionEnd|null} [connection] ConnectionStateData connection - */ - - /** - * Constructs a new ConnectionStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ConnectionStateData. - * @implements IConnectionStateData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IConnectionStateData=} [properties] Properties to set - */ - function ConnectionStateData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @instance - */ - ConnectionStateData.prototype.path = $util.newBuffer([]); - - /** - * ConnectionStateData connection. - * @member {ibc.core.connection.v1.IConnectionEnd|null|undefined} connection - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @instance - */ - ConnectionStateData.prototype.connection = null; - - /** - * Encodes the specified ConnectionStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConnectionStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IConnectionStateData} message ConnectionStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - $root.ibc.core.connection.v1.ConnectionEnd.encode(message.connection, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConnectionStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ConnectionStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IConnectionStateData} message ConnectionStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ConnectionStateData} ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ConnectionStateData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ConnectionStateData} ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.connection != null && message.hasOwnProperty("connection")) { - let error = $root.ibc.core.connection.v1.ConnectionEnd.verify(message.connection); - if (error) - return "connection." + error; - } - return null; - }; - - /** - * Creates a ConnectionStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ConnectionStateData} ConnectionStateData - */ - ConnectionStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ConnectionStateData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.ConnectionStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.connection != null) { - if (typeof object.connection !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ConnectionStateData.connection: object expected"); - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.fromObject(object.connection); - } - return message; - }; - - /** - * Creates a plain object from a ConnectionStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v1.ConnectionStateData} message ConnectionStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.connection = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = $root.ibc.core.connection.v1.ConnectionEnd.toObject(message.connection, options); - return object; - }; - - /** - * Converts this ConnectionStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ConnectionStateData - * @instance - * @returns {Object.} JSON object - */ - ConnectionStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConnectionStateData; - })(); - - v1.ChannelStateData = (function() { - - /** - * Properties of a ChannelStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IChannelStateData - * @property {Uint8Array|null} [path] ChannelStateData path - * @property {ibc.core.channel.v1.IChannel|null} [channel] ChannelStateData channel - */ - - /** - * Constructs a new ChannelStateData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a ChannelStateData. - * @implements IChannelStateData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IChannelStateData=} [properties] Properties to set - */ - function ChannelStateData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChannelStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @instance - */ - ChannelStateData.prototype.path = $util.newBuffer([]); - - /** - * ChannelStateData channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @instance - */ - ChannelStateData.prototype.channel = null; - - /** - * Encodes the specified ChannelStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.ChannelStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IChannelStateData} message ChannelStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChannelStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.ChannelStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v1.IChannelStateData} message ChannelStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.ChannelStateData} ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.ChannelStateData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.ChannelStateData} ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChannelStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChannelStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - let error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - return null; - }; - - /** - * Creates a ChannelStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.ChannelStateData} ChannelStateData - */ - ChannelStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.ChannelStateData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.ChannelStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.lightclients.solomachine.v1.ChannelStateData.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - return message; - }; - - /** - * Creates a plain object from a ChannelStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v1.ChannelStateData} message ChannelStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChannelStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.channel = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - return object; - }; - - /** - * Converts this ChannelStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.ChannelStateData - * @instance - * @returns {Object.} JSON object - */ - ChannelStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ChannelStateData; - })(); - - v1.PacketCommitmentData = (function() { - - /** - * Properties of a PacketCommitmentData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IPacketCommitmentData - * @property {Uint8Array|null} [path] PacketCommitmentData path - * @property {Uint8Array|null} [commitment] PacketCommitmentData commitment - */ - - /** - * Constructs a new PacketCommitmentData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a PacketCommitmentData. - * @implements IPacketCommitmentData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IPacketCommitmentData=} [properties] Properties to set - */ - function PacketCommitmentData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketCommitmentData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @instance - */ - PacketCommitmentData.prototype.path = $util.newBuffer([]); - - /** - * PacketCommitmentData commitment. - * @member {Uint8Array} commitment - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @instance - */ - PacketCommitmentData.prototype.commitment = $util.newBuffer([]); - - /** - * Encodes the specified PacketCommitmentData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketCommitmentData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketCommitmentData} message PacketCommitmentData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketCommitmentData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.commitment); - return writer; - }; - - /** - * Encodes the specified PacketCommitmentData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketCommitmentData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketCommitmentData} message PacketCommitmentData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketCommitmentData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.PacketCommitmentData} PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketCommitmentData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.PacketCommitmentData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.commitment = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.PacketCommitmentData} PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketCommitmentData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketCommitmentData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketCommitmentData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.commitment != null && message.hasOwnProperty("commitment")) - if (!(message.commitment && typeof message.commitment.length === "number" || $util.isString(message.commitment))) - return "commitment: buffer expected"; - return null; - }; - - /** - * Creates a PacketCommitmentData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.PacketCommitmentData} PacketCommitmentData - */ - PacketCommitmentData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.PacketCommitmentData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.PacketCommitmentData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.commitment != null) - if (typeof object.commitment === "string") - $util.base64.decode(object.commitment, message.commitment = $util.newBuffer($util.base64.length(object.commitment)), 0); - else if (object.commitment.length) - message.commitment = object.commitment; - return message; - }; - - /** - * Creates a plain object from a PacketCommitmentData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v1.PacketCommitmentData} message PacketCommitmentData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketCommitmentData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (options.bytes === String) - object.commitment = ""; - else { - object.commitment = []; - if (options.bytes !== Array) - object.commitment = $util.newBuffer(object.commitment); - } - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.commitment != null && message.hasOwnProperty("commitment")) - object.commitment = options.bytes === String ? $util.base64.encode(message.commitment, 0, message.commitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.commitment) : message.commitment; - return object; - }; - - /** - * Converts this PacketCommitmentData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.PacketCommitmentData - * @instance - * @returns {Object.} JSON object - */ - PacketCommitmentData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketCommitmentData; - })(); - - v1.PacketAcknowledgementData = (function() { - - /** - * Properties of a PacketAcknowledgementData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IPacketAcknowledgementData - * @property {Uint8Array|null} [path] PacketAcknowledgementData path - * @property {Uint8Array|null} [acknowledgement] PacketAcknowledgementData acknowledgement - */ - - /** - * Constructs a new PacketAcknowledgementData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a PacketAcknowledgementData. - * @implements IPacketAcknowledgementData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IPacketAcknowledgementData=} [properties] Properties to set - */ - function PacketAcknowledgementData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketAcknowledgementData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @instance - */ - PacketAcknowledgementData.prototype.path = $util.newBuffer([]); - - /** - * PacketAcknowledgementData acknowledgement. - * @member {Uint8Array} acknowledgement - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @instance - */ - PacketAcknowledgementData.prototype.acknowledgement = $util.newBuffer([]); - - /** - * Encodes the specified PacketAcknowledgementData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketAcknowledgementData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketAcknowledgementData} message PacketAcknowledgementData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketAcknowledgementData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.acknowledgement); - return writer; - }; - - /** - * Encodes the specified PacketAcknowledgementData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketAcknowledgementData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketAcknowledgementData} message PacketAcknowledgementData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketAcknowledgementData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.PacketAcknowledgementData} PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketAcknowledgementData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.PacketAcknowledgementData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.acknowledgement = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.PacketAcknowledgementData} PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketAcknowledgementData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketAcknowledgementData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketAcknowledgementData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) - return "acknowledgement: buffer expected"; - return null; - }; - - /** - * Creates a PacketAcknowledgementData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.PacketAcknowledgementData} PacketAcknowledgementData - */ - PacketAcknowledgementData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.PacketAcknowledgementData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.PacketAcknowledgementData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.acknowledgement != null) - if (typeof object.acknowledgement === "string") - $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); - else if (object.acknowledgement.length) - message.acknowledgement = object.acknowledgement; - return message; - }; - - /** - * Creates a plain object from a PacketAcknowledgementData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v1.PacketAcknowledgementData} message PacketAcknowledgementData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketAcknowledgementData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (options.bytes === String) - object.acknowledgement = ""; - else { - object.acknowledgement = []; - if (options.bytes !== Array) - object.acknowledgement = $util.newBuffer(object.acknowledgement); - } - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; - return object; - }; - - /** - * Converts this PacketAcknowledgementData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.PacketAcknowledgementData - * @instance - * @returns {Object.} JSON object - */ - PacketAcknowledgementData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketAcknowledgementData; - })(); - - v1.PacketReceiptAbsenceData = (function() { - - /** - * Properties of a PacketReceiptAbsenceData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface IPacketReceiptAbsenceData - * @property {Uint8Array|null} [path] PacketReceiptAbsenceData path - */ - - /** - * Constructs a new PacketReceiptAbsenceData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a PacketReceiptAbsenceData. - * @implements IPacketReceiptAbsenceData - * @constructor - * @param {ibc.lightclients.solomachine.v1.IPacketReceiptAbsenceData=} [properties] Properties to set - */ - function PacketReceiptAbsenceData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketReceiptAbsenceData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @instance - */ - PacketReceiptAbsenceData.prototype.path = $util.newBuffer([]); - - /** - * Encodes the specified PacketReceiptAbsenceData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketReceiptAbsenceData} message PacketReceiptAbsenceData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketReceiptAbsenceData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - return writer; - }; - - /** - * Encodes the specified PacketReceiptAbsenceData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v1.IPacketReceiptAbsenceData} message PacketReceiptAbsenceData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketReceiptAbsenceData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData} PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketReceiptAbsenceData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData} PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketReceiptAbsenceData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketReceiptAbsenceData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketReceiptAbsenceData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - return null; - }; - - /** - * Creates a PacketReceiptAbsenceData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData} PacketReceiptAbsenceData - */ - PacketReceiptAbsenceData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - return message; - }; - - /** - * Creates a plain object from a PacketReceiptAbsenceData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData} message PacketReceiptAbsenceData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketReceiptAbsenceData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - return object; - }; - - /** - * Converts this PacketReceiptAbsenceData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData - * @instance - * @returns {Object.} JSON object - */ - PacketReceiptAbsenceData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketReceiptAbsenceData; - })(); - - v1.NextSequenceRecvData = (function() { - - /** - * Properties of a NextSequenceRecvData. - * @memberof ibc.lightclients.solomachine.v1 - * @interface INextSequenceRecvData - * @property {Uint8Array|null} [path] NextSequenceRecvData path - * @property {Long|null} [next_seq_recv] NextSequenceRecvData next_seq_recv - */ - - /** - * Constructs a new NextSequenceRecvData. - * @memberof ibc.lightclients.solomachine.v1 - * @classdesc Represents a NextSequenceRecvData. - * @implements INextSequenceRecvData - * @constructor - * @param {ibc.lightclients.solomachine.v1.INextSequenceRecvData=} [properties] Properties to set - */ - function NextSequenceRecvData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NextSequenceRecvData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @instance - */ - NextSequenceRecvData.prototype.path = $util.newBuffer([]); - - /** - * NextSequenceRecvData next_seq_recv. - * @member {Long} next_seq_recv - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @instance - */ - NextSequenceRecvData.prototype.next_seq_recv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified NextSequenceRecvData message. Does not implicitly {@link ibc.lightclients.solomachine.v1.NextSequenceRecvData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v1.INextSequenceRecvData} message NextSequenceRecvData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NextSequenceRecvData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.next_seq_recv != null && Object.hasOwnProperty.call(message, "next_seq_recv")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.next_seq_recv); - return writer; - }; - - /** - * Encodes the specified NextSequenceRecvData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v1.NextSequenceRecvData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v1.INextSequenceRecvData} message NextSequenceRecvData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NextSequenceRecvData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v1.NextSequenceRecvData} NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NextSequenceRecvData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v1.NextSequenceRecvData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.next_seq_recv = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v1.NextSequenceRecvData} NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NextSequenceRecvData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NextSequenceRecvData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NextSequenceRecvData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.next_seq_recv != null && message.hasOwnProperty("next_seq_recv")) - if (!$util.isInteger(message.next_seq_recv) && !(message.next_seq_recv && $util.isInteger(message.next_seq_recv.low) && $util.isInteger(message.next_seq_recv.high))) - return "next_seq_recv: integer|Long expected"; - return null; - }; - - /** - * Creates a NextSequenceRecvData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v1.NextSequenceRecvData} NextSequenceRecvData - */ - NextSequenceRecvData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v1.NextSequenceRecvData) - return object; - let message = new $root.ibc.lightclients.solomachine.v1.NextSequenceRecvData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.next_seq_recv != null) - if ($util.Long) - (message.next_seq_recv = $util.Long.fromValue(object.next_seq_recv)).unsigned = true; - else if (typeof object.next_seq_recv === "string") - message.next_seq_recv = parseInt(object.next_seq_recv, 10); - else if (typeof object.next_seq_recv === "number") - message.next_seq_recv = object.next_seq_recv; - else if (typeof object.next_seq_recv === "object") - message.next_seq_recv = new $util.LongBits(object.next_seq_recv.low >>> 0, object.next_seq_recv.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a NextSequenceRecvData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v1.NextSequenceRecvData} message NextSequenceRecvData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NextSequenceRecvData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.next_seq_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_seq_recv = options.longs === String ? "0" : 0; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.next_seq_recv != null && message.hasOwnProperty("next_seq_recv")) - if (typeof message.next_seq_recv === "number") - object.next_seq_recv = options.longs === String ? String(message.next_seq_recv) : message.next_seq_recv; - else - object.next_seq_recv = options.longs === String ? $util.Long.prototype.toString.call(message.next_seq_recv) : options.longs === Number ? new $util.LongBits(message.next_seq_recv.low >>> 0, message.next_seq_recv.high >>> 0).toNumber(true) : message.next_seq_recv; - return object; - }; - - /** - * Converts this NextSequenceRecvData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v1.NextSequenceRecvData - * @instance - * @returns {Object.} JSON object - */ - NextSequenceRecvData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NextSequenceRecvData; - })(); - - return v1; - })(); - - solomachine.v2 = (function() { - - /** - * Namespace v2. - * @memberof ibc.lightclients.solomachine - * @namespace - */ - const v2 = {}; - - v2.ClientState = (function() { - - /** - * Properties of a ClientState. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IClientState - * @property {Long|null} [sequence] ClientState sequence - * @property {boolean|null} [is_frozen] ClientState is_frozen - * @property {ibc.lightclients.solomachine.v2.IConsensusState|null} [consensus_state] ClientState consensus_state - * @property {boolean|null} [allow_update_after_proposal] ClientState allow_update_after_proposal - */ - - /** - * Constructs a new ClientState. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ClientState. - * @implements IClientState - * @constructor - * @param {ibc.lightclients.solomachine.v2.IClientState=} [properties] Properties to set - */ - function ClientState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientState sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - */ - ClientState.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ClientState is_frozen. - * @member {boolean} is_frozen - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - */ - ClientState.prototype.is_frozen = false; - - /** - * ClientState consensus_state. - * @member {ibc.lightclients.solomachine.v2.IConsensusState|null|undefined} consensus_state - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - */ - ClientState.prototype.consensus_state = null; - - /** - * ClientState allow_update_after_proposal. - * @member {boolean} allow_update_after_proposal - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - */ - ClientState.prototype.allow_update_after_proposal = false; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {ibc.lightclients.solomachine.v2.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.is_frozen != null && Object.hasOwnProperty.call(message, "is_frozen")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_frozen); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.ibc.lightclients.solomachine.v2.ConsensusState.encode(message.consensus_state, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.allow_update_after_proposal != null && Object.hasOwnProperty.call(message, "allow_update_after_proposal")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allow_update_after_proposal); - return writer; - }; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {ibc.lightclients.solomachine.v2.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ClientState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.is_frozen = reader.bool(); - break; - case 3: - message.consensus_state = $root.ibc.lightclients.solomachine.v2.ConsensusState.decode(reader, reader.uint32()); - break; - case 4: - message.allow_update_after_proposal = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientState message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.is_frozen != null && message.hasOwnProperty("is_frozen")) - if (typeof message.is_frozen !== "boolean") - return "is_frozen: boolean expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.ibc.lightclients.solomachine.v2.ConsensusState.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - if (message.allow_update_after_proposal != null && message.hasOwnProperty("allow_update_after_proposal")) - if (typeof message.allow_update_after_proposal !== "boolean") - return "allow_update_after_proposal: boolean expected"; - return null; - }; - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ClientState} ClientState - */ - ClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ClientState) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.ClientState(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.is_frozen != null) - message.is_frozen = Boolean(object.is_frozen); - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ClientState.consensus_state: object expected"); - message.consensus_state = $root.ibc.lightclients.solomachine.v2.ConsensusState.fromObject(object.consensus_state); - } - if (object.allow_update_after_proposal != null) - message.allow_update_after_proposal = Boolean(object.allow_update_after_proposal); - return message; - }; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @static - * @param {ibc.lightclients.solomachine.v2.ClientState} message ClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - object.is_frozen = false; - object.consensus_state = null; - object.allow_update_after_proposal = false; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.is_frozen != null && message.hasOwnProperty("is_frozen")) - object.is_frozen = message.is_frozen; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.ibc.lightclients.solomachine.v2.ConsensusState.toObject(message.consensus_state, options); - if (message.allow_update_after_proposal != null && message.hasOwnProperty("allow_update_after_proposal")) - object.allow_update_after_proposal = message.allow_update_after_proposal; - return object; - }; - - /** - * Converts this ClientState to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ClientState - * @instance - * @returns {Object.} JSON object - */ - ClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientState; - })(); - - v2.ConsensusState = (function() { - - /** - * Properties of a ConsensusState. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IConsensusState - * @property {google.protobuf.IAny|null} [public_key] ConsensusState public_key - * @property {string|null} [diversifier] ConsensusState diversifier - * @property {Long|null} [timestamp] ConsensusState timestamp - */ - - /** - * Constructs a new ConsensusState. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ConsensusState. - * @implements IConsensusState - * @constructor - * @param {ibc.lightclients.solomachine.v2.IConsensusState=} [properties] Properties to set - */ - function ConsensusState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusState public_key. - * @member {google.protobuf.IAny|null|undefined} public_key - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @instance - */ - ConsensusState.prototype.public_key = null; - - /** - * ConsensusState diversifier. - * @member {string} diversifier - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @instance - */ - ConsensusState.prototype.diversifier = ""; - - /** - * ConsensusState timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @instance - */ - ConsensusState.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified ConsensusState message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v2.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.public_key != null && Object.hasOwnProperty.call(message, "public_key")) - $root.google.protobuf.Any.encode(message.public_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.diversifier != null && Object.hasOwnProperty.call(message, "diversifier")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.diversifier); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified ConsensusState message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v2.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ConsensusState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.public_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.diversifier = reader.string(); - break; - case 3: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusState message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.public_key != null && message.hasOwnProperty("public_key")) { - let error = $root.google.protobuf.Any.verify(message.public_key); - if (error) - return "public_key." + error; - } - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - if (!$util.isString(message.diversifier)) - return "diversifier: string expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a ConsensusState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ConsensusState} ConsensusState - */ - ConsensusState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ConsensusState) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.ConsensusState(); - if (object.public_key != null) { - if (typeof object.public_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ConsensusState.public_key: object expected"); - message.public_key = $root.google.protobuf.Any.fromObject(object.public_key); - } - if (object.diversifier != null) - message.diversifier = String(object.diversifier); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a ConsensusState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @static - * @param {ibc.lightclients.solomachine.v2.ConsensusState} message ConsensusState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.public_key = null; - object.diversifier = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.public_key != null && message.hasOwnProperty("public_key")) - object.public_key = $root.google.protobuf.Any.toObject(message.public_key, options); - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - object.diversifier = message.diversifier; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this ConsensusState to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ConsensusState - * @instance - * @returns {Object.} JSON object - */ - ConsensusState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusState; - })(); - - v2.Header = (function() { - - /** - * Properties of a Header. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IHeader - * @property {Long|null} [sequence] Header sequence - * @property {Long|null} [timestamp] Header timestamp - * @property {Uint8Array|null} [signature] Header signature - * @property {google.protobuf.IAny|null} [new_public_key] Header new_public_key - * @property {string|null} [new_diversifier] Header new_diversifier - */ - - /** - * Constructs a new Header. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a Header. - * @implements IHeader - * @constructor - * @param {ibc.lightclients.solomachine.v2.IHeader=} [properties] Properties to set - */ - function Header(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Header sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Header timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Header signature. - * @member {Uint8Array} signature - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.signature = $util.newBuffer([]); - - /** - * Header new_public_key. - * @member {google.protobuf.IAny|null|undefined} new_public_key - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.new_public_key = null; - - /** - * Header new_diversifier. - * @member {string} new_diversifier - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - */ - Header.prototype.new_diversifier = ""; - - /** - * Encodes the specified Header message. Does not implicitly {@link ibc.lightclients.solomachine.v2.Header.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {ibc.lightclients.solomachine.v2.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature); - if (message.new_public_key != null && Object.hasOwnProperty.call(message, "new_public_key")) - $root.google.protobuf.Any.encode(message.new_public_key, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.new_diversifier != null && Object.hasOwnProperty.call(message, "new_diversifier")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.new_diversifier); - return writer; - }; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.Header.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {ibc.lightclients.solomachine.v2.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Header message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.Header(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - case 3: - message.signature = reader.bytes(); - break; - case 4: - message.new_public_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 5: - message.new_diversifier = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Header message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Header.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.new_public_key != null && message.hasOwnProperty("new_public_key")) { - let error = $root.google.protobuf.Any.verify(message.new_public_key); - if (error) - return "new_public_key." + error; - } - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - if (!$util.isString(message.new_diversifier)) - return "new_diversifier: string expected"; - return null; - }; - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.Header} Header - */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.Header) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.Header(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - if (object.new_public_key != null) { - if (typeof object.new_public_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.Header.new_public_key: object expected"); - message.new_public_key = $root.google.protobuf.Any.fromObject(object.new_public_key); - } - if (object.new_diversifier != null) - message.new_diversifier = String(object.new_diversifier); - return message; - }; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.Header - * @static - * @param {ibc.lightclients.solomachine.v2.Header} message Header - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Header.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.new_public_key = null; - object.new_diversifier = ""; - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.new_public_key != null && message.hasOwnProperty("new_public_key")) - object.new_public_key = $root.google.protobuf.Any.toObject(message.new_public_key, options); - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - object.new_diversifier = message.new_diversifier; - return object; - }; - - /** - * Converts this Header to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.Header - * @instance - * @returns {Object.} JSON object - */ - Header.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Header; - })(); - - v2.Misbehaviour = (function() { - - /** - * Properties of a Misbehaviour. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IMisbehaviour - * @property {string|null} [client_id] Misbehaviour client_id - * @property {Long|null} [sequence] Misbehaviour sequence - * @property {ibc.lightclients.solomachine.v2.ISignatureAndData|null} [signature_one] Misbehaviour signature_one - * @property {ibc.lightclients.solomachine.v2.ISignatureAndData|null} [signature_two] Misbehaviour signature_two - */ - - /** - * Constructs a new Misbehaviour. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a Misbehaviour. - * @implements IMisbehaviour - * @constructor - * @param {ibc.lightclients.solomachine.v2.IMisbehaviour=} [properties] Properties to set - */ - function Misbehaviour(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Misbehaviour client_id. - * @member {string} client_id - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - */ - Misbehaviour.prototype.client_id = ""; - - /** - * Misbehaviour sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - */ - Misbehaviour.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Misbehaviour signature_one. - * @member {ibc.lightclients.solomachine.v2.ISignatureAndData|null|undefined} signature_one - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - */ - Misbehaviour.prototype.signature_one = null; - - /** - * Misbehaviour signature_two. - * @member {ibc.lightclients.solomachine.v2.ISignatureAndData|null|undefined} signature_two - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - */ - Misbehaviour.prototype.signature_two = null; - - /** - * Encodes the specified Misbehaviour message. Does not implicitly {@link ibc.lightclients.solomachine.v2.Misbehaviour.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v2.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.sequence); - if (message.signature_one != null && Object.hasOwnProperty.call(message, "signature_one")) - $root.ibc.lightclients.solomachine.v2.SignatureAndData.encode(message.signature_one, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signature_two != null && Object.hasOwnProperty.call(message, "signature_two")) - $root.ibc.lightclients.solomachine.v2.SignatureAndData.encode(message.signature_two, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Misbehaviour message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.Misbehaviour.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v2.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.Misbehaviour(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.sequence = reader.uint64(); - break; - case 3: - message.signature_one = $root.ibc.lightclients.solomachine.v2.SignatureAndData.decode(reader, reader.uint32()); - break; - case 4: - message.signature_two = $root.ibc.lightclients.solomachine.v2.SignatureAndData.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Misbehaviour message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Misbehaviour.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.signature_one != null && message.hasOwnProperty("signature_one")) { - let error = $root.ibc.lightclients.solomachine.v2.SignatureAndData.verify(message.signature_one); - if (error) - return "signature_one." + error; - } - if (message.signature_two != null && message.hasOwnProperty("signature_two")) { - let error = $root.ibc.lightclients.solomachine.v2.SignatureAndData.verify(message.signature_two); - if (error) - return "signature_two." + error; - } - return null; - }; - - /** - * Creates a Misbehaviour message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.Misbehaviour} Misbehaviour - */ - Misbehaviour.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.Misbehaviour) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.Misbehaviour(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.signature_one != null) { - if (typeof object.signature_one !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.Misbehaviour.signature_one: object expected"); - message.signature_one = $root.ibc.lightclients.solomachine.v2.SignatureAndData.fromObject(object.signature_one); - } - if (object.signature_two != null) { - if (typeof object.signature_two !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.Misbehaviour.signature_two: object expected"); - message.signature_two = $root.ibc.lightclients.solomachine.v2.SignatureAndData.fromObject(object.signature_two); - } - return message; - }; - - /** - * Creates a plain object from a Misbehaviour message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @static - * @param {ibc.lightclients.solomachine.v2.Misbehaviour} message Misbehaviour - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Misbehaviour.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - object.signature_one = null; - object.signature_two = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.signature_one != null && message.hasOwnProperty("signature_one")) - object.signature_one = $root.ibc.lightclients.solomachine.v2.SignatureAndData.toObject(message.signature_one, options); - if (message.signature_two != null && message.hasOwnProperty("signature_two")) - object.signature_two = $root.ibc.lightclients.solomachine.v2.SignatureAndData.toObject(message.signature_two, options); - return object; - }; - - /** - * Converts this Misbehaviour to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.Misbehaviour - * @instance - * @returns {Object.} JSON object - */ - Misbehaviour.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Misbehaviour; - })(); - - v2.SignatureAndData = (function() { - - /** - * Properties of a SignatureAndData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface ISignatureAndData - * @property {Uint8Array|null} [signature] SignatureAndData signature - * @property {ibc.lightclients.solomachine.v2.DataType|null} [data_type] SignatureAndData data_type - * @property {Uint8Array|null} [data] SignatureAndData data - * @property {Long|null} [timestamp] SignatureAndData timestamp - */ - - /** - * Constructs a new SignatureAndData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a SignatureAndData. - * @implements ISignatureAndData - * @constructor - * @param {ibc.lightclients.solomachine.v2.ISignatureAndData=} [properties] Properties to set - */ - function SignatureAndData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignatureAndData signature. - * @member {Uint8Array} signature - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - */ - SignatureAndData.prototype.signature = $util.newBuffer([]); - - /** - * SignatureAndData data_type. - * @member {ibc.lightclients.solomachine.v2.DataType} data_type - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - */ - SignatureAndData.prototype.data_type = 0; - - /** - * SignatureAndData data. - * @member {Uint8Array} data - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - */ - SignatureAndData.prototype.data = $util.newBuffer([]); - - /** - * SignatureAndData timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - */ - SignatureAndData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified SignatureAndData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignatureAndData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v2.ISignatureAndData} message SignatureAndData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignatureAndData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature); - if (message.data_type != null && Object.hasOwnProperty.call(message, "data_type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.data_type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified SignatureAndData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignatureAndData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v2.ISignatureAndData} message SignatureAndData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignatureAndData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.SignatureAndData} SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignatureAndData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.SignatureAndData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature = reader.bytes(); - break; - case 2: - message.data_type = reader.int32(); - break; - case 3: - message.data = reader.bytes(); - break; - case 4: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignatureAndData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.SignatureAndData} SignatureAndData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignatureAndData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignatureAndData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignatureAndData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.data_type != null && message.hasOwnProperty("data_type")) - switch (message.data_type) { - default: - return "data_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a SignatureAndData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.SignatureAndData} SignatureAndData - */ - SignatureAndData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.SignatureAndData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.SignatureAndData(); - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - switch (object.data_type) { - case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.data_type = 0; - break; - case "DATA_TYPE_CLIENT_STATE": - case 1: - message.data_type = 1; - break; - case "DATA_TYPE_CONSENSUS_STATE": - case 2: - message.data_type = 2; - break; - case "DATA_TYPE_CONNECTION_STATE": - case 3: - message.data_type = 3; - break; - case "DATA_TYPE_CHANNEL_STATE": - case 4: - message.data_type = 4; - break; - case "DATA_TYPE_PACKET_COMMITMENT": - case 5: - message.data_type = 5; - break; - case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": - case 6: - message.data_type = 6; - break; - case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": - case 7: - message.data_type = 7; - break; - case "DATA_TYPE_NEXT_SEQUENCE_RECV": - case 8: - message.data_type = 8; - break; - case "DATA_TYPE_HEADER": - case 9: - message.data_type = 9; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a SignatureAndData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @static - * @param {ibc.lightclients.solomachine.v2.SignatureAndData} message SignatureAndData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignatureAndData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - object.data_type = options.enums === String ? "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.data_type != null && message.hasOwnProperty("data_type")) - object.data_type = options.enums === String ? $root.ibc.lightclients.solomachine.v2.DataType[message.data_type] : message.data_type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this SignatureAndData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.SignatureAndData - * @instance - * @returns {Object.} JSON object - */ - SignatureAndData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignatureAndData; - })(); - - v2.TimestampedSignatureData = (function() { - - /** - * Properties of a TimestampedSignatureData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface ITimestampedSignatureData - * @property {Uint8Array|null} [signature_data] TimestampedSignatureData signature_data - * @property {Long|null} [timestamp] TimestampedSignatureData timestamp - */ - - /** - * Constructs a new TimestampedSignatureData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a TimestampedSignatureData. - * @implements ITimestampedSignatureData - * @constructor - * @param {ibc.lightclients.solomachine.v2.ITimestampedSignatureData=} [properties] Properties to set - */ - function TimestampedSignatureData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TimestampedSignatureData signature_data. - * @member {Uint8Array} signature_data - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @instance - */ - TimestampedSignatureData.prototype.signature_data = $util.newBuffer([]); - - /** - * TimestampedSignatureData timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @instance - */ - TimestampedSignatureData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified TimestampedSignatureData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.TimestampedSignatureData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v2.ITimestampedSignatureData} message TimestampedSignatureData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampedSignatureData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signature_data != null && Object.hasOwnProperty.call(message, "signature_data")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature_data); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - return writer; - }; - - /** - * Encodes the specified TimestampedSignatureData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.TimestampedSignatureData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v2.ITimestampedSignatureData} message TimestampedSignatureData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampedSignatureData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.TimestampedSignatureData} TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampedSignatureData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.TimestampedSignatureData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signature_data = reader.bytes(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimestampedSignatureData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.TimestampedSignatureData} TimestampedSignatureData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampedSignatureData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimestampedSignatureData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimestampedSignatureData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signature_data != null && message.hasOwnProperty("signature_data")) - if (!(message.signature_data && typeof message.signature_data.length === "number" || $util.isString(message.signature_data))) - return "signature_data: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - return null; - }; - - /** - * Creates a TimestampedSignatureData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.TimestampedSignatureData} TimestampedSignatureData - */ - TimestampedSignatureData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.TimestampedSignatureData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.TimestampedSignatureData(); - if (object.signature_data != null) - if (typeof object.signature_data === "string") - $util.base64.decode(object.signature_data, message.signature_data = $util.newBuffer($util.base64.length(object.signature_data)), 0); - else if (object.signature_data.length) - message.signature_data = object.signature_data; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a TimestampedSignatureData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @static - * @param {ibc.lightclients.solomachine.v2.TimestampedSignatureData} message TimestampedSignatureData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimestampedSignatureData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.signature_data = ""; - else { - object.signature_data = []; - if (options.bytes !== Array) - object.signature_data = $util.newBuffer(object.signature_data); - } - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.signature_data != null && message.hasOwnProperty("signature_data")) - object.signature_data = options.bytes === String ? $util.base64.encode(message.signature_data, 0, message.signature_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature_data) : message.signature_data; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - return object; - }; - - /** - * Converts this TimestampedSignatureData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.TimestampedSignatureData - * @instance - * @returns {Object.} JSON object - */ - TimestampedSignatureData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TimestampedSignatureData; - })(); - - v2.SignBytes = (function() { - - /** - * Properties of a SignBytes. - * @memberof ibc.lightclients.solomachine.v2 - * @interface ISignBytes - * @property {Long|null} [sequence] SignBytes sequence - * @property {Long|null} [timestamp] SignBytes timestamp - * @property {string|null} [diversifier] SignBytes diversifier - * @property {ibc.lightclients.solomachine.v2.DataType|null} [data_type] SignBytes data_type - * @property {Uint8Array|null} [data] SignBytes data - */ - - /** - * Constructs a new SignBytes. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a SignBytes. - * @implements ISignBytes - * @constructor - * @param {ibc.lightclients.solomachine.v2.ISignBytes=} [properties] Properties to set - */ - function SignBytes(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignBytes sequence. - * @member {Long} sequence - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SignBytes timestamp. - * @member {Long} timestamp - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * SignBytes diversifier. - * @member {string} diversifier - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.diversifier = ""; - - /** - * SignBytes data_type. - * @member {ibc.lightclients.solomachine.v2.DataType} data_type - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.data_type = 0; - - /** - * SignBytes data. - * @member {Uint8Array} data - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - */ - SignBytes.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified SignBytes message. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignBytes.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v2.ISignBytes} message SignBytes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignBytes.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.diversifier != null && Object.hasOwnProperty.call(message, "diversifier")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.diversifier); - if (message.data_type != null && Object.hasOwnProperty.call(message, "data_type")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.data_type); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified SignBytes message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.SignBytes.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v2.ISignBytes} message SignBytes message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignBytes.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignBytes message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.SignBytes} SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignBytes.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.SignBytes(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence = reader.uint64(); - break; - case 2: - message.timestamp = reader.uint64(); - break; - case 3: - message.diversifier = reader.string(); - break; - case 4: - message.data_type = reader.int32(); - break; - case 5: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignBytes message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.SignBytes} SignBytes - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignBytes.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignBytes message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignBytes.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - if (!$util.isString(message.diversifier)) - return "diversifier: string expected"; - if (message.data_type != null && message.hasOwnProperty("data_type")) - switch (message.data_type) { - default: - return "data_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a SignBytes message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.SignBytes} SignBytes - */ - SignBytes.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.SignBytes) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.SignBytes(); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.diversifier != null) - message.diversifier = String(object.diversifier); - switch (object.data_type) { - case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": - case 0: - message.data_type = 0; - break; - case "DATA_TYPE_CLIENT_STATE": - case 1: - message.data_type = 1; - break; - case "DATA_TYPE_CONSENSUS_STATE": - case 2: - message.data_type = 2; - break; - case "DATA_TYPE_CONNECTION_STATE": - case 3: - message.data_type = 3; - break; - case "DATA_TYPE_CHANNEL_STATE": - case 4: - message.data_type = 4; - break; - case "DATA_TYPE_PACKET_COMMITMENT": - case 5: - message.data_type = 5; - break; - case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": - case 6: - message.data_type = 6; - break; - case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": - case 7: - message.data_type = 7; - break; - case "DATA_TYPE_NEXT_SEQUENCE_RECV": - case 8: - message.data_type = 8; - break; - case "DATA_TYPE_HEADER": - case 9: - message.data_type = 9; - break; - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a SignBytes message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @static - * @param {ibc.lightclients.solomachine.v2.SignBytes} message SignBytes - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignBytes.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - object.diversifier = ""; - object.data_type = options.enums === String ? "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.diversifier != null && message.hasOwnProperty("diversifier")) - object.diversifier = message.diversifier; - if (message.data_type != null && message.hasOwnProperty("data_type")) - object.data_type = options.enums === String ? $root.ibc.lightclients.solomachine.v2.DataType[message.data_type] : message.data_type; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this SignBytes to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.SignBytes - * @instance - * @returns {Object.} JSON object - */ - SignBytes.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignBytes; - })(); - - /** - * DataType enum. - * @name ibc.lightclients.solomachine.v2.DataType - * @enum {number} - * @property {number} DATA_TYPE_UNINITIALIZED_UNSPECIFIED=0 DATA_TYPE_UNINITIALIZED_UNSPECIFIED value - * @property {number} DATA_TYPE_CLIENT_STATE=1 DATA_TYPE_CLIENT_STATE value - * @property {number} DATA_TYPE_CONSENSUS_STATE=2 DATA_TYPE_CONSENSUS_STATE value - * @property {number} DATA_TYPE_CONNECTION_STATE=3 DATA_TYPE_CONNECTION_STATE value - * @property {number} DATA_TYPE_CHANNEL_STATE=4 DATA_TYPE_CHANNEL_STATE value - * @property {number} DATA_TYPE_PACKET_COMMITMENT=5 DATA_TYPE_PACKET_COMMITMENT value - * @property {number} DATA_TYPE_PACKET_ACKNOWLEDGEMENT=6 DATA_TYPE_PACKET_ACKNOWLEDGEMENT value - * @property {number} DATA_TYPE_PACKET_RECEIPT_ABSENCE=7 DATA_TYPE_PACKET_RECEIPT_ABSENCE value - * @property {number} DATA_TYPE_NEXT_SEQUENCE_RECV=8 DATA_TYPE_NEXT_SEQUENCE_RECV value - * @property {number} DATA_TYPE_HEADER=9 DATA_TYPE_HEADER value - */ - v2.DataType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_TYPE_UNINITIALIZED_UNSPECIFIED"] = 0; - values[valuesById[1] = "DATA_TYPE_CLIENT_STATE"] = 1; - values[valuesById[2] = "DATA_TYPE_CONSENSUS_STATE"] = 2; - values[valuesById[3] = "DATA_TYPE_CONNECTION_STATE"] = 3; - values[valuesById[4] = "DATA_TYPE_CHANNEL_STATE"] = 4; - values[valuesById[5] = "DATA_TYPE_PACKET_COMMITMENT"] = 5; - values[valuesById[6] = "DATA_TYPE_PACKET_ACKNOWLEDGEMENT"] = 6; - values[valuesById[7] = "DATA_TYPE_PACKET_RECEIPT_ABSENCE"] = 7; - values[valuesById[8] = "DATA_TYPE_NEXT_SEQUENCE_RECV"] = 8; - values[valuesById[9] = "DATA_TYPE_HEADER"] = 9; - return values; - })(); - - v2.HeaderData = (function() { - - /** - * Properties of a HeaderData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IHeaderData - * @property {google.protobuf.IAny|null} [new_pub_key] HeaderData new_pub_key - * @property {string|null} [new_diversifier] HeaderData new_diversifier - */ - - /** - * Constructs a new HeaderData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a HeaderData. - * @implements IHeaderData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IHeaderData=} [properties] Properties to set - */ - function HeaderData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HeaderData new_pub_key. - * @member {google.protobuf.IAny|null|undefined} new_pub_key - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @instance - */ - HeaderData.prototype.new_pub_key = null; - - /** - * HeaderData new_diversifier. - * @member {string} new_diversifier - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @instance - */ - HeaderData.prototype.new_diversifier = ""; - - /** - * Encodes the specified HeaderData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.HeaderData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v2.IHeaderData} message HeaderData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeaderData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.new_pub_key != null && Object.hasOwnProperty.call(message, "new_pub_key")) - $root.google.protobuf.Any.encode(message.new_pub_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.new_diversifier != null && Object.hasOwnProperty.call(message, "new_diversifier")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.new_diversifier); - return writer; - }; - - /** - * Encodes the specified HeaderData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.HeaderData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v2.IHeaderData} message HeaderData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HeaderData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HeaderData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.HeaderData} HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeaderData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.HeaderData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.new_pub_key = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.new_diversifier = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HeaderData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.HeaderData} HeaderData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HeaderData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HeaderData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HeaderData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.new_pub_key != null && message.hasOwnProperty("new_pub_key")) { - let error = $root.google.protobuf.Any.verify(message.new_pub_key); - if (error) - return "new_pub_key." + error; - } - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - if (!$util.isString(message.new_diversifier)) - return "new_diversifier: string expected"; - return null; - }; - - /** - * Creates a HeaderData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.HeaderData} HeaderData - */ - HeaderData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.HeaderData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.HeaderData(); - if (object.new_pub_key != null) { - if (typeof object.new_pub_key !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.HeaderData.new_pub_key: object expected"); - message.new_pub_key = $root.google.protobuf.Any.fromObject(object.new_pub_key); - } - if (object.new_diversifier != null) - message.new_diversifier = String(object.new_diversifier); - return message; - }; - - /** - * Creates a plain object from a HeaderData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @static - * @param {ibc.lightclients.solomachine.v2.HeaderData} message HeaderData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HeaderData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.new_pub_key = null; - object.new_diversifier = ""; - } - if (message.new_pub_key != null && message.hasOwnProperty("new_pub_key")) - object.new_pub_key = $root.google.protobuf.Any.toObject(message.new_pub_key, options); - if (message.new_diversifier != null && message.hasOwnProperty("new_diversifier")) - object.new_diversifier = message.new_diversifier; - return object; - }; - - /** - * Converts this HeaderData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.HeaderData - * @instance - * @returns {Object.} JSON object - */ - HeaderData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HeaderData; - })(); - - v2.ClientStateData = (function() { - - /** - * Properties of a ClientStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IClientStateData - * @property {Uint8Array|null} [path] ClientStateData path - * @property {google.protobuf.IAny|null} [client_state] ClientStateData client_state - */ - - /** - * Constructs a new ClientStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ClientStateData. - * @implements IClientStateData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IClientStateData=} [properties] Properties to set - */ - function ClientStateData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @instance - */ - ClientStateData.prototype.path = $util.newBuffer([]); - - /** - * ClientStateData client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @instance - */ - ClientStateData.prototype.client_state = null; - - /** - * Encodes the specified ClientStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IClientStateData} message ClientStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ClientStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IClientStateData} message ClientStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ClientStateData} ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ClientStateData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ClientStateData} ClientStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - let error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - return null; - }; - - /** - * Creates a ClientStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ClientStateData} ClientStateData - */ - ClientStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ClientStateData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.ClientStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ClientStateData.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - return message; - }; - - /** - * Creates a plain object from a ClientStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @static - * @param {ibc.lightclients.solomachine.v2.ClientStateData} message ClientStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.client_state = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - return object; - }; - - /** - * Converts this ClientStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ClientStateData - * @instance - * @returns {Object.} JSON object - */ - ClientStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientStateData; - })(); - - v2.ConsensusStateData = (function() { - - /** - * Properties of a ConsensusStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IConsensusStateData - * @property {Uint8Array|null} [path] ConsensusStateData path - * @property {google.protobuf.IAny|null} [consensus_state] ConsensusStateData consensus_state - */ - - /** - * Constructs a new ConsensusStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ConsensusStateData. - * @implements IConsensusStateData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IConsensusStateData=} [properties] Properties to set - */ - function ConsensusStateData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @instance - */ - ConsensusStateData.prototype.path = $util.newBuffer([]); - - /** - * ConsensusStateData consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @instance - */ - ConsensusStateData.prototype.consensus_state = null; - - /** - * Encodes the specified ConsensusStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IConsensusStateData} message ConsensusStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConsensusStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConsensusStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IConsensusStateData} message ConsensusStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ConsensusStateData} ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ConsensusStateData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ConsensusStateData} ConsensusStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - let error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - return null; - }; - - /** - * Creates a ConsensusStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ConsensusStateData} ConsensusStateData - */ - ConsensusStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ConsensusStateData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.ConsensusStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ConsensusStateData.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - return message; - }; - - /** - * Creates a plain object from a ConsensusStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @static - * @param {ibc.lightclients.solomachine.v2.ConsensusStateData} message ConsensusStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.consensus_state = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - return object; - }; - - /** - * Converts this ConsensusStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ConsensusStateData - * @instance - * @returns {Object.} JSON object - */ - ConsensusStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusStateData; - })(); - - v2.ConnectionStateData = (function() { - - /** - * Properties of a ConnectionStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IConnectionStateData - * @property {Uint8Array|null} [path] ConnectionStateData path - * @property {ibc.core.connection.v1.IConnectionEnd|null} [connection] ConnectionStateData connection - */ - - /** - * Constructs a new ConnectionStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ConnectionStateData. - * @implements IConnectionStateData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IConnectionStateData=} [properties] Properties to set - */ - function ConnectionStateData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConnectionStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @instance - */ - ConnectionStateData.prototype.path = $util.newBuffer([]); - - /** - * ConnectionStateData connection. - * @member {ibc.core.connection.v1.IConnectionEnd|null|undefined} connection - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @instance - */ - ConnectionStateData.prototype.connection = null; - - /** - * Encodes the specified ConnectionStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConnectionStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IConnectionStateData} message ConnectionStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) - $root.ibc.core.connection.v1.ConnectionEnd.encode(message.connection, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConnectionStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ConnectionStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IConnectionStateData} message ConnectionStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConnectionStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ConnectionStateData} ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ConnectionStateData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConnectionStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ConnectionStateData} ConnectionStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConnectionStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConnectionStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConnectionStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.connection != null && message.hasOwnProperty("connection")) { - let error = $root.ibc.core.connection.v1.ConnectionEnd.verify(message.connection); - if (error) - return "connection." + error; - } - return null; - }; - - /** - * Creates a ConnectionStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ConnectionStateData} ConnectionStateData - */ - ConnectionStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ConnectionStateData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.ConnectionStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.connection != null) { - if (typeof object.connection !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ConnectionStateData.connection: object expected"); - message.connection = $root.ibc.core.connection.v1.ConnectionEnd.fromObject(object.connection); - } - return message; - }; - - /** - * Creates a plain object from a ConnectionStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @static - * @param {ibc.lightclients.solomachine.v2.ConnectionStateData} message ConnectionStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConnectionStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.connection = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.connection != null && message.hasOwnProperty("connection")) - object.connection = $root.ibc.core.connection.v1.ConnectionEnd.toObject(message.connection, options); - return object; - }; - - /** - * Converts this ConnectionStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ConnectionStateData - * @instance - * @returns {Object.} JSON object - */ - ConnectionStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConnectionStateData; - })(); - - v2.ChannelStateData = (function() { - - /** - * Properties of a ChannelStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IChannelStateData - * @property {Uint8Array|null} [path] ChannelStateData path - * @property {ibc.core.channel.v1.IChannel|null} [channel] ChannelStateData channel - */ - - /** - * Constructs a new ChannelStateData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a ChannelStateData. - * @implements IChannelStateData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IChannelStateData=} [properties] Properties to set - */ - function ChannelStateData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChannelStateData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @instance - */ - ChannelStateData.prototype.path = $util.newBuffer([]); - - /** - * ChannelStateData channel. - * @member {ibc.core.channel.v1.IChannel|null|undefined} channel - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @instance - */ - ChannelStateData.prototype.channel = null; - - /** - * Encodes the specified ChannelStateData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.ChannelStateData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IChannelStateData} message ChannelStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelStateData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - $root.ibc.core.channel.v1.Channel.encode(message.channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChannelStateData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.ChannelStateData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v2.IChannelStateData} message ChannelStateData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChannelStateData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.ChannelStateData} ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelStateData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.ChannelStateData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.channel = $root.ibc.core.channel.v1.Channel.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChannelStateData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.ChannelStateData} ChannelStateData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChannelStateData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChannelStateData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChannelStateData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.channel != null && message.hasOwnProperty("channel")) { - let error = $root.ibc.core.channel.v1.Channel.verify(message.channel); - if (error) - return "channel." + error; - } - return null; - }; - - /** - * Creates a ChannelStateData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.ChannelStateData} ChannelStateData - */ - ChannelStateData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.ChannelStateData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.ChannelStateData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.channel != null) { - if (typeof object.channel !== "object") - throw TypeError(".ibc.lightclients.solomachine.v2.ChannelStateData.channel: object expected"); - message.channel = $root.ibc.core.channel.v1.Channel.fromObject(object.channel); - } - return message; - }; - - /** - * Creates a plain object from a ChannelStateData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @static - * @param {ibc.lightclients.solomachine.v2.ChannelStateData} message ChannelStateData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChannelStateData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - object.channel = null; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = $root.ibc.core.channel.v1.Channel.toObject(message.channel, options); - return object; - }; - - /** - * Converts this ChannelStateData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.ChannelStateData - * @instance - * @returns {Object.} JSON object - */ - ChannelStateData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ChannelStateData; - })(); - - v2.PacketCommitmentData = (function() { - - /** - * Properties of a PacketCommitmentData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IPacketCommitmentData - * @property {Uint8Array|null} [path] PacketCommitmentData path - * @property {Uint8Array|null} [commitment] PacketCommitmentData commitment - */ - - /** - * Constructs a new PacketCommitmentData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a PacketCommitmentData. - * @implements IPacketCommitmentData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IPacketCommitmentData=} [properties] Properties to set - */ - function PacketCommitmentData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketCommitmentData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @instance - */ - PacketCommitmentData.prototype.path = $util.newBuffer([]); - - /** - * PacketCommitmentData commitment. - * @member {Uint8Array} commitment - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @instance - */ - PacketCommitmentData.prototype.commitment = $util.newBuffer([]); - - /** - * Encodes the specified PacketCommitmentData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketCommitmentData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketCommitmentData} message PacketCommitmentData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketCommitmentData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.commitment); - return writer; - }; - - /** - * Encodes the specified PacketCommitmentData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketCommitmentData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketCommitmentData} message PacketCommitmentData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketCommitmentData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.PacketCommitmentData} PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketCommitmentData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.PacketCommitmentData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.commitment = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketCommitmentData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.PacketCommitmentData} PacketCommitmentData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketCommitmentData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketCommitmentData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketCommitmentData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.commitment != null && message.hasOwnProperty("commitment")) - if (!(message.commitment && typeof message.commitment.length === "number" || $util.isString(message.commitment))) - return "commitment: buffer expected"; - return null; - }; - - /** - * Creates a PacketCommitmentData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.PacketCommitmentData} PacketCommitmentData - */ - PacketCommitmentData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.PacketCommitmentData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.PacketCommitmentData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.commitment != null) - if (typeof object.commitment === "string") - $util.base64.decode(object.commitment, message.commitment = $util.newBuffer($util.base64.length(object.commitment)), 0); - else if (object.commitment.length) - message.commitment = object.commitment; - return message; - }; - - /** - * Creates a plain object from a PacketCommitmentData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @static - * @param {ibc.lightclients.solomachine.v2.PacketCommitmentData} message PacketCommitmentData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketCommitmentData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (options.bytes === String) - object.commitment = ""; - else { - object.commitment = []; - if (options.bytes !== Array) - object.commitment = $util.newBuffer(object.commitment); - } - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.commitment != null && message.hasOwnProperty("commitment")) - object.commitment = options.bytes === String ? $util.base64.encode(message.commitment, 0, message.commitment.length) : options.bytes === Array ? Array.prototype.slice.call(message.commitment) : message.commitment; - return object; - }; - - /** - * Converts this PacketCommitmentData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.PacketCommitmentData - * @instance - * @returns {Object.} JSON object - */ - PacketCommitmentData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketCommitmentData; - })(); - - v2.PacketAcknowledgementData = (function() { - - /** - * Properties of a PacketAcknowledgementData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IPacketAcknowledgementData - * @property {Uint8Array|null} [path] PacketAcknowledgementData path - * @property {Uint8Array|null} [acknowledgement] PacketAcknowledgementData acknowledgement - */ - - /** - * Constructs a new PacketAcknowledgementData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a PacketAcknowledgementData. - * @implements IPacketAcknowledgementData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IPacketAcknowledgementData=} [properties] Properties to set - */ - function PacketAcknowledgementData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketAcknowledgementData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @instance - */ - PacketAcknowledgementData.prototype.path = $util.newBuffer([]); - - /** - * PacketAcknowledgementData acknowledgement. - * @member {Uint8Array} acknowledgement - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @instance - */ - PacketAcknowledgementData.prototype.acknowledgement = $util.newBuffer([]); - - /** - * Encodes the specified PacketAcknowledgementData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketAcknowledgementData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketAcknowledgementData} message PacketAcknowledgementData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketAcknowledgementData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.acknowledgement != null && Object.hasOwnProperty.call(message, "acknowledgement")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.acknowledgement); - return writer; - }; - - /** - * Encodes the specified PacketAcknowledgementData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketAcknowledgementData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketAcknowledgementData} message PacketAcknowledgementData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketAcknowledgementData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.PacketAcknowledgementData} PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketAcknowledgementData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.PacketAcknowledgementData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.acknowledgement = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketAcknowledgementData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.PacketAcknowledgementData} PacketAcknowledgementData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketAcknowledgementData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketAcknowledgementData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketAcknowledgementData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - if (!(message.acknowledgement && typeof message.acknowledgement.length === "number" || $util.isString(message.acknowledgement))) - return "acknowledgement: buffer expected"; - return null; - }; - - /** - * Creates a PacketAcknowledgementData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.PacketAcknowledgementData} PacketAcknowledgementData - */ - PacketAcknowledgementData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.PacketAcknowledgementData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.PacketAcknowledgementData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.acknowledgement != null) - if (typeof object.acknowledgement === "string") - $util.base64.decode(object.acknowledgement, message.acknowledgement = $util.newBuffer($util.base64.length(object.acknowledgement)), 0); - else if (object.acknowledgement.length) - message.acknowledgement = object.acknowledgement; - return message; - }; - - /** - * Creates a plain object from a PacketAcknowledgementData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @static - * @param {ibc.lightclients.solomachine.v2.PacketAcknowledgementData} message PacketAcknowledgementData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketAcknowledgementData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (options.bytes === String) - object.acknowledgement = ""; - else { - object.acknowledgement = []; - if (options.bytes !== Array) - object.acknowledgement = $util.newBuffer(object.acknowledgement); - } - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.acknowledgement != null && message.hasOwnProperty("acknowledgement")) - object.acknowledgement = options.bytes === String ? $util.base64.encode(message.acknowledgement, 0, message.acknowledgement.length) : options.bytes === Array ? Array.prototype.slice.call(message.acknowledgement) : message.acknowledgement; - return object; - }; - - /** - * Converts this PacketAcknowledgementData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.PacketAcknowledgementData - * @instance - * @returns {Object.} JSON object - */ - PacketAcknowledgementData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketAcknowledgementData; - })(); - - v2.PacketReceiptAbsenceData = (function() { - - /** - * Properties of a PacketReceiptAbsenceData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface IPacketReceiptAbsenceData - * @property {Uint8Array|null} [path] PacketReceiptAbsenceData path - */ - - /** - * Constructs a new PacketReceiptAbsenceData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a PacketReceiptAbsenceData. - * @implements IPacketReceiptAbsenceData - * @constructor - * @param {ibc.lightclients.solomachine.v2.IPacketReceiptAbsenceData=} [properties] Properties to set - */ - function PacketReceiptAbsenceData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketReceiptAbsenceData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @instance - */ - PacketReceiptAbsenceData.prototype.path = $util.newBuffer([]); - - /** - * Encodes the specified PacketReceiptAbsenceData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketReceiptAbsenceData} message PacketReceiptAbsenceData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketReceiptAbsenceData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - return writer; - }; - - /** - * Encodes the specified PacketReceiptAbsenceData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v2.IPacketReceiptAbsenceData} message PacketReceiptAbsenceData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketReceiptAbsenceData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData} PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketReceiptAbsenceData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketReceiptAbsenceData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData} PacketReceiptAbsenceData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketReceiptAbsenceData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketReceiptAbsenceData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketReceiptAbsenceData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - return null; - }; - - /** - * Creates a PacketReceiptAbsenceData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData} PacketReceiptAbsenceData - */ - PacketReceiptAbsenceData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - return message; - }; - - /** - * Creates a plain object from a PacketReceiptAbsenceData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @static - * @param {ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData} message PacketReceiptAbsenceData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketReceiptAbsenceData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - return object; - }; - - /** - * Converts this PacketReceiptAbsenceData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData - * @instance - * @returns {Object.} JSON object - */ - PacketReceiptAbsenceData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketReceiptAbsenceData; - })(); - - v2.NextSequenceRecvData = (function() { - - /** - * Properties of a NextSequenceRecvData. - * @memberof ibc.lightclients.solomachine.v2 - * @interface INextSequenceRecvData - * @property {Uint8Array|null} [path] NextSequenceRecvData path - * @property {Long|null} [next_seq_recv] NextSequenceRecvData next_seq_recv - */ - - /** - * Constructs a new NextSequenceRecvData. - * @memberof ibc.lightclients.solomachine.v2 - * @classdesc Represents a NextSequenceRecvData. - * @implements INextSequenceRecvData - * @constructor - * @param {ibc.lightclients.solomachine.v2.INextSequenceRecvData=} [properties] Properties to set - */ - function NextSequenceRecvData(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NextSequenceRecvData path. - * @member {Uint8Array} path - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @instance - */ - NextSequenceRecvData.prototype.path = $util.newBuffer([]); - - /** - * NextSequenceRecvData next_seq_recv. - * @member {Long} next_seq_recv - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @instance - */ - NextSequenceRecvData.prototype.next_seq_recv = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified NextSequenceRecvData message. Does not implicitly {@link ibc.lightclients.solomachine.v2.NextSequenceRecvData.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v2.INextSequenceRecvData} message NextSequenceRecvData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NextSequenceRecvData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.path); - if (message.next_seq_recv != null && Object.hasOwnProperty.call(message, "next_seq_recv")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.next_seq_recv); - return writer; - }; - - /** - * Encodes the specified NextSequenceRecvData message, length delimited. Does not implicitly {@link ibc.lightclients.solomachine.v2.NextSequenceRecvData.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v2.INextSequenceRecvData} message NextSequenceRecvData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NextSequenceRecvData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.solomachine.v2.NextSequenceRecvData} NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NextSequenceRecvData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.solomachine.v2.NextSequenceRecvData(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.bytes(); - break; - case 2: - message.next_seq_recv = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NextSequenceRecvData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.solomachine.v2.NextSequenceRecvData} NextSequenceRecvData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NextSequenceRecvData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NextSequenceRecvData message. - * @function verify - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NextSequenceRecvData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!(message.path && typeof message.path.length === "number" || $util.isString(message.path))) - return "path: buffer expected"; - if (message.next_seq_recv != null && message.hasOwnProperty("next_seq_recv")) - if (!$util.isInteger(message.next_seq_recv) && !(message.next_seq_recv && $util.isInteger(message.next_seq_recv.low) && $util.isInteger(message.next_seq_recv.high))) - return "next_seq_recv: integer|Long expected"; - return null; - }; - - /** - * Creates a NextSequenceRecvData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.solomachine.v2.NextSequenceRecvData} NextSequenceRecvData - */ - NextSequenceRecvData.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.solomachine.v2.NextSequenceRecvData) - return object; - let message = new $root.ibc.lightclients.solomachine.v2.NextSequenceRecvData(); - if (object.path != null) - if (typeof object.path === "string") - $util.base64.decode(object.path, message.path = $util.newBuffer($util.base64.length(object.path)), 0); - else if (object.path.length) - message.path = object.path; - if (object.next_seq_recv != null) - if ($util.Long) - (message.next_seq_recv = $util.Long.fromValue(object.next_seq_recv)).unsigned = true; - else if (typeof object.next_seq_recv === "string") - message.next_seq_recv = parseInt(object.next_seq_recv, 10); - else if (typeof object.next_seq_recv === "number") - message.next_seq_recv = object.next_seq_recv; - else if (typeof object.next_seq_recv === "object") - message.next_seq_recv = new $util.LongBits(object.next_seq_recv.low >>> 0, object.next_seq_recv.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a NextSequenceRecvData message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @static - * @param {ibc.lightclients.solomachine.v2.NextSequenceRecvData} message NextSequenceRecvData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NextSequenceRecvData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.path = ""; - else { - object.path = []; - if (options.bytes !== Array) - object.path = $util.newBuffer(object.path); - } - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.next_seq_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.next_seq_recv = options.longs === String ? "0" : 0; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = options.bytes === String ? $util.base64.encode(message.path, 0, message.path.length) : options.bytes === Array ? Array.prototype.slice.call(message.path) : message.path; - if (message.next_seq_recv != null && message.hasOwnProperty("next_seq_recv")) - if (typeof message.next_seq_recv === "number") - object.next_seq_recv = options.longs === String ? String(message.next_seq_recv) : message.next_seq_recv; - else - object.next_seq_recv = options.longs === String ? $util.Long.prototype.toString.call(message.next_seq_recv) : options.longs === Number ? new $util.LongBits(message.next_seq_recv.low >>> 0, message.next_seq_recv.high >>> 0).toNumber(true) : message.next_seq_recv; - return object; - }; - - /** - * Converts this NextSequenceRecvData to JSON. - * @function toJSON - * @memberof ibc.lightclients.solomachine.v2.NextSequenceRecvData - * @instance - * @returns {Object.} JSON object - */ - NextSequenceRecvData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NextSequenceRecvData; - })(); - - return v2; - })(); - - return solomachine; - })(); - - lightclients.tendermint = (function() { - - /** - * Namespace tendermint. - * @memberof ibc.lightclients - * @namespace - */ - const tendermint = {}; - - tendermint.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.lightclients.tendermint - * @namespace - */ - const v1 = {}; - - v1.ClientState = (function() { - - /** - * Properties of a ClientState. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IClientState - * @property {string|null} [chain_id] ClientState chain_id - * @property {ibc.lightclients.tendermint.v1.IFraction|null} [trust_level] ClientState trust_level - * @property {google.protobuf.IDuration|null} [trusting_period] ClientState trusting_period - * @property {google.protobuf.IDuration|null} [unbonding_period] ClientState unbonding_period - * @property {google.protobuf.IDuration|null} [max_clock_drift] ClientState max_clock_drift - * @property {ibc.core.client.v1.IHeight|null} [frozen_height] ClientState frozen_height - * @property {ibc.core.client.v1.IHeight|null} [latest_height] ClientState latest_height - * @property {Array.|null} [proof_specs] ClientState proof_specs - * @property {Array.|null} [upgrade_path] ClientState upgrade_path - * @property {boolean|null} [allow_update_after_expiry] ClientState allow_update_after_expiry - * @property {boolean|null} [allow_update_after_misbehaviour] ClientState allow_update_after_misbehaviour - */ - - /** - * Constructs a new ClientState. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a ClientState. - * @implements IClientState - * @constructor - * @param {ibc.lightclients.tendermint.v1.IClientState=} [properties] Properties to set - */ - function ClientState(properties) { - this.proof_specs = []; - this.upgrade_path = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientState chain_id. - * @member {string} chain_id - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.chain_id = ""; - - /** - * ClientState trust_level. - * @member {ibc.lightclients.tendermint.v1.IFraction|null|undefined} trust_level - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.trust_level = null; - - /** - * ClientState trusting_period. - * @member {google.protobuf.IDuration|null|undefined} trusting_period - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.trusting_period = null; - - /** - * ClientState unbonding_period. - * @member {google.protobuf.IDuration|null|undefined} unbonding_period - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.unbonding_period = null; - - /** - * ClientState max_clock_drift. - * @member {google.protobuf.IDuration|null|undefined} max_clock_drift - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.max_clock_drift = null; - - /** - * ClientState frozen_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} frozen_height - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.frozen_height = null; - - /** - * ClientState latest_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} latest_height - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.latest_height = null; - - /** - * ClientState proof_specs. - * @member {Array.} proof_specs - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.proof_specs = $util.emptyArray; - - /** - * ClientState upgrade_path. - * @member {Array.} upgrade_path - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.upgrade_path = $util.emptyArray; - - /** - * ClientState allow_update_after_expiry. - * @member {boolean} allow_update_after_expiry - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.allow_update_after_expiry = false; - - /** - * ClientState allow_update_after_misbehaviour. - * @member {boolean} allow_update_after_misbehaviour - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - */ - ClientState.prototype.allow_update_after_misbehaviour = false; - - /** - * Encodes the specified ClientState message. Does not implicitly {@link ibc.lightclients.tendermint.v1.ClientState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {ibc.lightclients.tendermint.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chain_id != null && Object.hasOwnProperty.call(message, "chain_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.chain_id); - if (message.trust_level != null && Object.hasOwnProperty.call(message, "trust_level")) - $root.ibc.lightclients.tendermint.v1.Fraction.encode(message.trust_level, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.trusting_period != null && Object.hasOwnProperty.call(message, "trusting_period")) - $root.google.protobuf.Duration.encode(message.trusting_period, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.unbonding_period != null && Object.hasOwnProperty.call(message, "unbonding_period")) - $root.google.protobuf.Duration.encode(message.unbonding_period, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.max_clock_drift != null && Object.hasOwnProperty.call(message, "max_clock_drift")) - $root.google.protobuf.Duration.encode(message.max_clock_drift, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.frozen_height != null && Object.hasOwnProperty.call(message, "frozen_height")) - $root.ibc.core.client.v1.Height.encode(message.frozen_height, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.latest_height != null && Object.hasOwnProperty.call(message, "latest_height")) - $root.ibc.core.client.v1.Height.encode(message.latest_height, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.proof_specs != null && message.proof_specs.length) - for (let i = 0; i < message.proof_specs.length; ++i) - $root.ics23.ProofSpec.encode(message.proof_specs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.upgrade_path != null && message.upgrade_path.length) - for (let i = 0; i < message.upgrade_path.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.upgrade_path[i]); - if (message.allow_update_after_expiry != null && Object.hasOwnProperty.call(message, "allow_update_after_expiry")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.allow_update_after_expiry); - if (message.allow_update_after_misbehaviour != null && Object.hasOwnProperty.call(message, "allow_update_after_misbehaviour")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.allow_update_after_misbehaviour); - return writer; - }; - - /** - * Encodes the specified ClientState message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.ClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {ibc.lightclients.tendermint.v1.IClientState} message ClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.ClientState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.chain_id = reader.string(); - break; - case 2: - message.trust_level = $root.ibc.lightclients.tendermint.v1.Fraction.decode(reader, reader.uint32()); - break; - case 3: - message.trusting_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 4: - message.unbonding_period = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: - message.max_clock_drift = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 6: - message.frozen_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 7: - message.latest_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 8: - if (!(message.proof_specs && message.proof_specs.length)) - message.proof_specs = []; - message.proof_specs.push($root.ics23.ProofSpec.decode(reader, reader.uint32())); - break; - case 9: - if (!(message.upgrade_path && message.upgrade_path.length)) - message.upgrade_path = []; - message.upgrade_path.push(reader.string()); - break; - case 10: - message.allow_update_after_expiry = reader.bool(); - break; - case 11: - message.allow_update_after_misbehaviour = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.ClientState} ClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientState message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - if (!$util.isString(message.chain_id)) - return "chain_id: string expected"; - if (message.trust_level != null && message.hasOwnProperty("trust_level")) { - let error = $root.ibc.lightclients.tendermint.v1.Fraction.verify(message.trust_level); - if (error) - return "trust_level." + error; - } - if (message.trusting_period != null && message.hasOwnProperty("trusting_period")) { - let error = $root.google.protobuf.Duration.verify(message.trusting_period); - if (error) - return "trusting_period." + error; - } - if (message.unbonding_period != null && message.hasOwnProperty("unbonding_period")) { - let error = $root.google.protobuf.Duration.verify(message.unbonding_period); - if (error) - return "unbonding_period." + error; - } - if (message.max_clock_drift != null && message.hasOwnProperty("max_clock_drift")) { - let error = $root.google.protobuf.Duration.verify(message.max_clock_drift); - if (error) - return "max_clock_drift." + error; - } - if (message.frozen_height != null && message.hasOwnProperty("frozen_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.frozen_height); - if (error) - return "frozen_height." + error; - } - if (message.latest_height != null && message.hasOwnProperty("latest_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.latest_height); - if (error) - return "latest_height." + error; - } - if (message.proof_specs != null && message.hasOwnProperty("proof_specs")) { - if (!Array.isArray(message.proof_specs)) - return "proof_specs: array expected"; - for (let i = 0; i < message.proof_specs.length; ++i) { - let error = $root.ics23.ProofSpec.verify(message.proof_specs[i]); - if (error) - return "proof_specs." + error; - } - } - if (message.upgrade_path != null && message.hasOwnProperty("upgrade_path")) { - if (!Array.isArray(message.upgrade_path)) - return "upgrade_path: array expected"; - for (let i = 0; i < message.upgrade_path.length; ++i) - if (!$util.isString(message.upgrade_path[i])) - return "upgrade_path: string[] expected"; - } - if (message.allow_update_after_expiry != null && message.hasOwnProperty("allow_update_after_expiry")) - if (typeof message.allow_update_after_expiry !== "boolean") - return "allow_update_after_expiry: boolean expected"; - if (message.allow_update_after_misbehaviour != null && message.hasOwnProperty("allow_update_after_misbehaviour")) - if (typeof message.allow_update_after_misbehaviour !== "boolean") - return "allow_update_after_misbehaviour: boolean expected"; - return null; - }; - - /** - * Creates a ClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.ClientState} ClientState - */ - ClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.ClientState) - return object; - let message = new $root.ibc.lightclients.tendermint.v1.ClientState(); - if (object.chain_id != null) - message.chain_id = String(object.chain_id); - if (object.trust_level != null) { - if (typeof object.trust_level !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.trust_level: object expected"); - message.trust_level = $root.ibc.lightclients.tendermint.v1.Fraction.fromObject(object.trust_level); - } - if (object.trusting_period != null) { - if (typeof object.trusting_period !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.trusting_period: object expected"); - message.trusting_period = $root.google.protobuf.Duration.fromObject(object.trusting_period); - } - if (object.unbonding_period != null) { - if (typeof object.unbonding_period !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.unbonding_period: object expected"); - message.unbonding_period = $root.google.protobuf.Duration.fromObject(object.unbonding_period); - } - if (object.max_clock_drift != null) { - if (typeof object.max_clock_drift !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.max_clock_drift: object expected"); - message.max_clock_drift = $root.google.protobuf.Duration.fromObject(object.max_clock_drift); - } - if (object.frozen_height != null) { - if (typeof object.frozen_height !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.frozen_height: object expected"); - message.frozen_height = $root.ibc.core.client.v1.Height.fromObject(object.frozen_height); - } - if (object.latest_height != null) { - if (typeof object.latest_height !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.latest_height: object expected"); - message.latest_height = $root.ibc.core.client.v1.Height.fromObject(object.latest_height); - } - if (object.proof_specs) { - if (!Array.isArray(object.proof_specs)) - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.proof_specs: array expected"); - message.proof_specs = []; - for (let i = 0; i < object.proof_specs.length; ++i) { - if (typeof object.proof_specs[i] !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.proof_specs: object expected"); - message.proof_specs[i] = $root.ics23.ProofSpec.fromObject(object.proof_specs[i]); - } - } - if (object.upgrade_path) { - if (!Array.isArray(object.upgrade_path)) - throw TypeError(".ibc.lightclients.tendermint.v1.ClientState.upgrade_path: array expected"); - message.upgrade_path = []; - for (let i = 0; i < object.upgrade_path.length; ++i) - message.upgrade_path[i] = String(object.upgrade_path[i]); - } - if (object.allow_update_after_expiry != null) - message.allow_update_after_expiry = Boolean(object.allow_update_after_expiry); - if (object.allow_update_after_misbehaviour != null) - message.allow_update_after_misbehaviour = Boolean(object.allow_update_after_misbehaviour); - return message; - }; - - /** - * Creates a plain object from a ClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @static - * @param {ibc.lightclients.tendermint.v1.ClientState} message ClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.proof_specs = []; - object.upgrade_path = []; - } - if (options.defaults) { - object.chain_id = ""; - object.trust_level = null; - object.trusting_period = null; - object.unbonding_period = null; - object.max_clock_drift = null; - object.frozen_height = null; - object.latest_height = null; - object.allow_update_after_expiry = false; - object.allow_update_after_misbehaviour = false; - } - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - object.chain_id = message.chain_id; - if (message.trust_level != null && message.hasOwnProperty("trust_level")) - object.trust_level = $root.ibc.lightclients.tendermint.v1.Fraction.toObject(message.trust_level, options); - if (message.trusting_period != null && message.hasOwnProperty("trusting_period")) - object.trusting_period = $root.google.protobuf.Duration.toObject(message.trusting_period, options); - if (message.unbonding_period != null && message.hasOwnProperty("unbonding_period")) - object.unbonding_period = $root.google.protobuf.Duration.toObject(message.unbonding_period, options); - if (message.max_clock_drift != null && message.hasOwnProperty("max_clock_drift")) - object.max_clock_drift = $root.google.protobuf.Duration.toObject(message.max_clock_drift, options); - if (message.frozen_height != null && message.hasOwnProperty("frozen_height")) - object.frozen_height = $root.ibc.core.client.v1.Height.toObject(message.frozen_height, options); - if (message.latest_height != null && message.hasOwnProperty("latest_height")) - object.latest_height = $root.ibc.core.client.v1.Height.toObject(message.latest_height, options); - if (message.proof_specs && message.proof_specs.length) { - object.proof_specs = []; - for (let j = 0; j < message.proof_specs.length; ++j) - object.proof_specs[j] = $root.ics23.ProofSpec.toObject(message.proof_specs[j], options); - } - if (message.upgrade_path && message.upgrade_path.length) { - object.upgrade_path = []; - for (let j = 0; j < message.upgrade_path.length; ++j) - object.upgrade_path[j] = message.upgrade_path[j]; - } - if (message.allow_update_after_expiry != null && message.hasOwnProperty("allow_update_after_expiry")) - object.allow_update_after_expiry = message.allow_update_after_expiry; - if (message.allow_update_after_misbehaviour != null && message.hasOwnProperty("allow_update_after_misbehaviour")) - object.allow_update_after_misbehaviour = message.allow_update_after_misbehaviour; - return object; - }; - - /** - * Converts this ClientState to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.ClientState - * @instance - * @returns {Object.} JSON object - */ - ClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientState; - })(); - - v1.ConsensusState = (function() { - - /** - * Properties of a ConsensusState. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IConsensusState - * @property {google.protobuf.ITimestamp|null} [timestamp] ConsensusState timestamp - * @property {ibc.core.commitment.v1.IMerkleRoot|null} [root] ConsensusState root - * @property {Uint8Array|null} [next_validators_hash] ConsensusState next_validators_hash - */ - - /** - * Constructs a new ConsensusState. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a ConsensusState. - * @implements IConsensusState - * @constructor - * @param {ibc.lightclients.tendermint.v1.IConsensusState=} [properties] Properties to set - */ - function ConsensusState(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusState timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.timestamp = null; - - /** - * ConsensusState root. - * @member {ibc.core.commitment.v1.IMerkleRoot|null|undefined} root - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.root = null; - - /** - * ConsensusState next_validators_hash. - * @member {Uint8Array} next_validators_hash - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @instance - */ - ConsensusState.prototype.next_validators_hash = $util.newBuffer([]); - - /** - * Encodes the specified ConsensusState message. Does not implicitly {@link ibc.lightclients.tendermint.v1.ConsensusState.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {ibc.lightclients.tendermint.v1.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.root != null && Object.hasOwnProperty.call(message, "root")) - $root.ibc.core.commitment.v1.MerkleRoot.encode(message.root, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.next_validators_hash != null && Object.hasOwnProperty.call(message, "next_validators_hash")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.next_validators_hash); - return writer; - }; - - /** - * Encodes the specified ConsensusState message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.ConsensusState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {ibc.lightclients.tendermint.v1.IConsensusState} message ConsensusState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.ConsensusState(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.root = $root.ibc.core.commitment.v1.MerkleRoot.decode(reader, reader.uint32()); - break; - case 3: - message.next_validators_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.ConsensusState} ConsensusState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusState message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - let error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.root != null && message.hasOwnProperty("root")) { - let error = $root.ibc.core.commitment.v1.MerkleRoot.verify(message.root); - if (error) - return "root." + error; - } - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - if (!(message.next_validators_hash && typeof message.next_validators_hash.length === "number" || $util.isString(message.next_validators_hash))) - return "next_validators_hash: buffer expected"; - return null; - }; - - /** - * Creates a ConsensusState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.ConsensusState} ConsensusState - */ - ConsensusState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.ConsensusState) - return object; - let message = new $root.ibc.lightclients.tendermint.v1.ConsensusState(); - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ConsensusState.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.root != null) { - if (typeof object.root !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.ConsensusState.root: object expected"); - message.root = $root.ibc.core.commitment.v1.MerkleRoot.fromObject(object.root); - } - if (object.next_validators_hash != null) - if (typeof object.next_validators_hash === "string") - $util.base64.decode(object.next_validators_hash, message.next_validators_hash = $util.newBuffer($util.base64.length(object.next_validators_hash)), 0); - else if (object.next_validators_hash.length) - message.next_validators_hash = object.next_validators_hash; - return message; - }; - - /** - * Creates a plain object from a ConsensusState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @static - * @param {ibc.lightclients.tendermint.v1.ConsensusState} message ConsensusState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusState.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.timestamp = null; - object.root = null; - if (options.bytes === String) - object.next_validators_hash = ""; - else { - object.next_validators_hash = []; - if (options.bytes !== Array) - object.next_validators_hash = $util.newBuffer(object.next_validators_hash); - } - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.root != null && message.hasOwnProperty("root")) - object.root = $root.ibc.core.commitment.v1.MerkleRoot.toObject(message.root, options); - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - object.next_validators_hash = options.bytes === String ? $util.base64.encode(message.next_validators_hash, 0, message.next_validators_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.next_validators_hash) : message.next_validators_hash; - return object; - }; - - /** - * Converts this ConsensusState to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.ConsensusState - * @instance - * @returns {Object.} JSON object - */ - ConsensusState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusState; - })(); - - v1.Misbehaviour = (function() { - - /** - * Properties of a Misbehaviour. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IMisbehaviour - * @property {string|null} [client_id] Misbehaviour client_id - * @property {ibc.lightclients.tendermint.v1.IHeader|null} [header_1] Misbehaviour header_1 - * @property {ibc.lightclients.tendermint.v1.IHeader|null} [header_2] Misbehaviour header_2 - */ - - /** - * Constructs a new Misbehaviour. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a Misbehaviour. - * @implements IMisbehaviour - * @constructor - * @param {ibc.lightclients.tendermint.v1.IMisbehaviour=} [properties] Properties to set - */ - function Misbehaviour(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Misbehaviour client_id. - * @member {string} client_id - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.client_id = ""; - - /** - * Misbehaviour header_1. - * @member {ibc.lightclients.tendermint.v1.IHeader|null|undefined} header_1 - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.header_1 = null; - - /** - * Misbehaviour header_2. - * @member {ibc.lightclients.tendermint.v1.IHeader|null|undefined} header_2 - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @instance - */ - Misbehaviour.prototype.header_2 = null; - - /** - * Encodes the specified Misbehaviour message. Does not implicitly {@link ibc.lightclients.tendermint.v1.Misbehaviour.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {ibc.lightclients.tendermint.v1.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.header_1 != null && Object.hasOwnProperty.call(message, "header_1")) - $root.ibc.lightclients.tendermint.v1.Header.encode(message.header_1, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.header_2 != null && Object.hasOwnProperty.call(message, "header_2")) - $root.ibc.lightclients.tendermint.v1.Header.encode(message.header_2, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Misbehaviour message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.Misbehaviour.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {ibc.lightclients.tendermint.v1.IMisbehaviour} message Misbehaviour message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Misbehaviour.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.Misbehaviour(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.header_1 = $root.ibc.lightclients.tendermint.v1.Header.decode(reader, reader.uint32()); - break; - case 3: - message.header_2 = $root.ibc.lightclients.tendermint.v1.Header.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Misbehaviour message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.Misbehaviour} Misbehaviour - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Misbehaviour.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Misbehaviour message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Misbehaviour.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.header_1 != null && message.hasOwnProperty("header_1")) { - let error = $root.ibc.lightclients.tendermint.v1.Header.verify(message.header_1); - if (error) - return "header_1." + error; - } - if (message.header_2 != null && message.hasOwnProperty("header_2")) { - let error = $root.ibc.lightclients.tendermint.v1.Header.verify(message.header_2); - if (error) - return "header_2." + error; - } - return null; - }; - - /** - * Creates a Misbehaviour message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.Misbehaviour} Misbehaviour - */ - Misbehaviour.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.Misbehaviour) - return object; - let message = new $root.ibc.lightclients.tendermint.v1.Misbehaviour(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.header_1 != null) { - if (typeof object.header_1 !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Misbehaviour.header_1: object expected"); - message.header_1 = $root.ibc.lightclients.tendermint.v1.Header.fromObject(object.header_1); - } - if (object.header_2 != null) { - if (typeof object.header_2 !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Misbehaviour.header_2: object expected"); - message.header_2 = $root.ibc.lightclients.tendermint.v1.Header.fromObject(object.header_2); - } - return message; - }; - - /** - * Creates a plain object from a Misbehaviour message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @static - * @param {ibc.lightclients.tendermint.v1.Misbehaviour} message Misbehaviour - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Misbehaviour.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.client_id = ""; - object.header_1 = null; - object.header_2 = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.header_1 != null && message.hasOwnProperty("header_1")) - object.header_1 = $root.ibc.lightclients.tendermint.v1.Header.toObject(message.header_1, options); - if (message.header_2 != null && message.hasOwnProperty("header_2")) - object.header_2 = $root.ibc.lightclients.tendermint.v1.Header.toObject(message.header_2, options); - return object; - }; - - /** - * Converts this Misbehaviour to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.Misbehaviour - * @instance - * @returns {Object.} JSON object - */ - Misbehaviour.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Misbehaviour; - })(); - - v1.Header = (function() { - - /** - * Properties of a Header. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IHeader - * @property {tendermint.types.ISignedHeader|null} [signed_header] Header signed_header - * @property {tendermint.types.IValidatorSet|null} [validator_set] Header validator_set - * @property {ibc.core.client.v1.IHeight|null} [trusted_height] Header trusted_height - * @property {tendermint.types.IValidatorSet|null} [trusted_validators] Header trusted_validators - */ - - /** - * Constructs a new Header. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a Header. - * @implements IHeader - * @constructor - * @param {ibc.lightclients.tendermint.v1.IHeader=} [properties] Properties to set - */ - function Header(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Header signed_header. - * @member {tendermint.types.ISignedHeader|null|undefined} signed_header - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - */ - Header.prototype.signed_header = null; - - /** - * Header validator_set. - * @member {tendermint.types.IValidatorSet|null|undefined} validator_set - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - */ - Header.prototype.validator_set = null; - - /** - * Header trusted_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} trusted_height - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - */ - Header.prototype.trusted_height = null; - - /** - * Header trusted_validators. - * @member {tendermint.types.IValidatorSet|null|undefined} trusted_validators - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - */ - Header.prototype.trusted_validators = null; - - /** - * Encodes the specified Header message. Does not implicitly {@link ibc.lightclients.tendermint.v1.Header.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {ibc.lightclients.tendermint.v1.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signed_header != null && Object.hasOwnProperty.call(message, "signed_header")) - $root.tendermint.types.SignedHeader.encode(message.signed_header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.validator_set != null && Object.hasOwnProperty.call(message, "validator_set")) - $root.tendermint.types.ValidatorSet.encode(message.validator_set, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.trusted_height != null && Object.hasOwnProperty.call(message, "trusted_height")) - $root.ibc.core.client.v1.Height.encode(message.trusted_height, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.trusted_validators != null && Object.hasOwnProperty.call(message, "trusted_validators")) - $root.tendermint.types.ValidatorSet.encode(message.trusted_validators, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.Header.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {ibc.lightclients.tendermint.v1.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Header message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.Header(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signed_header = $root.tendermint.types.SignedHeader.decode(reader, reader.uint32()); - break; - case 2: - message.validator_set = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); - break; - case 3: - message.trusted_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 4: - message.trusted_validators = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Header message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Header.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signed_header != null && message.hasOwnProperty("signed_header")) { - let error = $root.tendermint.types.SignedHeader.verify(message.signed_header); - if (error) - return "signed_header." + error; - } - if (message.validator_set != null && message.hasOwnProperty("validator_set")) { - let error = $root.tendermint.types.ValidatorSet.verify(message.validator_set); - if (error) - return "validator_set." + error; - } - if (message.trusted_height != null && message.hasOwnProperty("trusted_height")) { - let error = $root.ibc.core.client.v1.Height.verify(message.trusted_height); - if (error) - return "trusted_height." + error; - } - if (message.trusted_validators != null && message.hasOwnProperty("trusted_validators")) { - let error = $root.tendermint.types.ValidatorSet.verify(message.trusted_validators); - if (error) - return "trusted_validators." + error; - } - return null; - }; - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.Header} Header - */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.Header) - return object; - let message = new $root.ibc.lightclients.tendermint.v1.Header(); - if (object.signed_header != null) { - if (typeof object.signed_header !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Header.signed_header: object expected"); - message.signed_header = $root.tendermint.types.SignedHeader.fromObject(object.signed_header); - } - if (object.validator_set != null) { - if (typeof object.validator_set !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Header.validator_set: object expected"); - message.validator_set = $root.tendermint.types.ValidatorSet.fromObject(object.validator_set); - } - if (object.trusted_height != null) { - if (typeof object.trusted_height !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Header.trusted_height: object expected"); - message.trusted_height = $root.ibc.core.client.v1.Height.fromObject(object.trusted_height); - } - if (object.trusted_validators != null) { - if (typeof object.trusted_validators !== "object") - throw TypeError(".ibc.lightclients.tendermint.v1.Header.trusted_validators: object expected"); - message.trusted_validators = $root.tendermint.types.ValidatorSet.fromObject(object.trusted_validators); - } - return message; - }; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.Header - * @static - * @param {ibc.lightclients.tendermint.v1.Header} message Header - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Header.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.signed_header = null; - object.validator_set = null; - object.trusted_height = null; - object.trusted_validators = null; - } - if (message.signed_header != null && message.hasOwnProperty("signed_header")) - object.signed_header = $root.tendermint.types.SignedHeader.toObject(message.signed_header, options); - if (message.validator_set != null && message.hasOwnProperty("validator_set")) - object.validator_set = $root.tendermint.types.ValidatorSet.toObject(message.validator_set, options); - if (message.trusted_height != null && message.hasOwnProperty("trusted_height")) - object.trusted_height = $root.ibc.core.client.v1.Height.toObject(message.trusted_height, options); - if (message.trusted_validators != null && message.hasOwnProperty("trusted_validators")) - object.trusted_validators = $root.tendermint.types.ValidatorSet.toObject(message.trusted_validators, options); - return object; - }; - - /** - * Converts this Header to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.Header - * @instance - * @returns {Object.} JSON object - */ - Header.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Header; - })(); - - v1.Fraction = (function() { - - /** - * Properties of a Fraction. - * @memberof ibc.lightclients.tendermint.v1 - * @interface IFraction - * @property {Long|null} [numerator] Fraction numerator - * @property {Long|null} [denominator] Fraction denominator - */ - - /** - * Constructs a new Fraction. - * @memberof ibc.lightclients.tendermint.v1 - * @classdesc Represents a Fraction. - * @implements IFraction - * @constructor - * @param {ibc.lightclients.tendermint.v1.IFraction=} [properties] Properties to set - */ - function Fraction(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Fraction numerator. - * @member {Long} numerator - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @instance - */ - Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Fraction denominator. - * @member {Long} denominator - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @instance - */ - Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Fraction message. Does not implicitly {@link ibc.lightclients.tendermint.v1.Fraction.verify|verify} messages. - * @function encode - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {ibc.lightclients.tendermint.v1.IFraction} message Fraction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fraction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.numerator != null && Object.hasOwnProperty.call(message, "numerator")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.numerator); - if (message.denominator != null && Object.hasOwnProperty.call(message, "denominator")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.denominator); - return writer; - }; - - /** - * Encodes the specified Fraction message, length delimited. Does not implicitly {@link ibc.lightclients.tendermint.v1.Fraction.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {ibc.lightclients.tendermint.v1.IFraction} message Fraction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fraction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Fraction message from the specified reader or buffer. - * @function decode - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.lightclients.tendermint.v1.Fraction} Fraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fraction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.lightclients.tendermint.v1.Fraction(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.numerator = reader.uint64(); - break; - case 2: - message.denominator = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Fraction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.lightclients.tendermint.v1.Fraction} Fraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fraction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Fraction message. - * @function verify - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Fraction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.numerator != null && message.hasOwnProperty("numerator")) - if (!$util.isInteger(message.numerator) && !(message.numerator && $util.isInteger(message.numerator.low) && $util.isInteger(message.numerator.high))) - return "numerator: integer|Long expected"; - if (message.denominator != null && message.hasOwnProperty("denominator")) - if (!$util.isInteger(message.denominator) && !(message.denominator && $util.isInteger(message.denominator.low) && $util.isInteger(message.denominator.high))) - return "denominator: integer|Long expected"; - return null; - }; - - /** - * Creates a Fraction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {Object.} object Plain object - * @returns {ibc.lightclients.tendermint.v1.Fraction} Fraction - */ - Fraction.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.lightclients.tendermint.v1.Fraction) - return object; - let message = new $root.ibc.lightclients.tendermint.v1.Fraction(); - if (object.numerator != null) - if ($util.Long) - (message.numerator = $util.Long.fromValue(object.numerator)).unsigned = true; - else if (typeof object.numerator === "string") - message.numerator = parseInt(object.numerator, 10); - else if (typeof object.numerator === "number") - message.numerator = object.numerator; - else if (typeof object.numerator === "object") - message.numerator = new $util.LongBits(object.numerator.low >>> 0, object.numerator.high >>> 0).toNumber(true); - if (object.denominator != null) - if ($util.Long) - (message.denominator = $util.Long.fromValue(object.denominator)).unsigned = true; - else if (typeof object.denominator === "string") - message.denominator = parseInt(object.denominator, 10); - else if (typeof object.denominator === "number") - message.denominator = object.denominator; - else if (typeof object.denominator === "object") - message.denominator = new $util.LongBits(object.denominator.low >>> 0, object.denominator.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Fraction message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @static - * @param {ibc.lightclients.tendermint.v1.Fraction} message Fraction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Fraction.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.numerator = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.numerator = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.denominator = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.denominator = options.longs === String ? "0" : 0; - } - if (message.numerator != null && message.hasOwnProperty("numerator")) - if (typeof message.numerator === "number") - object.numerator = options.longs === String ? String(message.numerator) : message.numerator; - else - object.numerator = options.longs === String ? $util.Long.prototype.toString.call(message.numerator) : options.longs === Number ? new $util.LongBits(message.numerator.low >>> 0, message.numerator.high >>> 0).toNumber(true) : message.numerator; - if (message.denominator != null && message.hasOwnProperty("denominator")) - if (typeof message.denominator === "number") - object.denominator = options.longs === String ? String(message.denominator) : message.denominator; - else - object.denominator = options.longs === String ? $util.Long.prototype.toString.call(message.denominator) : options.longs === Number ? new $util.LongBits(message.denominator.low >>> 0, message.denominator.high >>> 0).toNumber(true) : message.denominator; - return object; - }; - - /** - * Converts this Fraction to JSON. - * @function toJSON - * @memberof ibc.lightclients.tendermint.v1.Fraction - * @instance - * @returns {Object.} JSON object - */ - Fraction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Fraction; - })(); - - return v1; - })(); - - return tendermint; - })(); - - return lightclients; - })(); - - return ibc; -})(); - -export const ics23 = $root.ics23 = (() => { - - /** - * Namespace ics23. - * @exports ics23 - * @namespace - */ - const ics23 = {}; - - /** - * HashOp enum. - * @name ics23.HashOp - * @enum {number} - * @property {number} NO_HASH=0 NO_HASH value - * @property {number} SHA256=1 SHA256 value - * @property {number} SHA512=2 SHA512 value - * @property {number} KECCAK=3 KECCAK value - * @property {number} RIPEMD160=4 RIPEMD160 value - * @property {number} BITCOIN=5 BITCOIN value - */ - ics23.HashOp = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NO_HASH"] = 0; - values[valuesById[1] = "SHA256"] = 1; - values[valuesById[2] = "SHA512"] = 2; - values[valuesById[3] = "KECCAK"] = 3; - values[valuesById[4] = "RIPEMD160"] = 4; - values[valuesById[5] = "BITCOIN"] = 5; - return values; - })(); - - /** - * LengthOp defines how to process the key and value of the LeafOp - * to include length information. After encoding the length with the given - * algorithm, the length will be prepended to the key and value bytes. - * (Each one with it's own encoded length) - * @name ics23.LengthOp - * @enum {number} - * @property {number} NO_PREFIX=0 NO_PREFIX value - * @property {number} VAR_PROTO=1 VAR_PROTO value - * @property {number} VAR_RLP=2 VAR_RLP value - * @property {number} FIXED32_BIG=3 FIXED32_BIG value - * @property {number} FIXED32_LITTLE=4 FIXED32_LITTLE value - * @property {number} FIXED64_BIG=5 FIXED64_BIG value - * @property {number} FIXED64_LITTLE=6 FIXED64_LITTLE value - * @property {number} REQUIRE_32_BYTES=7 REQUIRE_32_BYTES value - * @property {number} REQUIRE_64_BYTES=8 REQUIRE_64_BYTES value - */ - ics23.LengthOp = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NO_PREFIX"] = 0; - values[valuesById[1] = "VAR_PROTO"] = 1; - values[valuesById[2] = "VAR_RLP"] = 2; - values[valuesById[3] = "FIXED32_BIG"] = 3; - values[valuesById[4] = "FIXED32_LITTLE"] = 4; - values[valuesById[5] = "FIXED64_BIG"] = 5; - values[valuesById[6] = "FIXED64_LITTLE"] = 6; - values[valuesById[7] = "REQUIRE_32_BYTES"] = 7; - values[valuesById[8] = "REQUIRE_64_BYTES"] = 8; - return values; - })(); - - ics23.ExistenceProof = (function() { - - /** - * Properties of an ExistenceProof. - * @memberof ics23 - * @interface IExistenceProof - * @property {Uint8Array|null} [key] ExistenceProof key - * @property {Uint8Array|null} [value] ExistenceProof value - * @property {ics23.ILeafOp|null} [leaf] ExistenceProof leaf - * @property {Array.|null} [path] ExistenceProof path - */ - - /** - * Constructs a new ExistenceProof. - * @memberof ics23 - * @classdesc ExistenceProof takes a key and a value and a set of steps to perform on it. - * The result of peforming all these steps will provide a "root hash", which can - * be compared to the value in a header. - * - * Since it is computationally infeasible to produce a hash collission for any of the used - * cryptographic hash functions, if someone can provide a series of operations to transform - * a given key and value into a root hash that matches some trusted root, these key and values - * must be in the referenced merkle tree. - * - * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, - * which should be controlled by a spec. Eg. with lengthOp as NONE, - * prefix = FOO, key = BAR, value = CHOICE - * and - * prefix = F, key = OOBAR, value = CHOICE - * would produce the same value. - * - * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field - * in the ProofSpec is valuable to prevent this mutability. And why all trees should - * length-prefix the data before hashing it. - * @implements IExistenceProof - * @constructor - * @param {ics23.IExistenceProof=} [properties] Properties to set - */ - function ExistenceProof(properties) { - this.path = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExistenceProof key. - * @member {Uint8Array} key - * @memberof ics23.ExistenceProof - * @instance - */ - ExistenceProof.prototype.key = $util.newBuffer([]); - - /** - * ExistenceProof value. - * @member {Uint8Array} value - * @memberof ics23.ExistenceProof - * @instance - */ - ExistenceProof.prototype.value = $util.newBuffer([]); - - /** - * ExistenceProof leaf. - * @member {ics23.ILeafOp|null|undefined} leaf - * @memberof ics23.ExistenceProof - * @instance - */ - ExistenceProof.prototype.leaf = null; - - /** - * ExistenceProof path. - * @member {Array.} path - * @memberof ics23.ExistenceProof - * @instance - */ - ExistenceProof.prototype.path = $util.emptyArray; - - /** - * Encodes the specified ExistenceProof message. Does not implicitly {@link ics23.ExistenceProof.verify|verify} messages. - * @function encode - * @memberof ics23.ExistenceProof - * @static - * @param {ics23.IExistenceProof} message ExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExistenceProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - if (message.leaf != null && Object.hasOwnProperty.call(message, "leaf")) - $root.ics23.LeafOp.encode(message.leaf, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.path != null && message.path.length) - for (let i = 0; i < message.path.length; ++i) - $root.ics23.InnerOp.encode(message.path[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExistenceProof message, length delimited. Does not implicitly {@link ics23.ExistenceProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.ExistenceProof - * @static - * @param {ics23.IExistenceProof} message ExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExistenceProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.ExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.ExistenceProof} ExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExistenceProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.ExistenceProof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - case 3: - message.leaf = $root.ics23.LeafOp.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.path && message.path.length)) - message.path = []; - message.path.push($root.ics23.InnerOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExistenceProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.ExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.ExistenceProof} ExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExistenceProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExistenceProof message. - * @function verify - * @memberof ics23.ExistenceProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExistenceProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - if (message.leaf != null && message.hasOwnProperty("leaf")) { - let error = $root.ics23.LeafOp.verify(message.leaf); - if (error) - return "leaf." + error; - } - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (let i = 0; i < message.path.length; ++i) { - let error = $root.ics23.InnerOp.verify(message.path[i]); - if (error) - return "path." + error; - } - } - return null; - }; - - /** - * Creates an ExistenceProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.ExistenceProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.ExistenceProof} ExistenceProof - */ - ExistenceProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.ExistenceProof) - return object; - let message = new $root.ics23.ExistenceProof(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - if (object.leaf != null) { - if (typeof object.leaf !== "object") - throw TypeError(".ics23.ExistenceProof.leaf: object expected"); - message.leaf = $root.ics23.LeafOp.fromObject(object.leaf); - } - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".ics23.ExistenceProof.path: array expected"); - message.path = []; - for (let i = 0; i < object.path.length; ++i) { - if (typeof object.path[i] !== "object") - throw TypeError(".ics23.ExistenceProof.path: object expected"); - message.path[i] = $root.ics23.InnerOp.fromObject(object.path[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ExistenceProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.ExistenceProof - * @static - * @param {ics23.ExistenceProof} message ExistenceProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExistenceProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - object.leaf = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - if (message.leaf != null && message.hasOwnProperty("leaf")) - object.leaf = $root.ics23.LeafOp.toObject(message.leaf, options); - if (message.path && message.path.length) { - object.path = []; - for (let j = 0; j < message.path.length; ++j) - object.path[j] = $root.ics23.InnerOp.toObject(message.path[j], options); - } - return object; - }; - - /** - * Converts this ExistenceProof to JSON. - * @function toJSON - * @memberof ics23.ExistenceProof - * @instance - * @returns {Object.} JSON object - */ - ExistenceProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExistenceProof; - })(); - - ics23.NonExistenceProof = (function() { - - /** - * Properties of a NonExistenceProof. - * @memberof ics23 - * @interface INonExistenceProof - * @property {Uint8Array|null} [key] NonExistenceProof key - * @property {ics23.IExistenceProof|null} [left] NonExistenceProof left - * @property {ics23.IExistenceProof|null} [right] NonExistenceProof right - */ - - /** - * Constructs a new NonExistenceProof. - * @memberof ics23 - * @classdesc Represents a NonExistenceProof. - * @implements INonExistenceProof - * @constructor - * @param {ics23.INonExistenceProof=} [properties] Properties to set - */ - function NonExistenceProof(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NonExistenceProof key. - * @member {Uint8Array} key - * @memberof ics23.NonExistenceProof - * @instance - */ - NonExistenceProof.prototype.key = $util.newBuffer([]); - - /** - * NonExistenceProof left. - * @member {ics23.IExistenceProof|null|undefined} left - * @memberof ics23.NonExistenceProof - * @instance - */ - NonExistenceProof.prototype.left = null; - - /** - * NonExistenceProof right. - * @member {ics23.IExistenceProof|null|undefined} right - * @memberof ics23.NonExistenceProof - * @instance - */ - NonExistenceProof.prototype.right = null; - - /** - * Encodes the specified NonExistenceProof message. Does not implicitly {@link ics23.NonExistenceProof.verify|verify} messages. - * @function encode - * @memberof ics23.NonExistenceProof - * @static - * @param {ics23.INonExistenceProof} message NonExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NonExistenceProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.left != null && Object.hasOwnProperty.call(message, "left")) - $root.ics23.ExistenceProof.encode(message.left, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.right != null && Object.hasOwnProperty.call(message, "right")) - $root.ics23.ExistenceProof.encode(message.right, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NonExistenceProof message, length delimited. Does not implicitly {@link ics23.NonExistenceProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.NonExistenceProof - * @static - * @param {ics23.INonExistenceProof} message NonExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NonExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NonExistenceProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.NonExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.NonExistenceProof} NonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NonExistenceProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.NonExistenceProof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.left = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); - break; - case 3: - message.right = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NonExistenceProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.NonExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.NonExistenceProof} NonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NonExistenceProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NonExistenceProof message. - * @function verify - * @memberof ics23.NonExistenceProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NonExistenceProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.left != null && message.hasOwnProperty("left")) { - let error = $root.ics23.ExistenceProof.verify(message.left); - if (error) - return "left." + error; - } - if (message.right != null && message.hasOwnProperty("right")) { - let error = $root.ics23.ExistenceProof.verify(message.right); - if (error) - return "right." + error; - } - return null; - }; - - /** - * Creates a NonExistenceProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.NonExistenceProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.NonExistenceProof} NonExistenceProof - */ - NonExistenceProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.NonExistenceProof) - return object; - let message = new $root.ics23.NonExistenceProof(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.left != null) { - if (typeof object.left !== "object") - throw TypeError(".ics23.NonExistenceProof.left: object expected"); - message.left = $root.ics23.ExistenceProof.fromObject(object.left); - } - if (object.right != null) { - if (typeof object.right !== "object") - throw TypeError(".ics23.NonExistenceProof.right: object expected"); - message.right = $root.ics23.ExistenceProof.fromObject(object.right); - } - return message; - }; - - /** - * Creates a plain object from a NonExistenceProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.NonExistenceProof - * @static - * @param {ics23.NonExistenceProof} message NonExistenceProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NonExistenceProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - object.left = null; - object.right = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.left != null && message.hasOwnProperty("left")) - object.left = $root.ics23.ExistenceProof.toObject(message.left, options); - if (message.right != null && message.hasOwnProperty("right")) - object.right = $root.ics23.ExistenceProof.toObject(message.right, options); - return object; - }; - - /** - * Converts this NonExistenceProof to JSON. - * @function toJSON - * @memberof ics23.NonExistenceProof - * @instance - * @returns {Object.} JSON object - */ - NonExistenceProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NonExistenceProof; - })(); - - ics23.CommitmentProof = (function() { - - /** - * Properties of a CommitmentProof. - * @memberof ics23 - * @interface ICommitmentProof - * @property {ics23.IExistenceProof|null} [exist] CommitmentProof exist - * @property {ics23.INonExistenceProof|null} [nonexist] CommitmentProof nonexist - * @property {ics23.IBatchProof|null} [batch] CommitmentProof batch - * @property {ics23.ICompressedBatchProof|null} [compressed] CommitmentProof compressed - */ - - /** - * Constructs a new CommitmentProof. - * @memberof ics23 - * @classdesc Represents a CommitmentProof. - * @implements ICommitmentProof - * @constructor - * @param {ics23.ICommitmentProof=} [properties] Properties to set - */ - function CommitmentProof(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitmentProof exist. - * @member {ics23.IExistenceProof|null|undefined} exist - * @memberof ics23.CommitmentProof - * @instance - */ - CommitmentProof.prototype.exist = null; - - /** - * CommitmentProof nonexist. - * @member {ics23.INonExistenceProof|null|undefined} nonexist - * @memberof ics23.CommitmentProof - * @instance - */ - CommitmentProof.prototype.nonexist = null; - - /** - * CommitmentProof batch. - * @member {ics23.IBatchProof|null|undefined} batch - * @memberof ics23.CommitmentProof - * @instance - */ - CommitmentProof.prototype.batch = null; - - /** - * CommitmentProof compressed. - * @member {ics23.ICompressedBatchProof|null|undefined} compressed - * @memberof ics23.CommitmentProof - * @instance - */ - CommitmentProof.prototype.compressed = null; - - // OneOf field names bound to virtual getters and setters - let $oneOfFields; - - /** - * CommitmentProof proof. - * @member {"exist"|"nonexist"|"batch"|"compressed"|undefined} proof - * @memberof ics23.CommitmentProof - * @instance - */ - Object.defineProperty(CommitmentProof.prototype, "proof", { - get: $util.oneOfGetter($oneOfFields = ["exist", "nonexist", "batch", "compressed"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified CommitmentProof message. Does not implicitly {@link ics23.CommitmentProof.verify|verify} messages. - * @function encode - * @memberof ics23.CommitmentProof - * @static - * @param {ics23.ICommitmentProof} message CommitmentProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitmentProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exist != null && Object.hasOwnProperty.call(message, "exist")) - $root.ics23.ExistenceProof.encode(message.exist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nonexist != null && Object.hasOwnProperty.call(message, "nonexist")) - $root.ics23.NonExistenceProof.encode(message.nonexist, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) - $root.ics23.BatchProof.encode(message.batch, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.compressed != null && Object.hasOwnProperty.call(message, "compressed")) - $root.ics23.CompressedBatchProof.encode(message.compressed, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommitmentProof message, length delimited. Does not implicitly {@link ics23.CommitmentProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CommitmentProof - * @static - * @param {ics23.ICommitmentProof} message CommitmentProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitmentProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitmentProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.CommitmentProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CommitmentProof} CommitmentProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitmentProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CommitmentProof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exist = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); - break; - case 2: - message.nonexist = $root.ics23.NonExistenceProof.decode(reader, reader.uint32()); - break; - case 3: - message.batch = $root.ics23.BatchProof.decode(reader, reader.uint32()); - break; - case 4: - message.compressed = $root.ics23.CompressedBatchProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitmentProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CommitmentProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CommitmentProof} CommitmentProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitmentProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitmentProof message. - * @function verify - * @memberof ics23.CommitmentProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitmentProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - properties.proof = 1; - { - let error = $root.ics23.ExistenceProof.verify(message.exist); - if (error) - return "exist." + error; - } - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - let error = $root.ics23.NonExistenceProof.verify(message.nonexist); - if (error) - return "nonexist." + error; - } - } - if (message.batch != null && message.hasOwnProperty("batch")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - let error = $root.ics23.BatchProof.verify(message.batch); - if (error) - return "batch." + error; - } - } - if (message.compressed != null && message.hasOwnProperty("compressed")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - let error = $root.ics23.CompressedBatchProof.verify(message.compressed); - if (error) - return "compressed." + error; - } - } - return null; - }; - - /** - * Creates a CommitmentProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CommitmentProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.CommitmentProof} CommitmentProof - */ - CommitmentProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CommitmentProof) - return object; - let message = new $root.ics23.CommitmentProof(); - if (object.exist != null) { - if (typeof object.exist !== "object") - throw TypeError(".ics23.CommitmentProof.exist: object expected"); - message.exist = $root.ics23.ExistenceProof.fromObject(object.exist); - } - if (object.nonexist != null) { - if (typeof object.nonexist !== "object") - throw TypeError(".ics23.CommitmentProof.nonexist: object expected"); - message.nonexist = $root.ics23.NonExistenceProof.fromObject(object.nonexist); - } - if (object.batch != null) { - if (typeof object.batch !== "object") - throw TypeError(".ics23.CommitmentProof.batch: object expected"); - message.batch = $root.ics23.BatchProof.fromObject(object.batch); - } - if (object.compressed != null) { - if (typeof object.compressed !== "object") - throw TypeError(".ics23.CommitmentProof.compressed: object expected"); - message.compressed = $root.ics23.CompressedBatchProof.fromObject(object.compressed); - } - return message; - }; - - /** - * Creates a plain object from a CommitmentProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CommitmentProof - * @static - * @param {ics23.CommitmentProof} message CommitmentProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitmentProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - object.exist = $root.ics23.ExistenceProof.toObject(message.exist, options); - if (options.oneofs) - object.proof = "exist"; - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - object.nonexist = $root.ics23.NonExistenceProof.toObject(message.nonexist, options); - if (options.oneofs) - object.proof = "nonexist"; - } - if (message.batch != null && message.hasOwnProperty("batch")) { - object.batch = $root.ics23.BatchProof.toObject(message.batch, options); - if (options.oneofs) - object.proof = "batch"; - } - if (message.compressed != null && message.hasOwnProperty("compressed")) { - object.compressed = $root.ics23.CompressedBatchProof.toObject(message.compressed, options); - if (options.oneofs) - object.proof = "compressed"; - } - return object; - }; - - /** - * Converts this CommitmentProof to JSON. - * @function toJSON - * @memberof ics23.CommitmentProof - * @instance - * @returns {Object.} JSON object - */ - CommitmentProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CommitmentProof; - })(); - - ics23.LeafOp = (function() { - - /** - * Properties of a LeafOp. - * @memberof ics23 - * @interface ILeafOp - * @property {ics23.HashOp|null} [hash] LeafOp hash - * @property {ics23.HashOp|null} [prehash_key] LeafOp prehash_key - * @property {ics23.HashOp|null} [prehash_value] LeafOp prehash_value - * @property {ics23.LengthOp|null} [length] LeafOp length - * @property {Uint8Array|null} [prefix] LeafOp prefix - */ - - /** - * Constructs a new LeafOp. - * @memberof ics23 - * @classdesc LeafOp represents the raw key-value data we wish to prove, and - * must be flexible to represent the internal transformation from - * the original key-value pairs into the basis hash, for many existing - * merkle trees. - * - * key and value are passed in. So that the signature of this operation is: - * leafOp(key, value) -> output - * - * To process this, first prehash the keys and values if needed (ANY means no hash in this case): - * hkey = prehashKey(key) - * hvalue = prehashValue(value) - * - * Then combine the bytes, and hash it - * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) - * @implements ILeafOp - * @constructor - * @param {ics23.ILeafOp=} [properties] Properties to set - */ - function LeafOp(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LeafOp hash. - * @member {ics23.HashOp} hash - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.hash = 0; - - /** - * LeafOp prehash_key. - * @member {ics23.HashOp} prehash_key - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.prehash_key = 0; - - /** - * LeafOp prehash_value. - * @member {ics23.HashOp} prehash_value - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.prehash_value = 0; - - /** - * LeafOp length. - * @member {ics23.LengthOp} length - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.length = 0; - - /** - * LeafOp prefix. - * @member {Uint8Array} prefix - * @memberof ics23.LeafOp - * @instance - */ - LeafOp.prototype.prefix = $util.newBuffer([]); - - /** - * Encodes the specified LeafOp message. Does not implicitly {@link ics23.LeafOp.verify|verify} messages. - * @function encode - * @memberof ics23.LeafOp - * @static - * @param {ics23.ILeafOp} message LeafOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LeafOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hash); - if (message.prehash_key != null && Object.hasOwnProperty.call(message, "prehash_key")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.prehash_key); - if (message.prehash_value != null && Object.hasOwnProperty.call(message, "prehash_value")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.prehash_value); - if (message.length != null && Object.hasOwnProperty.call(message, "length")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.length); - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.prefix); - return writer; - }; - - /** - * Encodes the specified LeafOp message, length delimited. Does not implicitly {@link ics23.LeafOp.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.LeafOp - * @static - * @param {ics23.ILeafOp} message LeafOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LeafOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LeafOp message from the specified reader or buffer. - * @function decode - * @memberof ics23.LeafOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.LeafOp} LeafOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LeafOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.LeafOp(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.int32(); - break; - case 2: - message.prehash_key = reader.int32(); - break; - case 3: - message.prehash_value = reader.int32(); - break; - case 4: - message.length = reader.int32(); - break; - case 5: - message.prefix = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LeafOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.LeafOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.LeafOp} LeafOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LeafOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LeafOp message. - * @function verify - * @memberof ics23.LeafOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LeafOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - switch (message.hash) { - default: - return "hash: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.prehash_key != null && message.hasOwnProperty("prehash_key")) - switch (message.prehash_key) { - default: - return "prehash_key: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.prehash_value != null && message.hasOwnProperty("prehash_value")) - switch (message.prehash_value) { - default: - return "prehash_value: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.length != null && message.hasOwnProperty("length")) - switch (message.length) { - default: - return "length: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.prefix != null && message.hasOwnProperty("prefix")) - if (!(message.prefix && typeof message.prefix.length === "number" || $util.isString(message.prefix))) - return "prefix: buffer expected"; - return null; - }; - - /** - * Creates a LeafOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.LeafOp - * @static - * @param {Object.} object Plain object - * @returns {ics23.LeafOp} LeafOp - */ - LeafOp.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.LeafOp) - return object; - let message = new $root.ics23.LeafOp(); - switch (object.hash) { - case "NO_HASH": - case 0: - message.hash = 0; - break; - case "SHA256": - case 1: - message.hash = 1; - break; - case "SHA512": - case 2: - message.hash = 2; - break; - case "KECCAK": - case 3: - message.hash = 3; - break; - case "RIPEMD160": - case 4: - message.hash = 4; - break; - case "BITCOIN": - case 5: - message.hash = 5; - break; - } - switch (object.prehash_key) { - case "NO_HASH": - case 0: - message.prehash_key = 0; - break; - case "SHA256": - case 1: - message.prehash_key = 1; - break; - case "SHA512": - case 2: - message.prehash_key = 2; - break; - case "KECCAK": - case 3: - message.prehash_key = 3; - break; - case "RIPEMD160": - case 4: - message.prehash_key = 4; - break; - case "BITCOIN": - case 5: - message.prehash_key = 5; - break; - } - switch (object.prehash_value) { - case "NO_HASH": - case 0: - message.prehash_value = 0; - break; - case "SHA256": - case 1: - message.prehash_value = 1; - break; - case "SHA512": - case 2: - message.prehash_value = 2; - break; - case "KECCAK": - case 3: - message.prehash_value = 3; - break; - case "RIPEMD160": - case 4: - message.prehash_value = 4; - break; - case "BITCOIN": - case 5: - message.prehash_value = 5; - break; - } - switch (object.length) { - case "NO_PREFIX": - case 0: - message.length = 0; - break; - case "VAR_PROTO": - case 1: - message.length = 1; - break; - case "VAR_RLP": - case 2: - message.length = 2; - break; - case "FIXED32_BIG": - case 3: - message.length = 3; - break; - case "FIXED32_LITTLE": - case 4: - message.length = 4; - break; - case "FIXED64_BIG": - case 5: - message.length = 5; - break; - case "FIXED64_LITTLE": - case 6: - message.length = 6; - break; - case "REQUIRE_32_BYTES": - case 7: - message.length = 7; - break; - case "REQUIRE_64_BYTES": - case 8: - message.length = 8; - break; - } - if (object.prefix != null) - if (typeof object.prefix === "string") - $util.base64.decode(object.prefix, message.prefix = $util.newBuffer($util.base64.length(object.prefix)), 0); - else if (object.prefix.length) - message.prefix = object.prefix; - return message; - }; - - /** - * Creates a plain object from a LeafOp message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.LeafOp - * @static - * @param {ics23.LeafOp} message LeafOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LeafOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.hash = options.enums === String ? "NO_HASH" : 0; - object.prehash_key = options.enums === String ? "NO_HASH" : 0; - object.prehash_value = options.enums === String ? "NO_HASH" : 0; - object.length = options.enums === String ? "NO_PREFIX" : 0; - if (options.bytes === String) - object.prefix = ""; - else { - object.prefix = []; - if (options.bytes !== Array) - object.prefix = $util.newBuffer(object.prefix); - } - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.enums === String ? $root.ics23.HashOp[message.hash] : message.hash; - if (message.prehash_key != null && message.hasOwnProperty("prehash_key")) - object.prehash_key = options.enums === String ? $root.ics23.HashOp[message.prehash_key] : message.prehash_key; - if (message.prehash_value != null && message.hasOwnProperty("prehash_value")) - object.prehash_value = options.enums === String ? $root.ics23.HashOp[message.prehash_value] : message.prehash_value; - if (message.length != null && message.hasOwnProperty("length")) - object.length = options.enums === String ? $root.ics23.LengthOp[message.length] : message.length; - if (message.prefix != null && message.hasOwnProperty("prefix")) - object.prefix = options.bytes === String ? $util.base64.encode(message.prefix, 0, message.prefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.prefix) : message.prefix; - return object; - }; - - /** - * Converts this LeafOp to JSON. - * @function toJSON - * @memberof ics23.LeafOp - * @instance - * @returns {Object.} JSON object - */ - LeafOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return LeafOp; - })(); - - ics23.InnerOp = (function() { - - /** - * Properties of an InnerOp. - * @memberof ics23 - * @interface IInnerOp - * @property {ics23.HashOp|null} [hash] InnerOp hash - * @property {Uint8Array|null} [prefix] InnerOp prefix - * @property {Uint8Array|null} [suffix] InnerOp suffix - */ - - /** - * Constructs a new InnerOp. - * @memberof ics23 - * @classdesc InnerOp represents a merkle-proof step that is not a leaf. - * It represents concatenating two children and hashing them to provide the next result. - * - * The result of the previous step is passed in, so the signature of this op is: - * innerOp(child) -> output - * - * The result of applying InnerOp should be: - * output = op.hash(op.prefix || child || op.suffix) - * - * where the || operator is concatenation of binary data, - * and child is the result of hashing all the tree below this step. - * - * Any special data, like prepending child with the length, or prepending the entire operation with - * some value to differentiate from leaf nodes, should be included in prefix and suffix. - * If either of prefix or suffix is empty, we just treat it as an empty string - * @implements IInnerOp - * @constructor - * @param {ics23.IInnerOp=} [properties] Properties to set - */ - function InnerOp(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InnerOp hash. - * @member {ics23.HashOp} hash - * @memberof ics23.InnerOp - * @instance - */ - InnerOp.prototype.hash = 0; - - /** - * InnerOp prefix. - * @member {Uint8Array} prefix - * @memberof ics23.InnerOp - * @instance - */ - InnerOp.prototype.prefix = $util.newBuffer([]); - - /** - * InnerOp suffix. - * @member {Uint8Array} suffix - * @memberof ics23.InnerOp - * @instance - */ - InnerOp.prototype.suffix = $util.newBuffer([]); - - /** - * Encodes the specified InnerOp message. Does not implicitly {@link ics23.InnerOp.verify|verify} messages. - * @function encode - * @memberof ics23.InnerOp - * @static - * @param {ics23.IInnerOp} message InnerOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InnerOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hash); - if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.prefix); - if (message.suffix != null && Object.hasOwnProperty.call(message, "suffix")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.suffix); - return writer; - }; - - /** - * Encodes the specified InnerOp message, length delimited. Does not implicitly {@link ics23.InnerOp.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.InnerOp - * @static - * @param {ics23.IInnerOp} message InnerOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InnerOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InnerOp message from the specified reader or buffer. - * @function decode - * @memberof ics23.InnerOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.InnerOp} InnerOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InnerOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.InnerOp(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.int32(); - break; - case 2: - message.prefix = reader.bytes(); - break; - case 3: - message.suffix = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InnerOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.InnerOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.InnerOp} InnerOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InnerOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InnerOp message. - * @function verify - * @memberof ics23.InnerOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InnerOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - switch (message.hash) { - default: - return "hash: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.prefix != null && message.hasOwnProperty("prefix")) - if (!(message.prefix && typeof message.prefix.length === "number" || $util.isString(message.prefix))) - return "prefix: buffer expected"; - if (message.suffix != null && message.hasOwnProperty("suffix")) - if (!(message.suffix && typeof message.suffix.length === "number" || $util.isString(message.suffix))) - return "suffix: buffer expected"; - return null; - }; - - /** - * Creates an InnerOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.InnerOp - * @static - * @param {Object.} object Plain object - * @returns {ics23.InnerOp} InnerOp - */ - InnerOp.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.InnerOp) - return object; - let message = new $root.ics23.InnerOp(); - switch (object.hash) { - case "NO_HASH": - case 0: - message.hash = 0; - break; - case "SHA256": - case 1: - message.hash = 1; - break; - case "SHA512": - case 2: - message.hash = 2; - break; - case "KECCAK": - case 3: - message.hash = 3; - break; - case "RIPEMD160": - case 4: - message.hash = 4; - break; - case "BITCOIN": - case 5: - message.hash = 5; - break; - } - if (object.prefix != null) - if (typeof object.prefix === "string") - $util.base64.decode(object.prefix, message.prefix = $util.newBuffer($util.base64.length(object.prefix)), 0); - else if (object.prefix.length) - message.prefix = object.prefix; - if (object.suffix != null) - if (typeof object.suffix === "string") - $util.base64.decode(object.suffix, message.suffix = $util.newBuffer($util.base64.length(object.suffix)), 0); - else if (object.suffix.length) - message.suffix = object.suffix; - return message; - }; - - /** - * Creates a plain object from an InnerOp message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.InnerOp - * @static - * @param {ics23.InnerOp} message InnerOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InnerOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.hash = options.enums === String ? "NO_HASH" : 0; - if (options.bytes === String) - object.prefix = ""; - else { - object.prefix = []; - if (options.bytes !== Array) - object.prefix = $util.newBuffer(object.prefix); - } - if (options.bytes === String) - object.suffix = ""; - else { - object.suffix = []; - if (options.bytes !== Array) - object.suffix = $util.newBuffer(object.suffix); - } - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.enums === String ? $root.ics23.HashOp[message.hash] : message.hash; - if (message.prefix != null && message.hasOwnProperty("prefix")) - object.prefix = options.bytes === String ? $util.base64.encode(message.prefix, 0, message.prefix.length) : options.bytes === Array ? Array.prototype.slice.call(message.prefix) : message.prefix; - if (message.suffix != null && message.hasOwnProperty("suffix")) - object.suffix = options.bytes === String ? $util.base64.encode(message.suffix, 0, message.suffix.length) : options.bytes === Array ? Array.prototype.slice.call(message.suffix) : message.suffix; - return object; - }; - - /** - * Converts this InnerOp to JSON. - * @function toJSON - * @memberof ics23.InnerOp - * @instance - * @returns {Object.} JSON object - */ - InnerOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InnerOp; - })(); - - ics23.ProofSpec = (function() { - - /** - * Properties of a ProofSpec. - * @memberof ics23 - * @interface IProofSpec - * @property {ics23.ILeafOp|null} [leaf_spec] ProofSpec leaf_spec - * @property {ics23.IInnerSpec|null} [inner_spec] ProofSpec inner_spec - * @property {number|null} [max_depth] ProofSpec max_depth - * @property {number|null} [min_depth] ProofSpec min_depth - */ - - /** - * Constructs a new ProofSpec. - * @memberof ics23 - * @classdesc ProofSpec defines what the expected parameters are for a given proof type. - * This can be stored in the client and used to validate any incoming proofs. - * - * verify(ProofSpec, Proof) -> Proof | Error - * - * As demonstrated in tests, if we don't fix the algorithm used to calculate the - * LeafHash for a given tree, there are many possible key-value pairs that can - * generate a given hash (by interpretting the preimage differently). - * We need this for proper security, requires client knows a priori what - * tree format server uses. But not in code, rather a configuration object. - * @implements IProofSpec - * @constructor - * @param {ics23.IProofSpec=} [properties] Properties to set - */ - function ProofSpec(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProofSpec leaf_spec. - * @member {ics23.ILeafOp|null|undefined} leaf_spec - * @memberof ics23.ProofSpec - * @instance - */ - ProofSpec.prototype.leaf_spec = null; - - /** - * ProofSpec inner_spec. - * @member {ics23.IInnerSpec|null|undefined} inner_spec - * @memberof ics23.ProofSpec - * @instance - */ - ProofSpec.prototype.inner_spec = null; - - /** - * ProofSpec max_depth. - * @member {number} max_depth - * @memberof ics23.ProofSpec - * @instance - */ - ProofSpec.prototype.max_depth = 0; - - /** - * ProofSpec min_depth. - * @member {number} min_depth - * @memberof ics23.ProofSpec - * @instance - */ - ProofSpec.prototype.min_depth = 0; - - /** - * Encodes the specified ProofSpec message. Does not implicitly {@link ics23.ProofSpec.verify|verify} messages. - * @function encode - * @memberof ics23.ProofSpec - * @static - * @param {ics23.IProofSpec} message ProofSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.leaf_spec != null && Object.hasOwnProperty.call(message, "leaf_spec")) - $root.ics23.LeafOp.encode(message.leaf_spec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.inner_spec != null && Object.hasOwnProperty.call(message, "inner_spec")) - $root.ics23.InnerSpec.encode(message.inner_spec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.max_depth != null && Object.hasOwnProperty.call(message, "max_depth")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.max_depth); - if (message.min_depth != null && Object.hasOwnProperty.call(message, "min_depth")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.min_depth); - return writer; - }; - - /** - * Encodes the specified ProofSpec message, length delimited. Does not implicitly {@link ics23.ProofSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.ProofSpec - * @static - * @param {ics23.IProofSpec} message ProofSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProofSpec message from the specified reader or buffer. - * @function decode - * @memberof ics23.ProofSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.ProofSpec} ProofSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.ProofSpec(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.leaf_spec = $root.ics23.LeafOp.decode(reader, reader.uint32()); - break; - case 2: - message.inner_spec = $root.ics23.InnerSpec.decode(reader, reader.uint32()); - break; - case 3: - message.max_depth = reader.int32(); - break; - case 4: - message.min_depth = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProofSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.ProofSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.ProofSpec} ProofSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProofSpec message. - * @function verify - * @memberof ics23.ProofSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProofSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.leaf_spec != null && message.hasOwnProperty("leaf_spec")) { - let error = $root.ics23.LeafOp.verify(message.leaf_spec); - if (error) - return "leaf_spec." + error; - } - if (message.inner_spec != null && message.hasOwnProperty("inner_spec")) { - let error = $root.ics23.InnerSpec.verify(message.inner_spec); - if (error) - return "inner_spec." + error; - } - if (message.max_depth != null && message.hasOwnProperty("max_depth")) - if (!$util.isInteger(message.max_depth)) - return "max_depth: integer expected"; - if (message.min_depth != null && message.hasOwnProperty("min_depth")) - if (!$util.isInteger(message.min_depth)) - return "min_depth: integer expected"; - return null; - }; - - /** - * Creates a ProofSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.ProofSpec - * @static - * @param {Object.} object Plain object - * @returns {ics23.ProofSpec} ProofSpec - */ - ProofSpec.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.ProofSpec) - return object; - let message = new $root.ics23.ProofSpec(); - if (object.leaf_spec != null) { - if (typeof object.leaf_spec !== "object") - throw TypeError(".ics23.ProofSpec.leaf_spec: object expected"); - message.leaf_spec = $root.ics23.LeafOp.fromObject(object.leaf_spec); - } - if (object.inner_spec != null) { - if (typeof object.inner_spec !== "object") - throw TypeError(".ics23.ProofSpec.inner_spec: object expected"); - message.inner_spec = $root.ics23.InnerSpec.fromObject(object.inner_spec); - } - if (object.max_depth != null) - message.max_depth = object.max_depth | 0; - if (object.min_depth != null) - message.min_depth = object.min_depth | 0; - return message; - }; - - /** - * Creates a plain object from a ProofSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.ProofSpec - * @static - * @param {ics23.ProofSpec} message ProofSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProofSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.leaf_spec = null; - object.inner_spec = null; - object.max_depth = 0; - object.min_depth = 0; - } - if (message.leaf_spec != null && message.hasOwnProperty("leaf_spec")) - object.leaf_spec = $root.ics23.LeafOp.toObject(message.leaf_spec, options); - if (message.inner_spec != null && message.hasOwnProperty("inner_spec")) - object.inner_spec = $root.ics23.InnerSpec.toObject(message.inner_spec, options); - if (message.max_depth != null && message.hasOwnProperty("max_depth")) - object.max_depth = message.max_depth; - if (message.min_depth != null && message.hasOwnProperty("min_depth")) - object.min_depth = message.min_depth; - return object; - }; - - /** - * Converts this ProofSpec to JSON. - * @function toJSON - * @memberof ics23.ProofSpec - * @instance - * @returns {Object.} JSON object - */ - ProofSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProofSpec; - })(); - - ics23.InnerSpec = (function() { - - /** - * Properties of an InnerSpec. - * @memberof ics23 - * @interface IInnerSpec - * @property {Array.|null} [child_order] InnerSpec child_order - * @property {number|null} [child_size] InnerSpec child_size - * @property {number|null} [min_prefix_length] InnerSpec min_prefix_length - * @property {number|null} [max_prefix_length] InnerSpec max_prefix_length - * @property {Uint8Array|null} [empty_child] InnerSpec empty_child - * @property {ics23.HashOp|null} [hash] InnerSpec hash - */ - - /** - * Constructs a new InnerSpec. - * @memberof ics23 - * @classdesc Represents an InnerSpec. - * @implements IInnerSpec - * @constructor - * @param {ics23.IInnerSpec=} [properties] Properties to set - */ - function InnerSpec(properties) { - this.child_order = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InnerSpec child_order. - * @member {Array.} child_order - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.child_order = $util.emptyArray; - - /** - * InnerSpec child_size. - * @member {number} child_size - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.child_size = 0; - - /** - * InnerSpec min_prefix_length. - * @member {number} min_prefix_length - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.min_prefix_length = 0; - - /** - * InnerSpec max_prefix_length. - * @member {number} max_prefix_length - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.max_prefix_length = 0; - - /** - * InnerSpec empty_child. - * @member {Uint8Array} empty_child - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.empty_child = $util.newBuffer([]); - - /** - * InnerSpec hash. - * @member {ics23.HashOp} hash - * @memberof ics23.InnerSpec - * @instance - */ - InnerSpec.prototype.hash = 0; - - /** - * Encodes the specified InnerSpec message. Does not implicitly {@link ics23.InnerSpec.verify|verify} messages. - * @function encode - * @memberof ics23.InnerSpec - * @static - * @param {ics23.IInnerSpec} message InnerSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InnerSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.child_order != null && message.child_order.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (let i = 0; i < message.child_order.length; ++i) - writer.int32(message.child_order[i]); - writer.ldelim(); - } - if (message.child_size != null && Object.hasOwnProperty.call(message, "child_size")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.child_size); - if (message.min_prefix_length != null && Object.hasOwnProperty.call(message, "min_prefix_length")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.min_prefix_length); - if (message.max_prefix_length != null && Object.hasOwnProperty.call(message, "max_prefix_length")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.max_prefix_length); - if (message.empty_child != null && Object.hasOwnProperty.call(message, "empty_child")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.empty_child); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.hash); - return writer; - }; - - /** - * Encodes the specified InnerSpec message, length delimited. Does not implicitly {@link ics23.InnerSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.InnerSpec - * @static - * @param {ics23.IInnerSpec} message InnerSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InnerSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InnerSpec message from the specified reader or buffer. - * @function decode - * @memberof ics23.InnerSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.InnerSpec} InnerSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InnerSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.InnerSpec(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.child_order && message.child_order.length)) - message.child_order = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.child_order.push(reader.int32()); - } else - message.child_order.push(reader.int32()); - break; - case 2: - message.child_size = reader.int32(); - break; - case 3: - message.min_prefix_length = reader.int32(); - break; - case 4: - message.max_prefix_length = reader.int32(); - break; - case 5: - message.empty_child = reader.bytes(); - break; - case 6: - message.hash = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InnerSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.InnerSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.InnerSpec} InnerSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InnerSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InnerSpec message. - * @function verify - * @memberof ics23.InnerSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InnerSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.child_order != null && message.hasOwnProperty("child_order")) { - if (!Array.isArray(message.child_order)) - return "child_order: array expected"; - for (let i = 0; i < message.child_order.length; ++i) - if (!$util.isInteger(message.child_order[i])) - return "child_order: integer[] expected"; - } - if (message.child_size != null && message.hasOwnProperty("child_size")) - if (!$util.isInteger(message.child_size)) - return "child_size: integer expected"; - if (message.min_prefix_length != null && message.hasOwnProperty("min_prefix_length")) - if (!$util.isInteger(message.min_prefix_length)) - return "min_prefix_length: integer expected"; - if (message.max_prefix_length != null && message.hasOwnProperty("max_prefix_length")) - if (!$util.isInteger(message.max_prefix_length)) - return "max_prefix_length: integer expected"; - if (message.empty_child != null && message.hasOwnProperty("empty_child")) - if (!(message.empty_child && typeof message.empty_child.length === "number" || $util.isString(message.empty_child))) - return "empty_child: buffer expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - switch (message.hash) { - default: - return "hash: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates an InnerSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.InnerSpec - * @static - * @param {Object.} object Plain object - * @returns {ics23.InnerSpec} InnerSpec - */ - InnerSpec.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.InnerSpec) - return object; - let message = new $root.ics23.InnerSpec(); - if (object.child_order) { - if (!Array.isArray(object.child_order)) - throw TypeError(".ics23.InnerSpec.child_order: array expected"); - message.child_order = []; - for (let i = 0; i < object.child_order.length; ++i) - message.child_order[i] = object.child_order[i] | 0; - } - if (object.child_size != null) - message.child_size = object.child_size | 0; - if (object.min_prefix_length != null) - message.min_prefix_length = object.min_prefix_length | 0; - if (object.max_prefix_length != null) - message.max_prefix_length = object.max_prefix_length | 0; - if (object.empty_child != null) - if (typeof object.empty_child === "string") - $util.base64.decode(object.empty_child, message.empty_child = $util.newBuffer($util.base64.length(object.empty_child)), 0); - else if (object.empty_child.length) - message.empty_child = object.empty_child; - switch (object.hash) { - case "NO_HASH": - case 0: - message.hash = 0; - break; - case "SHA256": - case 1: - message.hash = 1; - break; - case "SHA512": - case 2: - message.hash = 2; - break; - case "KECCAK": - case 3: - message.hash = 3; - break; - case "RIPEMD160": - case 4: - message.hash = 4; - break; - case "BITCOIN": - case 5: - message.hash = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from an InnerSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.InnerSpec - * @static - * @param {ics23.InnerSpec} message InnerSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InnerSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.child_order = []; - if (options.defaults) { - object.child_size = 0; - object.min_prefix_length = 0; - object.max_prefix_length = 0; - if (options.bytes === String) - object.empty_child = ""; - else { - object.empty_child = []; - if (options.bytes !== Array) - object.empty_child = $util.newBuffer(object.empty_child); - } - object.hash = options.enums === String ? "NO_HASH" : 0; - } - if (message.child_order && message.child_order.length) { - object.child_order = []; - for (let j = 0; j < message.child_order.length; ++j) - object.child_order[j] = message.child_order[j]; - } - if (message.child_size != null && message.hasOwnProperty("child_size")) - object.child_size = message.child_size; - if (message.min_prefix_length != null && message.hasOwnProperty("min_prefix_length")) - object.min_prefix_length = message.min_prefix_length; - if (message.max_prefix_length != null && message.hasOwnProperty("max_prefix_length")) - object.max_prefix_length = message.max_prefix_length; - if (message.empty_child != null && message.hasOwnProperty("empty_child")) - object.empty_child = options.bytes === String ? $util.base64.encode(message.empty_child, 0, message.empty_child.length) : options.bytes === Array ? Array.prototype.slice.call(message.empty_child) : message.empty_child; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.enums === String ? $root.ics23.HashOp[message.hash] : message.hash; - return object; - }; - - /** - * Converts this InnerSpec to JSON. - * @function toJSON - * @memberof ics23.InnerSpec - * @instance - * @returns {Object.} JSON object - */ - InnerSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InnerSpec; - })(); - - ics23.BatchProof = (function() { - - /** - * Properties of a BatchProof. - * @memberof ics23 - * @interface IBatchProof - * @property {Array.|null} [entries] BatchProof entries - */ - - /** - * Constructs a new BatchProof. - * @memberof ics23 - * @classdesc Represents a BatchProof. - * @implements IBatchProof - * @constructor - * @param {ics23.IBatchProof=} [properties] Properties to set - */ - function BatchProof(properties) { - this.entries = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchProof entries. - * @member {Array.} entries - * @memberof ics23.BatchProof - * @instance - */ - BatchProof.prototype.entries = $util.emptyArray; - - /** - * Encodes the specified BatchProof message. Does not implicitly {@link ics23.BatchProof.verify|verify} messages. - * @function encode - * @memberof ics23.BatchProof - * @static - * @param {ics23.IBatchProof} message BatchProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entries != null && message.entries.length) - for (let i = 0; i < message.entries.length; ++i) - $root.ics23.BatchEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchProof message, length delimited. Does not implicitly {@link ics23.BatchProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.BatchProof - * @static - * @param {ics23.IBatchProof} message BatchProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.BatchProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.BatchProof} BatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.BatchProof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push($root.ics23.BatchEntry.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.BatchProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.BatchProof} BatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchProof message. - * @function verify - * @memberof ics23.BatchProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (let i = 0; i < message.entries.length; ++i) { - let error = $root.ics23.BatchEntry.verify(message.entries[i]); - if (error) - return "entries." + error; - } - } - return null; - }; - - /** - * Creates a BatchProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.BatchProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.BatchProof} BatchProof - */ - BatchProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.BatchProof) - return object; - let message = new $root.ics23.BatchProof(); - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".ics23.BatchProof.entries: array expected"); - message.entries = []; - for (let i = 0; i < object.entries.length; ++i) { - if (typeof object.entries[i] !== "object") - throw TypeError(".ics23.BatchProof.entries: object expected"); - message.entries[i] = $root.ics23.BatchEntry.fromObject(object.entries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.BatchProof - * @static - * @param {ics23.BatchProof} message BatchProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.entries = []; - if (message.entries && message.entries.length) { - object.entries = []; - for (let j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.ics23.BatchEntry.toObject(message.entries[j], options); - } - return object; - }; - - /** - * Converts this BatchProof to JSON. - * @function toJSON - * @memberof ics23.BatchProof - * @instance - * @returns {Object.} JSON object - */ - BatchProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BatchProof; - })(); - - ics23.BatchEntry = (function() { - - /** - * Properties of a BatchEntry. - * @memberof ics23 - * @interface IBatchEntry - * @property {ics23.IExistenceProof|null} [exist] BatchEntry exist - * @property {ics23.INonExistenceProof|null} [nonexist] BatchEntry nonexist - */ - - /** - * Constructs a new BatchEntry. - * @memberof ics23 - * @classdesc Represents a BatchEntry. - * @implements IBatchEntry - * @constructor - * @param {ics23.IBatchEntry=} [properties] Properties to set - */ - function BatchEntry(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchEntry exist. - * @member {ics23.IExistenceProof|null|undefined} exist - * @memberof ics23.BatchEntry - * @instance - */ - BatchEntry.prototype.exist = null; - - /** - * BatchEntry nonexist. - * @member {ics23.INonExistenceProof|null|undefined} nonexist - * @memberof ics23.BatchEntry - * @instance - */ - BatchEntry.prototype.nonexist = null; - - // OneOf field names bound to virtual getters and setters - let $oneOfFields; - - /** - * BatchEntry proof. - * @member {"exist"|"nonexist"|undefined} proof - * @memberof ics23.BatchEntry - * @instance - */ - Object.defineProperty(BatchEntry.prototype, "proof", { - get: $util.oneOfGetter($oneOfFields = ["exist", "nonexist"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified BatchEntry message. Does not implicitly {@link ics23.BatchEntry.verify|verify} messages. - * @function encode - * @memberof ics23.BatchEntry - * @static - * @param {ics23.IBatchEntry} message BatchEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exist != null && Object.hasOwnProperty.call(message, "exist")) - $root.ics23.ExistenceProof.encode(message.exist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nonexist != null && Object.hasOwnProperty.call(message, "nonexist")) - $root.ics23.NonExistenceProof.encode(message.nonexist, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchEntry message, length delimited. Does not implicitly {@link ics23.BatchEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.BatchEntry - * @static - * @param {ics23.IBatchEntry} message BatchEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchEntry message from the specified reader or buffer. - * @function decode - * @memberof ics23.BatchEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.BatchEntry} BatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.BatchEntry(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exist = $root.ics23.ExistenceProof.decode(reader, reader.uint32()); - break; - case 2: - message.nonexist = $root.ics23.NonExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.BatchEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.BatchEntry} BatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchEntry message. - * @function verify - * @memberof ics23.BatchEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - properties.proof = 1; - { - let error = $root.ics23.ExistenceProof.verify(message.exist); - if (error) - return "exist." + error; - } - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - let error = $root.ics23.NonExistenceProof.verify(message.nonexist); - if (error) - return "nonexist." + error; - } - } - return null; - }; - - /** - * Creates a BatchEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.BatchEntry - * @static - * @param {Object.} object Plain object - * @returns {ics23.BatchEntry} BatchEntry - */ - BatchEntry.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.BatchEntry) - return object; - let message = new $root.ics23.BatchEntry(); - if (object.exist != null) { - if (typeof object.exist !== "object") - throw TypeError(".ics23.BatchEntry.exist: object expected"); - message.exist = $root.ics23.ExistenceProof.fromObject(object.exist); - } - if (object.nonexist != null) { - if (typeof object.nonexist !== "object") - throw TypeError(".ics23.BatchEntry.nonexist: object expected"); - message.nonexist = $root.ics23.NonExistenceProof.fromObject(object.nonexist); - } - return message; - }; - - /** - * Creates a plain object from a BatchEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.BatchEntry - * @static - * @param {ics23.BatchEntry} message BatchEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - object.exist = $root.ics23.ExistenceProof.toObject(message.exist, options); - if (options.oneofs) - object.proof = "exist"; - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - object.nonexist = $root.ics23.NonExistenceProof.toObject(message.nonexist, options); - if (options.oneofs) - object.proof = "nonexist"; - } - return object; - }; - - /** - * Converts this BatchEntry to JSON. - * @function toJSON - * @memberof ics23.BatchEntry - * @instance - * @returns {Object.} JSON object - */ - BatchEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BatchEntry; - })(); - - ics23.CompressedBatchProof = (function() { - - /** - * Properties of a CompressedBatchProof. - * @memberof ics23 - * @interface ICompressedBatchProof - * @property {Array.|null} [entries] CompressedBatchProof entries - * @property {Array.|null} [lookup_inners] CompressedBatchProof lookup_inners - */ - - /** - * Constructs a new CompressedBatchProof. - * @memberof ics23 - * @classdesc Represents a CompressedBatchProof. - * @implements ICompressedBatchProof - * @constructor - * @param {ics23.ICompressedBatchProof=} [properties] Properties to set - */ - function CompressedBatchProof(properties) { - this.entries = []; - this.lookup_inners = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CompressedBatchProof entries. - * @member {Array.} entries - * @memberof ics23.CompressedBatchProof - * @instance - */ - CompressedBatchProof.prototype.entries = $util.emptyArray; - - /** - * CompressedBatchProof lookup_inners. - * @member {Array.} lookup_inners - * @memberof ics23.CompressedBatchProof - * @instance - */ - CompressedBatchProof.prototype.lookup_inners = $util.emptyArray; - - /** - * Encodes the specified CompressedBatchProof message. Does not implicitly {@link ics23.CompressedBatchProof.verify|verify} messages. - * @function encode - * @memberof ics23.CompressedBatchProof - * @static - * @param {ics23.ICompressedBatchProof} message CompressedBatchProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedBatchProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entries != null && message.entries.length) - for (let i = 0; i < message.entries.length; ++i) - $root.ics23.CompressedBatchEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.lookup_inners != null && message.lookup_inners.length) - for (let i = 0; i < message.lookup_inners.length; ++i) - $root.ics23.InnerOp.encode(message.lookup_inners[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CompressedBatchProof message, length delimited. Does not implicitly {@link ics23.CompressedBatchProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CompressedBatchProof - * @static - * @param {ics23.ICompressedBatchProof} message CompressedBatchProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedBatchProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompressedBatchProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.CompressedBatchProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CompressedBatchProof} CompressedBatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedBatchProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedBatchProof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push($root.ics23.CompressedBatchEntry.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.lookup_inners && message.lookup_inners.length)) - message.lookup_inners = []; - message.lookup_inners.push($root.ics23.InnerOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompressedBatchProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CompressedBatchProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CompressedBatchProof} CompressedBatchProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedBatchProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompressedBatchProof message. - * @function verify - * @memberof ics23.CompressedBatchProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompressedBatchProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (let i = 0; i < message.entries.length; ++i) { - let error = $root.ics23.CompressedBatchEntry.verify(message.entries[i]); - if (error) - return "entries." + error; - } - } - if (message.lookup_inners != null && message.hasOwnProperty("lookup_inners")) { - if (!Array.isArray(message.lookup_inners)) - return "lookup_inners: array expected"; - for (let i = 0; i < message.lookup_inners.length; ++i) { - let error = $root.ics23.InnerOp.verify(message.lookup_inners[i]); - if (error) - return "lookup_inners." + error; - } - } - return null; - }; - - /** - * Creates a CompressedBatchProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CompressedBatchProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.CompressedBatchProof} CompressedBatchProof - */ - CompressedBatchProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CompressedBatchProof) - return object; - let message = new $root.ics23.CompressedBatchProof(); - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".ics23.CompressedBatchProof.entries: array expected"); - message.entries = []; - for (let i = 0; i < object.entries.length; ++i) { - if (typeof object.entries[i] !== "object") - throw TypeError(".ics23.CompressedBatchProof.entries: object expected"); - message.entries[i] = $root.ics23.CompressedBatchEntry.fromObject(object.entries[i]); - } - } - if (object.lookup_inners) { - if (!Array.isArray(object.lookup_inners)) - throw TypeError(".ics23.CompressedBatchProof.lookup_inners: array expected"); - message.lookup_inners = []; - for (let i = 0; i < object.lookup_inners.length; ++i) { - if (typeof object.lookup_inners[i] !== "object") - throw TypeError(".ics23.CompressedBatchProof.lookup_inners: object expected"); - message.lookup_inners[i] = $root.ics23.InnerOp.fromObject(object.lookup_inners[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CompressedBatchProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CompressedBatchProof - * @static - * @param {ics23.CompressedBatchProof} message CompressedBatchProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompressedBatchProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) { - object.entries = []; - object.lookup_inners = []; - } - if (message.entries && message.entries.length) { - object.entries = []; - for (let j = 0; j < message.entries.length; ++j) - object.entries[j] = $root.ics23.CompressedBatchEntry.toObject(message.entries[j], options); - } - if (message.lookup_inners && message.lookup_inners.length) { - object.lookup_inners = []; - for (let j = 0; j < message.lookup_inners.length; ++j) - object.lookup_inners[j] = $root.ics23.InnerOp.toObject(message.lookup_inners[j], options); - } - return object; - }; - - /** - * Converts this CompressedBatchProof to JSON. - * @function toJSON - * @memberof ics23.CompressedBatchProof - * @instance - * @returns {Object.} JSON object - */ - CompressedBatchProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompressedBatchProof; - })(); - - ics23.CompressedBatchEntry = (function() { - - /** - * Properties of a CompressedBatchEntry. - * @memberof ics23 - * @interface ICompressedBatchEntry - * @property {ics23.ICompressedExistenceProof|null} [exist] CompressedBatchEntry exist - * @property {ics23.ICompressedNonExistenceProof|null} [nonexist] CompressedBatchEntry nonexist - */ - - /** - * Constructs a new CompressedBatchEntry. - * @memberof ics23 - * @classdesc Represents a CompressedBatchEntry. - * @implements ICompressedBatchEntry - * @constructor - * @param {ics23.ICompressedBatchEntry=} [properties] Properties to set - */ - function CompressedBatchEntry(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CompressedBatchEntry exist. - * @member {ics23.ICompressedExistenceProof|null|undefined} exist - * @memberof ics23.CompressedBatchEntry - * @instance - */ - CompressedBatchEntry.prototype.exist = null; - - /** - * CompressedBatchEntry nonexist. - * @member {ics23.ICompressedNonExistenceProof|null|undefined} nonexist - * @memberof ics23.CompressedBatchEntry - * @instance - */ - CompressedBatchEntry.prototype.nonexist = null; - - // OneOf field names bound to virtual getters and setters - let $oneOfFields; - - /** - * CompressedBatchEntry proof. - * @member {"exist"|"nonexist"|undefined} proof - * @memberof ics23.CompressedBatchEntry - * @instance - */ - Object.defineProperty(CompressedBatchEntry.prototype, "proof", { - get: $util.oneOfGetter($oneOfFields = ["exist", "nonexist"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified CompressedBatchEntry message. Does not implicitly {@link ics23.CompressedBatchEntry.verify|verify} messages. - * @function encode - * @memberof ics23.CompressedBatchEntry - * @static - * @param {ics23.ICompressedBatchEntry} message CompressedBatchEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedBatchEntry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exist != null && Object.hasOwnProperty.call(message, "exist")) - $root.ics23.CompressedExistenceProof.encode(message.exist, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nonexist != null && Object.hasOwnProperty.call(message, "nonexist")) - $root.ics23.CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CompressedBatchEntry message, length delimited. Does not implicitly {@link ics23.CompressedBatchEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CompressedBatchEntry - * @static - * @param {ics23.ICompressedBatchEntry} message CompressedBatchEntry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedBatchEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompressedBatchEntry message from the specified reader or buffer. - * @function decode - * @memberof ics23.CompressedBatchEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedBatchEntry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedBatchEntry(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exist = $root.ics23.CompressedExistenceProof.decode(reader, reader.uint32()); - break; - case 2: - message.nonexist = $root.ics23.CompressedNonExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompressedBatchEntry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CompressedBatchEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedBatchEntry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompressedBatchEntry message. - * @function verify - * @memberof ics23.CompressedBatchEntry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompressedBatchEntry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - properties.proof = 1; - { - let error = $root.ics23.CompressedExistenceProof.verify(message.exist); - if (error) - return "exist." + error; - } - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - if (properties.proof === 1) - return "proof: multiple values"; - properties.proof = 1; - { - let error = $root.ics23.CompressedNonExistenceProof.verify(message.nonexist); - if (error) - return "nonexist." + error; - } - } - return null; - }; - - /** - * Creates a CompressedBatchEntry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CompressedBatchEntry - * @static - * @param {Object.} object Plain object - * @returns {ics23.CompressedBatchEntry} CompressedBatchEntry - */ - CompressedBatchEntry.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CompressedBatchEntry) - return object; - let message = new $root.ics23.CompressedBatchEntry(); - if (object.exist != null) { - if (typeof object.exist !== "object") - throw TypeError(".ics23.CompressedBatchEntry.exist: object expected"); - message.exist = $root.ics23.CompressedExistenceProof.fromObject(object.exist); - } - if (object.nonexist != null) { - if (typeof object.nonexist !== "object") - throw TypeError(".ics23.CompressedBatchEntry.nonexist: object expected"); - message.nonexist = $root.ics23.CompressedNonExistenceProof.fromObject(object.nonexist); - } - return message; - }; - - /** - * Creates a plain object from a CompressedBatchEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CompressedBatchEntry - * @static - * @param {ics23.CompressedBatchEntry} message CompressedBatchEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompressedBatchEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (message.exist != null && message.hasOwnProperty("exist")) { - object.exist = $root.ics23.CompressedExistenceProof.toObject(message.exist, options); - if (options.oneofs) - object.proof = "exist"; - } - if (message.nonexist != null && message.hasOwnProperty("nonexist")) { - object.nonexist = $root.ics23.CompressedNonExistenceProof.toObject(message.nonexist, options); - if (options.oneofs) - object.proof = "nonexist"; - } - return object; - }; - - /** - * Converts this CompressedBatchEntry to JSON. - * @function toJSON - * @memberof ics23.CompressedBatchEntry - * @instance - * @returns {Object.} JSON object - */ - CompressedBatchEntry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompressedBatchEntry; - })(); - - ics23.CompressedExistenceProof = (function() { - - /** - * Properties of a CompressedExistenceProof. - * @memberof ics23 - * @interface ICompressedExistenceProof - * @property {Uint8Array|null} [key] CompressedExistenceProof key - * @property {Uint8Array|null} [value] CompressedExistenceProof value - * @property {ics23.ILeafOp|null} [leaf] CompressedExistenceProof leaf - * @property {Array.|null} [path] CompressedExistenceProof path - */ - - /** - * Constructs a new CompressedExistenceProof. - * @memberof ics23 - * @classdesc Represents a CompressedExistenceProof. - * @implements ICompressedExistenceProof - * @constructor - * @param {ics23.ICompressedExistenceProof=} [properties] Properties to set - */ - function CompressedExistenceProof(properties) { - this.path = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CompressedExistenceProof key. - * @member {Uint8Array} key - * @memberof ics23.CompressedExistenceProof - * @instance - */ - CompressedExistenceProof.prototype.key = $util.newBuffer([]); - - /** - * CompressedExistenceProof value. - * @member {Uint8Array} value - * @memberof ics23.CompressedExistenceProof - * @instance - */ - CompressedExistenceProof.prototype.value = $util.newBuffer([]); - - /** - * CompressedExistenceProof leaf. - * @member {ics23.ILeafOp|null|undefined} leaf - * @memberof ics23.CompressedExistenceProof - * @instance - */ - CompressedExistenceProof.prototype.leaf = null; - - /** - * CompressedExistenceProof path. - * @member {Array.} path - * @memberof ics23.CompressedExistenceProof - * @instance - */ - CompressedExistenceProof.prototype.path = $util.emptyArray; - - /** - * Encodes the specified CompressedExistenceProof message. Does not implicitly {@link ics23.CompressedExistenceProof.verify|verify} messages. - * @function encode - * @memberof ics23.CompressedExistenceProof - * @static - * @param {ics23.ICompressedExistenceProof} message CompressedExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedExistenceProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - if (message.leaf != null && Object.hasOwnProperty.call(message, "leaf")) - $root.ics23.LeafOp.encode(message.leaf, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (let i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CompressedExistenceProof message, length delimited. Does not implicitly {@link ics23.CompressedExistenceProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CompressedExistenceProof - * @static - * @param {ics23.ICompressedExistenceProof} message CompressedExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompressedExistenceProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.CompressedExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedExistenceProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedExistenceProof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - case 3: - message.leaf = $root.ics23.LeafOp.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompressedExistenceProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CompressedExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedExistenceProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompressedExistenceProof message. - * @function verify - * @memberof ics23.CompressedExistenceProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompressedExistenceProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - if (message.leaf != null && message.hasOwnProperty("leaf")) { - let error = $root.ics23.LeafOp.verify(message.leaf); - if (error) - return "leaf." + error; - } - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (let i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - return null; - }; - - /** - * Creates a CompressedExistenceProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CompressedExistenceProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.CompressedExistenceProof} CompressedExistenceProof - */ - CompressedExistenceProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CompressedExistenceProof) - return object; - let message = new $root.ics23.CompressedExistenceProof(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - if (object.leaf != null) { - if (typeof object.leaf !== "object") - throw TypeError(".ics23.CompressedExistenceProof.leaf: object expected"); - message.leaf = $root.ics23.LeafOp.fromObject(object.leaf); - } - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".ics23.CompressedExistenceProof.path: array expected"); - message.path = []; - for (let i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from a CompressedExistenceProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CompressedExistenceProof - * @static - * @param {ics23.CompressedExistenceProof} message CompressedExistenceProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompressedExistenceProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - object.leaf = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - if (message.leaf != null && message.hasOwnProperty("leaf")) - object.leaf = $root.ics23.LeafOp.toObject(message.leaf, options); - if (message.path && message.path.length) { - object.path = []; - for (let j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - return object; - }; - - /** - * Converts this CompressedExistenceProof to JSON. - * @function toJSON - * @memberof ics23.CompressedExistenceProof - * @instance - * @returns {Object.} JSON object - */ - CompressedExistenceProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompressedExistenceProof; - })(); - - ics23.CompressedNonExistenceProof = (function() { - - /** - * Properties of a CompressedNonExistenceProof. - * @memberof ics23 - * @interface ICompressedNonExistenceProof - * @property {Uint8Array|null} [key] CompressedNonExistenceProof key - * @property {ics23.ICompressedExistenceProof|null} [left] CompressedNonExistenceProof left - * @property {ics23.ICompressedExistenceProof|null} [right] CompressedNonExistenceProof right - */ - - /** - * Constructs a new CompressedNonExistenceProof. - * @memberof ics23 - * @classdesc Represents a CompressedNonExistenceProof. - * @implements ICompressedNonExistenceProof - * @constructor - * @param {ics23.ICompressedNonExistenceProof=} [properties] Properties to set - */ - function CompressedNonExistenceProof(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CompressedNonExistenceProof key. - * @member {Uint8Array} key - * @memberof ics23.CompressedNonExistenceProof - * @instance - */ - CompressedNonExistenceProof.prototype.key = $util.newBuffer([]); - - /** - * CompressedNonExistenceProof left. - * @member {ics23.ICompressedExistenceProof|null|undefined} left - * @memberof ics23.CompressedNonExistenceProof - * @instance - */ - CompressedNonExistenceProof.prototype.left = null; - - /** - * CompressedNonExistenceProof right. - * @member {ics23.ICompressedExistenceProof|null|undefined} right - * @memberof ics23.CompressedNonExistenceProof - * @instance - */ - CompressedNonExistenceProof.prototype.right = null; - - /** - * Encodes the specified CompressedNonExistenceProof message. Does not implicitly {@link ics23.CompressedNonExistenceProof.verify|verify} messages. - * @function encode - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {ics23.ICompressedNonExistenceProof} message CompressedNonExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedNonExistenceProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.left != null && Object.hasOwnProperty.call(message, "left")) - $root.ics23.CompressedExistenceProof.encode(message.left, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.right != null && Object.hasOwnProperty.call(message, "right")) - $root.ics23.CompressedExistenceProof.encode(message.right, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CompressedNonExistenceProof message, length delimited. Does not implicitly {@link ics23.CompressedNonExistenceProof.verify|verify} messages. - * @function encodeDelimited - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {ics23.ICompressedNonExistenceProof} message CompressedNonExistenceProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompressedNonExistenceProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompressedNonExistenceProof message from the specified reader or buffer. - * @function decode - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedNonExistenceProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.ics23.CompressedNonExistenceProof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.left = $root.ics23.CompressedExistenceProof.decode(reader, reader.uint32()); - break; - case 3: - message.right = $root.ics23.CompressedExistenceProof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompressedNonExistenceProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompressedNonExistenceProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompressedNonExistenceProof message. - * @function verify - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompressedNonExistenceProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.left != null && message.hasOwnProperty("left")) { - let error = $root.ics23.CompressedExistenceProof.verify(message.left); - if (error) - return "left." + error; - } - if (message.right != null && message.hasOwnProperty("right")) { - let error = $root.ics23.CompressedExistenceProof.verify(message.right); - if (error) - return "right." + error; - } - return null; - }; - - /** - * Creates a CompressedNonExistenceProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {Object.} object Plain object - * @returns {ics23.CompressedNonExistenceProof} CompressedNonExistenceProof - */ - CompressedNonExistenceProof.fromObject = function fromObject(object) { - if (object instanceof $root.ics23.CompressedNonExistenceProof) - return object; - let message = new $root.ics23.CompressedNonExistenceProof(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.left != null) { - if (typeof object.left !== "object") - throw TypeError(".ics23.CompressedNonExistenceProof.left: object expected"); - message.left = $root.ics23.CompressedExistenceProof.fromObject(object.left); - } - if (object.right != null) { - if (typeof object.right !== "object") - throw TypeError(".ics23.CompressedNonExistenceProof.right: object expected"); - message.right = $root.ics23.CompressedExistenceProof.fromObject(object.right); - } - return message; - }; - - /** - * Creates a plain object from a CompressedNonExistenceProof message. Also converts values to other types if specified. - * @function toObject - * @memberof ics23.CompressedNonExistenceProof - * @static - * @param {ics23.CompressedNonExistenceProof} message CompressedNonExistenceProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompressedNonExistenceProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - object.left = null; - object.right = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.left != null && message.hasOwnProperty("left")) - object.left = $root.ics23.CompressedExistenceProof.toObject(message.left, options); - if (message.right != null && message.hasOwnProperty("right")) - object.right = $root.ics23.CompressedExistenceProof.toObject(message.right, options); - return object; - }; - - /** - * Converts this CompressedNonExistenceProof to JSON. - * @function toJSON - * @memberof ics23.CompressedNonExistenceProof - * @instance - * @returns {Object.} JSON object - */ - CompressedNonExistenceProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CompressedNonExistenceProof; - })(); - - return ics23; -})(); - -export const tendermint = $root.tendermint = (() => { - - /** - * Namespace tendermint. - * @exports tendermint - * @namespace - */ - const tendermint = {}; - - tendermint.types = (function() { - - /** - * Namespace types. - * @memberof tendermint - * @namespace - */ - const types = {}; - - types.ValidatorSet = (function() { - - /** - * Properties of a ValidatorSet. - * @memberof tendermint.types - * @interface IValidatorSet - * @property {Array.|null} [validators] ValidatorSet validators - * @property {tendermint.types.IValidator|null} [proposer] ValidatorSet proposer - * @property {Long|null} [total_voting_power] ValidatorSet total_voting_power - */ - - /** - * Constructs a new ValidatorSet. - * @memberof tendermint.types - * @classdesc Represents a ValidatorSet. - * @implements IValidatorSet - * @constructor - * @param {tendermint.types.IValidatorSet=} [properties] Properties to set - */ - function ValidatorSet(properties) { - this.validators = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidatorSet validators. - * @member {Array.} validators - * @memberof tendermint.types.ValidatorSet - * @instance - */ - ValidatorSet.prototype.validators = $util.emptyArray; - - /** - * ValidatorSet proposer. - * @member {tendermint.types.IValidator|null|undefined} proposer - * @memberof tendermint.types.ValidatorSet - * @instance - */ - ValidatorSet.prototype.proposer = null; - - /** - * ValidatorSet total_voting_power. - * @member {Long} total_voting_power - * @memberof tendermint.types.ValidatorSet - * @instance - */ - ValidatorSet.prototype.total_voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified ValidatorSet message. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @function encode - * @memberof tendermint.types.ValidatorSet - * @static - * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.validators != null && message.validators.length) - for (let i = 0; i < message.validators.length; ++i) - $root.tendermint.types.Validator.encode(message.validators[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) - $root.tendermint.types.Validator.encode(message.proposer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.total_voting_power != null && Object.hasOwnProperty.call(message, "total_voting_power")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.total_voting_power); - return writer; - }; - - /** - * Encodes the specified ValidatorSet message, length delimited. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.ValidatorSet - * @static - * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.ValidatorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.ValidatorSet} ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorSet(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.validators && message.validators.length)) - message.validators = []; - message.validators.push($root.tendermint.types.Validator.decode(reader, reader.uint32())); - break; - case 2: - message.proposer = $root.tendermint.types.Validator.decode(reader, reader.uint32()); - break; - case 3: - message.total_voting_power = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.ValidatorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.ValidatorSet} ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidatorSet message. - * @function verify - * @memberof tendermint.types.ValidatorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidatorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.validators != null && message.hasOwnProperty("validators")) { - if (!Array.isArray(message.validators)) - return "validators: array expected"; - for (let i = 0; i < message.validators.length; ++i) { - let error = $root.tendermint.types.Validator.verify(message.validators[i]); - if (error) - return "validators." + error; - } - } - if (message.proposer != null && message.hasOwnProperty("proposer")) { - let error = $root.tendermint.types.Validator.verify(message.proposer); - if (error) - return "proposer." + error; - } - if (message.total_voting_power != null && message.hasOwnProperty("total_voting_power")) - if (!$util.isInteger(message.total_voting_power) && !(message.total_voting_power && $util.isInteger(message.total_voting_power.low) && $util.isInteger(message.total_voting_power.high))) - return "total_voting_power: integer|Long expected"; - return null; - }; - - /** - * Creates a ValidatorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.ValidatorSet - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.ValidatorSet} ValidatorSet - */ - ValidatorSet.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.ValidatorSet) - return object; - let message = new $root.tendermint.types.ValidatorSet(); - if (object.validators) { - if (!Array.isArray(object.validators)) - throw TypeError(".tendermint.types.ValidatorSet.validators: array expected"); - message.validators = []; - for (let i = 0; i < object.validators.length; ++i) { - if (typeof object.validators[i] !== "object") - throw TypeError(".tendermint.types.ValidatorSet.validators: object expected"); - message.validators[i] = $root.tendermint.types.Validator.fromObject(object.validators[i]); - } - } - if (object.proposer != null) { - if (typeof object.proposer !== "object") - throw TypeError(".tendermint.types.ValidatorSet.proposer: object expected"); - message.proposer = $root.tendermint.types.Validator.fromObject(object.proposer); - } - if (object.total_voting_power != null) - if ($util.Long) - (message.total_voting_power = $util.Long.fromValue(object.total_voting_power)).unsigned = false; - else if (typeof object.total_voting_power === "string") - message.total_voting_power = parseInt(object.total_voting_power, 10); - else if (typeof object.total_voting_power === "number") - message.total_voting_power = object.total_voting_power; - else if (typeof object.total_voting_power === "object") - message.total_voting_power = new $util.LongBits(object.total_voting_power.low >>> 0, object.total_voting_power.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ValidatorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.ValidatorSet - * @static - * @param {tendermint.types.ValidatorSet} message ValidatorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidatorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.validators = []; - if (options.defaults) { - object.proposer = null; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.total_voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total_voting_power = options.longs === String ? "0" : 0; - } - if (message.validators && message.validators.length) { - object.validators = []; - for (let j = 0; j < message.validators.length; ++j) - object.validators[j] = $root.tendermint.types.Validator.toObject(message.validators[j], options); - } - if (message.proposer != null && message.hasOwnProperty("proposer")) - object.proposer = $root.tendermint.types.Validator.toObject(message.proposer, options); - if (message.total_voting_power != null && message.hasOwnProperty("total_voting_power")) - if (typeof message.total_voting_power === "number") - object.total_voting_power = options.longs === String ? String(message.total_voting_power) : message.total_voting_power; - else - object.total_voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.total_voting_power) : options.longs === Number ? new $util.LongBits(message.total_voting_power.low >>> 0, message.total_voting_power.high >>> 0).toNumber() : message.total_voting_power; - return object; - }; - - /** - * Converts this ValidatorSet to JSON. - * @function toJSON - * @memberof tendermint.types.ValidatorSet - * @instance - * @returns {Object.} JSON object - */ - ValidatorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValidatorSet; - })(); - - types.Validator = (function() { - - /** - * Properties of a Validator. - * @memberof tendermint.types - * @interface IValidator - * @property {Uint8Array|null} [address] Validator address - * @property {tendermint.crypto.IPublicKey|null} [pub_key] Validator pub_key - * @property {Long|null} [voting_power] Validator voting_power - * @property {Long|null} [proposer_priority] Validator proposer_priority - */ - - /** - * Constructs a new Validator. - * @memberof tendermint.types - * @classdesc Represents a Validator. - * @implements IValidator - * @constructor - * @param {tendermint.types.IValidator=} [properties] Properties to set - */ - function Validator(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Validator address. - * @member {Uint8Array} address - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.address = $util.newBuffer([]); - - /** - * Validator pub_key. - * @member {tendermint.crypto.IPublicKey|null|undefined} pub_key - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.pub_key = null; - - /** - * Validator voting_power. - * @member {Long} voting_power - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Validator proposer_priority. - * @member {Long} proposer_priority - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.proposer_priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified Validator message. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Validator - * @static - * @param {tendermint.types.IValidator} message Validator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Validator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); - if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key")) - $root.tendermint.crypto.PublicKey.encode(message.pub_key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.voting_power != null && Object.hasOwnProperty.call(message, "voting_power")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.voting_power); - if (message.proposer_priority != null && Object.hasOwnProperty.call(message, "proposer_priority")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.proposer_priority); - return writer; - }; - - /** - * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Validator - * @static - * @param {tendermint.types.IValidator} message Validator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Validator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Validator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Validator} Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Validator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Validator(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.bytes(); - break; - case 2: - message.pub_key = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); - break; - case 3: - message.voting_power = reader.int64(); - break; - case 4: - message.proposer_priority = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Validator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Validator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Validator} Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Validator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Validator message. - * @function verify - * @memberof tendermint.types.Validator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Validator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) - return "address: buffer expected"; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) { - let error = $root.tendermint.crypto.PublicKey.verify(message.pub_key); - if (error) - return "pub_key." + error; - } - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (!$util.isInteger(message.voting_power) && !(message.voting_power && $util.isInteger(message.voting_power.low) && $util.isInteger(message.voting_power.high))) - return "voting_power: integer|Long expected"; - if (message.proposer_priority != null && message.hasOwnProperty("proposer_priority")) - if (!$util.isInteger(message.proposer_priority) && !(message.proposer_priority && $util.isInteger(message.proposer_priority.low) && $util.isInteger(message.proposer_priority.high))) - return "proposer_priority: integer|Long expected"; - return null; - }; - - /** - * Creates a Validator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Validator - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Validator} Validator - */ - Validator.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Validator) - return object; - let message = new $root.tendermint.types.Validator(); - if (object.address != null) - if (typeof object.address === "string") - $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); - else if (object.address.length) - message.address = object.address; - if (object.pub_key != null) { - if (typeof object.pub_key !== "object") - throw TypeError(".tendermint.types.Validator.pub_key: object expected"); - message.pub_key = $root.tendermint.crypto.PublicKey.fromObject(object.pub_key); - } - if (object.voting_power != null) - if ($util.Long) - (message.voting_power = $util.Long.fromValue(object.voting_power)).unsigned = false; - else if (typeof object.voting_power === "string") - message.voting_power = parseInt(object.voting_power, 10); - else if (typeof object.voting_power === "number") - message.voting_power = object.voting_power; - else if (typeof object.voting_power === "object") - message.voting_power = new $util.LongBits(object.voting_power.low >>> 0, object.voting_power.high >>> 0).toNumber(); - if (object.proposer_priority != null) - if ($util.Long) - (message.proposer_priority = $util.Long.fromValue(object.proposer_priority)).unsigned = false; - else if (typeof object.proposer_priority === "string") - message.proposer_priority = parseInt(object.proposer_priority, 10); - else if (typeof object.proposer_priority === "number") - message.proposer_priority = object.proposer_priority; - else if (typeof object.proposer_priority === "object") - message.proposer_priority = new $util.LongBits(object.proposer_priority.low >>> 0, object.proposer_priority.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Validator message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Validator - * @static - * @param {tendermint.types.Validator} message Validator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Validator.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.address = ""; - else { - object.address = []; - if (options.bytes !== Array) - object.address = $util.newBuffer(object.address); - } - object.pub_key = null; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.voting_power = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.proposer_priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposer_priority = options.longs === String ? "0" : 0; - } - if (message.address != null && message.hasOwnProperty("address")) - object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) - object.pub_key = $root.tendermint.crypto.PublicKey.toObject(message.pub_key, options); - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (typeof message.voting_power === "number") - object.voting_power = options.longs === String ? String(message.voting_power) : message.voting_power; - else - object.voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.voting_power) : options.longs === Number ? new $util.LongBits(message.voting_power.low >>> 0, message.voting_power.high >>> 0).toNumber() : message.voting_power; - if (message.proposer_priority != null && message.hasOwnProperty("proposer_priority")) - if (typeof message.proposer_priority === "number") - object.proposer_priority = options.longs === String ? String(message.proposer_priority) : message.proposer_priority; - else - object.proposer_priority = options.longs === String ? $util.Long.prototype.toString.call(message.proposer_priority) : options.longs === Number ? new $util.LongBits(message.proposer_priority.low >>> 0, message.proposer_priority.high >>> 0).toNumber() : message.proposer_priority; - return object; - }; - - /** - * Converts this Validator to JSON. - * @function toJSON - * @memberof tendermint.types.Validator - * @instance - * @returns {Object.} JSON object - */ - Validator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Validator; - })(); - - types.SimpleValidator = (function() { - - /** - * Properties of a SimpleValidator. - * @memberof tendermint.types - * @interface ISimpleValidator - * @property {tendermint.crypto.IPublicKey|null} [pub_key] SimpleValidator pub_key - * @property {Long|null} [voting_power] SimpleValidator voting_power - */ - - /** - * Constructs a new SimpleValidator. - * @memberof tendermint.types - * @classdesc Represents a SimpleValidator. - * @implements ISimpleValidator - * @constructor - * @param {tendermint.types.ISimpleValidator=} [properties] Properties to set - */ - function SimpleValidator(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SimpleValidator pub_key. - * @member {tendermint.crypto.IPublicKey|null|undefined} pub_key - * @memberof tendermint.types.SimpleValidator - * @instance - */ - SimpleValidator.prototype.pub_key = null; - - /** - * SimpleValidator voting_power. - * @member {Long} voting_power - * @memberof tendermint.types.SimpleValidator - * @instance - */ - SimpleValidator.prototype.voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified SimpleValidator message. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @function encode - * @memberof tendermint.types.SimpleValidator - * @static - * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleValidator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key")) - $root.tendermint.crypto.PublicKey.encode(message.pub_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.voting_power != null && Object.hasOwnProperty.call(message, "voting_power")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.voting_power); - return writer; - }; - - /** - * Encodes the specified SimpleValidator message, length delimited. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.SimpleValidator - * @static - * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleValidator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.SimpleValidator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.SimpleValidator} SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleValidator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SimpleValidator(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pub_key = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); - break; - case 2: - message.voting_power = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.SimpleValidator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.SimpleValidator} SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleValidator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SimpleValidator message. - * @function verify - * @memberof tendermint.types.SimpleValidator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimpleValidator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) { - let error = $root.tendermint.crypto.PublicKey.verify(message.pub_key); - if (error) - return "pub_key." + error; - } - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (!$util.isInteger(message.voting_power) && !(message.voting_power && $util.isInteger(message.voting_power.low) && $util.isInteger(message.voting_power.high))) - return "voting_power: integer|Long expected"; - return null; - }; - - /** - * Creates a SimpleValidator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.SimpleValidator - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.SimpleValidator} SimpleValidator - */ - SimpleValidator.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.SimpleValidator) - return object; - let message = new $root.tendermint.types.SimpleValidator(); - if (object.pub_key != null) { - if (typeof object.pub_key !== "object") - throw TypeError(".tendermint.types.SimpleValidator.pub_key: object expected"); - message.pub_key = $root.tendermint.crypto.PublicKey.fromObject(object.pub_key); - } - if (object.voting_power != null) - if ($util.Long) - (message.voting_power = $util.Long.fromValue(object.voting_power)).unsigned = false; - else if (typeof object.voting_power === "string") - message.voting_power = parseInt(object.voting_power, 10); - else if (typeof object.voting_power === "number") - message.voting_power = object.voting_power; - else if (typeof object.voting_power === "object") - message.voting_power = new $util.LongBits(object.voting_power.low >>> 0, object.voting_power.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a SimpleValidator message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.SimpleValidator - * @static - * @param {tendermint.types.SimpleValidator} message SimpleValidator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimpleValidator.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.pub_key = null; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.voting_power = options.longs === String ? "0" : 0; - } - if (message.pub_key != null && message.hasOwnProperty("pub_key")) - object.pub_key = $root.tendermint.crypto.PublicKey.toObject(message.pub_key, options); - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (typeof message.voting_power === "number") - object.voting_power = options.longs === String ? String(message.voting_power) : message.voting_power; - else - object.voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.voting_power) : options.longs === Number ? new $util.LongBits(message.voting_power.low >>> 0, message.voting_power.high >>> 0).toNumber() : message.voting_power; - return object; - }; - - /** - * Converts this SimpleValidator to JSON. - * @function toJSON - * @memberof tendermint.types.SimpleValidator - * @instance - * @returns {Object.} JSON object - */ - SimpleValidator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SimpleValidator; - })(); - - /** - * BlockIDFlag enum. - * @name tendermint.types.BlockIDFlag - * @enum {number} - * @property {number} BLOCK_ID_FLAG_UNKNOWN=0 BLOCK_ID_FLAG_UNKNOWN value - * @property {number} BLOCK_ID_FLAG_ABSENT=1 BLOCK_ID_FLAG_ABSENT value - * @property {number} BLOCK_ID_FLAG_COMMIT=2 BLOCK_ID_FLAG_COMMIT value - * @property {number} BLOCK_ID_FLAG_NIL=3 BLOCK_ID_FLAG_NIL value - */ - types.BlockIDFlag = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BLOCK_ID_FLAG_UNKNOWN"] = 0; - values[valuesById[1] = "BLOCK_ID_FLAG_ABSENT"] = 1; - values[valuesById[2] = "BLOCK_ID_FLAG_COMMIT"] = 2; - values[valuesById[3] = "BLOCK_ID_FLAG_NIL"] = 3; - return values; - })(); - - /** - * SignedMsgType enum. - * @name tendermint.types.SignedMsgType - * @enum {number} - * @property {number} SIGNED_MSG_TYPE_UNKNOWN=0 SIGNED_MSG_TYPE_UNKNOWN value - * @property {number} SIGNED_MSG_TYPE_PREVOTE=1 SIGNED_MSG_TYPE_PREVOTE value - * @property {number} SIGNED_MSG_TYPE_PRECOMMIT=2 SIGNED_MSG_TYPE_PRECOMMIT value - * @property {number} SIGNED_MSG_TYPE_PROPOSAL=32 SIGNED_MSG_TYPE_PROPOSAL value - */ - types.SignedMsgType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SIGNED_MSG_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "SIGNED_MSG_TYPE_PREVOTE"] = 1; - values[valuesById[2] = "SIGNED_MSG_TYPE_PRECOMMIT"] = 2; - values[valuesById[32] = "SIGNED_MSG_TYPE_PROPOSAL"] = 32; - return values; - })(); - - types.PartSetHeader = (function() { - - /** - * Properties of a PartSetHeader. - * @memberof tendermint.types - * @interface IPartSetHeader - * @property {number|null} [total] PartSetHeader total - * @property {Uint8Array|null} [hash] PartSetHeader hash - */ - - /** - * Constructs a new PartSetHeader. - * @memberof tendermint.types - * @classdesc Represents a PartSetHeader. - * @implements IPartSetHeader - * @constructor - * @param {tendermint.types.IPartSetHeader=} [properties] Properties to set - */ - function PartSetHeader(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartSetHeader total. - * @member {number} total - * @memberof tendermint.types.PartSetHeader - * @instance - */ - PartSetHeader.prototype.total = 0; - - /** - * PartSetHeader hash. - * @member {Uint8Array} hash - * @memberof tendermint.types.PartSetHeader - * @instance - */ - PartSetHeader.prototype.hash = $util.newBuffer([]); - - /** - * Encodes the specified PartSetHeader message. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @function encode - * @memberof tendermint.types.PartSetHeader - * @static - * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartSetHeader.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.total != null && Object.hasOwnProperty.call(message, "total")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.total); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hash); - return writer; - }; - - /** - * Encodes the specified PartSetHeader message, length delimited. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.PartSetHeader - * @static - * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartSetHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.PartSetHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.PartSetHeader} PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartSetHeader.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.PartSetHeader(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = reader.uint32(); - break; - case 2: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.PartSetHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.PartSetHeader} PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartSetHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartSetHeader message. - * @function verify - * @memberof tendermint.types.PartSetHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartSetHeader.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.total != null && message.hasOwnProperty("total")) - if (!$util.isInteger(message.total)) - return "total: integer expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - return null; - }; - - /** - * Creates a PartSetHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.PartSetHeader - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.PartSetHeader} PartSetHeader - */ - PartSetHeader.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.PartSetHeader) - return object; - let message = new $root.tendermint.types.PartSetHeader(); - if (object.total != null) - message.total = object.total >>> 0; - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - return message; - }; - - /** - * Creates a plain object from a PartSetHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.PartSetHeader - * @static - * @param {tendermint.types.PartSetHeader} message PartSetHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartSetHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.total = 0; - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - } - if (message.total != null && message.hasOwnProperty("total")) - object.total = message.total; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - return object; - }; - - /** - * Converts this PartSetHeader to JSON. - * @function toJSON - * @memberof tendermint.types.PartSetHeader - * @instance - * @returns {Object.} JSON object - */ - PartSetHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PartSetHeader; - })(); - - types.Part = (function() { - - /** - * Properties of a Part. - * @memberof tendermint.types - * @interface IPart - * @property {number|null} [index] Part index - * @property {Uint8Array|null} [bytes] Part bytes - * @property {tendermint.crypto.IProof|null} [proof] Part proof - */ - - /** - * Constructs a new Part. - * @memberof tendermint.types - * @classdesc Represents a Part. - * @implements IPart - * @constructor - * @param {tendermint.types.IPart=} [properties] Properties to set - */ - function Part(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Part index. - * @member {number} index - * @memberof tendermint.types.Part - * @instance - */ - Part.prototype.index = 0; - - /** - * Part bytes. - * @member {Uint8Array} bytes - * @memberof tendermint.types.Part - * @instance - */ - Part.prototype.bytes = $util.newBuffer([]); - - /** - * Part proof. - * @member {tendermint.crypto.IProof|null|undefined} proof - * @memberof tendermint.types.Part - * @instance - */ - Part.prototype.proof = null; - - /** - * Encodes the specified Part message. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Part - * @static - * @param {tendermint.types.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); - if (message.bytes != null && Object.hasOwnProperty.call(message, "bytes")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bytes); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Part - * @static - * @param {tendermint.types.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Part message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Part(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.bytes = reader.bytes(); - break; - case 3: - message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Part message. - * @function verify - * @memberof tendermint.types.Part - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Part.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.bytes != null && message.hasOwnProperty("bytes")) - if (!(message.bytes && typeof message.bytes.length === "number" || $util.isString(message.bytes))) - return "bytes: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - let error = $root.tendermint.crypto.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - return null; - }; - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Part - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Part} Part - */ - Part.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Part) - return object; - let message = new $root.tendermint.types.Part(); - if (object.index != null) - message.index = object.index >>> 0; - if (object.bytes != null) - if (typeof object.bytes === "string") - $util.base64.decode(object.bytes, message.bytes = $util.newBuffer($util.base64.length(object.bytes)), 0); - else if (object.bytes.length) - message.bytes = object.bytes; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".tendermint.types.Part.proof: object expected"); - message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); - } - return message; - }; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Part - * @static - * @param {tendermint.types.Part} message Part - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Part.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.index = 0; - if (options.bytes === String) - object.bytes = ""; - else { - object.bytes = []; - if (options.bytes !== Array) - object.bytes = $util.newBuffer(object.bytes); - } - object.proof = null; - } - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.bytes != null && message.hasOwnProperty("bytes")) - object.bytes = options.bytes === String ? $util.base64.encode(message.bytes, 0, message.bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytes) : message.bytes; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); - return object; - }; - - /** - * Converts this Part to JSON. - * @function toJSON - * @memberof tendermint.types.Part - * @instance - * @returns {Object.} JSON object - */ - Part.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Part; - })(); - - types.BlockID = (function() { - - /** - * Properties of a BlockID. - * @memberof tendermint.types - * @interface IBlockID - * @property {Uint8Array|null} [hash] BlockID hash - * @property {tendermint.types.IPartSetHeader|null} [part_set_header] BlockID part_set_header - */ - - /** - * Constructs a new BlockID. - * @memberof tendermint.types - * @classdesc Represents a BlockID. - * @implements IBlockID - * @constructor - * @param {tendermint.types.IBlockID=} [properties] Properties to set - */ - function BlockID(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockID hash. - * @member {Uint8Array} hash - * @memberof tendermint.types.BlockID - * @instance - */ - BlockID.prototype.hash = $util.newBuffer([]); - - /** - * BlockID part_set_header. - * @member {tendermint.types.IPartSetHeader|null|undefined} part_set_header - * @memberof tendermint.types.BlockID - * @instance - */ - BlockID.prototype.part_set_header = null; - - /** - * Encodes the specified BlockID message. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @function encode - * @memberof tendermint.types.BlockID - * @static - * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockID.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); - if (message.part_set_header != null && Object.hasOwnProperty.call(message, "part_set_header")) - $root.tendermint.types.PartSetHeader.encode(message.part_set_header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BlockID message, length delimited. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.BlockID - * @static - * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockID.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockID message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.BlockID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.BlockID} BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockID.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockID(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - case 2: - message.part_set_header = $root.tendermint.types.PartSetHeader.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockID message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.BlockID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.BlockID} BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockID.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockID message. - * @function verify - * @memberof tendermint.types.BlockID - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockID.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - if (message.part_set_header != null && message.hasOwnProperty("part_set_header")) { - let error = $root.tendermint.types.PartSetHeader.verify(message.part_set_header); - if (error) - return "part_set_header." + error; - } - return null; - }; - - /** - * Creates a BlockID message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.BlockID - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.BlockID} BlockID - */ - BlockID.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.BlockID) - return object; - let message = new $root.tendermint.types.BlockID(); - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - if (object.part_set_header != null) { - if (typeof object.part_set_header !== "object") - throw TypeError(".tendermint.types.BlockID.part_set_header: object expected"); - message.part_set_header = $root.tendermint.types.PartSetHeader.fromObject(object.part_set_header); - } - return message; - }; - - /** - * Creates a plain object from a BlockID message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.BlockID - * @static - * @param {tendermint.types.BlockID} message BlockID - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockID.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - object.part_set_header = null; - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - if (message.part_set_header != null && message.hasOwnProperty("part_set_header")) - object.part_set_header = $root.tendermint.types.PartSetHeader.toObject(message.part_set_header, options); - return object; - }; - - /** - * Converts this BlockID to JSON. - * @function toJSON - * @memberof tendermint.types.BlockID - * @instance - * @returns {Object.} JSON object - */ - BlockID.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockID; - })(); - - types.Header = (function() { - - /** - * Properties of a Header. - * @memberof tendermint.types - * @interface IHeader - * @property {tendermint.version.IConsensus|null} [version] Header version - * @property {string|null} [chain_id] Header chain_id - * @property {Long|null} [height] Header height - * @property {google.protobuf.ITimestamp|null} [time] Header time - * @property {tendermint.types.IBlockID|null} [last_block_id] Header last_block_id - * @property {Uint8Array|null} [last_commit_hash] Header last_commit_hash - * @property {Uint8Array|null} [data_hash] Header data_hash - * @property {Uint8Array|null} [validators_hash] Header validators_hash - * @property {Uint8Array|null} [next_validators_hash] Header next_validators_hash - * @property {Uint8Array|null} [consensus_hash] Header consensus_hash - * @property {Uint8Array|null} [app_hash] Header app_hash - * @property {Uint8Array|null} [last_results_hash] Header last_results_hash - * @property {Uint8Array|null} [evidence_hash] Header evidence_hash - * @property {Uint8Array|null} [proposer_address] Header proposer_address - */ - - /** - * Constructs a new Header. - * @memberof tendermint.types - * @classdesc Represents a Header. - * @implements IHeader - * @constructor - * @param {tendermint.types.IHeader=} [properties] Properties to set - */ - function Header(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Header version. - * @member {tendermint.version.IConsensus|null|undefined} version - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.version = null; - - /** - * Header chain_id. - * @member {string} chain_id - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.chain_id = ""; - - /** - * Header height. - * @member {Long} height - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Header time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.time = null; - - /** - * Header last_block_id. - * @member {tendermint.types.IBlockID|null|undefined} last_block_id - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.last_block_id = null; - - /** - * Header last_commit_hash. - * @member {Uint8Array} last_commit_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.last_commit_hash = $util.newBuffer([]); - - /** - * Header data_hash. - * @member {Uint8Array} data_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.data_hash = $util.newBuffer([]); - - /** - * Header validators_hash. - * @member {Uint8Array} validators_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.validators_hash = $util.newBuffer([]); - - /** - * Header next_validators_hash. - * @member {Uint8Array} next_validators_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.next_validators_hash = $util.newBuffer([]); - - /** - * Header consensus_hash. - * @member {Uint8Array} consensus_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.consensus_hash = $util.newBuffer([]); - - /** - * Header app_hash. - * @member {Uint8Array} app_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.app_hash = $util.newBuffer([]); - - /** - * Header last_results_hash. - * @member {Uint8Array} last_results_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.last_results_hash = $util.newBuffer([]); - - /** - * Header evidence_hash. - * @member {Uint8Array} evidence_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.evidence_hash = $util.newBuffer([]); - - /** - * Header proposer_address. - * @member {Uint8Array} proposer_address - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.proposer_address = $util.newBuffer([]); - - /** - * Encodes the specified Header message. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Header - * @static - * @param {tendermint.types.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.tendermint.version.Consensus.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.chain_id != null && Object.hasOwnProperty.call(message, "chain_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain_id); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.last_block_id != null && Object.hasOwnProperty.call(message, "last_block_id")) - $root.tendermint.types.BlockID.encode(message.last_block_id, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.last_commit_hash != null && Object.hasOwnProperty.call(message, "last_commit_hash")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.last_commit_hash); - if (message.data_hash != null && Object.hasOwnProperty.call(message, "data_hash")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.data_hash); - if (message.validators_hash != null && Object.hasOwnProperty.call(message, "validators_hash")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.validators_hash); - if (message.next_validators_hash != null && Object.hasOwnProperty.call(message, "next_validators_hash")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.next_validators_hash); - if (message.consensus_hash != null && Object.hasOwnProperty.call(message, "consensus_hash")) - writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.consensus_hash); - if (message.app_hash != null && Object.hasOwnProperty.call(message, "app_hash")) - writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.app_hash); - if (message.last_results_hash != null && Object.hasOwnProperty.call(message, "last_results_hash")) - writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.last_results_hash); - if (message.evidence_hash != null && Object.hasOwnProperty.call(message, "evidence_hash")) - writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.evidence_hash); - if (message.proposer_address != null && Object.hasOwnProperty.call(message, "proposer_address")) - writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.proposer_address); - return writer; - }; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Header - * @static - * @param {tendermint.types.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Header message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Header(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = $root.tendermint.version.Consensus.decode(reader, reader.uint32()); - break; - case 2: - message.chain_id = reader.string(); - break; - case 3: - message.height = reader.int64(); - break; - case 4: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.last_block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.last_commit_hash = reader.bytes(); - break; - case 7: - message.data_hash = reader.bytes(); - break; - case 8: - message.validators_hash = reader.bytes(); - break; - case 9: - message.next_validators_hash = reader.bytes(); - break; - case 10: - message.consensus_hash = reader.bytes(); - break; - case 11: - message.app_hash = reader.bytes(); - break; - case 12: - message.last_results_hash = reader.bytes(); - break; - case 13: - message.evidence_hash = reader.bytes(); - break; - case 14: - message.proposer_address = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Header message. - * @function verify - * @memberof tendermint.types.Header - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Header.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - let error = $root.tendermint.version.Consensus.verify(message.version); - if (error) - return "version." + error; - } - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - if (!$util.isString(message.chain_id)) - return "chain_id: string expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.time != null && message.hasOwnProperty("time")) { - let error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - if (message.last_block_id != null && message.hasOwnProperty("last_block_id")) { - let error = $root.tendermint.types.BlockID.verify(message.last_block_id); - if (error) - return "last_block_id." + error; - } - if (message.last_commit_hash != null && message.hasOwnProperty("last_commit_hash")) - if (!(message.last_commit_hash && typeof message.last_commit_hash.length === "number" || $util.isString(message.last_commit_hash))) - return "last_commit_hash: buffer expected"; - if (message.data_hash != null && message.hasOwnProperty("data_hash")) - if (!(message.data_hash && typeof message.data_hash.length === "number" || $util.isString(message.data_hash))) - return "data_hash: buffer expected"; - if (message.validators_hash != null && message.hasOwnProperty("validators_hash")) - if (!(message.validators_hash && typeof message.validators_hash.length === "number" || $util.isString(message.validators_hash))) - return "validators_hash: buffer expected"; - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - if (!(message.next_validators_hash && typeof message.next_validators_hash.length === "number" || $util.isString(message.next_validators_hash))) - return "next_validators_hash: buffer expected"; - if (message.consensus_hash != null && message.hasOwnProperty("consensus_hash")) - if (!(message.consensus_hash && typeof message.consensus_hash.length === "number" || $util.isString(message.consensus_hash))) - return "consensus_hash: buffer expected"; - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - if (!(message.app_hash && typeof message.app_hash.length === "number" || $util.isString(message.app_hash))) - return "app_hash: buffer expected"; - if (message.last_results_hash != null && message.hasOwnProperty("last_results_hash")) - if (!(message.last_results_hash && typeof message.last_results_hash.length === "number" || $util.isString(message.last_results_hash))) - return "last_results_hash: buffer expected"; - if (message.evidence_hash != null && message.hasOwnProperty("evidence_hash")) - if (!(message.evidence_hash && typeof message.evidence_hash.length === "number" || $util.isString(message.evidence_hash))) - return "evidence_hash: buffer expected"; - if (message.proposer_address != null && message.hasOwnProperty("proposer_address")) - if (!(message.proposer_address && typeof message.proposer_address.length === "number" || $util.isString(message.proposer_address))) - return "proposer_address: buffer expected"; - return null; - }; - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Header - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Header} Header - */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Header) - return object; - let message = new $root.tendermint.types.Header(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".tendermint.types.Header.version: object expected"); - message.version = $root.tendermint.version.Consensus.fromObject(object.version); - } - if (object.chain_id != null) - message.chain_id = String(object.chain_id); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".tendermint.types.Header.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.last_block_id != null) { - if (typeof object.last_block_id !== "object") - throw TypeError(".tendermint.types.Header.last_block_id: object expected"); - message.last_block_id = $root.tendermint.types.BlockID.fromObject(object.last_block_id); - } - if (object.last_commit_hash != null) - if (typeof object.last_commit_hash === "string") - $util.base64.decode(object.last_commit_hash, message.last_commit_hash = $util.newBuffer($util.base64.length(object.last_commit_hash)), 0); - else if (object.last_commit_hash.length) - message.last_commit_hash = object.last_commit_hash; - if (object.data_hash != null) - if (typeof object.data_hash === "string") - $util.base64.decode(object.data_hash, message.data_hash = $util.newBuffer($util.base64.length(object.data_hash)), 0); - else if (object.data_hash.length) - message.data_hash = object.data_hash; - if (object.validators_hash != null) - if (typeof object.validators_hash === "string") - $util.base64.decode(object.validators_hash, message.validators_hash = $util.newBuffer($util.base64.length(object.validators_hash)), 0); - else if (object.validators_hash.length) - message.validators_hash = object.validators_hash; - if (object.next_validators_hash != null) - if (typeof object.next_validators_hash === "string") - $util.base64.decode(object.next_validators_hash, message.next_validators_hash = $util.newBuffer($util.base64.length(object.next_validators_hash)), 0); - else if (object.next_validators_hash.length) - message.next_validators_hash = object.next_validators_hash; - if (object.consensus_hash != null) - if (typeof object.consensus_hash === "string") - $util.base64.decode(object.consensus_hash, message.consensus_hash = $util.newBuffer($util.base64.length(object.consensus_hash)), 0); - else if (object.consensus_hash.length) - message.consensus_hash = object.consensus_hash; - if (object.app_hash != null) - if (typeof object.app_hash === "string") - $util.base64.decode(object.app_hash, message.app_hash = $util.newBuffer($util.base64.length(object.app_hash)), 0); - else if (object.app_hash.length) - message.app_hash = object.app_hash; - if (object.last_results_hash != null) - if (typeof object.last_results_hash === "string") - $util.base64.decode(object.last_results_hash, message.last_results_hash = $util.newBuffer($util.base64.length(object.last_results_hash)), 0); - else if (object.last_results_hash.length) - message.last_results_hash = object.last_results_hash; - if (object.evidence_hash != null) - if (typeof object.evidence_hash === "string") - $util.base64.decode(object.evidence_hash, message.evidence_hash = $util.newBuffer($util.base64.length(object.evidence_hash)), 0); - else if (object.evidence_hash.length) - message.evidence_hash = object.evidence_hash; - if (object.proposer_address != null) - if (typeof object.proposer_address === "string") - $util.base64.decode(object.proposer_address, message.proposer_address = $util.newBuffer($util.base64.length(object.proposer_address)), 0); - else if (object.proposer_address.length) - message.proposer_address = object.proposer_address; - return message; - }; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Header - * @static - * @param {tendermint.types.Header} message Header - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Header.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.version = null; - object.chain_id = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.time = null; - object.last_block_id = null; - if (options.bytes === String) - object.last_commit_hash = ""; - else { - object.last_commit_hash = []; - if (options.bytes !== Array) - object.last_commit_hash = $util.newBuffer(object.last_commit_hash); - } - if (options.bytes === String) - object.data_hash = ""; - else { - object.data_hash = []; - if (options.bytes !== Array) - object.data_hash = $util.newBuffer(object.data_hash); - } - if (options.bytes === String) - object.validators_hash = ""; - else { - object.validators_hash = []; - if (options.bytes !== Array) - object.validators_hash = $util.newBuffer(object.validators_hash); - } - if (options.bytes === String) - object.next_validators_hash = ""; - else { - object.next_validators_hash = []; - if (options.bytes !== Array) - object.next_validators_hash = $util.newBuffer(object.next_validators_hash); - } - if (options.bytes === String) - object.consensus_hash = ""; - else { - object.consensus_hash = []; - if (options.bytes !== Array) - object.consensus_hash = $util.newBuffer(object.consensus_hash); - } - if (options.bytes === String) - object.app_hash = ""; - else { - object.app_hash = []; - if (options.bytes !== Array) - object.app_hash = $util.newBuffer(object.app_hash); - } - if (options.bytes === String) - object.last_results_hash = ""; - else { - object.last_results_hash = []; - if (options.bytes !== Array) - object.last_results_hash = $util.newBuffer(object.last_results_hash); - } - if (options.bytes === String) - object.evidence_hash = ""; - else { - object.evidence_hash = []; - if (options.bytes !== Array) - object.evidence_hash = $util.newBuffer(object.evidence_hash); - } - if (options.bytes === String) - object.proposer_address = ""; - else { - object.proposer_address = []; - if (options.bytes !== Array) - object.proposer_address = $util.newBuffer(object.proposer_address); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.tendermint.version.Consensus.toObject(message.version, options); - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - object.chain_id = message.chain_id; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (message.last_block_id != null && message.hasOwnProperty("last_block_id")) - object.last_block_id = $root.tendermint.types.BlockID.toObject(message.last_block_id, options); - if (message.last_commit_hash != null && message.hasOwnProperty("last_commit_hash")) - object.last_commit_hash = options.bytes === String ? $util.base64.encode(message.last_commit_hash, 0, message.last_commit_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_commit_hash) : message.last_commit_hash; - if (message.data_hash != null && message.hasOwnProperty("data_hash")) - object.data_hash = options.bytes === String ? $util.base64.encode(message.data_hash, 0, message.data_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.data_hash) : message.data_hash; - if (message.validators_hash != null && message.hasOwnProperty("validators_hash")) - object.validators_hash = options.bytes === String ? $util.base64.encode(message.validators_hash, 0, message.validators_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.validators_hash) : message.validators_hash; - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - object.next_validators_hash = options.bytes === String ? $util.base64.encode(message.next_validators_hash, 0, message.next_validators_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.next_validators_hash) : message.next_validators_hash; - if (message.consensus_hash != null && message.hasOwnProperty("consensus_hash")) - object.consensus_hash = options.bytes === String ? $util.base64.encode(message.consensus_hash, 0, message.consensus_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.consensus_hash) : message.consensus_hash; - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - object.app_hash = options.bytes === String ? $util.base64.encode(message.app_hash, 0, message.app_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.app_hash) : message.app_hash; - if (message.last_results_hash != null && message.hasOwnProperty("last_results_hash")) - object.last_results_hash = options.bytes === String ? $util.base64.encode(message.last_results_hash, 0, message.last_results_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_results_hash) : message.last_results_hash; - if (message.evidence_hash != null && message.hasOwnProperty("evidence_hash")) - object.evidence_hash = options.bytes === String ? $util.base64.encode(message.evidence_hash, 0, message.evidence_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.evidence_hash) : message.evidence_hash; - if (message.proposer_address != null && message.hasOwnProperty("proposer_address")) - object.proposer_address = options.bytes === String ? $util.base64.encode(message.proposer_address, 0, message.proposer_address.length) : options.bytes === Array ? Array.prototype.slice.call(message.proposer_address) : message.proposer_address; - return object; - }; - - /** - * Converts this Header to JSON. - * @function toJSON - * @memberof tendermint.types.Header - * @instance - * @returns {Object.} JSON object - */ - Header.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Header; - })(); - - types.Data = (function() { - - /** - * Properties of a Data. - * @memberof tendermint.types - * @interface IData - * @property {Array.|null} [txs] Data txs - */ - - /** - * Constructs a new Data. - * @memberof tendermint.types - * @classdesc Represents a Data. - * @implements IData - * @constructor - * @param {tendermint.types.IData=} [properties] Properties to set - */ - function Data(properties) { - this.txs = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Data txs. - * @member {Array.} txs - * @memberof tendermint.types.Data - * @instance - */ - Data.prototype.txs = $util.emptyArray; - - /** - * Encodes the specified Data message. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Data - * @static - * @param {tendermint.types.IData} message Data message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Data.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.txs != null && message.txs.length) - for (let i = 0; i < message.txs.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txs[i]); - return writer; - }; - - /** - * Encodes the specified Data message, length delimited. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Data - * @static - * @param {tendermint.types.IData} message Data message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Data.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Data message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Data - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Data} Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Data.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Data(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.txs && message.txs.length)) - message.txs = []; - message.txs.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Data message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Data - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Data} Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Data.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Data message. - * @function verify - * @memberof tendermint.types.Data - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Data.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.txs != null && message.hasOwnProperty("txs")) { - if (!Array.isArray(message.txs)) - return "txs: array expected"; - for (let i = 0; i < message.txs.length; ++i) - if (!(message.txs[i] && typeof message.txs[i].length === "number" || $util.isString(message.txs[i]))) - return "txs: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Data message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Data - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Data} Data - */ - Data.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Data) - return object; - let message = new $root.tendermint.types.Data(); - if (object.txs) { - if (!Array.isArray(object.txs)) - throw TypeError(".tendermint.types.Data.txs: array expected"); - message.txs = []; - for (let i = 0; i < object.txs.length; ++i) - if (typeof object.txs[i] === "string") - $util.base64.decode(object.txs[i], message.txs[i] = $util.newBuffer($util.base64.length(object.txs[i])), 0); - else if (object.txs[i].length) - message.txs[i] = object.txs[i]; - } - return message; - }; - - /** - * Creates a plain object from a Data message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Data - * @static - * @param {tendermint.types.Data} message Data - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Data.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.txs = []; - if (message.txs && message.txs.length) { - object.txs = []; - for (let j = 0; j < message.txs.length; ++j) - object.txs[j] = options.bytes === String ? $util.base64.encode(message.txs[j], 0, message.txs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.txs[j]) : message.txs[j]; - } - return object; - }; - - /** - * Converts this Data to JSON. - * @function toJSON - * @memberof tendermint.types.Data - * @instance - * @returns {Object.} JSON object - */ - Data.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Data; - })(); - - types.Vote = (function() { - - /** - * Properties of a Vote. - * @memberof tendermint.types - * @interface IVote - * @property {tendermint.types.SignedMsgType|null} [type] Vote type - * @property {Long|null} [height] Vote height - * @property {number|null} [round] Vote round - * @property {tendermint.types.IBlockID|null} [block_id] Vote block_id - * @property {google.protobuf.ITimestamp|null} [timestamp] Vote timestamp - * @property {Uint8Array|null} [validator_address] Vote validator_address - * @property {number|null} [validator_index] Vote validator_index - * @property {Uint8Array|null} [signature] Vote signature - */ - - /** - * Constructs a new Vote. - * @memberof tendermint.types - * @classdesc Represents a Vote. - * @implements IVote - * @constructor - * @param {tendermint.types.IVote=} [properties] Properties to set - */ - function Vote(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Vote type. - * @member {tendermint.types.SignedMsgType} type - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.type = 0; - - /** - * Vote height. - * @member {Long} height - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Vote round. - * @member {number} round - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.round = 0; - - /** - * Vote block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.block_id = null; - - /** - * Vote timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.timestamp = null; - - /** - * Vote validator_address. - * @member {Uint8Array} validator_address - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.validator_address = $util.newBuffer([]); - - /** - * Vote validator_index. - * @member {number} validator_index - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.validator_index = 0; - - /** - * Vote signature. - * @member {Uint8Array} signature - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.signature = $util.newBuffer([]); - - /** - * Encodes the specified Vote message. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Vote - * @static - * @param {tendermint.types.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.validator_address != null && Object.hasOwnProperty.call(message, "validator_address")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.validator_address); - if (message.validator_index != null && Object.hasOwnProperty.call(message, "validator_index")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.validator_index); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.signature); - return writer; - }; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Vote - * @static - * @param {tendermint.types.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Vote(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.height = reader.int64(); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 5: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.validator_address = reader.bytes(); - break; - case 7: - message.validator_index = reader.int32(); - break; - case 8: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vote message. - * @function verify - * @memberof tendermint.types.Vote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 32: - break; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - let error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - let error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - if (!(message.validator_address && typeof message.validator_address.length === "number" || $util.isString(message.validator_address))) - return "validator_address: buffer expected"; - if (message.validator_index != null && message.hasOwnProperty("validator_index")) - if (!$util.isInteger(message.validator_index)) - return "validator_index: integer expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Vote - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Vote} Vote - */ - Vote.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Vote) - return object; - let message = new $root.tendermint.types.Vote(); - switch (object.type) { - case "SIGNED_MSG_TYPE_UNKNOWN": - case 0: - message.type = 0; - break; - case "SIGNED_MSG_TYPE_PREVOTE": - case 1: - message.type = 1; - break; - case "SIGNED_MSG_TYPE_PRECOMMIT": - case 2: - message.type = 2; - break; - case "SIGNED_MSG_TYPE_PROPOSAL": - case 32: - message.type = 32; - break; - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.round != null) - message.round = object.round | 0; - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.Vote.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".tendermint.types.Vote.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.validator_address != null) - if (typeof object.validator_address === "string") - $util.base64.decode(object.validator_address, message.validator_address = $util.newBuffer($util.base64.length(object.validator_address)), 0); - else if (object.validator_address.length) - message.validator_address = object.validator_address; - if (object.validator_index != null) - message.validator_index = object.validator_index | 0; - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Vote - * @static - * @param {tendermint.types.Vote} message Vote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vote.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.round = 0; - object.block_id = null; - object.timestamp = null; - if (options.bytes === String) - object.validator_address = ""; - else { - object.validator_address = []; - if (options.bytes !== Array) - object.validator_address = $util.newBuffer(object.validator_address); - } - object.validator_index = 0; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - object.validator_address = options.bytes === String ? $util.base64.encode(message.validator_address, 0, message.validator_address.length) : options.bytes === Array ? Array.prototype.slice.call(message.validator_address) : message.validator_address; - if (message.validator_index != null && message.hasOwnProperty("validator_index")) - object.validator_index = message.validator_index; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; - - /** - * Converts this Vote to JSON. - * @function toJSON - * @memberof tendermint.types.Vote - * @instance - * @returns {Object.} JSON object - */ - Vote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Vote; - })(); - - types.Commit = (function() { - - /** - * Properties of a Commit. - * @memberof tendermint.types - * @interface ICommit - * @property {Long|null} [height] Commit height - * @property {number|null} [round] Commit round - * @property {tendermint.types.IBlockID|null} [block_id] Commit block_id - * @property {Array.|null} [signatures] Commit signatures - */ - - /** - * Constructs a new Commit. - * @memberof tendermint.types - * @classdesc Represents a Commit. - * @implements ICommit - * @constructor - * @param {tendermint.types.ICommit=} [properties] Properties to set - */ - function Commit(properties) { - this.signatures = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Commit height. - * @member {Long} height - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Commit round. - * @member {number} round - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.round = 0; - - /** - * Commit block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.block_id = null; - - /** - * Commit signatures. - * @member {Array.} signatures - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.signatures = $util.emptyArray; - - /** - * Encodes the specified Commit message. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Commit - * @static - * @param {tendermint.types.ICommit} message Commit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Commit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.round); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signatures != null && message.signatures.length) - for (let i = 0; i < message.signatures.length; ++i) - $root.tendermint.types.CommitSig.encode(message.signatures[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Commit message, length delimited. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Commit - * @static - * @param {tendermint.types.ICommit} message Commit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Commit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Commit message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Commit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Commit} Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Commit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Commit(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.int64(); - break; - case 2: - message.round = reader.int32(); - break; - case 3: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.signatures && message.signatures.length)) - message.signatures = []; - message.signatures.push($root.tendermint.types.CommitSig.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Commit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Commit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Commit} Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Commit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Commit message. - * @function verify - * @memberof tendermint.types.Commit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Commit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - let error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.signatures != null && message.hasOwnProperty("signatures")) { - if (!Array.isArray(message.signatures)) - return "signatures: array expected"; - for (let i = 0; i < message.signatures.length; ++i) { - let error = $root.tendermint.types.CommitSig.verify(message.signatures[i]); - if (error) - return "signatures." + error; - } - } - return null; - }; - - /** - * Creates a Commit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Commit - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Commit} Commit - */ - Commit.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Commit) - return object; - let message = new $root.tendermint.types.Commit(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.round != null) - message.round = object.round | 0; - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.Commit.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.signatures) { - if (!Array.isArray(object.signatures)) - throw TypeError(".tendermint.types.Commit.signatures: array expected"); - message.signatures = []; - for (let i = 0; i < object.signatures.length; ++i) { - if (typeof object.signatures[i] !== "object") - throw TypeError(".tendermint.types.Commit.signatures: object expected"); - message.signatures[i] = $root.tendermint.types.CommitSig.fromObject(object.signatures[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Commit message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Commit - * @static - * @param {tendermint.types.Commit} message Commit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Commit.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.signatures = []; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.round = 0; - object.block_id = null; - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.signatures && message.signatures.length) { - object.signatures = []; - for (let j = 0; j < message.signatures.length; ++j) - object.signatures[j] = $root.tendermint.types.CommitSig.toObject(message.signatures[j], options); - } - return object; - }; - - /** - * Converts this Commit to JSON. - * @function toJSON - * @memberof tendermint.types.Commit - * @instance - * @returns {Object.} JSON object - */ - Commit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Commit; - })(); - - types.CommitSig = (function() { - - /** - * Properties of a CommitSig. - * @memberof tendermint.types - * @interface ICommitSig - * @property {tendermint.types.BlockIDFlag|null} [block_id_flag] CommitSig block_id_flag - * @property {Uint8Array|null} [validator_address] CommitSig validator_address - * @property {google.protobuf.ITimestamp|null} [timestamp] CommitSig timestamp - * @property {Uint8Array|null} [signature] CommitSig signature - */ - - /** - * Constructs a new CommitSig. - * @memberof tendermint.types - * @classdesc Represents a CommitSig. - * @implements ICommitSig - * @constructor - * @param {tendermint.types.ICommitSig=} [properties] Properties to set - */ - function CommitSig(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitSig block_id_flag. - * @member {tendermint.types.BlockIDFlag} block_id_flag - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.block_id_flag = 0; - - /** - * CommitSig validator_address. - * @member {Uint8Array} validator_address - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.validator_address = $util.newBuffer([]); - - /** - * CommitSig timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.timestamp = null; - - /** - * CommitSig signature. - * @member {Uint8Array} signature - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.signature = $util.newBuffer([]); - - /** - * Encodes the specified CommitSig message. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @function encode - * @memberof tendermint.types.CommitSig - * @static - * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitSig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block_id_flag != null && Object.hasOwnProperty.call(message, "block_id_flag")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.block_id_flag); - if (message.validator_address != null && Object.hasOwnProperty.call(message, "validator_address")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.validator_address); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.signature); - return writer; - }; - - /** - * Encodes the specified CommitSig message, length delimited. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.CommitSig - * @static - * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitSig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitSig message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.CommitSig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.CommitSig} CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitSig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.CommitSig(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id_flag = reader.int32(); - break; - case 2: - message.validator_address = reader.bytes(); - break; - case 3: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitSig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.CommitSig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.CommitSig} CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitSig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitSig message. - * @function verify - * @memberof tendermint.types.CommitSig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitSig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block_id_flag != null && message.hasOwnProperty("block_id_flag")) - switch (message.block_id_flag) { - default: - return "block_id_flag: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - if (!(message.validator_address && typeof message.validator_address.length === "number" || $util.isString(message.validator_address))) - return "validator_address: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - let error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; - - /** - * Creates a CommitSig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.CommitSig - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.CommitSig} CommitSig - */ - CommitSig.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.CommitSig) - return object; - let message = new $root.tendermint.types.CommitSig(); - switch (object.block_id_flag) { - case "BLOCK_ID_FLAG_UNKNOWN": - case 0: - message.block_id_flag = 0; - break; - case "BLOCK_ID_FLAG_ABSENT": - case 1: - message.block_id_flag = 1; - break; - case "BLOCK_ID_FLAG_COMMIT": - case 2: - message.block_id_flag = 2; - break; - case "BLOCK_ID_FLAG_NIL": - case 3: - message.block_id_flag = 3; - break; - } - if (object.validator_address != null) - if (typeof object.validator_address === "string") - $util.base64.decode(object.validator_address, message.validator_address = $util.newBuffer($util.base64.length(object.validator_address)), 0); - else if (object.validator_address.length) - message.validator_address = object.validator_address; - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".tendermint.types.CommitSig.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; - - /** - * Creates a plain object from a CommitSig message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.CommitSig - * @static - * @param {tendermint.types.CommitSig} message CommitSig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitSig.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.block_id_flag = options.enums === String ? "BLOCK_ID_FLAG_UNKNOWN" : 0; - if (options.bytes === String) - object.validator_address = ""; - else { - object.validator_address = []; - if (options.bytes !== Array) - object.validator_address = $util.newBuffer(object.validator_address); - } - object.timestamp = null; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - } - if (message.block_id_flag != null && message.hasOwnProperty("block_id_flag")) - object.block_id_flag = options.enums === String ? $root.tendermint.types.BlockIDFlag[message.block_id_flag] : message.block_id_flag; - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - object.validator_address = options.bytes === String ? $util.base64.encode(message.validator_address, 0, message.validator_address.length) : options.bytes === Array ? Array.prototype.slice.call(message.validator_address) : message.validator_address; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; - - /** - * Converts this CommitSig to JSON. - * @function toJSON - * @memberof tendermint.types.CommitSig - * @instance - * @returns {Object.} JSON object - */ - CommitSig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CommitSig; - })(); - - types.Proposal = (function() { - - /** - * Properties of a Proposal. - * @memberof tendermint.types - * @interface IProposal - * @property {tendermint.types.SignedMsgType|null} [type] Proposal type - * @property {Long|null} [height] Proposal height - * @property {number|null} [round] Proposal round - * @property {number|null} [pol_round] Proposal pol_round - * @property {tendermint.types.IBlockID|null} [block_id] Proposal block_id - * @property {google.protobuf.ITimestamp|null} [timestamp] Proposal timestamp - * @property {Uint8Array|null} [signature] Proposal signature - */ - - /** - * Constructs a new Proposal. - * @memberof tendermint.types - * @classdesc Represents a Proposal. - * @implements IProposal - * @constructor - * @param {tendermint.types.IProposal=} [properties] Properties to set - */ - function Proposal(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proposal type. - * @member {tendermint.types.SignedMsgType} type - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.type = 0; - - /** - * Proposal height. - * @member {Long} height - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Proposal round. - * @member {number} round - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.round = 0; - - /** - * Proposal pol_round. - * @member {number} pol_round - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.pol_round = 0; - - /** - * Proposal block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.block_id = null; - - /** - * Proposal timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.timestamp = null; - - /** - * Proposal signature. - * @member {Uint8Array} signature - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.signature = $util.newBuffer([]); - - /** - * Encodes the specified Proposal message. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Proposal - * @static - * @param {tendermint.types.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); - if (message.pol_round != null && Object.hasOwnProperty.call(message, "pol_round")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pol_round); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.signature); - return writer; - }; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Proposal - * @static - * @param {tendermint.types.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Proposal(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.height = reader.int64(); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.pol_round = reader.int32(); - break; - case 5: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proposal message. - * @function verify - * @memberof tendermint.types.Proposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 32: - break; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.pol_round != null && message.hasOwnProperty("pol_round")) - if (!$util.isInteger(message.pol_round)) - return "pol_round: integer expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - let error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - let error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Proposal - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Proposal} Proposal - */ - Proposal.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Proposal) - return object; - let message = new $root.tendermint.types.Proposal(); - switch (object.type) { - case "SIGNED_MSG_TYPE_UNKNOWN": - case 0: - message.type = 0; - break; - case "SIGNED_MSG_TYPE_PREVOTE": - case 1: - message.type = 1; - break; - case "SIGNED_MSG_TYPE_PRECOMMIT": - case 2: - message.type = 2; - break; - case "SIGNED_MSG_TYPE_PROPOSAL": - case 32: - message.type = 32; - break; - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.round != null) - message.round = object.round | 0; - if (object.pol_round != null) - message.pol_round = object.pol_round | 0; - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.Proposal.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".tendermint.types.Proposal.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Proposal - * @static - * @param {tendermint.types.Proposal} message Proposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.round = 0; - object.pol_round = 0; - object.block_id = null; - object.timestamp = null; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.pol_round != null && message.hasOwnProperty("pol_round")) - object.pol_round = message.pol_round; - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; - - /** - * Converts this Proposal to JSON. - * @function toJSON - * @memberof tendermint.types.Proposal - * @instance - * @returns {Object.} JSON object - */ - Proposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proposal; - })(); - - types.SignedHeader = (function() { - - /** - * Properties of a SignedHeader. - * @memberof tendermint.types - * @interface ISignedHeader - * @property {tendermint.types.IHeader|null} [header] SignedHeader header - * @property {tendermint.types.ICommit|null} [commit] SignedHeader commit - */ - - /** - * Constructs a new SignedHeader. - * @memberof tendermint.types - * @classdesc Represents a SignedHeader. - * @implements ISignedHeader - * @constructor - * @param {tendermint.types.ISignedHeader=} [properties] Properties to set - */ - function SignedHeader(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignedHeader header. - * @member {tendermint.types.IHeader|null|undefined} header - * @memberof tendermint.types.SignedHeader - * @instance - */ - SignedHeader.prototype.header = null; - - /** - * SignedHeader commit. - * @member {tendermint.types.ICommit|null|undefined} commit - * @memberof tendermint.types.SignedHeader - * @instance - */ - SignedHeader.prototype.commit = null; - - /** - * Encodes the specified SignedHeader message. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @function encode - * @memberof tendermint.types.SignedHeader - * @static - * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedHeader.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) - $root.tendermint.types.Commit.encode(message.commit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SignedHeader message, length delimited. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.SignedHeader - * @static - * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignedHeader message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.SignedHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.SignedHeader} SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedHeader.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SignedHeader(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); - break; - case 2: - message.commit = $root.tendermint.types.Commit.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignedHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.SignedHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.SignedHeader} SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignedHeader message. - * @function verify - * @memberof tendermint.types.SignedHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignedHeader.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.header != null && message.hasOwnProperty("header")) { - let error = $root.tendermint.types.Header.verify(message.header); - if (error) - return "header." + error; - } - if (message.commit != null && message.hasOwnProperty("commit")) { - let error = $root.tendermint.types.Commit.verify(message.commit); - if (error) - return "commit." + error; - } - return null; - }; - - /** - * Creates a SignedHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.SignedHeader - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.SignedHeader} SignedHeader - */ - SignedHeader.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.SignedHeader) - return object; - let message = new $root.tendermint.types.SignedHeader(); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".tendermint.types.SignedHeader.header: object expected"); - message.header = $root.tendermint.types.Header.fromObject(object.header); - } - if (object.commit != null) { - if (typeof object.commit !== "object") - throw TypeError(".tendermint.types.SignedHeader.commit: object expected"); - message.commit = $root.tendermint.types.Commit.fromObject(object.commit); - } - return message; - }; - - /** - * Creates a plain object from a SignedHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.SignedHeader - * @static - * @param {tendermint.types.SignedHeader} message SignedHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignedHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.header = null; - object.commit = null; - } - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.tendermint.types.Header.toObject(message.header, options); - if (message.commit != null && message.hasOwnProperty("commit")) - object.commit = $root.tendermint.types.Commit.toObject(message.commit, options); - return object; - }; - - /** - * Converts this SignedHeader to JSON. - * @function toJSON - * @memberof tendermint.types.SignedHeader - * @instance - * @returns {Object.} JSON object - */ - SignedHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignedHeader; - })(); - - types.LightBlock = (function() { - - /** - * Properties of a LightBlock. - * @memberof tendermint.types - * @interface ILightBlock - * @property {tendermint.types.ISignedHeader|null} [signed_header] LightBlock signed_header - * @property {tendermint.types.IValidatorSet|null} [validator_set] LightBlock validator_set - */ - - /** - * Constructs a new LightBlock. - * @memberof tendermint.types - * @classdesc Represents a LightBlock. - * @implements ILightBlock - * @constructor - * @param {tendermint.types.ILightBlock=} [properties] Properties to set - */ - function LightBlock(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LightBlock signed_header. - * @member {tendermint.types.ISignedHeader|null|undefined} signed_header - * @memberof tendermint.types.LightBlock - * @instance - */ - LightBlock.prototype.signed_header = null; - - /** - * LightBlock validator_set. - * @member {tendermint.types.IValidatorSet|null|undefined} validator_set - * @memberof tendermint.types.LightBlock - * @instance - */ - LightBlock.prototype.validator_set = null; - - /** - * Encodes the specified LightBlock message. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @function encode - * @memberof tendermint.types.LightBlock - * @static - * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LightBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signed_header != null && Object.hasOwnProperty.call(message, "signed_header")) - $root.tendermint.types.SignedHeader.encode(message.signed_header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.validator_set != null && Object.hasOwnProperty.call(message, "validator_set")) - $root.tendermint.types.ValidatorSet.encode(message.validator_set, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LightBlock message, length delimited. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.LightBlock - * @static - * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LightBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LightBlock message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.LightBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.LightBlock} LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LightBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.LightBlock(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signed_header = $root.tendermint.types.SignedHeader.decode(reader, reader.uint32()); - break; - case 2: - message.validator_set = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LightBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.LightBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.LightBlock} LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LightBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LightBlock message. - * @function verify - * @memberof tendermint.types.LightBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LightBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signed_header != null && message.hasOwnProperty("signed_header")) { - let error = $root.tendermint.types.SignedHeader.verify(message.signed_header); - if (error) - return "signed_header." + error; - } - if (message.validator_set != null && message.hasOwnProperty("validator_set")) { - let error = $root.tendermint.types.ValidatorSet.verify(message.validator_set); - if (error) - return "validator_set." + error; - } - return null; - }; - - /** - * Creates a LightBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.LightBlock - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.LightBlock} LightBlock - */ - LightBlock.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.LightBlock) - return object; - let message = new $root.tendermint.types.LightBlock(); - if (object.signed_header != null) { - if (typeof object.signed_header !== "object") - throw TypeError(".tendermint.types.LightBlock.signed_header: object expected"); - message.signed_header = $root.tendermint.types.SignedHeader.fromObject(object.signed_header); - } - if (object.validator_set != null) { - if (typeof object.validator_set !== "object") - throw TypeError(".tendermint.types.LightBlock.validator_set: object expected"); - message.validator_set = $root.tendermint.types.ValidatorSet.fromObject(object.validator_set); - } - return message; - }; - - /** - * Creates a plain object from a LightBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.LightBlock - * @static - * @param {tendermint.types.LightBlock} message LightBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LightBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.signed_header = null; - object.validator_set = null; - } - if (message.signed_header != null && message.hasOwnProperty("signed_header")) - object.signed_header = $root.tendermint.types.SignedHeader.toObject(message.signed_header, options); - if (message.validator_set != null && message.hasOwnProperty("validator_set")) - object.validator_set = $root.tendermint.types.ValidatorSet.toObject(message.validator_set, options); - return object; - }; - - /** - * Converts this LightBlock to JSON. - * @function toJSON - * @memberof tendermint.types.LightBlock - * @instance - * @returns {Object.} JSON object - */ - LightBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return LightBlock; - })(); - - types.BlockMeta = (function() { - - /** - * Properties of a BlockMeta. - * @memberof tendermint.types - * @interface IBlockMeta - * @property {tendermint.types.IBlockID|null} [block_id] BlockMeta block_id - * @property {Long|null} [block_size] BlockMeta block_size - * @property {tendermint.types.IHeader|null} [header] BlockMeta header - * @property {Long|null} [num_txs] BlockMeta num_txs - */ - - /** - * Constructs a new BlockMeta. - * @memberof tendermint.types - * @classdesc Represents a BlockMeta. - * @implements IBlockMeta - * @constructor - * @param {tendermint.types.IBlockMeta=} [properties] Properties to set - */ - function BlockMeta(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockMeta block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.block_id = null; - - /** - * BlockMeta block_size. - * @member {Long} block_size - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.block_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BlockMeta header. - * @member {tendermint.types.IHeader|null|undefined} header - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.header = null; - - /** - * BlockMeta num_txs. - * @member {Long} num_txs - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.num_txs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified BlockMeta message. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @function encode - * @memberof tendermint.types.BlockMeta - * @static - * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockMeta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.block_size != null && Object.hasOwnProperty.call(message, "block_size")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.block_size); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.num_txs != null && Object.hasOwnProperty.call(message, "num_txs")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.num_txs); - return writer; - }; - - /** - * Encodes the specified BlockMeta message, length delimited. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.BlockMeta - * @static - * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockMeta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockMeta message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.BlockMeta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.BlockMeta} BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockMeta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockMeta(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 2: - message.block_size = reader.int64(); - break; - case 3: - message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); - break; - case 4: - message.num_txs = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockMeta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.BlockMeta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.BlockMeta} BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockMeta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockMeta message. - * @function verify - * @memberof tendermint.types.BlockMeta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockMeta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - let error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.block_size != null && message.hasOwnProperty("block_size")) - if (!$util.isInteger(message.block_size) && !(message.block_size && $util.isInteger(message.block_size.low) && $util.isInteger(message.block_size.high))) - return "block_size: integer|Long expected"; - if (message.header != null && message.hasOwnProperty("header")) { - let error = $root.tendermint.types.Header.verify(message.header); - if (error) - return "header." + error; - } - if (message.num_txs != null && message.hasOwnProperty("num_txs")) - if (!$util.isInteger(message.num_txs) && !(message.num_txs && $util.isInteger(message.num_txs.low) && $util.isInteger(message.num_txs.high))) - return "num_txs: integer|Long expected"; - return null; - }; - - /** - * Creates a BlockMeta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.BlockMeta - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.BlockMeta} BlockMeta - */ - BlockMeta.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.BlockMeta) - return object; - let message = new $root.tendermint.types.BlockMeta(); - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.BlockMeta.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.block_size != null) - if ($util.Long) - (message.block_size = $util.Long.fromValue(object.block_size)).unsigned = false; - else if (typeof object.block_size === "string") - message.block_size = parseInt(object.block_size, 10); - else if (typeof object.block_size === "number") - message.block_size = object.block_size; - else if (typeof object.block_size === "object") - message.block_size = new $util.LongBits(object.block_size.low >>> 0, object.block_size.high >>> 0).toNumber(); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".tendermint.types.BlockMeta.header: object expected"); - message.header = $root.tendermint.types.Header.fromObject(object.header); - } - if (object.num_txs != null) - if ($util.Long) - (message.num_txs = $util.Long.fromValue(object.num_txs)).unsigned = false; - else if (typeof object.num_txs === "string") - message.num_txs = parseInt(object.num_txs, 10); - else if (typeof object.num_txs === "number") - message.num_txs = object.num_txs; - else if (typeof object.num_txs === "object") - message.num_txs = new $util.LongBits(object.num_txs.low >>> 0, object.num_txs.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a BlockMeta message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.BlockMeta - * @static - * @param {tendermint.types.BlockMeta} message BlockMeta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockMeta.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.block_id = null; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.block_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block_size = options.longs === String ? "0" : 0; - object.header = null; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.num_txs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.num_txs = options.longs === String ? "0" : 0; - } - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.block_size != null && message.hasOwnProperty("block_size")) - if (typeof message.block_size === "number") - object.block_size = options.longs === String ? String(message.block_size) : message.block_size; - else - object.block_size = options.longs === String ? $util.Long.prototype.toString.call(message.block_size) : options.longs === Number ? new $util.LongBits(message.block_size.low >>> 0, message.block_size.high >>> 0).toNumber() : message.block_size; - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.tendermint.types.Header.toObject(message.header, options); - if (message.num_txs != null && message.hasOwnProperty("num_txs")) - if (typeof message.num_txs === "number") - object.num_txs = options.longs === String ? String(message.num_txs) : message.num_txs; - else - object.num_txs = options.longs === String ? $util.Long.prototype.toString.call(message.num_txs) : options.longs === Number ? new $util.LongBits(message.num_txs.low >>> 0, message.num_txs.high >>> 0).toNumber() : message.num_txs; - return object; - }; - - /** - * Converts this BlockMeta to JSON. - * @function toJSON - * @memberof tendermint.types.BlockMeta - * @instance - * @returns {Object.} JSON object - */ - BlockMeta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockMeta; - })(); - - types.TxProof = (function() { - - /** - * Properties of a TxProof. - * @memberof tendermint.types - * @interface ITxProof - * @property {Uint8Array|null} [root_hash] TxProof root_hash - * @property {Uint8Array|null} [data] TxProof data - * @property {tendermint.crypto.IProof|null} [proof] TxProof proof - */ - - /** - * Constructs a new TxProof. - * @memberof tendermint.types - * @classdesc Represents a TxProof. - * @implements ITxProof - * @constructor - * @param {tendermint.types.ITxProof=} [properties] Properties to set - */ - function TxProof(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TxProof root_hash. - * @member {Uint8Array} root_hash - * @memberof tendermint.types.TxProof - * @instance - */ - TxProof.prototype.root_hash = $util.newBuffer([]); - - /** - * TxProof data. - * @member {Uint8Array} data - * @memberof tendermint.types.TxProof - * @instance - */ - TxProof.prototype.data = $util.newBuffer([]); - - /** - * TxProof proof. - * @member {tendermint.crypto.IProof|null|undefined} proof - * @memberof tendermint.types.TxProof - * @instance - */ - TxProof.prototype.proof = null; - - /** - * Encodes the specified TxProof message. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @function encode - * @memberof tendermint.types.TxProof - * @static - * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.root_hash != null && Object.hasOwnProperty.call(message, "root_hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.root_hash); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TxProof message, length delimited. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.TxProof - * @static - * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TxProof message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.TxProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.TxProof} TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.TxProof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.root_hash = reader.bytes(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TxProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.TxProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.TxProof} TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TxProof message. - * @function verify - * @memberof tendermint.types.TxProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TxProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.root_hash != null && message.hasOwnProperty("root_hash")) - if (!(message.root_hash && typeof message.root_hash.length === "number" || $util.isString(message.root_hash))) - return "root_hash: buffer expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - let error = $root.tendermint.crypto.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - return null; - }; - - /** - * Creates a TxProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.TxProof - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.TxProof} TxProof - */ - TxProof.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.TxProof) - return object; - let message = new $root.tendermint.types.TxProof(); - if (object.root_hash != null) - if (typeof object.root_hash === "string") - $util.base64.decode(object.root_hash, message.root_hash = $util.newBuffer($util.base64.length(object.root_hash)), 0); - else if (object.root_hash.length) - message.root_hash = object.root_hash; - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".tendermint.types.TxProof.proof: object expected"); - message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); - } - return message; - }; - - /** - * Creates a plain object from a TxProof message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.TxProof - * @static - * @param {tendermint.types.TxProof} message TxProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TxProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.root_hash = ""; - else { - object.root_hash = []; - if (options.bytes !== Array) - object.root_hash = $util.newBuffer(object.root_hash); - } - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.proof = null; - } - if (message.root_hash != null && message.hasOwnProperty("root_hash")) - object.root_hash = options.bytes === String ? $util.base64.encode(message.root_hash, 0, message.root_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.root_hash) : message.root_hash; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); - return object; - }; - - /** - * Converts this TxProof to JSON. - * @function toJSON - * @memberof tendermint.types.TxProof - * @instance - * @returns {Object.} JSON object - */ - TxProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TxProof; - })(); - - return types; - })(); - - tendermint.crypto = (function() { - - /** - * Namespace crypto. - * @memberof tendermint - * @namespace - */ - const crypto = {}; - - crypto.PublicKey = (function() { - - /** - * Properties of a PublicKey. - * @memberof tendermint.crypto - * @interface IPublicKey - * @property {Uint8Array|null} [ed25519] PublicKey ed25519 - * @property {Uint8Array|null} [secp256k1] PublicKey secp256k1 - */ - - /** - * Constructs a new PublicKey. - * @memberof tendermint.crypto - * @classdesc Represents a PublicKey. - * @implements IPublicKey - * @constructor - * @param {tendermint.crypto.IPublicKey=} [properties] Properties to set - */ - function PublicKey(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PublicKey ed25519. - * @member {Uint8Array|null|undefined} ed25519 - * @memberof tendermint.crypto.PublicKey - * @instance - */ - PublicKey.prototype.ed25519 = null; - - /** - * PublicKey secp256k1. - * @member {Uint8Array|null|undefined} secp256k1 - * @memberof tendermint.crypto.PublicKey - * @instance - */ - PublicKey.prototype.secp256k1 = null; - - // OneOf field names bound to virtual getters and setters - let $oneOfFields; - - /** - * PublicKey sum. - * @member {"ed25519"|"secp256k1"|undefined} sum - * @memberof tendermint.crypto.PublicKey - * @instance - */ - Object.defineProperty(PublicKey.prototype, "sum", { - get: $util.oneOfGetter($oneOfFields = ["ed25519", "secp256k1"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.PublicKey - * @static - * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublicKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ed25519 != null && Object.hasOwnProperty.call(message, "ed25519")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ed25519); - if (message.secp256k1 != null && Object.hasOwnProperty.call(message, "secp256k1")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.secp256k1); - return writer; - }; - - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.PublicKey - * @static - * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublicKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.PublicKey} PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublicKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.PublicKey(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ed25519 = reader.bytes(); - break; - case 2: - message.secp256k1 = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PublicKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.PublicKey} PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublicKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PublicKey message. - * @function verify - * @memberof tendermint.crypto.PublicKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PublicKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { - properties.sum = 1; - if (!(message.ed25519 && typeof message.ed25519.length === "number" || $util.isString(message.ed25519))) - return "ed25519: buffer expected"; - } - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { - if (properties.sum === 1) - return "sum: multiple values"; - properties.sum = 1; - if (!(message.secp256k1 && typeof message.secp256k1.length === "number" || $util.isString(message.secp256k1))) - return "secp256k1: buffer expected"; - } - return null; - }; - - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.PublicKey - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.PublicKey} PublicKey - */ - PublicKey.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.PublicKey) - return object; - let message = new $root.tendermint.crypto.PublicKey(); - if (object.ed25519 != null) - if (typeof object.ed25519 === "string") - $util.base64.decode(object.ed25519, message.ed25519 = $util.newBuffer($util.base64.length(object.ed25519)), 0); - else if (object.ed25519.length) - message.ed25519 = object.ed25519; - if (object.secp256k1 != null) - if (typeof object.secp256k1 === "string") - $util.base64.decode(object.secp256k1, message.secp256k1 = $util.newBuffer($util.base64.length(object.secp256k1)), 0); - else if (object.secp256k1.length) - message.secp256k1 = object.secp256k1; - return message; - }; - - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.PublicKey - * @static - * @param {tendermint.crypto.PublicKey} message PublicKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PublicKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { - object.ed25519 = options.bytes === String ? $util.base64.encode(message.ed25519, 0, message.ed25519.length) : options.bytes === Array ? Array.prototype.slice.call(message.ed25519) : message.ed25519; - if (options.oneofs) - object.sum = "ed25519"; - } - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { - object.secp256k1 = options.bytes === String ? $util.base64.encode(message.secp256k1, 0, message.secp256k1.length) : options.bytes === Array ? Array.prototype.slice.call(message.secp256k1) : message.secp256k1; - if (options.oneofs) - object.sum = "secp256k1"; - } - return object; - }; - - /** - * Converts this PublicKey to JSON. - * @function toJSON - * @memberof tendermint.crypto.PublicKey - * @instance - * @returns {Object.} JSON object - */ - PublicKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PublicKey; - })(); - - crypto.Proof = (function() { - - /** - * Properties of a Proof. - * @memberof tendermint.crypto - * @interface IProof - * @property {Long|null} [total] Proof total - * @property {Long|null} [index] Proof index - * @property {Uint8Array|null} [leaf_hash] Proof leaf_hash - * @property {Array.|null} [aunts] Proof aunts - */ - - /** - * Constructs a new Proof. - * @memberof tendermint.crypto - * @classdesc Represents a Proof. - * @implements IProof - * @constructor - * @param {tendermint.crypto.IProof=} [properties] Properties to set - */ - function Proof(properties) { - this.aunts = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proof total. - * @member {Long} total - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.total = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Proof index. - * @member {Long} index - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Proof leaf_hash. - * @member {Uint8Array} leaf_hash - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.leaf_hash = $util.newBuffer([]); - - /** - * Proof aunts. - * @member {Array.} aunts - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.aunts = $util.emptyArray; - - /** - * Encodes the specified Proof message. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.Proof - * @static - * @param {tendermint.crypto.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.total != null && Object.hasOwnProperty.call(message, "total")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.total); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.index); - if (message.leaf_hash != null && Object.hasOwnProperty.call(message, "leaf_hash")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.leaf_hash); - if (message.aunts != null && message.aunts.length) - for (let i = 0; i < message.aunts.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.aunts[i]); - return writer; - }; - - /** - * Encodes the specified Proof message, length delimited. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.Proof - * @static - * @param {tendermint.crypto.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proof message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.Proof(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = reader.int64(); - break; - case 2: - message.index = reader.int64(); - break; - case 3: - message.leaf_hash = reader.bytes(); - break; - case 4: - if (!(message.aunts && message.aunts.length)) - message.aunts = []; - message.aunts.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proof message. - * @function verify - * @memberof tendermint.crypto.Proof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.total != null && message.hasOwnProperty("total")) - if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) - return "total: integer|Long expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) - return "index: integer|Long expected"; - if (message.leaf_hash != null && message.hasOwnProperty("leaf_hash")) - if (!(message.leaf_hash && typeof message.leaf_hash.length === "number" || $util.isString(message.leaf_hash))) - return "leaf_hash: buffer expected"; - if (message.aunts != null && message.hasOwnProperty("aunts")) { - if (!Array.isArray(message.aunts)) - return "aunts: array expected"; - for (let i = 0; i < message.aunts.length; ++i) - if (!(message.aunts[i] && typeof message.aunts[i].length === "number" || $util.isString(message.aunts[i]))) - return "aunts: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Proof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.Proof - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.Proof} Proof - */ - Proof.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.Proof) - return object; - let message = new $root.tendermint.crypto.Proof(); - if (object.total != null) - if ($util.Long) - (message.total = $util.Long.fromValue(object.total)).unsigned = false; - else if (typeof object.total === "string") - message.total = parseInt(object.total, 10); - else if (typeof object.total === "number") - message.total = object.total; - else if (typeof object.total === "object") - message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(); - if (object.index != null) - if ($util.Long) - (message.index = $util.Long.fromValue(object.index)).unsigned = false; - else if (typeof object.index === "string") - message.index = parseInt(object.index, 10); - else if (typeof object.index === "number") - message.index = object.index; - else if (typeof object.index === "object") - message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); - if (object.leaf_hash != null) - if (typeof object.leaf_hash === "string") - $util.base64.decode(object.leaf_hash, message.leaf_hash = $util.newBuffer($util.base64.length(object.leaf_hash)), 0); - else if (object.leaf_hash.length) - message.leaf_hash = object.leaf_hash; - if (object.aunts) { - if (!Array.isArray(object.aunts)) - throw TypeError(".tendermint.crypto.Proof.aunts: array expected"); - message.aunts = []; - for (let i = 0; i < object.aunts.length; ++i) - if (typeof object.aunts[i] === "string") - $util.base64.decode(object.aunts[i], message.aunts[i] = $util.newBuffer($util.base64.length(object.aunts[i])), 0); - else if (object.aunts[i].length) - message.aunts[i] = object.aunts[i]; - } - return message; - }; - - /** - * Creates a plain object from a Proof message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.Proof - * @static - * @param {tendermint.crypto.Proof} message Proof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proof.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.aunts = []; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.index = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.leaf_hash = ""; - else { - object.leaf_hash = []; - if (options.bytes !== Array) - object.leaf_hash = $util.newBuffer(object.leaf_hash); - } - } - if (message.total != null && message.hasOwnProperty("total")) - if (typeof message.total === "number") - object.total = options.longs === String ? String(message.total) : message.total; - else - object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber() : message.total; - if (message.index != null && message.hasOwnProperty("index")) - if (typeof message.index === "number") - object.index = options.longs === String ? String(message.index) : message.index; - else - object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; - if (message.leaf_hash != null && message.hasOwnProperty("leaf_hash")) - object.leaf_hash = options.bytes === String ? $util.base64.encode(message.leaf_hash, 0, message.leaf_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.leaf_hash) : message.leaf_hash; - if (message.aunts && message.aunts.length) { - object.aunts = []; - for (let j = 0; j < message.aunts.length; ++j) - object.aunts[j] = options.bytes === String ? $util.base64.encode(message.aunts[j], 0, message.aunts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.aunts[j]) : message.aunts[j]; - } - return object; - }; - - /** - * Converts this Proof to JSON. - * @function toJSON - * @memberof tendermint.crypto.Proof - * @instance - * @returns {Object.} JSON object - */ - Proof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proof; - })(); - - crypto.ValueOp = (function() { - - /** - * Properties of a ValueOp. - * @memberof tendermint.crypto - * @interface IValueOp - * @property {Uint8Array|null} [key] ValueOp key - * @property {tendermint.crypto.IProof|null} [proof] ValueOp proof - */ - - /** - * Constructs a new ValueOp. - * @memberof tendermint.crypto - * @classdesc Represents a ValueOp. - * @implements IValueOp - * @constructor - * @param {tendermint.crypto.IValueOp=} [properties] Properties to set - */ - function ValueOp(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValueOp key. - * @member {Uint8Array} key - * @memberof tendermint.crypto.ValueOp - * @instance - */ - ValueOp.prototype.key = $util.newBuffer([]); - - /** - * ValueOp proof. - * @member {tendermint.crypto.IProof|null|undefined} proof - * @memberof tendermint.crypto.ValueOp - * @instance - */ - ValueOp.prototype.proof = null; - - /** - * Encodes the specified ValueOp message. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.ValueOp - * @static - * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ValueOp message, length delimited. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.ValueOp - * @static - * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValueOp message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.ValueOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.ValueOp} ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ValueOp(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValueOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.ValueOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.ValueOp} ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValueOp message. - * @function verify - * @memberof tendermint.crypto.ValueOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValueOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - let error = $root.tendermint.crypto.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - return null; - }; - - /** - * Creates a ValueOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.ValueOp - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.ValueOp} ValueOp - */ - ValueOp.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.ValueOp) - return object; - let message = new $root.tendermint.crypto.ValueOp(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".tendermint.crypto.ValueOp.proof: object expected"); - message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); - } - return message; - }; - - /** - * Creates a plain object from a ValueOp message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.ValueOp - * @static - * @param {tendermint.crypto.ValueOp} message ValueOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValueOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - object.proof = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); - return object; - }; - - /** - * Converts this ValueOp to JSON. - * @function toJSON - * @memberof tendermint.crypto.ValueOp - * @instance - * @returns {Object.} JSON object - */ - ValueOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValueOp; - })(); - - crypto.DominoOp = (function() { - - /** - * Properties of a DominoOp. - * @memberof tendermint.crypto - * @interface IDominoOp - * @property {string|null} [key] DominoOp key - * @property {string|null} [input] DominoOp input - * @property {string|null} [output] DominoOp output - */ - - /** - * Constructs a new DominoOp. - * @memberof tendermint.crypto - * @classdesc Represents a DominoOp. - * @implements IDominoOp - * @constructor - * @param {tendermint.crypto.IDominoOp=} [properties] Properties to set - */ - function DominoOp(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DominoOp key. - * @member {string} key - * @memberof tendermint.crypto.DominoOp - * @instance - */ - DominoOp.prototype.key = ""; - - /** - * DominoOp input. - * @member {string} input - * @memberof tendermint.crypto.DominoOp - * @instance - */ - DominoOp.prototype.input = ""; - - /** - * DominoOp output. - * @member {string} output - * @memberof tendermint.crypto.DominoOp - * @instance - */ - DominoOp.prototype.output = ""; - - /** - * Encodes the specified DominoOp message. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.DominoOp - * @static - * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DominoOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.input != null && Object.hasOwnProperty.call(message, "input")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.input); - if (message.output != null && Object.hasOwnProperty.call(message, "output")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.output); - return writer; - }; - - /** - * Encodes the specified DominoOp message, length delimited. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.DominoOp - * @static - * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DominoOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DominoOp message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.DominoOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.DominoOp} DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DominoOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.DominoOp(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.input = reader.string(); - break; - case 3: - message.output = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DominoOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.DominoOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.DominoOp} DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DominoOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DominoOp message. - * @function verify - * @memberof tendermint.crypto.DominoOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DominoOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.input != null && message.hasOwnProperty("input")) - if (!$util.isString(message.input)) - return "input: string expected"; - if (message.output != null && message.hasOwnProperty("output")) - if (!$util.isString(message.output)) - return "output: string expected"; - return null; - }; - - /** - * Creates a DominoOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.DominoOp - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.DominoOp} DominoOp - */ - DominoOp.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.DominoOp) - return object; - let message = new $root.tendermint.crypto.DominoOp(); - if (object.key != null) - message.key = String(object.key); - if (object.input != null) - message.input = String(object.input); - if (object.output != null) - message.output = String(object.output); - return message; - }; - - /** - * Creates a plain object from a DominoOp message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.DominoOp - * @static - * @param {tendermint.crypto.DominoOp} message DominoOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DominoOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.key = ""; - object.input = ""; - object.output = ""; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.input != null && message.hasOwnProperty("input")) - object.input = message.input; - if (message.output != null && message.hasOwnProperty("output")) - object.output = message.output; - return object; - }; - - /** - * Converts this DominoOp to JSON. - * @function toJSON - * @memberof tendermint.crypto.DominoOp - * @instance - * @returns {Object.} JSON object - */ - DominoOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DominoOp; - })(); - - crypto.ProofOp = (function() { - - /** - * Properties of a ProofOp. - * @memberof tendermint.crypto - * @interface IProofOp - * @property {string|null} [type] ProofOp type - * @property {Uint8Array|null} [key] ProofOp key - * @property {Uint8Array|null} [data] ProofOp data - */ - - /** - * Constructs a new ProofOp. - * @memberof tendermint.crypto - * @classdesc Represents a ProofOp. - * @implements IProofOp - * @constructor - * @param {tendermint.crypto.IProofOp=} [properties] Properties to set - */ - function ProofOp(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProofOp type. - * @member {string} type - * @memberof tendermint.crypto.ProofOp - * @instance - */ - ProofOp.prototype.type = ""; - - /** - * ProofOp key. - * @member {Uint8Array} key - * @memberof tendermint.crypto.ProofOp - * @instance - */ - ProofOp.prototype.key = $util.newBuffer([]); - - /** - * ProofOp data. - * @member {Uint8Array} data - * @memberof tendermint.crypto.ProofOp - * @instance - */ - ProofOp.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified ProofOp message. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.ProofOp - * @static - * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified ProofOp message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.ProofOp - * @static - * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProofOp message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.ProofOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.ProofOp} ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOp(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.key = reader.bytes(); - break; - case 3: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProofOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.ProofOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.ProofOp} ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProofOp message. - * @function verify - * @memberof tendermint.crypto.ProofOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProofOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a ProofOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.ProofOp - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.ProofOp} ProofOp - */ - ProofOp.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.ProofOp) - return object; - let message = new $root.tendermint.crypto.ProofOp(); - if (object.type != null) - message.type = String(object.type); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a ProofOp message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.ProofOp - * @static - * @param {tendermint.crypto.ProofOp} message ProofOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProofOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.type = ""; - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this ProofOp to JSON. - * @function toJSON - * @memberof tendermint.crypto.ProofOp - * @instance - * @returns {Object.} JSON object - */ - ProofOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProofOp; - })(); - - crypto.ProofOps = (function() { - - /** - * Properties of a ProofOps. - * @memberof tendermint.crypto - * @interface IProofOps - * @property {Array.|null} [ops] ProofOps ops - */ - - /** - * Constructs a new ProofOps. - * @memberof tendermint.crypto - * @classdesc Represents a ProofOps. - * @implements IProofOps - * @constructor - * @param {tendermint.crypto.IProofOps=} [properties] Properties to set - */ - function ProofOps(properties) { - this.ops = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProofOps ops. - * @member {Array.} ops - * @memberof tendermint.crypto.ProofOps - * @instance - */ - ProofOps.prototype.ops = $util.emptyArray; - - /** - * Encodes the specified ProofOps message. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.ProofOps - * @static - * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOps.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ops != null && message.ops.length) - for (let i = 0; i < message.ops.length; ++i) - $root.tendermint.crypto.ProofOp.encode(message.ops[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProofOps message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.ProofOps - * @static - * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOps.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProofOps message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.ProofOps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.ProofOps} ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOps.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOps(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ops && message.ops.length)) - message.ops = []; - message.ops.push($root.tendermint.crypto.ProofOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProofOps message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.ProofOps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.ProofOps} ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOps.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProofOps message. - * @function verify - * @memberof tendermint.crypto.ProofOps - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProofOps.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ops != null && message.hasOwnProperty("ops")) { - if (!Array.isArray(message.ops)) - return "ops: array expected"; - for (let i = 0; i < message.ops.length; ++i) { - let error = $root.tendermint.crypto.ProofOp.verify(message.ops[i]); - if (error) - return "ops." + error; - } - } - return null; - }; - - /** - * Creates a ProofOps message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.ProofOps - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.ProofOps} ProofOps - */ - ProofOps.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.ProofOps) - return object; - let message = new $root.tendermint.crypto.ProofOps(); - if (object.ops) { - if (!Array.isArray(object.ops)) - throw TypeError(".tendermint.crypto.ProofOps.ops: array expected"); - message.ops = []; - for (let i = 0; i < object.ops.length; ++i) { - if (typeof object.ops[i] !== "object") - throw TypeError(".tendermint.crypto.ProofOps.ops: object expected"); - message.ops[i] = $root.tendermint.crypto.ProofOp.fromObject(object.ops[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ProofOps message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.ProofOps - * @static - * @param {tendermint.crypto.ProofOps} message ProofOps - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProofOps.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.ops = []; - if (message.ops && message.ops.length) { - object.ops = []; - for (let j = 0; j < message.ops.length; ++j) - object.ops[j] = $root.tendermint.crypto.ProofOp.toObject(message.ops[j], options); - } - return object; - }; - - /** - * Converts this ProofOps to JSON. - * @function toJSON - * @memberof tendermint.crypto.ProofOps - * @instance - * @returns {Object.} JSON object - */ - ProofOps.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProofOps; - })(); - - return crypto; - })(); - - tendermint.version = (function() { - - /** - * Namespace version. - * @memberof tendermint - * @namespace - */ - const version = {}; - - version.App = (function() { - - /** - * Properties of an App. - * @memberof tendermint.version - * @interface IApp - * @property {Long|null} [protocol] App protocol - * @property {string|null} [software] App software - */ - - /** - * Constructs a new App. - * @memberof tendermint.version - * @classdesc Represents an App. - * @implements IApp - * @constructor - * @param {tendermint.version.IApp=} [properties] Properties to set - */ - function App(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * App protocol. - * @member {Long} protocol - * @memberof tendermint.version.App - * @instance - */ - App.prototype.protocol = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * App software. - * @member {string} software - * @memberof tendermint.version.App - * @instance - */ - App.prototype.software = ""; - - /** - * Encodes the specified App message. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @function encode - * @memberof tendermint.version.App - * @static - * @param {tendermint.version.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.protocol); - if (message.software != null && Object.hasOwnProperty.call(message, "software")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.software); - return writer; - }; - - /** - * Encodes the specified App message, length delimited. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.version.App - * @static - * @param {tendermint.version.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an App message from the specified reader or buffer. - * @function decode - * @memberof tendermint.version.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.version.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.App(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.protocol = reader.uint64(); - break; - case 2: - message.software = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an App message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.version.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.version.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an App message. - * @function verify - * @memberof tendermint.version.App - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - App.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.protocol != null && message.hasOwnProperty("protocol")) - if (!$util.isInteger(message.protocol) && !(message.protocol && $util.isInteger(message.protocol.low) && $util.isInteger(message.protocol.high))) - return "protocol: integer|Long expected"; - if (message.software != null && message.hasOwnProperty("software")) - if (!$util.isString(message.software)) - return "software: string expected"; - return null; - }; - - /** - * Creates an App message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.version.App - * @static - * @param {Object.} object Plain object - * @returns {tendermint.version.App} App - */ - App.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.version.App) - return object; - let message = new $root.tendermint.version.App(); - if (object.protocol != null) - if ($util.Long) - (message.protocol = $util.Long.fromValue(object.protocol)).unsigned = true; - else if (typeof object.protocol === "string") - message.protocol = parseInt(object.protocol, 10); - else if (typeof object.protocol === "number") - message.protocol = object.protocol; - else if (typeof object.protocol === "object") - message.protocol = new $util.LongBits(object.protocol.low >>> 0, object.protocol.high >>> 0).toNumber(true); - if (object.software != null) - message.software = String(object.software); - return message; - }; - - /** - * Creates a plain object from an App message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.version.App - * @static - * @param {tendermint.version.App} message App - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - App.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.protocol = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.protocol = options.longs === String ? "0" : 0; - object.software = ""; - } - if (message.protocol != null && message.hasOwnProperty("protocol")) - if (typeof message.protocol === "number") - object.protocol = options.longs === String ? String(message.protocol) : message.protocol; - else - object.protocol = options.longs === String ? $util.Long.prototype.toString.call(message.protocol) : options.longs === Number ? new $util.LongBits(message.protocol.low >>> 0, message.protocol.high >>> 0).toNumber(true) : message.protocol; - if (message.software != null && message.hasOwnProperty("software")) - object.software = message.software; - return object; - }; - - /** - * Converts this App to JSON. - * @function toJSON - * @memberof tendermint.version.App - * @instance - * @returns {Object.} JSON object - */ - App.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return App; - })(); - - version.Consensus = (function() { - - /** - * Properties of a Consensus. - * @memberof tendermint.version - * @interface IConsensus - * @property {Long|null} [block] Consensus block - * @property {Long|null} [app] Consensus app - */ - - /** - * Constructs a new Consensus. - * @memberof tendermint.version - * @classdesc Represents a Consensus. - * @implements IConsensus - * @constructor - * @param {tendermint.version.IConsensus=} [properties] Properties to set - */ - function Consensus(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Consensus block. - * @member {Long} block - * @memberof tendermint.version.Consensus - * @instance - */ - Consensus.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Consensus app. - * @member {Long} app - * @memberof tendermint.version.Consensus - * @instance - */ - Consensus.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Consensus message. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @function encode - * @memberof tendermint.version.Consensus - * @static - * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Consensus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.block); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.app); - return writer; - }; - - /** - * Encodes the specified Consensus message, length delimited. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.version.Consensus - * @static - * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Consensus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Consensus message from the specified reader or buffer. - * @function decode - * @memberof tendermint.version.Consensus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.version.Consensus} Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Consensus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.Consensus(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = reader.uint64(); - break; - case 2: - message.app = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Consensus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.version.Consensus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.version.Consensus} Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Consensus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Consensus message. - * @function verify - * @memberof tendermint.version.Consensus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Consensus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block != null && message.hasOwnProperty("block")) - if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) - return "block: integer|Long expected"; - if (message.app != null && message.hasOwnProperty("app")) - if (!$util.isInteger(message.app) && !(message.app && $util.isInteger(message.app.low) && $util.isInteger(message.app.high))) - return "app: integer|Long expected"; - return null; - }; - - /** - * Creates a Consensus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.version.Consensus - * @static - * @param {Object.} object Plain object - * @returns {tendermint.version.Consensus} Consensus - */ - Consensus.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.version.Consensus) - return object; - let message = new $root.tendermint.version.Consensus(); - if (object.block != null) - if ($util.Long) - (message.block = $util.Long.fromValue(object.block)).unsigned = true; - else if (typeof object.block === "string") - message.block = parseInt(object.block, 10); - else if (typeof object.block === "number") - message.block = object.block; - else if (typeof object.block === "object") - message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); - if (object.app != null) - if ($util.Long) - (message.app = $util.Long.fromValue(object.app)).unsigned = true; - else if (typeof object.app === "string") - message.app = parseInt(object.app, 10); - else if (typeof object.app === "number") - message.app = object.app; - else if (typeof object.app === "object") - message.app = new $util.LongBits(object.app.low >>> 0, object.app.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Consensus message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.version.Consensus - * @static - * @param {tendermint.version.Consensus} message Consensus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Consensus.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.app = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.app = options.longs === String ? "0" : 0; - } - if (message.block != null && message.hasOwnProperty("block")) - if (typeof message.block === "number") - object.block = options.longs === String ? String(message.block) : message.block; - else - object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; - if (message.app != null && message.hasOwnProperty("app")) - if (typeof message.app === "number") - object.app = options.longs === String ? String(message.app) : message.app; - else - object.app = options.longs === String ? $util.Long.prototype.toString.call(message.app) : options.longs === Number ? new $util.LongBits(message.app.low >>> 0, message.app.high >>> 0).toNumber(true) : message.app; - return object; - }; - - /** - * Converts this Consensus to JSON. - * @function toJSON - * @memberof tendermint.version.Consensus - * @instance - * @returns {Object.} JSON object - */ - Consensus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Consensus; - })(); - - return version; - })(); - - tendermint.libs = (function() { - - /** - * Namespace libs. - * @memberof tendermint - * @namespace - */ - const libs = {}; - - libs.bits = (function() { - - /** - * Namespace bits. - * @memberof tendermint.libs - * @namespace - */ - const bits = {}; - - bits.BitArray = (function() { - - /** - * Properties of a BitArray. - * @memberof tendermint.libs.bits - * @interface IBitArray - * @property {Long|null} [bits] BitArray bits - * @property {Array.|null} [elems] BitArray elems - */ - - /** - * Constructs a new BitArray. - * @memberof tendermint.libs.bits - * @classdesc Represents a BitArray. - * @implements IBitArray - * @constructor - * @param {tendermint.libs.bits.IBitArray=} [properties] Properties to set - */ - function BitArray(properties) { - this.elems = []; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BitArray bits. - * @member {Long} bits - * @memberof tendermint.libs.bits.BitArray - * @instance - */ - BitArray.prototype.bits = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BitArray elems. - * @member {Array.} elems - * @memberof tendermint.libs.bits.BitArray - * @instance - */ - BitArray.prototype.elems = $util.emptyArray; - - /** - * Encodes the specified BitArray message. Does not implicitly {@link tendermint.libs.bits.BitArray.verify|verify} messages. - * @function encode - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {tendermint.libs.bits.IBitArray} message BitArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BitArray.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bits != null && Object.hasOwnProperty.call(message, "bits")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.bits); - if (message.elems != null && message.elems.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (let i = 0; i < message.elems.length; ++i) - writer.uint64(message.elems[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified BitArray message, length delimited. Does not implicitly {@link tendermint.libs.bits.BitArray.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {tendermint.libs.bits.IBitArray} message BitArray message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BitArray.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BitArray message from the specified reader or buffer. - * @function decode - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.libs.bits.BitArray} BitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BitArray.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.libs.bits.BitArray(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.bits = reader.int64(); - break; - case 2: - if (!(message.elems && message.elems.length)) - message.elems = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.elems.push(reader.uint64()); - } else - message.elems.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BitArray message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.libs.bits.BitArray} BitArray - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BitArray.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BitArray message. - * @function verify - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BitArray.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bits != null && message.hasOwnProperty("bits")) - if (!$util.isInteger(message.bits) && !(message.bits && $util.isInteger(message.bits.low) && $util.isInteger(message.bits.high))) - return "bits: integer|Long expected"; - if (message.elems != null && message.hasOwnProperty("elems")) { - if (!Array.isArray(message.elems)) - return "elems: array expected"; - for (let i = 0; i < message.elems.length; ++i) - if (!$util.isInteger(message.elems[i]) && !(message.elems[i] && $util.isInteger(message.elems[i].low) && $util.isInteger(message.elems[i].high))) - return "elems: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a BitArray message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {Object.} object Plain object - * @returns {tendermint.libs.bits.BitArray} BitArray - */ - BitArray.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.libs.bits.BitArray) - return object; - let message = new $root.tendermint.libs.bits.BitArray(); - if (object.bits != null) - if ($util.Long) - (message.bits = $util.Long.fromValue(object.bits)).unsigned = false; - else if (typeof object.bits === "string") - message.bits = parseInt(object.bits, 10); - else if (typeof object.bits === "number") - message.bits = object.bits; - else if (typeof object.bits === "object") - message.bits = new $util.LongBits(object.bits.low >>> 0, object.bits.high >>> 0).toNumber(); - if (object.elems) { - if (!Array.isArray(object.elems)) - throw TypeError(".tendermint.libs.bits.BitArray.elems: array expected"); - message.elems = []; - for (let i = 0; i < object.elems.length; ++i) - if ($util.Long) - (message.elems[i] = $util.Long.fromValue(object.elems[i])).unsigned = true; - else if (typeof object.elems[i] === "string") - message.elems[i] = parseInt(object.elems[i], 10); - else if (typeof object.elems[i] === "number") - message.elems[i] = object.elems[i]; - else if (typeof object.elems[i] === "object") - message.elems[i] = new $util.LongBits(object.elems[i].low >>> 0, object.elems[i].high >>> 0).toNumber(true); - } - return message; - }; - - /** - * Creates a plain object from a BitArray message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.libs.bits.BitArray - * @static - * @param {tendermint.libs.bits.BitArray} message BitArray - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BitArray.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.elems = []; - if (options.defaults) - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.bits = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bits = options.longs === String ? "0" : 0; - if (message.bits != null && message.hasOwnProperty("bits")) - if (typeof message.bits === "number") - object.bits = options.longs === String ? String(message.bits) : message.bits; - else - object.bits = options.longs === String ? $util.Long.prototype.toString.call(message.bits) : options.longs === Number ? new $util.LongBits(message.bits.low >>> 0, message.bits.high >>> 0).toNumber() : message.bits; - if (message.elems && message.elems.length) { - object.elems = []; - for (let j = 0; j < message.elems.length; ++j) - if (typeof message.elems[j] === "number") - object.elems[j] = options.longs === String ? String(message.elems[j]) : message.elems[j]; - else - object.elems[j] = options.longs === String ? $util.Long.prototype.toString.call(message.elems[j]) : options.longs === Number ? new $util.LongBits(message.elems[j].low >>> 0, message.elems[j].high >>> 0).toNumber(true) : message.elems[j]; - } - return object; - }; - - /** - * Converts this BitArray to JSON. - * @function toJSON - * @memberof tendermint.libs.bits.BitArray - * @instance - * @returns {Object.} JSON object - */ - BitArray.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BitArray; - })(); - - return bits; - })(); - - return libs; - })(); - - return tendermint; -})(); - -export { $root as default }; diff --git a/src/generated/proto.cjs b/src/generated/proto.cjs deleted file mode 100644 index c4ca5ad8..00000000 --- a/src/generated/proto.cjs +++ /dev/null @@ -1,57784 +0,0 @@ -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("protobufjs/minimal")); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots["@neutron-org/neutron"] || ($protobuf.roots["@neutron-org/neutron"] = {}); - - $root.neutron = (function() { - - /** - * Namespace neutron. - * @exports neutron - * @namespace - */ - var neutron = {}; - - neutron.contractmanager = (function() { - - /** - * Namespace contractmanager. - * @memberof neutron - * @namespace - */ - var contractmanager = {}; - - contractmanager.Failure = (function() { - - /** - * Properties of a Failure. - * @memberof neutron.contractmanager - * @interface IFailure - * @property {string|null} [channel_id] Failure channel_id - * @property {string|null} [address] Failure address - * @property {Long|null} [id] Failure id - * @property {Long|null} [ack_id] Failure ack_id - * @property {string|null} [ack_type] Failure ack_type - */ - - /** - * Constructs a new Failure. - * @memberof neutron.contractmanager - * @classdesc Represents a Failure. - * @implements IFailure - * @constructor - * @param {neutron.contractmanager.IFailure=} [properties] Properties to set - */ - function Failure(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Failure channel_id. - * @member {string} channel_id - * @memberof neutron.contractmanager.Failure - * @instance - */ - Failure.prototype.channel_id = ""; - - /** - * Failure address. - * @member {string} address - * @memberof neutron.contractmanager.Failure - * @instance - */ - Failure.prototype.address = ""; - - /** - * Failure id. - * @member {Long} id - * @memberof neutron.contractmanager.Failure - * @instance - */ - Failure.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Failure ack_id. - * @member {Long} ack_id - * @memberof neutron.contractmanager.Failure - * @instance - */ - Failure.prototype.ack_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Failure ack_type. - * @member {string} ack_type - * @memberof neutron.contractmanager.Failure - * @instance - */ - Failure.prototype.ack_type = ""; - - /** - * Encodes the specified Failure message. Does not implicitly {@link neutron.contractmanager.Failure.verify|verify} messages. - * @function encode - * @memberof neutron.contractmanager.Failure - * @static - * @param {neutron.contractmanager.IFailure} message Failure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Failure.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.address); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.id); - if (message.ack_id != null && Object.hasOwnProperty.call(message, "ack_id")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.ack_id); - if (message.ack_type != null && Object.hasOwnProperty.call(message, "ack_type")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.ack_type); - return writer; - }; - - /** - * Encodes the specified Failure message, length delimited. Does not implicitly {@link neutron.contractmanager.Failure.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.contractmanager.Failure - * @static - * @param {neutron.contractmanager.IFailure} message Failure message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Failure.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Failure message from the specified reader or buffer. - * @function decode - * @memberof neutron.contractmanager.Failure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.contractmanager.Failure} Failure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Failure.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.contractmanager.Failure(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.address = reader.string(); - break; - case 3: - message.id = reader.uint64(); - break; - case 4: - message.ack_id = reader.uint64(); - break; - case 5: - message.ack_type = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Failure message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.contractmanager.Failure - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.contractmanager.Failure} Failure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Failure.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Failure message. - * @function verify - * @memberof neutron.contractmanager.Failure - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Failure.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) - return "id: integer|Long expected"; - if (message.ack_id != null && message.hasOwnProperty("ack_id")) - if (!$util.isInteger(message.ack_id) && !(message.ack_id && $util.isInteger(message.ack_id.low) && $util.isInteger(message.ack_id.high))) - return "ack_id: integer|Long expected"; - if (message.ack_type != null && message.hasOwnProperty("ack_type")) - if (!$util.isString(message.ack_type)) - return "ack_type: string expected"; - return null; - }; - - /** - * Creates a Failure message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.contractmanager.Failure - * @static - * @param {Object.} object Plain object - * @returns {neutron.contractmanager.Failure} Failure - */ - Failure.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.contractmanager.Failure) - return object; - var message = new $root.neutron.contractmanager.Failure(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.address != null) - message.address = String(object.address); - if (object.id != null) - if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = true; - else if (typeof object.id === "string") - message.id = parseInt(object.id, 10); - else if (typeof object.id === "number") - message.id = object.id; - else if (typeof object.id === "object") - message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); - if (object.ack_id != null) - if ($util.Long) - (message.ack_id = $util.Long.fromValue(object.ack_id)).unsigned = true; - else if (typeof object.ack_id === "string") - message.ack_id = parseInt(object.ack_id, 10); - else if (typeof object.ack_id === "number") - message.ack_id = object.ack_id; - else if (typeof object.ack_id === "object") - message.ack_id = new $util.LongBits(object.ack_id.low >>> 0, object.ack_id.high >>> 0).toNumber(true); - if (object.ack_type != null) - message.ack_type = String(object.ack_type); - return message; - }; - - /** - * Creates a plain object from a Failure message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.contractmanager.Failure - * @static - * @param {neutron.contractmanager.Failure} message Failure - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Failure.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.channel_id = ""; - object.address = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.id = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.ack_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.ack_id = options.longs === String ? "0" : 0; - object.ack_type = ""; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") - object.id = options.longs === String ? String(message.id) : message.id; - else - object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; - if (message.ack_id != null && message.hasOwnProperty("ack_id")) - if (typeof message.ack_id === "number") - object.ack_id = options.longs === String ? String(message.ack_id) : message.ack_id; - else - object.ack_id = options.longs === String ? $util.Long.prototype.toString.call(message.ack_id) : options.longs === Number ? new $util.LongBits(message.ack_id.low >>> 0, message.ack_id.high >>> 0).toNumber(true) : message.ack_id; - if (message.ack_type != null && message.hasOwnProperty("ack_type")) - object.ack_type = message.ack_type; - return object; - }; - - /** - * Converts this Failure to JSON. - * @function toJSON - * @memberof neutron.contractmanager.Failure - * @instance - * @returns {Object.} JSON object - */ - Failure.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Failure; - })(); - - contractmanager.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof neutron.contractmanager - * @interface IGenesisState - * @property {neutron.contractmanager.IParams|null} [params] GenesisState params - * @property {Array.|null} [failures_list] GenesisState failures_list - */ - - /** - * Constructs a new GenesisState. - * @memberof neutron.contractmanager - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {neutron.contractmanager.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.failures_list = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState params. - * @member {neutron.contractmanager.IParams|null|undefined} params - * @memberof neutron.contractmanager.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * GenesisState failures_list. - * @member {Array.} failures_list - * @memberof neutron.contractmanager.GenesisState - * @instance - */ - GenesisState.prototype.failures_list = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.contractmanager.GenesisState.verify|verify} messages. - * @function encode - * @memberof neutron.contractmanager.GenesisState - * @static - * @param {neutron.contractmanager.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.contractmanager.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.failures_list != null && message.failures_list.length) - for (var i = 0; i < message.failures_list.length; ++i) - $root.neutron.contractmanager.Failure.encode(message.failures_list[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.contractmanager.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.contractmanager.GenesisState - * @static - * @param {neutron.contractmanager.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof neutron.contractmanager.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.contractmanager.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.contractmanager.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.contractmanager.Params.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.failures_list && message.failures_list.length)) - message.failures_list = []; - message.failures_list.push($root.neutron.contractmanager.Failure.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.contractmanager.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.contractmanager.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof neutron.contractmanager.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.contractmanager.Params.verify(message.params); - if (error) - return "params." + error; - } - if (message.failures_list != null && message.hasOwnProperty("failures_list")) { - if (!Array.isArray(message.failures_list)) - return "failures_list: array expected"; - for (var i = 0; i < message.failures_list.length; ++i) { - var error = $root.neutron.contractmanager.Failure.verify(message.failures_list[i]); - if (error) - return "failures_list." + error; - } - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.contractmanager.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {neutron.contractmanager.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.contractmanager.GenesisState) - return object; - var message = new $root.neutron.contractmanager.GenesisState(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.contractmanager.GenesisState.params: object expected"); - message.params = $root.neutron.contractmanager.Params.fromObject(object.params); - } - if (object.failures_list) { - if (!Array.isArray(object.failures_list)) - throw TypeError(".neutron.contractmanager.GenesisState.failures_list: array expected"); - message.failures_list = []; - for (var i = 0; i < object.failures_list.length; ++i) { - if (typeof object.failures_list[i] !== "object") - throw TypeError(".neutron.contractmanager.GenesisState.failures_list: object expected"); - message.failures_list[i] = $root.neutron.contractmanager.Failure.fromObject(object.failures_list[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.contractmanager.GenesisState - * @static - * @param {neutron.contractmanager.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.failures_list = []; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.contractmanager.Params.toObject(message.params, options); - if (message.failures_list && message.failures_list.length) { - object.failures_list = []; - for (var j = 0; j < message.failures_list.length; ++j) - object.failures_list[j] = $root.neutron.contractmanager.Failure.toObject(message.failures_list[j], options); - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof neutron.contractmanager.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - contractmanager.Params = (function() { - - /** - * Properties of a Params. - * @memberof neutron.contractmanager - * @interface IParams - */ - - /** - * Constructs a new Params. - * @memberof neutron.contractmanager - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {neutron.contractmanager.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.contractmanager.Params.verify|verify} messages. - * @function encode - * @memberof neutron.contractmanager.Params - * @static - * @param {neutron.contractmanager.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.contractmanager.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.contractmanager.Params - * @static - * @param {neutron.contractmanager.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof neutron.contractmanager.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.contractmanager.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.contractmanager.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.contractmanager.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.contractmanager.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof neutron.contractmanager.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.contractmanager.Params - * @static - * @param {Object.} object Plain object - * @returns {neutron.contractmanager.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.contractmanager.Params) - return object; - return new $root.neutron.contractmanager.Params(); - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.contractmanager.Params - * @static - * @param {neutron.contractmanager.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof neutron.contractmanager.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - contractmanager.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof neutron.contractmanager - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link neutron.contractmanager.Query#params}. - * @memberof neutron.contractmanager.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.contractmanager.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof neutron.contractmanager.Query - * @instance - * @param {neutron.contractmanager.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {neutron.contractmanager.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.neutron.contractmanager.QueryParamsRequest, $root.neutron.contractmanager.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof neutron.contractmanager.Query - * @instance - * @param {neutron.contractmanager.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.contractmanager.Query#addressFailures}. - * @memberof neutron.contractmanager.Query - * @typedef AddressFailuresCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.contractmanager.QueryFailuresResponse} [response] QueryFailuresResponse - */ - - /** - * Calls AddressFailures. - * @function addressFailures - * @memberof neutron.contractmanager.Query - * @instance - * @param {neutron.contractmanager.IQueryFailuresRequest} request QueryFailuresRequest message or plain object - * @param {neutron.contractmanager.Query.AddressFailuresCallback} callback Node-style callback called with the error, if any, and QueryFailuresResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.addressFailures = function addressFailures(request, callback) { - return this.rpcCall(addressFailures, $root.neutron.contractmanager.QueryFailuresRequest, $root.neutron.contractmanager.QueryFailuresResponse, request, callback); - }, "name", { value: "AddressFailures" }); - - /** - * Calls AddressFailures. - * @function addressFailures - * @memberof neutron.contractmanager.Query - * @instance - * @param {neutron.contractmanager.IQueryFailuresRequest} request QueryFailuresRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.contractmanager.Query#failures}. - * @memberof neutron.contractmanager.Query - * @typedef FailuresCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.contractmanager.QueryFailuresResponse} [response] QueryFailuresResponse - */ - - /** - * Calls Failures. - * @function failures - * @memberof neutron.contractmanager.Query - * @instance - * @param {neutron.contractmanager.IQueryFailuresRequest} request QueryFailuresRequest message or plain object - * @param {neutron.contractmanager.Query.FailuresCallback} callback Node-style callback called with the error, if any, and QueryFailuresResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.failures = function failures(request, callback) { - return this.rpcCall(failures, $root.neutron.contractmanager.QueryFailuresRequest, $root.neutron.contractmanager.QueryFailuresResponse, request, callback); - }, "name", { value: "Failures" }); - - /** - * Calls Failures. - * @function failures - * @memberof neutron.contractmanager.Query - * @instance - * @param {neutron.contractmanager.IQueryFailuresRequest} request QueryFailuresRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - contractmanager.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof neutron.contractmanager - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof neutron.contractmanager - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {neutron.contractmanager.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.contractmanager.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof neutron.contractmanager.QueryParamsRequest - * @static - * @param {neutron.contractmanager.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.contractmanager.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.contractmanager.QueryParamsRequest - * @static - * @param {neutron.contractmanager.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.contractmanager.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.contractmanager.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.contractmanager.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.contractmanager.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.contractmanager.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof neutron.contractmanager.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.contractmanager.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.contractmanager.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.contractmanager.QueryParamsRequest) - return object; - return new $root.neutron.contractmanager.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.contractmanager.QueryParamsRequest - * @static - * @param {neutron.contractmanager.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof neutron.contractmanager.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - contractmanager.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof neutron.contractmanager - * @interface IQueryParamsResponse - * @property {neutron.contractmanager.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof neutron.contractmanager - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {neutron.contractmanager.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {neutron.contractmanager.IParams|null|undefined} params - * @memberof neutron.contractmanager.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.contractmanager.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof neutron.contractmanager.QueryParamsResponse - * @static - * @param {neutron.contractmanager.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.contractmanager.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.contractmanager.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.contractmanager.QueryParamsResponse - * @static - * @param {neutron.contractmanager.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.contractmanager.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.contractmanager.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.contractmanager.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.contractmanager.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.contractmanager.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.contractmanager.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof neutron.contractmanager.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.contractmanager.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.contractmanager.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.contractmanager.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.contractmanager.QueryParamsResponse) - return object; - var message = new $root.neutron.contractmanager.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.contractmanager.QueryParamsResponse.params: object expected"); - message.params = $root.neutron.contractmanager.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.contractmanager.QueryParamsResponse - * @static - * @param {neutron.contractmanager.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.contractmanager.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof neutron.contractmanager.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - contractmanager.QueryFailuresRequest = (function() { - - /** - * Properties of a QueryFailuresRequest. - * @memberof neutron.contractmanager - * @interface IQueryFailuresRequest - * @property {string|null} [address] QueryFailuresRequest address - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryFailuresRequest pagination - */ - - /** - * Constructs a new QueryFailuresRequest. - * @memberof neutron.contractmanager - * @classdesc Represents a QueryFailuresRequest. - * @implements IQueryFailuresRequest - * @constructor - * @param {neutron.contractmanager.IQueryFailuresRequest=} [properties] Properties to set - */ - function QueryFailuresRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFailuresRequest address. - * @member {string} address - * @memberof neutron.contractmanager.QueryFailuresRequest - * @instance - */ - QueryFailuresRequest.prototype.address = ""; - - /** - * QueryFailuresRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof neutron.contractmanager.QueryFailuresRequest - * @instance - */ - QueryFailuresRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryFailuresRequest message. Does not implicitly {@link neutron.contractmanager.QueryFailuresRequest.verify|verify} messages. - * @function encode - * @memberof neutron.contractmanager.QueryFailuresRequest - * @static - * @param {neutron.contractmanager.IQueryFailuresRequest} message QueryFailuresRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFailuresRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryFailuresRequest message, length delimited. Does not implicitly {@link neutron.contractmanager.QueryFailuresRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.contractmanager.QueryFailuresRequest - * @static - * @param {neutron.contractmanager.IQueryFailuresRequest} message QueryFailuresRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFailuresRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFailuresRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.contractmanager.QueryFailuresRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.contractmanager.QueryFailuresRequest} QueryFailuresRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFailuresRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.contractmanager.QueryFailuresRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFailuresRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.contractmanager.QueryFailuresRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.contractmanager.QueryFailuresRequest} QueryFailuresRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFailuresRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFailuresRequest message. - * @function verify - * @memberof neutron.contractmanager.QueryFailuresRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFailuresRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryFailuresRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.contractmanager.QueryFailuresRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.contractmanager.QueryFailuresRequest} QueryFailuresRequest - */ - QueryFailuresRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.contractmanager.QueryFailuresRequest) - return object; - var message = new $root.neutron.contractmanager.QueryFailuresRequest(); - if (object.address != null) - message.address = String(object.address); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".neutron.contractmanager.QueryFailuresRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryFailuresRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.contractmanager.QueryFailuresRequest - * @static - * @param {neutron.contractmanager.QueryFailuresRequest} message QueryFailuresRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFailuresRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.address = ""; - object.pagination = null; - } - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryFailuresRequest to JSON. - * @function toJSON - * @memberof neutron.contractmanager.QueryFailuresRequest - * @instance - * @returns {Object.} JSON object - */ - QueryFailuresRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFailuresRequest; - })(); - - contractmanager.QueryFailuresResponse = (function() { - - /** - * Properties of a QueryFailuresResponse. - * @memberof neutron.contractmanager - * @interface IQueryFailuresResponse - * @property {Array.|null} [failures] QueryFailuresResponse failures - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryFailuresResponse pagination - */ - - /** - * Constructs a new QueryFailuresResponse. - * @memberof neutron.contractmanager - * @classdesc Represents a QueryFailuresResponse. - * @implements IQueryFailuresResponse - * @constructor - * @param {neutron.contractmanager.IQueryFailuresResponse=} [properties] Properties to set - */ - function QueryFailuresResponse(properties) { - this.failures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryFailuresResponse failures. - * @member {Array.} failures - * @memberof neutron.contractmanager.QueryFailuresResponse - * @instance - */ - QueryFailuresResponse.prototype.failures = $util.emptyArray; - - /** - * QueryFailuresResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof neutron.contractmanager.QueryFailuresResponse - * @instance - */ - QueryFailuresResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryFailuresResponse message. Does not implicitly {@link neutron.contractmanager.QueryFailuresResponse.verify|verify} messages. - * @function encode - * @memberof neutron.contractmanager.QueryFailuresResponse - * @static - * @param {neutron.contractmanager.IQueryFailuresResponse} message QueryFailuresResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFailuresResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.failures != null && message.failures.length) - for (var i = 0; i < message.failures.length; ++i) - $root.neutron.contractmanager.Failure.encode(message.failures[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryFailuresResponse message, length delimited. Does not implicitly {@link neutron.contractmanager.QueryFailuresResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.contractmanager.QueryFailuresResponse - * @static - * @param {neutron.contractmanager.IQueryFailuresResponse} message QueryFailuresResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryFailuresResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryFailuresResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.contractmanager.QueryFailuresResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.contractmanager.QueryFailuresResponse} QueryFailuresResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFailuresResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.contractmanager.QueryFailuresResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.failures && message.failures.length)) - message.failures = []; - message.failures.push($root.neutron.contractmanager.Failure.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryFailuresResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.contractmanager.QueryFailuresResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.contractmanager.QueryFailuresResponse} QueryFailuresResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryFailuresResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryFailuresResponse message. - * @function verify - * @memberof neutron.contractmanager.QueryFailuresResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryFailuresResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.failures != null && message.hasOwnProperty("failures")) { - if (!Array.isArray(message.failures)) - return "failures: array expected"; - for (var i = 0; i < message.failures.length; ++i) { - var error = $root.neutron.contractmanager.Failure.verify(message.failures[i]); - if (error) - return "failures." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryFailuresResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.contractmanager.QueryFailuresResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.contractmanager.QueryFailuresResponse} QueryFailuresResponse - */ - QueryFailuresResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.contractmanager.QueryFailuresResponse) - return object; - var message = new $root.neutron.contractmanager.QueryFailuresResponse(); - if (object.failures) { - if (!Array.isArray(object.failures)) - throw TypeError(".neutron.contractmanager.QueryFailuresResponse.failures: array expected"); - message.failures = []; - for (var i = 0; i < object.failures.length; ++i) { - if (typeof object.failures[i] !== "object") - throw TypeError(".neutron.contractmanager.QueryFailuresResponse.failures: object expected"); - message.failures[i] = $root.neutron.contractmanager.Failure.fromObject(object.failures[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".neutron.contractmanager.QueryFailuresResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryFailuresResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.contractmanager.QueryFailuresResponse - * @static - * @param {neutron.contractmanager.QueryFailuresResponse} message QueryFailuresResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryFailuresResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.failures = []; - if (options.defaults) - object.pagination = null; - if (message.failures && message.failures.length) { - object.failures = []; - for (var j = 0; j < message.failures.length; ++j) - object.failures[j] = $root.neutron.contractmanager.Failure.toObject(message.failures[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryFailuresResponse to JSON. - * @function toJSON - * @memberof neutron.contractmanager.QueryFailuresResponse - * @instance - * @returns {Object.} JSON object - */ - QueryFailuresResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryFailuresResponse; - })(); - - return contractmanager; - })(); - - neutron.cron = (function() { - - /** - * Namespace cron. - * @memberof neutron - * @namespace - */ - var cron = {}; - - cron.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof neutron.cron - * @interface IGenesisState - * @property {Array.|null} [scheduleList] GenesisState scheduleList - * @property {neutron.cron.IParams|null} [params] GenesisState params - */ - - /** - * Constructs a new GenesisState. - * @memberof neutron.cron - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {neutron.cron.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.scheduleList = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState scheduleList. - * @member {Array.} scheduleList - * @memberof neutron.cron.GenesisState - * @instance - */ - GenesisState.prototype.scheduleList = $util.emptyArray; - - /** - * GenesisState params. - * @member {neutron.cron.IParams|null|undefined} params - * @memberof neutron.cron.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.cron.GenesisState.verify|verify} messages. - * @function encode - * @memberof neutron.cron.GenesisState - * @static - * @param {neutron.cron.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.cron.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.scheduleList != null && message.scheduleList.length) - for (var i = 0; i < message.scheduleList.length; ++i) - $root.neutron.cron.Schedule.encode(message.scheduleList[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.cron.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.GenesisState - * @static - * @param {neutron.cron.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.scheduleList && message.scheduleList.length)) - message.scheduleList = []; - message.scheduleList.push($root.neutron.cron.Schedule.decode(reader, reader.uint32())); - break; - case 1: - message.params = $root.neutron.cron.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof neutron.cron.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scheduleList != null && message.hasOwnProperty("scheduleList")) { - if (!Array.isArray(message.scheduleList)) - return "scheduleList: array expected"; - for (var i = 0; i < message.scheduleList.length; ++i) { - var error = $root.neutron.cron.Schedule.verify(message.scheduleList[i]); - if (error) - return "scheduleList." + error; - } - } - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.cron.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.GenesisState) - return object; - var message = new $root.neutron.cron.GenesisState(); - if (object.scheduleList) { - if (!Array.isArray(object.scheduleList)) - throw TypeError(".neutron.cron.GenesisState.scheduleList: array expected"); - message.scheduleList = []; - for (var i = 0; i < object.scheduleList.length; ++i) { - if (typeof object.scheduleList[i] !== "object") - throw TypeError(".neutron.cron.GenesisState.scheduleList: object expected"); - message.scheduleList[i] = $root.neutron.cron.Schedule.fromObject(object.scheduleList[i]); - } - } - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.cron.GenesisState.params: object expected"); - message.params = $root.neutron.cron.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.GenesisState - * @static - * @param {neutron.cron.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scheduleList = []; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.cron.Params.toObject(message.params, options); - if (message.scheduleList && message.scheduleList.length) { - object.scheduleList = []; - for (var j = 0; j < message.scheduleList.length; ++j) - object.scheduleList[j] = $root.neutron.cron.Schedule.toObject(message.scheduleList[j], options); - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof neutron.cron.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - cron.Params = (function() { - - /** - * Properties of a Params. - * @memberof neutron.cron - * @interface IParams - * @property {string|null} [security_address] Params security_address - * @property {Long|null} [limit] Params limit - */ - - /** - * Constructs a new Params. - * @memberof neutron.cron - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {neutron.cron.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params security_address. - * @member {string} security_address - * @memberof neutron.cron.Params - * @instance - */ - Params.prototype.security_address = ""; - - /** - * Params limit. - * @member {Long} limit - * @memberof neutron.cron.Params - * @instance - */ - Params.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.cron.Params.verify|verify} messages. - * @function encode - * @memberof neutron.cron.Params - * @static - * @param {neutron.cron.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.security_address != null && Object.hasOwnProperty.call(message, "security_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.security_address); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.limit); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.cron.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.Params - * @static - * @param {neutron.cron.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.security_address = reader.string(); - break; - case 2: - message.limit = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof neutron.cron.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.security_address != null && message.hasOwnProperty("security_address")) - if (!$util.isString(message.security_address)) - return "security_address: string expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) - return "limit: integer|Long expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.Params - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.Params) - return object; - var message = new $root.neutron.cron.Params(); - if (object.security_address != null) - message.security_address = String(object.security_address); - if (object.limit != null) - if ($util.Long) - (message.limit = $util.Long.fromValue(object.limit)).unsigned = true; - else if (typeof object.limit === "string") - message.limit = parseInt(object.limit, 10); - else if (typeof object.limit === "number") - message.limit = object.limit; - else if (typeof object.limit === "object") - message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.Params - * @static - * @param {neutron.cron.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.security_address = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.limit = options.longs === String ? "0" : 0; - } - if (message.security_address != null && message.hasOwnProperty("security_address")) - object.security_address = message.security_address; - if (message.limit != null && message.hasOwnProperty("limit")) - if (typeof message.limit === "number") - object.limit = options.longs === String ? String(message.limit) : message.limit; - else - object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber(true) : message.limit; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof neutron.cron.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - cron.Schedule = (function() { - - /** - * Properties of a Schedule. - * @memberof neutron.cron - * @interface ISchedule - * @property {string|null} [name] Schedule name - * @property {Long|null} [period] Schedule period - * @property {Array.|null} [msgs] Schedule msgs - * @property {Long|null} [last_execute_height] Schedule last_execute_height - */ - - /** - * Constructs a new Schedule. - * @memberof neutron.cron - * @classdesc Represents a Schedule. - * @implements ISchedule - * @constructor - * @param {neutron.cron.ISchedule=} [properties] Properties to set - */ - function Schedule(properties) { - this.msgs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Schedule name. - * @member {string} name - * @memberof neutron.cron.Schedule - * @instance - */ - Schedule.prototype.name = ""; - - /** - * Schedule period. - * @member {Long} period - * @memberof neutron.cron.Schedule - * @instance - */ - Schedule.prototype.period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Schedule msgs. - * @member {Array.} msgs - * @memberof neutron.cron.Schedule - * @instance - */ - Schedule.prototype.msgs = $util.emptyArray; - - /** - * Schedule last_execute_height. - * @member {Long} last_execute_height - * @memberof neutron.cron.Schedule - * @instance - */ - Schedule.prototype.last_execute_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Schedule message. Does not implicitly {@link neutron.cron.Schedule.verify|verify} messages. - * @function encode - * @memberof neutron.cron.Schedule - * @static - * @param {neutron.cron.ISchedule} message Schedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.period != null && Object.hasOwnProperty.call(message, "period")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.period); - if (message.msgs != null && message.msgs.length) - for (var i = 0; i < message.msgs.length; ++i) - $root.neutron.cron.MsgExecuteContract.encode(message.msgs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.last_execute_height != null && Object.hasOwnProperty.call(message, "last_execute_height")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.last_execute_height); - return writer; - }; - - /** - * Encodes the specified Schedule message, length delimited. Does not implicitly {@link neutron.cron.Schedule.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.Schedule - * @static - * @param {neutron.cron.ISchedule} message Schedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Schedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Schedule message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.Schedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.Schedule} Schedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schedule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.Schedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.period = reader.uint64(); - break; - case 3: - if (!(message.msgs && message.msgs.length)) - message.msgs = []; - message.msgs.push($root.neutron.cron.MsgExecuteContract.decode(reader, reader.uint32())); - break; - case 4: - message.last_execute_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Schedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.Schedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.Schedule} Schedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Schedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Schedule message. - * @function verify - * @memberof neutron.cron.Schedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Schedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.period != null && message.hasOwnProperty("period")) - if (!$util.isInteger(message.period) && !(message.period && $util.isInteger(message.period.low) && $util.isInteger(message.period.high))) - return "period: integer|Long expected"; - if (message.msgs != null && message.hasOwnProperty("msgs")) { - if (!Array.isArray(message.msgs)) - return "msgs: array expected"; - for (var i = 0; i < message.msgs.length; ++i) { - var error = $root.neutron.cron.MsgExecuteContract.verify(message.msgs[i]); - if (error) - return "msgs." + error; - } - } - if (message.last_execute_height != null && message.hasOwnProperty("last_execute_height")) - if (!$util.isInteger(message.last_execute_height) && !(message.last_execute_height && $util.isInteger(message.last_execute_height.low) && $util.isInteger(message.last_execute_height.high))) - return "last_execute_height: integer|Long expected"; - return null; - }; - - /** - * Creates a Schedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.Schedule - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.Schedule} Schedule - */ - Schedule.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.Schedule) - return object; - var message = new $root.neutron.cron.Schedule(); - if (object.name != null) - message.name = String(object.name); - if (object.period != null) - if ($util.Long) - (message.period = $util.Long.fromValue(object.period)).unsigned = true; - else if (typeof object.period === "string") - message.period = parseInt(object.period, 10); - else if (typeof object.period === "number") - message.period = object.period; - else if (typeof object.period === "object") - message.period = new $util.LongBits(object.period.low >>> 0, object.period.high >>> 0).toNumber(true); - if (object.msgs) { - if (!Array.isArray(object.msgs)) - throw TypeError(".neutron.cron.Schedule.msgs: array expected"); - message.msgs = []; - for (var i = 0; i < object.msgs.length; ++i) { - if (typeof object.msgs[i] !== "object") - throw TypeError(".neutron.cron.Schedule.msgs: object expected"); - message.msgs[i] = $root.neutron.cron.MsgExecuteContract.fromObject(object.msgs[i]); - } - } - if (object.last_execute_height != null) - if ($util.Long) - (message.last_execute_height = $util.Long.fromValue(object.last_execute_height)).unsigned = true; - else if (typeof object.last_execute_height === "string") - message.last_execute_height = parseInt(object.last_execute_height, 10); - else if (typeof object.last_execute_height === "number") - message.last_execute_height = object.last_execute_height; - else if (typeof object.last_execute_height === "object") - message.last_execute_height = new $util.LongBits(object.last_execute_height.low >>> 0, object.last_execute_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Schedule message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.Schedule - * @static - * @param {neutron.cron.Schedule} message Schedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Schedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.msgs = []; - if (options.defaults) { - object.name = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.period = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.last_execute_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.last_execute_height = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.period != null && message.hasOwnProperty("period")) - if (typeof message.period === "number") - object.period = options.longs === String ? String(message.period) : message.period; - else - object.period = options.longs === String ? $util.Long.prototype.toString.call(message.period) : options.longs === Number ? new $util.LongBits(message.period.low >>> 0, message.period.high >>> 0).toNumber(true) : message.period; - if (message.msgs && message.msgs.length) { - object.msgs = []; - for (var j = 0; j < message.msgs.length; ++j) - object.msgs[j] = $root.neutron.cron.MsgExecuteContract.toObject(message.msgs[j], options); - } - if (message.last_execute_height != null && message.hasOwnProperty("last_execute_height")) - if (typeof message.last_execute_height === "number") - object.last_execute_height = options.longs === String ? String(message.last_execute_height) : message.last_execute_height; - else - object.last_execute_height = options.longs === String ? $util.Long.prototype.toString.call(message.last_execute_height) : options.longs === Number ? new $util.LongBits(message.last_execute_height.low >>> 0, message.last_execute_height.high >>> 0).toNumber(true) : message.last_execute_height; - return object; - }; - - /** - * Converts this Schedule to JSON. - * @function toJSON - * @memberof neutron.cron.Schedule - * @instance - * @returns {Object.} JSON object - */ - Schedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Schedule; - })(); - - cron.MsgExecuteContract = (function() { - - /** - * Properties of a MsgExecuteContract. - * @memberof neutron.cron - * @interface IMsgExecuteContract - * @property {string|null} [contract] MsgExecuteContract contract - * @property {string|null} [msg] MsgExecuteContract msg - */ - - /** - * Constructs a new MsgExecuteContract. - * @memberof neutron.cron - * @classdesc Represents a MsgExecuteContract. - * @implements IMsgExecuteContract - * @constructor - * @param {neutron.cron.IMsgExecuteContract=} [properties] Properties to set - */ - function MsgExecuteContract(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgExecuteContract contract. - * @member {string} contract - * @memberof neutron.cron.MsgExecuteContract - * @instance - */ - MsgExecuteContract.prototype.contract = ""; - - /** - * MsgExecuteContract msg. - * @member {string} msg - * @memberof neutron.cron.MsgExecuteContract - * @instance - */ - MsgExecuteContract.prototype.msg = ""; - - /** - * Encodes the specified MsgExecuteContract message. Does not implicitly {@link neutron.cron.MsgExecuteContract.verify|verify} messages. - * @function encode - * @memberof neutron.cron.MsgExecuteContract - * @static - * @param {neutron.cron.IMsgExecuteContract} message MsgExecuteContract message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgExecuteContract.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.contract != null && Object.hasOwnProperty.call(message, "contract")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.contract); - if (message.msg != null && Object.hasOwnProperty.call(message, "msg")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.msg); - return writer; - }; - - /** - * Encodes the specified MsgExecuteContract message, length delimited. Does not implicitly {@link neutron.cron.MsgExecuteContract.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.MsgExecuteContract - * @static - * @param {neutron.cron.IMsgExecuteContract} message MsgExecuteContract message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgExecuteContract.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgExecuteContract message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.MsgExecuteContract - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.MsgExecuteContract} MsgExecuteContract - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgExecuteContract.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.MsgExecuteContract(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.contract = reader.string(); - break; - case 2: - message.msg = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgExecuteContract message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.MsgExecuteContract - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.MsgExecuteContract} MsgExecuteContract - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgExecuteContract.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgExecuteContract message. - * @function verify - * @memberof neutron.cron.MsgExecuteContract - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgExecuteContract.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.contract != null && message.hasOwnProperty("contract")) - if (!$util.isString(message.contract)) - return "contract: string expected"; - if (message.msg != null && message.hasOwnProperty("msg")) - if (!$util.isString(message.msg)) - return "msg: string expected"; - return null; - }; - - /** - * Creates a MsgExecuteContract message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.MsgExecuteContract - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.MsgExecuteContract} MsgExecuteContract - */ - MsgExecuteContract.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.MsgExecuteContract) - return object; - var message = new $root.neutron.cron.MsgExecuteContract(); - if (object.contract != null) - message.contract = String(object.contract); - if (object.msg != null) - message.msg = String(object.msg); - return message; - }; - - /** - * Creates a plain object from a MsgExecuteContract message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.MsgExecuteContract - * @static - * @param {neutron.cron.MsgExecuteContract} message MsgExecuteContract - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgExecuteContract.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.contract = ""; - object.msg = ""; - } - if (message.contract != null && message.hasOwnProperty("contract")) - object.contract = message.contract; - if (message.msg != null && message.hasOwnProperty("msg")) - object.msg = message.msg; - return object; - }; - - /** - * Converts this MsgExecuteContract to JSON. - * @function toJSON - * @memberof neutron.cron.MsgExecuteContract - * @instance - * @returns {Object.} JSON object - */ - MsgExecuteContract.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgExecuteContract; - })(); - - cron.ScheduleCount = (function() { - - /** - * Properties of a ScheduleCount. - * @memberof neutron.cron - * @interface IScheduleCount - * @property {number|null} [count] ScheduleCount count - */ - - /** - * Constructs a new ScheduleCount. - * @memberof neutron.cron - * @classdesc Represents a ScheduleCount. - * @implements IScheduleCount - * @constructor - * @param {neutron.cron.IScheduleCount=} [properties] Properties to set - */ - function ScheduleCount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScheduleCount count. - * @member {number} count - * @memberof neutron.cron.ScheduleCount - * @instance - */ - ScheduleCount.prototype.count = 0; - - /** - * Encodes the specified ScheduleCount message. Does not implicitly {@link neutron.cron.ScheduleCount.verify|verify} messages. - * @function encode - * @memberof neutron.cron.ScheduleCount - * @static - * @param {neutron.cron.IScheduleCount} message ScheduleCount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScheduleCount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); - return writer; - }; - - /** - * Encodes the specified ScheduleCount message, length delimited. Does not implicitly {@link neutron.cron.ScheduleCount.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.ScheduleCount - * @static - * @param {neutron.cron.IScheduleCount} message ScheduleCount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScheduleCount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScheduleCount message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.ScheduleCount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.ScheduleCount} ScheduleCount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScheduleCount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.ScheduleCount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.count = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScheduleCount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.ScheduleCount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.ScheduleCount} ScheduleCount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScheduleCount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScheduleCount message. - * @function verify - * @memberof neutron.cron.ScheduleCount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScheduleCount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - return null; - }; - - /** - * Creates a ScheduleCount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.ScheduleCount - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.ScheduleCount} ScheduleCount - */ - ScheduleCount.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.ScheduleCount) - return object; - var message = new $root.neutron.cron.ScheduleCount(); - if (object.count != null) - message.count = object.count | 0; - return message; - }; - - /** - * Creates a plain object from a ScheduleCount message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.ScheduleCount - * @static - * @param {neutron.cron.ScheduleCount} message ScheduleCount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScheduleCount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.count = 0; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - return object; - }; - - /** - * Converts this ScheduleCount to JSON. - * @function toJSON - * @memberof neutron.cron.ScheduleCount - * @instance - * @returns {Object.} JSON object - */ - ScheduleCount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ScheduleCount; - })(); - - cron.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof neutron.cron - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - return Msg; - })(); - - cron.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof neutron.cron - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link neutron.cron.Query#params}. - * @memberof neutron.cron.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.cron.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof neutron.cron.Query - * @instance - * @param {neutron.cron.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {neutron.cron.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.neutron.cron.QueryParamsRequest, $root.neutron.cron.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof neutron.cron.Query - * @instance - * @param {neutron.cron.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.cron.Query#schedule}. - * @memberof neutron.cron.Query - * @typedef ScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.cron.QueryGetScheduleResponse} [response] QueryGetScheduleResponse - */ - - /** - * Calls Schedule. - * @function schedule - * @memberof neutron.cron.Query - * @instance - * @param {neutron.cron.IQueryGetScheduleRequest} request QueryGetScheduleRequest message or plain object - * @param {neutron.cron.Query.ScheduleCallback} callback Node-style callback called with the error, if any, and QueryGetScheduleResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.schedule = function schedule(request, callback) { - return this.rpcCall(schedule, $root.neutron.cron.QueryGetScheduleRequest, $root.neutron.cron.QueryGetScheduleResponse, request, callback); - }, "name", { value: "Schedule" }); - - /** - * Calls Schedule. - * @function schedule - * @memberof neutron.cron.Query - * @instance - * @param {neutron.cron.IQueryGetScheduleRequest} request QueryGetScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.cron.Query#schedules}. - * @memberof neutron.cron.Query - * @typedef SchedulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.cron.QuerySchedulesResponse} [response] QuerySchedulesResponse - */ - - /** - * Calls Schedules. - * @function schedules - * @memberof neutron.cron.Query - * @instance - * @param {neutron.cron.IQuerySchedulesRequest} request QuerySchedulesRequest message or plain object - * @param {neutron.cron.Query.SchedulesCallback} callback Node-style callback called with the error, if any, and QuerySchedulesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.schedules = function schedules(request, callback) { - return this.rpcCall(schedules, $root.neutron.cron.QuerySchedulesRequest, $root.neutron.cron.QuerySchedulesResponse, request, callback); - }, "name", { value: "Schedules" }); - - /** - * Calls Schedules. - * @function schedules - * @memberof neutron.cron.Query - * @instance - * @param {neutron.cron.IQuerySchedulesRequest} request QuerySchedulesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - cron.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof neutron.cron - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof neutron.cron - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {neutron.cron.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.cron.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof neutron.cron.QueryParamsRequest - * @static - * @param {neutron.cron.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.cron.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.QueryParamsRequest - * @static - * @param {neutron.cron.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof neutron.cron.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.QueryParamsRequest) - return object; - return new $root.neutron.cron.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.QueryParamsRequest - * @static - * @param {neutron.cron.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof neutron.cron.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - cron.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof neutron.cron - * @interface IQueryParamsResponse - * @property {neutron.cron.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof neutron.cron - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {neutron.cron.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {neutron.cron.IParams|null|undefined} params - * @memberof neutron.cron.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.cron.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof neutron.cron.QueryParamsResponse - * @static - * @param {neutron.cron.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.cron.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.cron.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.QueryParamsResponse - * @static - * @param {neutron.cron.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.cron.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof neutron.cron.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.cron.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.QueryParamsResponse) - return object; - var message = new $root.neutron.cron.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.cron.QueryParamsResponse.params: object expected"); - message.params = $root.neutron.cron.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.QueryParamsResponse - * @static - * @param {neutron.cron.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.cron.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof neutron.cron.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - cron.QueryGetScheduleRequest = (function() { - - /** - * Properties of a QueryGetScheduleRequest. - * @memberof neutron.cron - * @interface IQueryGetScheduleRequest - * @property {string|null} [name] QueryGetScheduleRequest name - */ - - /** - * Constructs a new QueryGetScheduleRequest. - * @memberof neutron.cron - * @classdesc Represents a QueryGetScheduleRequest. - * @implements IQueryGetScheduleRequest - * @constructor - * @param {neutron.cron.IQueryGetScheduleRequest=} [properties] Properties to set - */ - function QueryGetScheduleRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryGetScheduleRequest name. - * @member {string} name - * @memberof neutron.cron.QueryGetScheduleRequest - * @instance - */ - QueryGetScheduleRequest.prototype.name = ""; - - /** - * Encodes the specified QueryGetScheduleRequest message. Does not implicitly {@link neutron.cron.QueryGetScheduleRequest.verify|verify} messages. - * @function encode - * @memberof neutron.cron.QueryGetScheduleRequest - * @static - * @param {neutron.cron.IQueryGetScheduleRequest} message QueryGetScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryGetScheduleRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified QueryGetScheduleRequest message, length delimited. Does not implicitly {@link neutron.cron.QueryGetScheduleRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.QueryGetScheduleRequest - * @static - * @param {neutron.cron.IQueryGetScheduleRequest} message QueryGetScheduleRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryGetScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryGetScheduleRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.QueryGetScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.QueryGetScheduleRequest} QueryGetScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryGetScheduleRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.QueryGetScheduleRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryGetScheduleRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.QueryGetScheduleRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.QueryGetScheduleRequest} QueryGetScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryGetScheduleRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryGetScheduleRequest message. - * @function verify - * @memberof neutron.cron.QueryGetScheduleRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryGetScheduleRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a QueryGetScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.QueryGetScheduleRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.QueryGetScheduleRequest} QueryGetScheduleRequest - */ - QueryGetScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.QueryGetScheduleRequest) - return object; - var message = new $root.neutron.cron.QueryGetScheduleRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a QueryGetScheduleRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.QueryGetScheduleRequest - * @static - * @param {neutron.cron.QueryGetScheduleRequest} message QueryGetScheduleRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryGetScheduleRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this QueryGetScheduleRequest to JSON. - * @function toJSON - * @memberof neutron.cron.QueryGetScheduleRequest - * @instance - * @returns {Object.} JSON object - */ - QueryGetScheduleRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryGetScheduleRequest; - })(); - - cron.QueryGetScheduleResponse = (function() { - - /** - * Properties of a QueryGetScheduleResponse. - * @memberof neutron.cron - * @interface IQueryGetScheduleResponse - * @property {neutron.cron.ISchedule|null} [schedule] QueryGetScheduleResponse schedule - */ - - /** - * Constructs a new QueryGetScheduleResponse. - * @memberof neutron.cron - * @classdesc Represents a QueryGetScheduleResponse. - * @implements IQueryGetScheduleResponse - * @constructor - * @param {neutron.cron.IQueryGetScheduleResponse=} [properties] Properties to set - */ - function QueryGetScheduleResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryGetScheduleResponse schedule. - * @member {neutron.cron.ISchedule|null|undefined} schedule - * @memberof neutron.cron.QueryGetScheduleResponse - * @instance - */ - QueryGetScheduleResponse.prototype.schedule = null; - - /** - * Encodes the specified QueryGetScheduleResponse message. Does not implicitly {@link neutron.cron.QueryGetScheduleResponse.verify|verify} messages. - * @function encode - * @memberof neutron.cron.QueryGetScheduleResponse - * @static - * @param {neutron.cron.IQueryGetScheduleResponse} message QueryGetScheduleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryGetScheduleResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) - $root.neutron.cron.Schedule.encode(message.schedule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryGetScheduleResponse message, length delimited. Does not implicitly {@link neutron.cron.QueryGetScheduleResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.QueryGetScheduleResponse - * @static - * @param {neutron.cron.IQueryGetScheduleResponse} message QueryGetScheduleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryGetScheduleResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryGetScheduleResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.QueryGetScheduleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.QueryGetScheduleResponse} QueryGetScheduleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryGetScheduleResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.QueryGetScheduleResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.schedule = $root.neutron.cron.Schedule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryGetScheduleResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.QueryGetScheduleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.QueryGetScheduleResponse} QueryGetScheduleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryGetScheduleResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryGetScheduleResponse message. - * @function verify - * @memberof neutron.cron.QueryGetScheduleResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryGetScheduleResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.schedule != null && message.hasOwnProperty("schedule")) { - var error = $root.neutron.cron.Schedule.verify(message.schedule); - if (error) - return "schedule." + error; - } - return null; - }; - - /** - * Creates a QueryGetScheduleResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.QueryGetScheduleResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.QueryGetScheduleResponse} QueryGetScheduleResponse - */ - QueryGetScheduleResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.QueryGetScheduleResponse) - return object; - var message = new $root.neutron.cron.QueryGetScheduleResponse(); - if (object.schedule != null) { - if (typeof object.schedule !== "object") - throw TypeError(".neutron.cron.QueryGetScheduleResponse.schedule: object expected"); - message.schedule = $root.neutron.cron.Schedule.fromObject(object.schedule); - } - return message; - }; - - /** - * Creates a plain object from a QueryGetScheduleResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.QueryGetScheduleResponse - * @static - * @param {neutron.cron.QueryGetScheduleResponse} message QueryGetScheduleResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryGetScheduleResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.schedule = null; - if (message.schedule != null && message.hasOwnProperty("schedule")) - object.schedule = $root.neutron.cron.Schedule.toObject(message.schedule, options); - return object; - }; - - /** - * Converts this QueryGetScheduleResponse to JSON. - * @function toJSON - * @memberof neutron.cron.QueryGetScheduleResponse - * @instance - * @returns {Object.} JSON object - */ - QueryGetScheduleResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryGetScheduleResponse; - })(); - - cron.QuerySchedulesRequest = (function() { - - /** - * Properties of a QuerySchedulesRequest. - * @memberof neutron.cron - * @interface IQuerySchedulesRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QuerySchedulesRequest pagination - */ - - /** - * Constructs a new QuerySchedulesRequest. - * @memberof neutron.cron - * @classdesc Represents a QuerySchedulesRequest. - * @implements IQuerySchedulesRequest - * @constructor - * @param {neutron.cron.IQuerySchedulesRequest=} [properties] Properties to set - */ - function QuerySchedulesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QuerySchedulesRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof neutron.cron.QuerySchedulesRequest - * @instance - */ - QuerySchedulesRequest.prototype.pagination = null; - - /** - * Encodes the specified QuerySchedulesRequest message. Does not implicitly {@link neutron.cron.QuerySchedulesRequest.verify|verify} messages. - * @function encode - * @memberof neutron.cron.QuerySchedulesRequest - * @static - * @param {neutron.cron.IQuerySchedulesRequest} message QuerySchedulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuerySchedulesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QuerySchedulesRequest message, length delimited. Does not implicitly {@link neutron.cron.QuerySchedulesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.QuerySchedulesRequest - * @static - * @param {neutron.cron.IQuerySchedulesRequest} message QuerySchedulesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuerySchedulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuerySchedulesRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.QuerySchedulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.QuerySchedulesRequest} QuerySchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuerySchedulesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.QuerySchedulesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuerySchedulesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.QuerySchedulesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.QuerySchedulesRequest} QuerySchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuerySchedulesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuerySchedulesRequest message. - * @function verify - * @memberof neutron.cron.QuerySchedulesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuerySchedulesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QuerySchedulesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.QuerySchedulesRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.QuerySchedulesRequest} QuerySchedulesRequest - */ - QuerySchedulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.QuerySchedulesRequest) - return object; - var message = new $root.neutron.cron.QuerySchedulesRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".neutron.cron.QuerySchedulesRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QuerySchedulesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.QuerySchedulesRequest - * @static - * @param {neutron.cron.QuerySchedulesRequest} message QuerySchedulesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuerySchedulesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QuerySchedulesRequest to JSON. - * @function toJSON - * @memberof neutron.cron.QuerySchedulesRequest - * @instance - * @returns {Object.} JSON object - */ - QuerySchedulesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuerySchedulesRequest; - })(); - - cron.QuerySchedulesResponse = (function() { - - /** - * Properties of a QuerySchedulesResponse. - * @memberof neutron.cron - * @interface IQuerySchedulesResponse - * @property {Array.|null} [schedules] QuerySchedulesResponse schedules - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QuerySchedulesResponse pagination - */ - - /** - * Constructs a new QuerySchedulesResponse. - * @memberof neutron.cron - * @classdesc Represents a QuerySchedulesResponse. - * @implements IQuerySchedulesResponse - * @constructor - * @param {neutron.cron.IQuerySchedulesResponse=} [properties] Properties to set - */ - function QuerySchedulesResponse(properties) { - this.schedules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QuerySchedulesResponse schedules. - * @member {Array.} schedules - * @memberof neutron.cron.QuerySchedulesResponse - * @instance - */ - QuerySchedulesResponse.prototype.schedules = $util.emptyArray; - - /** - * QuerySchedulesResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof neutron.cron.QuerySchedulesResponse - * @instance - */ - QuerySchedulesResponse.prototype.pagination = null; - - /** - * Encodes the specified QuerySchedulesResponse message. Does not implicitly {@link neutron.cron.QuerySchedulesResponse.verify|verify} messages. - * @function encode - * @memberof neutron.cron.QuerySchedulesResponse - * @static - * @param {neutron.cron.IQuerySchedulesResponse} message QuerySchedulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuerySchedulesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.schedules != null && message.schedules.length) - for (var i = 0; i < message.schedules.length; ++i) - $root.neutron.cron.Schedule.encode(message.schedules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QuerySchedulesResponse message, length delimited. Does not implicitly {@link neutron.cron.QuerySchedulesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.cron.QuerySchedulesResponse - * @static - * @param {neutron.cron.IQuerySchedulesResponse} message QuerySchedulesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuerySchedulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuerySchedulesResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.cron.QuerySchedulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.cron.QuerySchedulesResponse} QuerySchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuerySchedulesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.cron.QuerySchedulesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.schedules && message.schedules.length)) - message.schedules = []; - message.schedules.push($root.neutron.cron.Schedule.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuerySchedulesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.cron.QuerySchedulesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.cron.QuerySchedulesResponse} QuerySchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuerySchedulesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuerySchedulesResponse message. - * @function verify - * @memberof neutron.cron.QuerySchedulesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuerySchedulesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.schedules != null && message.hasOwnProperty("schedules")) { - if (!Array.isArray(message.schedules)) - return "schedules: array expected"; - for (var i = 0; i < message.schedules.length; ++i) { - var error = $root.neutron.cron.Schedule.verify(message.schedules[i]); - if (error) - return "schedules." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QuerySchedulesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.cron.QuerySchedulesResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.cron.QuerySchedulesResponse} QuerySchedulesResponse - */ - QuerySchedulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.cron.QuerySchedulesResponse) - return object; - var message = new $root.neutron.cron.QuerySchedulesResponse(); - if (object.schedules) { - if (!Array.isArray(object.schedules)) - throw TypeError(".neutron.cron.QuerySchedulesResponse.schedules: array expected"); - message.schedules = []; - for (var i = 0; i < object.schedules.length; ++i) { - if (typeof object.schedules[i] !== "object") - throw TypeError(".neutron.cron.QuerySchedulesResponse.schedules: object expected"); - message.schedules[i] = $root.neutron.cron.Schedule.fromObject(object.schedules[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".neutron.cron.QuerySchedulesResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QuerySchedulesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.cron.QuerySchedulesResponse - * @static - * @param {neutron.cron.QuerySchedulesResponse} message QuerySchedulesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuerySchedulesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.schedules = []; - if (options.defaults) - object.pagination = null; - if (message.schedules && message.schedules.length) { - object.schedules = []; - for (var j = 0; j < message.schedules.length; ++j) - object.schedules[j] = $root.neutron.cron.Schedule.toObject(message.schedules[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QuerySchedulesResponse to JSON. - * @function toJSON - * @memberof neutron.cron.QuerySchedulesResponse - * @instance - * @returns {Object.} JSON object - */ - QuerySchedulesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuerySchedulesResponse; - })(); - - return cron; - })(); - - neutron.feeburner = (function() { - - /** - * Namespace feeburner. - * @memberof neutron - * @namespace - */ - var feeburner = {}; - - feeburner.TotalBurnedNeutronsAmount = (function() { - - /** - * Properties of a TotalBurnedNeutronsAmount. - * @memberof neutron.feeburner - * @interface ITotalBurnedNeutronsAmount - * @property {cosmos.base.v1beta1.ICoin|null} [coin] TotalBurnedNeutronsAmount coin - */ - - /** - * Constructs a new TotalBurnedNeutronsAmount. - * @memberof neutron.feeburner - * @classdesc Represents a TotalBurnedNeutronsAmount. - * @implements ITotalBurnedNeutronsAmount - * @constructor - * @param {neutron.feeburner.ITotalBurnedNeutronsAmount=} [properties] Properties to set - */ - function TotalBurnedNeutronsAmount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TotalBurnedNeutronsAmount coin. - * @member {cosmos.base.v1beta1.ICoin|null|undefined} coin - * @memberof neutron.feeburner.TotalBurnedNeutronsAmount - * @instance - */ - TotalBurnedNeutronsAmount.prototype.coin = null; - - /** - * Encodes the specified TotalBurnedNeutronsAmount message. Does not implicitly {@link neutron.feeburner.TotalBurnedNeutronsAmount.verify|verify} messages. - * @function encode - * @memberof neutron.feeburner.TotalBurnedNeutronsAmount - * @static - * @param {neutron.feeburner.ITotalBurnedNeutronsAmount} message TotalBurnedNeutronsAmount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TotalBurnedNeutronsAmount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.coin != null && Object.hasOwnProperty.call(message, "coin")) - $root.cosmos.base.v1beta1.Coin.encode(message.coin, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TotalBurnedNeutronsAmount message, length delimited. Does not implicitly {@link neutron.feeburner.TotalBurnedNeutronsAmount.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feeburner.TotalBurnedNeutronsAmount - * @static - * @param {neutron.feeburner.ITotalBurnedNeutronsAmount} message TotalBurnedNeutronsAmount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TotalBurnedNeutronsAmount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TotalBurnedNeutronsAmount message from the specified reader or buffer. - * @function decode - * @memberof neutron.feeburner.TotalBurnedNeutronsAmount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feeburner.TotalBurnedNeutronsAmount} TotalBurnedNeutronsAmount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TotalBurnedNeutronsAmount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feeburner.TotalBurnedNeutronsAmount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.coin = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TotalBurnedNeutronsAmount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feeburner.TotalBurnedNeutronsAmount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feeburner.TotalBurnedNeutronsAmount} TotalBurnedNeutronsAmount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TotalBurnedNeutronsAmount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TotalBurnedNeutronsAmount message. - * @function verify - * @memberof neutron.feeburner.TotalBurnedNeutronsAmount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TotalBurnedNeutronsAmount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.coin != null && message.hasOwnProperty("coin")) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.coin); - if (error) - return "coin." + error; - } - return null; - }; - - /** - * Creates a TotalBurnedNeutronsAmount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feeburner.TotalBurnedNeutronsAmount - * @static - * @param {Object.} object Plain object - * @returns {neutron.feeburner.TotalBurnedNeutronsAmount} TotalBurnedNeutronsAmount - */ - TotalBurnedNeutronsAmount.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feeburner.TotalBurnedNeutronsAmount) - return object; - var message = new $root.neutron.feeburner.TotalBurnedNeutronsAmount(); - if (object.coin != null) { - if (typeof object.coin !== "object") - throw TypeError(".neutron.feeburner.TotalBurnedNeutronsAmount.coin: object expected"); - message.coin = $root.cosmos.base.v1beta1.Coin.fromObject(object.coin); - } - return message; - }; - - /** - * Creates a plain object from a TotalBurnedNeutronsAmount message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feeburner.TotalBurnedNeutronsAmount - * @static - * @param {neutron.feeburner.TotalBurnedNeutronsAmount} message TotalBurnedNeutronsAmount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TotalBurnedNeutronsAmount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.coin = null; - if (message.coin != null && message.hasOwnProperty("coin")) - object.coin = $root.cosmos.base.v1beta1.Coin.toObject(message.coin, options); - return object; - }; - - /** - * Converts this TotalBurnedNeutronsAmount to JSON. - * @function toJSON - * @memberof neutron.feeburner.TotalBurnedNeutronsAmount - * @instance - * @returns {Object.} JSON object - */ - TotalBurnedNeutronsAmount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TotalBurnedNeutronsAmount; - })(); - - feeburner.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof neutron.feeburner - * @interface IGenesisState - * @property {neutron.feeburner.IParams|null} [params] GenesisState params - * @property {neutron.feeburner.ITotalBurnedNeutronsAmount|null} [total_burned_neutrons_amount] GenesisState total_burned_neutrons_amount - */ - - /** - * Constructs a new GenesisState. - * @memberof neutron.feeburner - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {neutron.feeburner.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState params. - * @member {neutron.feeburner.IParams|null|undefined} params - * @memberof neutron.feeburner.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * GenesisState total_burned_neutrons_amount. - * @member {neutron.feeburner.ITotalBurnedNeutronsAmount|null|undefined} total_burned_neutrons_amount - * @memberof neutron.feeburner.GenesisState - * @instance - */ - GenesisState.prototype.total_burned_neutrons_amount = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.feeburner.GenesisState.verify|verify} messages. - * @function encode - * @memberof neutron.feeburner.GenesisState - * @static - * @param {neutron.feeburner.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.feeburner.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.total_burned_neutrons_amount != null && Object.hasOwnProperty.call(message, "total_burned_neutrons_amount")) - $root.neutron.feeburner.TotalBurnedNeutronsAmount.encode(message.total_burned_neutrons_amount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.feeburner.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feeburner.GenesisState - * @static - * @param {neutron.feeburner.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof neutron.feeburner.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feeburner.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feeburner.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.feeburner.Params.decode(reader, reader.uint32()); - break; - case 2: - message.total_burned_neutrons_amount = $root.neutron.feeburner.TotalBurnedNeutronsAmount.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feeburner.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feeburner.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof neutron.feeburner.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.feeburner.Params.verify(message.params); - if (error) - return "params." + error; - } - if (message.total_burned_neutrons_amount != null && message.hasOwnProperty("total_burned_neutrons_amount")) { - var error = $root.neutron.feeburner.TotalBurnedNeutronsAmount.verify(message.total_burned_neutrons_amount); - if (error) - return "total_burned_neutrons_amount." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feeburner.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {neutron.feeburner.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feeburner.GenesisState) - return object; - var message = new $root.neutron.feeburner.GenesisState(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.feeburner.GenesisState.params: object expected"); - message.params = $root.neutron.feeburner.Params.fromObject(object.params); - } - if (object.total_burned_neutrons_amount != null) { - if (typeof object.total_burned_neutrons_amount !== "object") - throw TypeError(".neutron.feeburner.GenesisState.total_burned_neutrons_amount: object expected"); - message.total_burned_neutrons_amount = $root.neutron.feeburner.TotalBurnedNeutronsAmount.fromObject(object.total_burned_neutrons_amount); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feeburner.GenesisState - * @static - * @param {neutron.feeburner.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.params = null; - object.total_burned_neutrons_amount = null; - } - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.feeburner.Params.toObject(message.params, options); - if (message.total_burned_neutrons_amount != null && message.hasOwnProperty("total_burned_neutrons_amount")) - object.total_burned_neutrons_amount = $root.neutron.feeburner.TotalBurnedNeutronsAmount.toObject(message.total_burned_neutrons_amount, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof neutron.feeburner.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - feeburner.Params = (function() { - - /** - * Properties of a Params. - * @memberof neutron.feeburner - * @interface IParams - * @property {string|null} [neutron_denom] Params neutron_denom - * @property {string|null} [reserve_address] Params reserve_address - * @property {string|null} [treasury_address] Params treasury_address - */ - - /** - * Constructs a new Params. - * @memberof neutron.feeburner - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {neutron.feeburner.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params neutron_denom. - * @member {string} neutron_denom - * @memberof neutron.feeburner.Params - * @instance - */ - Params.prototype.neutron_denom = ""; - - /** - * Params reserve_address. - * @member {string} reserve_address - * @memberof neutron.feeburner.Params - * @instance - */ - Params.prototype.reserve_address = ""; - - /** - * Params treasury_address. - * @member {string} treasury_address - * @memberof neutron.feeburner.Params - * @instance - */ - Params.prototype.treasury_address = ""; - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.feeburner.Params.verify|verify} messages. - * @function encode - * @memberof neutron.feeburner.Params - * @static - * @param {neutron.feeburner.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.neutron_denom != null && Object.hasOwnProperty.call(message, "neutron_denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.neutron_denom); - if (message.reserve_address != null && Object.hasOwnProperty.call(message, "reserve_address")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.reserve_address); - if (message.treasury_address != null && Object.hasOwnProperty.call(message, "treasury_address")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.treasury_address); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.feeburner.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feeburner.Params - * @static - * @param {neutron.feeburner.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof neutron.feeburner.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feeburner.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feeburner.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.neutron_denom = reader.string(); - break; - case 2: - message.reserve_address = reader.string(); - break; - case 3: - message.treasury_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feeburner.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feeburner.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof neutron.feeburner.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.neutron_denom != null && message.hasOwnProperty("neutron_denom")) - if (!$util.isString(message.neutron_denom)) - return "neutron_denom: string expected"; - if (message.reserve_address != null && message.hasOwnProperty("reserve_address")) - if (!$util.isString(message.reserve_address)) - return "reserve_address: string expected"; - if (message.treasury_address != null && message.hasOwnProperty("treasury_address")) - if (!$util.isString(message.treasury_address)) - return "treasury_address: string expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feeburner.Params - * @static - * @param {Object.} object Plain object - * @returns {neutron.feeburner.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feeburner.Params) - return object; - var message = new $root.neutron.feeburner.Params(); - if (object.neutron_denom != null) - message.neutron_denom = String(object.neutron_denom); - if (object.reserve_address != null) - message.reserve_address = String(object.reserve_address); - if (object.treasury_address != null) - message.treasury_address = String(object.treasury_address); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feeburner.Params - * @static - * @param {neutron.feeburner.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.neutron_denom = ""; - object.reserve_address = ""; - object.treasury_address = ""; - } - if (message.neutron_denom != null && message.hasOwnProperty("neutron_denom")) - object.neutron_denom = message.neutron_denom; - if (message.reserve_address != null && message.hasOwnProperty("reserve_address")) - object.reserve_address = message.reserve_address; - if (message.treasury_address != null && message.hasOwnProperty("treasury_address")) - object.treasury_address = message.treasury_address; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof neutron.feeburner.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - feeburner.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof neutron.feeburner - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link neutron.feeburner.Query#params}. - * @memberof neutron.feeburner.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.feeburner.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof neutron.feeburner.Query - * @instance - * @param {neutron.feeburner.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {neutron.feeburner.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.neutron.feeburner.QueryParamsRequest, $root.neutron.feeburner.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof neutron.feeburner.Query - * @instance - * @param {neutron.feeburner.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.feeburner.Query#totalBurnedNeutronsAmount}. - * @memberof neutron.feeburner.Query - * @typedef TotalBurnedNeutronsAmountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse} [response] QueryTotalBurnedNeutronsAmountResponse - */ - - /** - * Calls TotalBurnedNeutronsAmount. - * @function totalBurnedNeutronsAmount - * @memberof neutron.feeburner.Query - * @instance - * @param {neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest} request QueryTotalBurnedNeutronsAmountRequest message or plain object - * @param {neutron.feeburner.Query.TotalBurnedNeutronsAmountCallback} callback Node-style callback called with the error, if any, and QueryTotalBurnedNeutronsAmountResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.totalBurnedNeutronsAmount = function totalBurnedNeutronsAmount(request, callback) { - return this.rpcCall(totalBurnedNeutronsAmount, $root.neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest, $root.neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse, request, callback); - }, "name", { value: "TotalBurnedNeutronsAmount" }); - - /** - * Calls TotalBurnedNeutronsAmount. - * @function totalBurnedNeutronsAmount - * @memberof neutron.feeburner.Query - * @instance - * @param {neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest} request QueryTotalBurnedNeutronsAmountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - feeburner.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof neutron.feeburner - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof neutron.feeburner - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {neutron.feeburner.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.feeburner.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof neutron.feeburner.QueryParamsRequest - * @static - * @param {neutron.feeburner.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.feeburner.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feeburner.QueryParamsRequest - * @static - * @param {neutron.feeburner.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.feeburner.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feeburner.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feeburner.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feeburner.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feeburner.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof neutron.feeburner.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feeburner.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.feeburner.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feeburner.QueryParamsRequest) - return object; - return new $root.neutron.feeburner.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feeburner.QueryParamsRequest - * @static - * @param {neutron.feeburner.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof neutron.feeburner.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - feeburner.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof neutron.feeburner - * @interface IQueryParamsResponse - * @property {neutron.feeburner.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof neutron.feeburner - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {neutron.feeburner.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {neutron.feeburner.IParams|null|undefined} params - * @memberof neutron.feeburner.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.feeburner.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof neutron.feeburner.QueryParamsResponse - * @static - * @param {neutron.feeburner.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.feeburner.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.feeburner.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feeburner.QueryParamsResponse - * @static - * @param {neutron.feeburner.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.feeburner.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feeburner.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feeburner.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.feeburner.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feeburner.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feeburner.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof neutron.feeburner.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.feeburner.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feeburner.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.feeburner.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feeburner.QueryParamsResponse) - return object; - var message = new $root.neutron.feeburner.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.feeburner.QueryParamsResponse.params: object expected"); - message.params = $root.neutron.feeburner.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feeburner.QueryParamsResponse - * @static - * @param {neutron.feeburner.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.feeburner.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof neutron.feeburner.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - feeburner.QueryTotalBurnedNeutronsAmountRequest = (function() { - - /** - * Properties of a QueryTotalBurnedNeutronsAmountRequest. - * @memberof neutron.feeburner - * @interface IQueryTotalBurnedNeutronsAmountRequest - */ - - /** - * Constructs a new QueryTotalBurnedNeutronsAmountRequest. - * @memberof neutron.feeburner - * @classdesc Represents a QueryTotalBurnedNeutronsAmountRequest. - * @implements IQueryTotalBurnedNeutronsAmountRequest - * @constructor - * @param {neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest=} [properties] Properties to set - */ - function QueryTotalBurnedNeutronsAmountRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryTotalBurnedNeutronsAmountRequest message. Does not implicitly {@link neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest.verify|verify} messages. - * @function encode - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest - * @static - * @param {neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest} message QueryTotalBurnedNeutronsAmountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalBurnedNeutronsAmountRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryTotalBurnedNeutronsAmountRequest message, length delimited. Does not implicitly {@link neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest - * @static - * @param {neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest} message QueryTotalBurnedNeutronsAmountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalBurnedNeutronsAmountRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalBurnedNeutronsAmountRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest} QueryTotalBurnedNeutronsAmountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalBurnedNeutronsAmountRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalBurnedNeutronsAmountRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest} QueryTotalBurnedNeutronsAmountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalBurnedNeutronsAmountRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalBurnedNeutronsAmountRequest message. - * @function verify - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalBurnedNeutronsAmountRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryTotalBurnedNeutronsAmountRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest} QueryTotalBurnedNeutronsAmountRequest - */ - QueryTotalBurnedNeutronsAmountRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest) - return object; - return new $root.neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest(); - }; - - /** - * Creates a plain object from a QueryTotalBurnedNeutronsAmountRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest - * @static - * @param {neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest} message QueryTotalBurnedNeutronsAmountRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalBurnedNeutronsAmountRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryTotalBurnedNeutronsAmountRequest to JSON. - * @function toJSON - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest - * @instance - * @returns {Object.} JSON object - */ - QueryTotalBurnedNeutronsAmountRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalBurnedNeutronsAmountRequest; - })(); - - feeburner.QueryTotalBurnedNeutronsAmountResponse = (function() { - - /** - * Properties of a QueryTotalBurnedNeutronsAmountResponse. - * @memberof neutron.feeburner - * @interface IQueryTotalBurnedNeutronsAmountResponse - * @property {neutron.feeburner.ITotalBurnedNeutronsAmount|null} [total_burned_neutrons_amount] QueryTotalBurnedNeutronsAmountResponse total_burned_neutrons_amount - */ - - /** - * Constructs a new QueryTotalBurnedNeutronsAmountResponse. - * @memberof neutron.feeburner - * @classdesc Represents a QueryTotalBurnedNeutronsAmountResponse. - * @implements IQueryTotalBurnedNeutronsAmountResponse - * @constructor - * @param {neutron.feeburner.IQueryTotalBurnedNeutronsAmountResponse=} [properties] Properties to set - */ - function QueryTotalBurnedNeutronsAmountResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryTotalBurnedNeutronsAmountResponse total_burned_neutrons_amount. - * @member {neutron.feeburner.ITotalBurnedNeutronsAmount|null|undefined} total_burned_neutrons_amount - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse - * @instance - */ - QueryTotalBurnedNeutronsAmountResponse.prototype.total_burned_neutrons_amount = null; - - /** - * Encodes the specified QueryTotalBurnedNeutronsAmountResponse message. Does not implicitly {@link neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse.verify|verify} messages. - * @function encode - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse - * @static - * @param {neutron.feeburner.IQueryTotalBurnedNeutronsAmountResponse} message QueryTotalBurnedNeutronsAmountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalBurnedNeutronsAmountResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.total_burned_neutrons_amount != null && Object.hasOwnProperty.call(message, "total_burned_neutrons_amount")) - $root.neutron.feeburner.TotalBurnedNeutronsAmount.encode(message.total_burned_neutrons_amount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryTotalBurnedNeutronsAmountResponse message, length delimited. Does not implicitly {@link neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse - * @static - * @param {neutron.feeburner.IQueryTotalBurnedNeutronsAmountResponse} message QueryTotalBurnedNeutronsAmountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryTotalBurnedNeutronsAmountResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryTotalBurnedNeutronsAmountResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse} QueryTotalBurnedNeutronsAmountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalBurnedNeutronsAmountResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total_burned_neutrons_amount = $root.neutron.feeburner.TotalBurnedNeutronsAmount.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryTotalBurnedNeutronsAmountResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse} QueryTotalBurnedNeutronsAmountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryTotalBurnedNeutronsAmountResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryTotalBurnedNeutronsAmountResponse message. - * @function verify - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryTotalBurnedNeutronsAmountResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.total_burned_neutrons_amount != null && message.hasOwnProperty("total_burned_neutrons_amount")) { - var error = $root.neutron.feeburner.TotalBurnedNeutronsAmount.verify(message.total_burned_neutrons_amount); - if (error) - return "total_burned_neutrons_amount." + error; - } - return null; - }; - - /** - * Creates a QueryTotalBurnedNeutronsAmountResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse} QueryTotalBurnedNeutronsAmountResponse - */ - QueryTotalBurnedNeutronsAmountResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse) - return object; - var message = new $root.neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse(); - if (object.total_burned_neutrons_amount != null) { - if (typeof object.total_burned_neutrons_amount !== "object") - throw TypeError(".neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse.total_burned_neutrons_amount: object expected"); - message.total_burned_neutrons_amount = $root.neutron.feeburner.TotalBurnedNeutronsAmount.fromObject(object.total_burned_neutrons_amount); - } - return message; - }; - - /** - * Creates a plain object from a QueryTotalBurnedNeutronsAmountResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse - * @static - * @param {neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse} message QueryTotalBurnedNeutronsAmountResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryTotalBurnedNeutronsAmountResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.total_burned_neutrons_amount = null; - if (message.total_burned_neutrons_amount != null && message.hasOwnProperty("total_burned_neutrons_amount")) - object.total_burned_neutrons_amount = $root.neutron.feeburner.TotalBurnedNeutronsAmount.toObject(message.total_burned_neutrons_amount, options); - return object; - }; - - /** - * Converts this QueryTotalBurnedNeutronsAmountResponse to JSON. - * @function toJSON - * @memberof neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse - * @instance - * @returns {Object.} JSON object - */ - QueryTotalBurnedNeutronsAmountResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryTotalBurnedNeutronsAmountResponse; - })(); - - return feeburner; - })(); - - neutron.feerefunder = (function() { - - /** - * Namespace feerefunder. - * @memberof neutron - * @namespace - */ - var feerefunder = {}; - - feerefunder.Fee = (function() { - - /** - * Properties of a Fee. - * @memberof neutron.feerefunder - * @interface IFee - * @property {Array.|null} [recv_fee] Fee recv_fee - * @property {Array.|null} [ack_fee] Fee ack_fee - * @property {Array.|null} [timeout_fee] Fee timeout_fee - */ - - /** - * Constructs a new Fee. - * @memberof neutron.feerefunder - * @classdesc Represents a Fee. - * @implements IFee - * @constructor - * @param {neutron.feerefunder.IFee=} [properties] Properties to set - */ - function Fee(properties) { - this.recv_fee = []; - this.ack_fee = []; - this.timeout_fee = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Fee recv_fee. - * @member {Array.} recv_fee - * @memberof neutron.feerefunder.Fee - * @instance - */ - Fee.prototype.recv_fee = $util.emptyArray; - - /** - * Fee ack_fee. - * @member {Array.} ack_fee - * @memberof neutron.feerefunder.Fee - * @instance - */ - Fee.prototype.ack_fee = $util.emptyArray; - - /** - * Fee timeout_fee. - * @member {Array.} timeout_fee - * @memberof neutron.feerefunder.Fee - * @instance - */ - Fee.prototype.timeout_fee = $util.emptyArray; - - /** - * Encodes the specified Fee message. Does not implicitly {@link neutron.feerefunder.Fee.verify|verify} messages. - * @function encode - * @memberof neutron.feerefunder.Fee - * @static - * @param {neutron.feerefunder.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recv_fee != null && message.recv_fee.length) - for (var i = 0; i < message.recv_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.recv_fee[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.ack_fee != null && message.ack_fee.length) - for (var i = 0; i < message.ack_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.ack_fee[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.timeout_fee != null && message.timeout_fee.length) - for (var i = 0; i < message.timeout_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.timeout_fee[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link neutron.feerefunder.Fee.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feerefunder.Fee - * @static - * @param {neutron.feerefunder.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @function decode - * @memberof neutron.feerefunder.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feerefunder.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feerefunder.Fee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.recv_fee && message.recv_fee.length)) - message.recv_fee = []; - message.recv_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.ack_fee && message.ack_fee.length)) - message.ack_fee = []; - message.ack_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.timeout_fee && message.timeout_fee.length)) - message.timeout_fee = []; - message.timeout_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feerefunder.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feerefunder.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Fee message. - * @function verify - * @memberof neutron.feerefunder.Fee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Fee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recv_fee != null && message.hasOwnProperty("recv_fee")) { - if (!Array.isArray(message.recv_fee)) - return "recv_fee: array expected"; - for (var i = 0; i < message.recv_fee.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.recv_fee[i]); - if (error) - return "recv_fee." + error; - } - } - if (message.ack_fee != null && message.hasOwnProperty("ack_fee")) { - if (!Array.isArray(message.ack_fee)) - return "ack_fee: array expected"; - for (var i = 0; i < message.ack_fee.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.ack_fee[i]); - if (error) - return "ack_fee." + error; - } - } - if (message.timeout_fee != null && message.hasOwnProperty("timeout_fee")) { - if (!Array.isArray(message.timeout_fee)) - return "timeout_fee: array expected"; - for (var i = 0; i < message.timeout_fee.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.timeout_fee[i]); - if (error) - return "timeout_fee." + error; - } - } - return null; - }; - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feerefunder.Fee - * @static - * @param {Object.} object Plain object - * @returns {neutron.feerefunder.Fee} Fee - */ - Fee.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feerefunder.Fee) - return object; - var message = new $root.neutron.feerefunder.Fee(); - if (object.recv_fee) { - if (!Array.isArray(object.recv_fee)) - throw TypeError(".neutron.feerefunder.Fee.recv_fee: array expected"); - message.recv_fee = []; - for (var i = 0; i < object.recv_fee.length; ++i) { - if (typeof object.recv_fee[i] !== "object") - throw TypeError(".neutron.feerefunder.Fee.recv_fee: object expected"); - message.recv_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.recv_fee[i]); - } - } - if (object.ack_fee) { - if (!Array.isArray(object.ack_fee)) - throw TypeError(".neutron.feerefunder.Fee.ack_fee: array expected"); - message.ack_fee = []; - for (var i = 0; i < object.ack_fee.length; ++i) { - if (typeof object.ack_fee[i] !== "object") - throw TypeError(".neutron.feerefunder.Fee.ack_fee: object expected"); - message.ack_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.ack_fee[i]); - } - } - if (object.timeout_fee) { - if (!Array.isArray(object.timeout_fee)) - throw TypeError(".neutron.feerefunder.Fee.timeout_fee: array expected"); - message.timeout_fee = []; - for (var i = 0; i < object.timeout_fee.length; ++i) { - if (typeof object.timeout_fee[i] !== "object") - throw TypeError(".neutron.feerefunder.Fee.timeout_fee: object expected"); - message.timeout_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.timeout_fee[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feerefunder.Fee - * @static - * @param {neutron.feerefunder.Fee} message Fee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Fee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.recv_fee = []; - object.ack_fee = []; - object.timeout_fee = []; - } - if (message.recv_fee && message.recv_fee.length) { - object.recv_fee = []; - for (var j = 0; j < message.recv_fee.length; ++j) - object.recv_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.recv_fee[j], options); - } - if (message.ack_fee && message.ack_fee.length) { - object.ack_fee = []; - for (var j = 0; j < message.ack_fee.length; ++j) - object.ack_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.ack_fee[j], options); - } - if (message.timeout_fee && message.timeout_fee.length) { - object.timeout_fee = []; - for (var j = 0; j < message.timeout_fee.length; ++j) - object.timeout_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.timeout_fee[j], options); - } - return object; - }; - - /** - * Converts this Fee to JSON. - * @function toJSON - * @memberof neutron.feerefunder.Fee - * @instance - * @returns {Object.} JSON object - */ - Fee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Fee; - })(); - - feerefunder.PacketID = (function() { - - /** - * Properties of a PacketID. - * @memberof neutron.feerefunder - * @interface IPacketID - * @property {string|null} [channel_id] PacketID channel_id - * @property {string|null} [port_id] PacketID port_id - * @property {Long|null} [sequence] PacketID sequence - */ - - /** - * Constructs a new PacketID. - * @memberof neutron.feerefunder - * @classdesc Represents a PacketID. - * @implements IPacketID - * @constructor - * @param {neutron.feerefunder.IPacketID=} [properties] Properties to set - */ - function PacketID(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PacketID channel_id. - * @member {string} channel_id - * @memberof neutron.feerefunder.PacketID - * @instance - */ - PacketID.prototype.channel_id = ""; - - /** - * PacketID port_id. - * @member {string} port_id - * @memberof neutron.feerefunder.PacketID - * @instance - */ - PacketID.prototype.port_id = ""; - - /** - * PacketID sequence. - * @member {Long} sequence - * @memberof neutron.feerefunder.PacketID - * @instance - */ - PacketID.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified PacketID message. Does not implicitly {@link neutron.feerefunder.PacketID.verify|verify} messages. - * @function encode - * @memberof neutron.feerefunder.PacketID - * @static - * @param {neutron.feerefunder.IPacketID} message PacketID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketID.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.port_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified PacketID message, length delimited. Does not implicitly {@link neutron.feerefunder.PacketID.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feerefunder.PacketID - * @static - * @param {neutron.feerefunder.IPacketID} message PacketID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PacketID.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PacketID message from the specified reader or buffer. - * @function decode - * @memberof neutron.feerefunder.PacketID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feerefunder.PacketID} PacketID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketID.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feerefunder.PacketID(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.port_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PacketID message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feerefunder.PacketID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feerefunder.PacketID} PacketID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PacketID.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PacketID message. - * @function verify - * @memberof neutron.feerefunder.PacketID - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PacketID.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a PacketID message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feerefunder.PacketID - * @static - * @param {Object.} object Plain object - * @returns {neutron.feerefunder.PacketID} PacketID - */ - PacketID.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feerefunder.PacketID) - return object; - var message = new $root.neutron.feerefunder.PacketID(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PacketID message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feerefunder.PacketID - * @static - * @param {neutron.feerefunder.PacketID} message PacketID - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PacketID.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.channel_id = ""; - object.port_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this PacketID to JSON. - * @function toJSON - * @memberof neutron.feerefunder.PacketID - * @instance - * @returns {Object.} JSON object - */ - PacketID.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PacketID; - })(); - - feerefunder.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof neutron.feerefunder - * @interface IGenesisState - * @property {neutron.feerefunder.IParams|null} [params] GenesisState params - * @property {Array.|null} [fee_infos] GenesisState fee_infos - */ - - /** - * Constructs a new GenesisState. - * @memberof neutron.feerefunder - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {neutron.feerefunder.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.fee_infos = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState params. - * @member {neutron.feerefunder.IParams|null|undefined} params - * @memberof neutron.feerefunder.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * GenesisState fee_infos. - * @member {Array.} fee_infos - * @memberof neutron.feerefunder.GenesisState - * @instance - */ - GenesisState.prototype.fee_infos = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.feerefunder.GenesisState.verify|verify} messages. - * @function encode - * @memberof neutron.feerefunder.GenesisState - * @static - * @param {neutron.feerefunder.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.feerefunder.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fee_infos != null && message.fee_infos.length) - for (var i = 0; i < message.fee_infos.length; ++i) - $root.neutron.feerefunder.FeeInfo.encode(message.fee_infos[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.feerefunder.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feerefunder.GenesisState - * @static - * @param {neutron.feerefunder.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof neutron.feerefunder.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feerefunder.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feerefunder.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.feerefunder.Params.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.fee_infos && message.fee_infos.length)) - message.fee_infos = []; - message.fee_infos.push($root.neutron.feerefunder.FeeInfo.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feerefunder.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feerefunder.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof neutron.feerefunder.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.feerefunder.Params.verify(message.params); - if (error) - return "params." + error; - } - if (message.fee_infos != null && message.hasOwnProperty("fee_infos")) { - if (!Array.isArray(message.fee_infos)) - return "fee_infos: array expected"; - for (var i = 0; i < message.fee_infos.length; ++i) { - var error = $root.neutron.feerefunder.FeeInfo.verify(message.fee_infos[i]); - if (error) - return "fee_infos." + error; - } - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feerefunder.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {neutron.feerefunder.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feerefunder.GenesisState) - return object; - var message = new $root.neutron.feerefunder.GenesisState(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.feerefunder.GenesisState.params: object expected"); - message.params = $root.neutron.feerefunder.Params.fromObject(object.params); - } - if (object.fee_infos) { - if (!Array.isArray(object.fee_infos)) - throw TypeError(".neutron.feerefunder.GenesisState.fee_infos: array expected"); - message.fee_infos = []; - for (var i = 0; i < object.fee_infos.length; ++i) { - if (typeof object.fee_infos[i] !== "object") - throw TypeError(".neutron.feerefunder.GenesisState.fee_infos: object expected"); - message.fee_infos[i] = $root.neutron.feerefunder.FeeInfo.fromObject(object.fee_infos[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feerefunder.GenesisState - * @static - * @param {neutron.feerefunder.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.fee_infos = []; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.feerefunder.Params.toObject(message.params, options); - if (message.fee_infos && message.fee_infos.length) { - object.fee_infos = []; - for (var j = 0; j < message.fee_infos.length; ++j) - object.fee_infos[j] = $root.neutron.feerefunder.FeeInfo.toObject(message.fee_infos[j], options); - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof neutron.feerefunder.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - feerefunder.FeeInfo = (function() { - - /** - * Properties of a FeeInfo. - * @memberof neutron.feerefunder - * @interface IFeeInfo - * @property {string|null} [payer] FeeInfo payer - * @property {neutron.feerefunder.IPacketID|null} [packet_id] FeeInfo packet_id - * @property {neutron.feerefunder.IFee|null} [fee] FeeInfo fee - */ - - /** - * Constructs a new FeeInfo. - * @memberof neutron.feerefunder - * @classdesc Represents a FeeInfo. - * @implements IFeeInfo - * @constructor - * @param {neutron.feerefunder.IFeeInfo=} [properties] Properties to set - */ - function FeeInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeeInfo payer. - * @member {string} payer - * @memberof neutron.feerefunder.FeeInfo - * @instance - */ - FeeInfo.prototype.payer = ""; - - /** - * FeeInfo packet_id. - * @member {neutron.feerefunder.IPacketID|null|undefined} packet_id - * @memberof neutron.feerefunder.FeeInfo - * @instance - */ - FeeInfo.prototype.packet_id = null; - - /** - * FeeInfo fee. - * @member {neutron.feerefunder.IFee|null|undefined} fee - * @memberof neutron.feerefunder.FeeInfo - * @instance - */ - FeeInfo.prototype.fee = null; - - /** - * Encodes the specified FeeInfo message. Does not implicitly {@link neutron.feerefunder.FeeInfo.verify|verify} messages. - * @function encode - * @memberof neutron.feerefunder.FeeInfo - * @static - * @param {neutron.feerefunder.IFeeInfo} message FeeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.payer != null && Object.hasOwnProperty.call(message, "payer")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.payer); - if (message.packet_id != null && Object.hasOwnProperty.call(message, "packet_id")) - $root.neutron.feerefunder.PacketID.encode(message.packet_id, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) - $root.neutron.feerefunder.Fee.encode(message.fee, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FeeInfo message, length delimited. Does not implicitly {@link neutron.feerefunder.FeeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feerefunder.FeeInfo - * @static - * @param {neutron.feerefunder.IFeeInfo} message FeeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeeInfo message from the specified reader or buffer. - * @function decode - * @memberof neutron.feerefunder.FeeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feerefunder.FeeInfo} FeeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feerefunder.FeeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.payer = reader.string(); - break; - case 2: - message.packet_id = $root.neutron.feerefunder.PacketID.decode(reader, reader.uint32()); - break; - case 3: - message.fee = $root.neutron.feerefunder.Fee.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feerefunder.FeeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feerefunder.FeeInfo} FeeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeeInfo message. - * @function verify - * @memberof neutron.feerefunder.FeeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.payer != null && message.hasOwnProperty("payer")) - if (!$util.isString(message.payer)) - return "payer: string expected"; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) { - var error = $root.neutron.feerefunder.PacketID.verify(message.packet_id); - if (error) - return "packet_id." + error; - } - if (message.fee != null && message.hasOwnProperty("fee")) { - var error = $root.neutron.feerefunder.Fee.verify(message.fee); - if (error) - return "fee." + error; - } - return null; - }; - - /** - * Creates a FeeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feerefunder.FeeInfo - * @static - * @param {Object.} object Plain object - * @returns {neutron.feerefunder.FeeInfo} FeeInfo - */ - FeeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feerefunder.FeeInfo) - return object; - var message = new $root.neutron.feerefunder.FeeInfo(); - if (object.payer != null) - message.payer = String(object.payer); - if (object.packet_id != null) { - if (typeof object.packet_id !== "object") - throw TypeError(".neutron.feerefunder.FeeInfo.packet_id: object expected"); - message.packet_id = $root.neutron.feerefunder.PacketID.fromObject(object.packet_id); - } - if (object.fee != null) { - if (typeof object.fee !== "object") - throw TypeError(".neutron.feerefunder.FeeInfo.fee: object expected"); - message.fee = $root.neutron.feerefunder.Fee.fromObject(object.fee); - } - return message; - }; - - /** - * Creates a plain object from a FeeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feerefunder.FeeInfo - * @static - * @param {neutron.feerefunder.FeeInfo} message FeeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.payer = ""; - object.packet_id = null; - object.fee = null; - } - if (message.payer != null && message.hasOwnProperty("payer")) - object.payer = message.payer; - if (message.packet_id != null && message.hasOwnProperty("packet_id")) - object.packet_id = $root.neutron.feerefunder.PacketID.toObject(message.packet_id, options); - if (message.fee != null && message.hasOwnProperty("fee")) - object.fee = $root.neutron.feerefunder.Fee.toObject(message.fee, options); - return object; - }; - - /** - * Converts this FeeInfo to JSON. - * @function toJSON - * @memberof neutron.feerefunder.FeeInfo - * @instance - * @returns {Object.} JSON object - */ - FeeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FeeInfo; - })(); - - feerefunder.Params = (function() { - - /** - * Properties of a Params. - * @memberof neutron.feerefunder - * @interface IParams - * @property {neutron.feerefunder.IFee|null} [min_fee] Params min_fee - */ - - /** - * Constructs a new Params. - * @memberof neutron.feerefunder - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {neutron.feerefunder.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params min_fee. - * @member {neutron.feerefunder.IFee|null|undefined} min_fee - * @memberof neutron.feerefunder.Params - * @instance - */ - Params.prototype.min_fee = null; - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.feerefunder.Params.verify|verify} messages. - * @function encode - * @memberof neutron.feerefunder.Params - * @static - * @param {neutron.feerefunder.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.min_fee != null && Object.hasOwnProperty.call(message, "min_fee")) - $root.neutron.feerefunder.Fee.encode(message.min_fee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.feerefunder.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feerefunder.Params - * @static - * @param {neutron.feerefunder.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof neutron.feerefunder.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feerefunder.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feerefunder.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.min_fee = $root.neutron.feerefunder.Fee.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feerefunder.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feerefunder.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof neutron.feerefunder.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.min_fee != null && message.hasOwnProperty("min_fee")) { - var error = $root.neutron.feerefunder.Fee.verify(message.min_fee); - if (error) - return "min_fee." + error; - } - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feerefunder.Params - * @static - * @param {Object.} object Plain object - * @returns {neutron.feerefunder.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feerefunder.Params) - return object; - var message = new $root.neutron.feerefunder.Params(); - if (object.min_fee != null) { - if (typeof object.min_fee !== "object") - throw TypeError(".neutron.feerefunder.Params.min_fee: object expected"); - message.min_fee = $root.neutron.feerefunder.Fee.fromObject(object.min_fee); - } - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feerefunder.Params - * @static - * @param {neutron.feerefunder.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.min_fee = null; - if (message.min_fee != null && message.hasOwnProperty("min_fee")) - object.min_fee = $root.neutron.feerefunder.Fee.toObject(message.min_fee, options); - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof neutron.feerefunder.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - feerefunder.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof neutron.feerefunder - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link neutron.feerefunder.Query#params}. - * @memberof neutron.feerefunder.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.feerefunder.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof neutron.feerefunder.Query - * @instance - * @param {neutron.feerefunder.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {neutron.feerefunder.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.neutron.feerefunder.QueryParamsRequest, $root.neutron.feerefunder.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof neutron.feerefunder.Query - * @instance - * @param {neutron.feerefunder.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.feerefunder.Query#feeInfo}. - * @memberof neutron.feerefunder.Query - * @typedef FeeInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.feerefunder.FeeInfoResponse} [response] FeeInfoResponse - */ - - /** - * Calls FeeInfo. - * @function feeInfo - * @memberof neutron.feerefunder.Query - * @instance - * @param {neutron.feerefunder.IFeeInfoRequest} request FeeInfoRequest message or plain object - * @param {neutron.feerefunder.Query.FeeInfoCallback} callback Node-style callback called with the error, if any, and FeeInfoResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.feeInfo = function feeInfo(request, callback) { - return this.rpcCall(feeInfo, $root.neutron.feerefunder.FeeInfoRequest, $root.neutron.feerefunder.FeeInfoResponse, request, callback); - }, "name", { value: "FeeInfo" }); - - /** - * Calls FeeInfo. - * @function feeInfo - * @memberof neutron.feerefunder.Query - * @instance - * @param {neutron.feerefunder.IFeeInfoRequest} request FeeInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - feerefunder.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof neutron.feerefunder - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof neutron.feerefunder - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {neutron.feerefunder.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.feerefunder.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof neutron.feerefunder.QueryParamsRequest - * @static - * @param {neutron.feerefunder.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.feerefunder.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feerefunder.QueryParamsRequest - * @static - * @param {neutron.feerefunder.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.feerefunder.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feerefunder.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feerefunder.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feerefunder.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feerefunder.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof neutron.feerefunder.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feerefunder.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.feerefunder.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feerefunder.QueryParamsRequest) - return object; - return new $root.neutron.feerefunder.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feerefunder.QueryParamsRequest - * @static - * @param {neutron.feerefunder.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof neutron.feerefunder.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - feerefunder.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof neutron.feerefunder - * @interface IQueryParamsResponse - * @property {neutron.feerefunder.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof neutron.feerefunder - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {neutron.feerefunder.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {neutron.feerefunder.IParams|null|undefined} params - * @memberof neutron.feerefunder.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.feerefunder.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof neutron.feerefunder.QueryParamsResponse - * @static - * @param {neutron.feerefunder.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.feerefunder.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.feerefunder.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feerefunder.QueryParamsResponse - * @static - * @param {neutron.feerefunder.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.feerefunder.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feerefunder.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feerefunder.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.feerefunder.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feerefunder.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feerefunder.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof neutron.feerefunder.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.feerefunder.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feerefunder.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.feerefunder.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feerefunder.QueryParamsResponse) - return object; - var message = new $root.neutron.feerefunder.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.feerefunder.QueryParamsResponse.params: object expected"); - message.params = $root.neutron.feerefunder.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feerefunder.QueryParamsResponse - * @static - * @param {neutron.feerefunder.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.feerefunder.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof neutron.feerefunder.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - feerefunder.FeeInfoRequest = (function() { - - /** - * Properties of a FeeInfoRequest. - * @memberof neutron.feerefunder - * @interface IFeeInfoRequest - * @property {string|null} [channel_id] FeeInfoRequest channel_id - * @property {string|null} [port_id] FeeInfoRequest port_id - * @property {Long|null} [sequence] FeeInfoRequest sequence - */ - - /** - * Constructs a new FeeInfoRequest. - * @memberof neutron.feerefunder - * @classdesc Represents a FeeInfoRequest. - * @implements IFeeInfoRequest - * @constructor - * @param {neutron.feerefunder.IFeeInfoRequest=} [properties] Properties to set - */ - function FeeInfoRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeeInfoRequest channel_id. - * @member {string} channel_id - * @memberof neutron.feerefunder.FeeInfoRequest - * @instance - */ - FeeInfoRequest.prototype.channel_id = ""; - - /** - * FeeInfoRequest port_id. - * @member {string} port_id - * @memberof neutron.feerefunder.FeeInfoRequest - * @instance - */ - FeeInfoRequest.prototype.port_id = ""; - - /** - * FeeInfoRequest sequence. - * @member {Long} sequence - * @memberof neutron.feerefunder.FeeInfoRequest - * @instance - */ - FeeInfoRequest.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified FeeInfoRequest message. Does not implicitly {@link neutron.feerefunder.FeeInfoRequest.verify|verify} messages. - * @function encode - * @memberof neutron.feerefunder.FeeInfoRequest - * @static - * @param {neutron.feerefunder.IFeeInfoRequest} message FeeInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.port_id); - if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence); - return writer; - }; - - /** - * Encodes the specified FeeInfoRequest message, length delimited. Does not implicitly {@link neutron.feerefunder.FeeInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feerefunder.FeeInfoRequest - * @static - * @param {neutron.feerefunder.IFeeInfoRequest} message FeeInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeeInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.feerefunder.FeeInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feerefunder.FeeInfoRequest} FeeInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeInfoRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feerefunder.FeeInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.channel_id = reader.string(); - break; - case 2: - message.port_id = reader.string(); - break; - case 3: - message.sequence = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeeInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feerefunder.FeeInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feerefunder.FeeInfoRequest} FeeInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeeInfoRequest message. - * @function verify - * @memberof neutron.feerefunder.FeeInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeeInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high))) - return "sequence: integer|Long expected"; - return null; - }; - - /** - * Creates a FeeInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feerefunder.FeeInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.feerefunder.FeeInfoRequest} FeeInfoRequest - */ - FeeInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feerefunder.FeeInfoRequest) - return object; - var message = new $root.neutron.feerefunder.FeeInfoRequest(); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.sequence != null) - if ($util.Long) - (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true; - else if (typeof object.sequence === "string") - message.sequence = parseInt(object.sequence, 10); - else if (typeof object.sequence === "number") - message.sequence = object.sequence; - else if (typeof object.sequence === "object") - message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a FeeInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feerefunder.FeeInfoRequest - * @static - * @param {neutron.feerefunder.FeeInfoRequest} message FeeInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeeInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.channel_id = ""; - object.port_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence = options.longs === String ? "0" : 0; - } - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.sequence != null && message.hasOwnProperty("sequence")) - if (typeof message.sequence === "number") - object.sequence = options.longs === String ? String(message.sequence) : message.sequence; - else - object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence; - return object; - }; - - /** - * Converts this FeeInfoRequest to JSON. - * @function toJSON - * @memberof neutron.feerefunder.FeeInfoRequest - * @instance - * @returns {Object.} JSON object - */ - FeeInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FeeInfoRequest; - })(); - - feerefunder.FeeInfoResponse = (function() { - - /** - * Properties of a FeeInfoResponse. - * @memberof neutron.feerefunder - * @interface IFeeInfoResponse - * @property {neutron.feerefunder.IFeeInfo|null} [fee_info] FeeInfoResponse fee_info - */ - - /** - * Constructs a new FeeInfoResponse. - * @memberof neutron.feerefunder - * @classdesc Represents a FeeInfoResponse. - * @implements IFeeInfoResponse - * @constructor - * @param {neutron.feerefunder.IFeeInfoResponse=} [properties] Properties to set - */ - function FeeInfoResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeeInfoResponse fee_info. - * @member {neutron.feerefunder.IFeeInfo|null|undefined} fee_info - * @memberof neutron.feerefunder.FeeInfoResponse - * @instance - */ - FeeInfoResponse.prototype.fee_info = null; - - /** - * Encodes the specified FeeInfoResponse message. Does not implicitly {@link neutron.feerefunder.FeeInfoResponse.verify|verify} messages. - * @function encode - * @memberof neutron.feerefunder.FeeInfoResponse - * @static - * @param {neutron.feerefunder.IFeeInfoResponse} message FeeInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeInfoResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fee_info != null && Object.hasOwnProperty.call(message, "fee_info")) - $root.neutron.feerefunder.FeeInfo.encode(message.fee_info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FeeInfoResponse message, length delimited. Does not implicitly {@link neutron.feerefunder.FeeInfoResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.feerefunder.FeeInfoResponse - * @static - * @param {neutron.feerefunder.IFeeInfoResponse} message FeeInfoResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeeInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeeInfoResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.feerefunder.FeeInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.feerefunder.FeeInfoResponse} FeeInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeInfoResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.feerefunder.FeeInfoResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fee_info = $root.neutron.feerefunder.FeeInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeeInfoResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.feerefunder.FeeInfoResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.feerefunder.FeeInfoResponse} FeeInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeeInfoResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeeInfoResponse message. - * @function verify - * @memberof neutron.feerefunder.FeeInfoResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeeInfoResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fee_info != null && message.hasOwnProperty("fee_info")) { - var error = $root.neutron.feerefunder.FeeInfo.verify(message.fee_info); - if (error) - return "fee_info." + error; - } - return null; - }; - - /** - * Creates a FeeInfoResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.feerefunder.FeeInfoResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.feerefunder.FeeInfoResponse} FeeInfoResponse - */ - FeeInfoResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.feerefunder.FeeInfoResponse) - return object; - var message = new $root.neutron.feerefunder.FeeInfoResponse(); - if (object.fee_info != null) { - if (typeof object.fee_info !== "object") - throw TypeError(".neutron.feerefunder.FeeInfoResponse.fee_info: object expected"); - message.fee_info = $root.neutron.feerefunder.FeeInfo.fromObject(object.fee_info); - } - return message; - }; - - /** - * Creates a plain object from a FeeInfoResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.feerefunder.FeeInfoResponse - * @static - * @param {neutron.feerefunder.FeeInfoResponse} message FeeInfoResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeeInfoResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.fee_info = null; - if (message.fee_info != null && message.hasOwnProperty("fee_info")) - object.fee_info = $root.neutron.feerefunder.FeeInfo.toObject(message.fee_info, options); - return object; - }; - - /** - * Converts this FeeInfoResponse to JSON. - * @function toJSON - * @memberof neutron.feerefunder.FeeInfoResponse - * @instance - * @returns {Object.} JSON object - */ - FeeInfoResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FeeInfoResponse; - })(); - - return feerefunder; - })(); - - neutron.interchainqueries = (function() { - - /** - * Namespace interchainqueries. - * @memberof neutron - * @namespace - */ - var interchainqueries = {}; - - interchainqueries.RegisteredQuery = (function() { - - /** - * Properties of a RegisteredQuery. - * @memberof neutron.interchainqueries - * @interface IRegisteredQuery - * @property {Long|null} [id] RegisteredQuery id - * @property {string|null} [owner] RegisteredQuery owner - * @property {string|null} [query_type] RegisteredQuery query_type - * @property {Array.|null} [keys] RegisteredQuery keys - * @property {string|null} [transactions_filter] RegisteredQuery transactions_filter - * @property {string|null} [connection_id] RegisteredQuery connection_id - * @property {Long|null} [update_period] RegisteredQuery update_period - * @property {Long|null} [last_submitted_result_local_height] RegisteredQuery last_submitted_result_local_height - * @property {ibc.core.client.v1.IHeight|null} [last_submitted_result_remote_height] RegisteredQuery last_submitted_result_remote_height - * @property {Array.|null} [deposit] RegisteredQuery deposit - * @property {Long|null} [submit_timeout] RegisteredQuery submit_timeout - * @property {Long|null} [registered_at_height] RegisteredQuery registered_at_height - */ - - /** - * Constructs a new RegisteredQuery. - * @memberof neutron.interchainqueries - * @classdesc Represents a RegisteredQuery. - * @implements IRegisteredQuery - * @constructor - * @param {neutron.interchainqueries.IRegisteredQuery=} [properties] Properties to set - */ - function RegisteredQuery(properties) { - this.keys = []; - this.deposit = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RegisteredQuery id. - * @member {Long} id - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RegisteredQuery owner. - * @member {string} owner - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.owner = ""; - - /** - * RegisteredQuery query_type. - * @member {string} query_type - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.query_type = ""; - - /** - * RegisteredQuery keys. - * @member {Array.} keys - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.keys = $util.emptyArray; - - /** - * RegisteredQuery transactions_filter. - * @member {string} transactions_filter - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.transactions_filter = ""; - - /** - * RegisteredQuery connection_id. - * @member {string} connection_id - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.connection_id = ""; - - /** - * RegisteredQuery update_period. - * @member {Long} update_period - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.update_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RegisteredQuery last_submitted_result_local_height. - * @member {Long} last_submitted_result_local_height - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.last_submitted_result_local_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RegisteredQuery last_submitted_result_remote_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} last_submitted_result_remote_height - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.last_submitted_result_remote_height = null; - - /** - * RegisteredQuery deposit. - * @member {Array.} deposit - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.deposit = $util.emptyArray; - - /** - * RegisteredQuery submit_timeout. - * @member {Long} submit_timeout - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.submit_timeout = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RegisteredQuery registered_at_height. - * @member {Long} registered_at_height - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - */ - RegisteredQuery.prototype.registered_at_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified RegisteredQuery message. Does not implicitly {@link neutron.interchainqueries.RegisteredQuery.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.RegisteredQuery - * @static - * @param {neutron.interchainqueries.IRegisteredQuery} message RegisteredQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredQuery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.id); - if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.owner); - if (message.query_type != null && Object.hasOwnProperty.call(message, "query_type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.query_type); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.neutron.interchainqueries.KVKey.encode(message.keys[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.transactions_filter != null && Object.hasOwnProperty.call(message, "transactions_filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.transactions_filter); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.connection_id); - if (message.update_period != null && Object.hasOwnProperty.call(message, "update_period")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.update_period); - if (message.last_submitted_result_local_height != null && Object.hasOwnProperty.call(message, "last_submitted_result_local_height")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.last_submitted_result_local_height); - if (message.last_submitted_result_remote_height != null && Object.hasOwnProperty.call(message, "last_submitted_result_remote_height")) - $root.ibc.core.client.v1.Height.encode(message.last_submitted_result_remote_height, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.deposit != null && message.deposit.length) - for (var i = 0; i < message.deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.deposit[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.submit_timeout != null && Object.hasOwnProperty.call(message, "submit_timeout")) - writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.submit_timeout); - if (message.registered_at_height != null && Object.hasOwnProperty.call(message, "registered_at_height")) - writer.uint32(/* id 12, wireType 0 =*/96).uint64(message.registered_at_height); - return writer; - }; - - /** - * Encodes the specified RegisteredQuery message, length delimited. Does not implicitly {@link neutron.interchainqueries.RegisteredQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.RegisteredQuery - * @static - * @param {neutron.interchainqueries.IRegisteredQuery} message RegisteredQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegisteredQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RegisteredQuery message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.RegisteredQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.RegisteredQuery} RegisteredQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredQuery.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.RegisteredQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.uint64(); - break; - case 2: - message.owner = reader.string(); - break; - case 3: - message.query_type = reader.string(); - break; - case 4: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.neutron.interchainqueries.KVKey.decode(reader, reader.uint32())); - break; - case 5: - message.transactions_filter = reader.string(); - break; - case 6: - message.connection_id = reader.string(); - break; - case 7: - message.update_period = reader.uint64(); - break; - case 8: - message.last_submitted_result_local_height = reader.uint64(); - break; - case 9: - message.last_submitted_result_remote_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.deposit && message.deposit.length)) - message.deposit = []; - message.deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 11: - message.submit_timeout = reader.uint64(); - break; - case 12: - message.registered_at_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RegisteredQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.RegisteredQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.RegisteredQuery} RegisteredQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegisteredQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RegisteredQuery message. - * @function verify - * @memberof neutron.interchainqueries.RegisteredQuery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RegisteredQuery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) - return "id: integer|Long expected"; - if (message.owner != null && message.hasOwnProperty("owner")) - if (!$util.isString(message.owner)) - return "owner: string expected"; - if (message.query_type != null && message.hasOwnProperty("query_type")) - if (!$util.isString(message.query_type)) - return "query_type: string expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.neutron.interchainqueries.KVKey.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - if (message.transactions_filter != null && message.hasOwnProperty("transactions_filter")) - if (!$util.isString(message.transactions_filter)) - return "transactions_filter: string expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.update_period != null && message.hasOwnProperty("update_period")) - if (!$util.isInteger(message.update_period) && !(message.update_period && $util.isInteger(message.update_period.low) && $util.isInteger(message.update_period.high))) - return "update_period: integer|Long expected"; - if (message.last_submitted_result_local_height != null && message.hasOwnProperty("last_submitted_result_local_height")) - if (!$util.isInteger(message.last_submitted_result_local_height) && !(message.last_submitted_result_local_height && $util.isInteger(message.last_submitted_result_local_height.low) && $util.isInteger(message.last_submitted_result_local_height.high))) - return "last_submitted_result_local_height: integer|Long expected"; - if (message.last_submitted_result_remote_height != null && message.hasOwnProperty("last_submitted_result_remote_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.last_submitted_result_remote_height); - if (error) - return "last_submitted_result_remote_height." + error; - } - if (message.deposit != null && message.hasOwnProperty("deposit")) { - if (!Array.isArray(message.deposit)) - return "deposit: array expected"; - for (var i = 0; i < message.deposit.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.deposit[i]); - if (error) - return "deposit." + error; - } - } - if (message.submit_timeout != null && message.hasOwnProperty("submit_timeout")) - if (!$util.isInteger(message.submit_timeout) && !(message.submit_timeout && $util.isInteger(message.submit_timeout.low) && $util.isInteger(message.submit_timeout.high))) - return "submit_timeout: integer|Long expected"; - if (message.registered_at_height != null && message.hasOwnProperty("registered_at_height")) - if (!$util.isInteger(message.registered_at_height) && !(message.registered_at_height && $util.isInteger(message.registered_at_height.low) && $util.isInteger(message.registered_at_height.high))) - return "registered_at_height: integer|Long expected"; - return null; - }; - - /** - * Creates a RegisteredQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.RegisteredQuery - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.RegisteredQuery} RegisteredQuery - */ - RegisteredQuery.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.RegisteredQuery) - return object; - var message = new $root.neutron.interchainqueries.RegisteredQuery(); - if (object.id != null) - if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = true; - else if (typeof object.id === "string") - message.id = parseInt(object.id, 10); - else if (typeof object.id === "number") - message.id = object.id; - else if (typeof object.id === "object") - message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); - if (object.owner != null) - message.owner = String(object.owner); - if (object.query_type != null) - message.query_type = String(object.query_type); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".neutron.interchainqueries.RegisteredQuery.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".neutron.interchainqueries.RegisteredQuery.keys: object expected"); - message.keys[i] = $root.neutron.interchainqueries.KVKey.fromObject(object.keys[i]); - } - } - if (object.transactions_filter != null) - message.transactions_filter = String(object.transactions_filter); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.update_period != null) - if ($util.Long) - (message.update_period = $util.Long.fromValue(object.update_period)).unsigned = true; - else if (typeof object.update_period === "string") - message.update_period = parseInt(object.update_period, 10); - else if (typeof object.update_period === "number") - message.update_period = object.update_period; - else if (typeof object.update_period === "object") - message.update_period = new $util.LongBits(object.update_period.low >>> 0, object.update_period.high >>> 0).toNumber(true); - if (object.last_submitted_result_local_height != null) - if ($util.Long) - (message.last_submitted_result_local_height = $util.Long.fromValue(object.last_submitted_result_local_height)).unsigned = true; - else if (typeof object.last_submitted_result_local_height === "string") - message.last_submitted_result_local_height = parseInt(object.last_submitted_result_local_height, 10); - else if (typeof object.last_submitted_result_local_height === "number") - message.last_submitted_result_local_height = object.last_submitted_result_local_height; - else if (typeof object.last_submitted_result_local_height === "object") - message.last_submitted_result_local_height = new $util.LongBits(object.last_submitted_result_local_height.low >>> 0, object.last_submitted_result_local_height.high >>> 0).toNumber(true); - if (object.last_submitted_result_remote_height != null) { - if (typeof object.last_submitted_result_remote_height !== "object") - throw TypeError(".neutron.interchainqueries.RegisteredQuery.last_submitted_result_remote_height: object expected"); - message.last_submitted_result_remote_height = $root.ibc.core.client.v1.Height.fromObject(object.last_submitted_result_remote_height); - } - if (object.deposit) { - if (!Array.isArray(object.deposit)) - throw TypeError(".neutron.interchainqueries.RegisteredQuery.deposit: array expected"); - message.deposit = []; - for (var i = 0; i < object.deposit.length; ++i) { - if (typeof object.deposit[i] !== "object") - throw TypeError(".neutron.interchainqueries.RegisteredQuery.deposit: object expected"); - message.deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.deposit[i]); - } - } - if (object.submit_timeout != null) - if ($util.Long) - (message.submit_timeout = $util.Long.fromValue(object.submit_timeout)).unsigned = true; - else if (typeof object.submit_timeout === "string") - message.submit_timeout = parseInt(object.submit_timeout, 10); - else if (typeof object.submit_timeout === "number") - message.submit_timeout = object.submit_timeout; - else if (typeof object.submit_timeout === "object") - message.submit_timeout = new $util.LongBits(object.submit_timeout.low >>> 0, object.submit_timeout.high >>> 0).toNumber(true); - if (object.registered_at_height != null) - if ($util.Long) - (message.registered_at_height = $util.Long.fromValue(object.registered_at_height)).unsigned = true; - else if (typeof object.registered_at_height === "string") - message.registered_at_height = parseInt(object.registered_at_height, 10); - else if (typeof object.registered_at_height === "number") - message.registered_at_height = object.registered_at_height; - else if (typeof object.registered_at_height === "object") - message.registered_at_height = new $util.LongBits(object.registered_at_height.low >>> 0, object.registered_at_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a RegisteredQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.RegisteredQuery - * @static - * @param {neutron.interchainqueries.RegisteredQuery} message RegisteredQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegisteredQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.keys = []; - object.deposit = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.id = options.longs === String ? "0" : 0; - object.owner = ""; - object.query_type = ""; - object.transactions_filter = ""; - object.connection_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.update_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.update_period = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.last_submitted_result_local_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.last_submitted_result_local_height = options.longs === String ? "0" : 0; - object.last_submitted_result_remote_height = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.submit_timeout = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.submit_timeout = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.registered_at_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.registered_at_height = options.longs === String ? "0" : 0; - } - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") - object.id = options.longs === String ? String(message.id) : message.id; - else - object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; - if (message.owner != null && message.hasOwnProperty("owner")) - object.owner = message.owner; - if (message.query_type != null && message.hasOwnProperty("query_type")) - object.query_type = message.query_type; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.neutron.interchainqueries.KVKey.toObject(message.keys[j], options); - } - if (message.transactions_filter != null && message.hasOwnProperty("transactions_filter")) - object.transactions_filter = message.transactions_filter; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.update_period != null && message.hasOwnProperty("update_period")) - if (typeof message.update_period === "number") - object.update_period = options.longs === String ? String(message.update_period) : message.update_period; - else - object.update_period = options.longs === String ? $util.Long.prototype.toString.call(message.update_period) : options.longs === Number ? new $util.LongBits(message.update_period.low >>> 0, message.update_period.high >>> 0).toNumber(true) : message.update_period; - if (message.last_submitted_result_local_height != null && message.hasOwnProperty("last_submitted_result_local_height")) - if (typeof message.last_submitted_result_local_height === "number") - object.last_submitted_result_local_height = options.longs === String ? String(message.last_submitted_result_local_height) : message.last_submitted_result_local_height; - else - object.last_submitted_result_local_height = options.longs === String ? $util.Long.prototype.toString.call(message.last_submitted_result_local_height) : options.longs === Number ? new $util.LongBits(message.last_submitted_result_local_height.low >>> 0, message.last_submitted_result_local_height.high >>> 0).toNumber(true) : message.last_submitted_result_local_height; - if (message.last_submitted_result_remote_height != null && message.hasOwnProperty("last_submitted_result_remote_height")) - object.last_submitted_result_remote_height = $root.ibc.core.client.v1.Height.toObject(message.last_submitted_result_remote_height, options); - if (message.deposit && message.deposit.length) { - object.deposit = []; - for (var j = 0; j < message.deposit.length; ++j) - object.deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.deposit[j], options); - } - if (message.submit_timeout != null && message.hasOwnProperty("submit_timeout")) - if (typeof message.submit_timeout === "number") - object.submit_timeout = options.longs === String ? String(message.submit_timeout) : message.submit_timeout; - else - object.submit_timeout = options.longs === String ? $util.Long.prototype.toString.call(message.submit_timeout) : options.longs === Number ? new $util.LongBits(message.submit_timeout.low >>> 0, message.submit_timeout.high >>> 0).toNumber(true) : message.submit_timeout; - if (message.registered_at_height != null && message.hasOwnProperty("registered_at_height")) - if (typeof message.registered_at_height === "number") - object.registered_at_height = options.longs === String ? String(message.registered_at_height) : message.registered_at_height; - else - object.registered_at_height = options.longs === String ? $util.Long.prototype.toString.call(message.registered_at_height) : options.longs === Number ? new $util.LongBits(message.registered_at_height.low >>> 0, message.registered_at_height.high >>> 0).toNumber(true) : message.registered_at_height; - return object; - }; - - /** - * Converts this RegisteredQuery to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.RegisteredQuery - * @instance - * @returns {Object.} JSON object - */ - RegisteredQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RegisteredQuery; - })(); - - interchainqueries.KVKey = (function() { - - /** - * Properties of a KVKey. - * @memberof neutron.interchainqueries - * @interface IKVKey - * @property {string|null} [path] KVKey path - * @property {Uint8Array|null} [key] KVKey key - */ - - /** - * Constructs a new KVKey. - * @memberof neutron.interchainqueries - * @classdesc Represents a KVKey. - * @implements IKVKey - * @constructor - * @param {neutron.interchainqueries.IKVKey=} [properties] Properties to set - */ - function KVKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KVKey path. - * @member {string} path - * @memberof neutron.interchainqueries.KVKey - * @instance - */ - KVKey.prototype.path = ""; - - /** - * KVKey key. - * @member {Uint8Array} key - * @memberof neutron.interchainqueries.KVKey - * @instance - */ - KVKey.prototype.key = $util.newBuffer([]); - - /** - * Encodes the specified KVKey message. Does not implicitly {@link neutron.interchainqueries.KVKey.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.KVKey - * @static - * @param {neutron.interchainqueries.IKVKey} message KVKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KVKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); - return writer; - }; - - /** - * Encodes the specified KVKey message, length delimited. Does not implicitly {@link neutron.interchainqueries.KVKey.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.KVKey - * @static - * @param {neutron.interchainqueries.IKVKey} message KVKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KVKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KVKey message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.KVKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.KVKey} KVKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KVKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.KVKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.string(); - break; - case 2: - message.key = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KVKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.KVKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.KVKey} KVKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KVKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KVKey message. - * @function verify - * @memberof neutron.interchainqueries.KVKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KVKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - return null; - }; - - /** - * Creates a KVKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.KVKey - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.KVKey} KVKey - */ - KVKey.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.KVKey) - return object; - var message = new $root.neutron.interchainqueries.KVKey(); - if (object.path != null) - message.path = String(object.path); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - return message; - }; - - /** - * Creates a plain object from a KVKey message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.KVKey - * @static - * @param {neutron.interchainqueries.KVKey} message KVKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KVKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.path = ""; - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - return object; - }; - - /** - * Converts this KVKey to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.KVKey - * @instance - * @returns {Object.} JSON object - */ - KVKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return KVKey; - })(); - - interchainqueries.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof neutron.interchainqueries - * @interface IGenesisState - * @property {neutron.interchainqueries.IParams|null} [params] GenesisState params - * @property {Array.|null} [registered_queries] GenesisState registered_queries - */ - - /** - * Constructs a new GenesisState. - * @memberof neutron.interchainqueries - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {neutron.interchainqueries.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.registered_queries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState params. - * @member {neutron.interchainqueries.IParams|null|undefined} params - * @memberof neutron.interchainqueries.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * GenesisState registered_queries. - * @member {Array.} registered_queries - * @memberof neutron.interchainqueries.GenesisState - * @instance - */ - GenesisState.prototype.registered_queries = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.interchainqueries.GenesisState.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.GenesisState - * @static - * @param {neutron.interchainqueries.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.interchainqueries.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.registered_queries != null && message.registered_queries.length) - for (var i = 0; i < message.registered_queries.length; ++i) - $root.neutron.interchainqueries.RegisteredQuery.encode(message.registered_queries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.interchainqueries.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.GenesisState - * @static - * @param {neutron.interchainqueries.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.interchainqueries.Params.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.registered_queries && message.registered_queries.length)) - message.registered_queries = []; - message.registered_queries.push($root.neutron.interchainqueries.RegisteredQuery.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof neutron.interchainqueries.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.interchainqueries.Params.verify(message.params); - if (error) - return "params." + error; - } - if (message.registered_queries != null && message.hasOwnProperty("registered_queries")) { - if (!Array.isArray(message.registered_queries)) - return "registered_queries: array expected"; - for (var i = 0; i < message.registered_queries.length; ++i) { - var error = $root.neutron.interchainqueries.RegisteredQuery.verify(message.registered_queries[i]); - if (error) - return "registered_queries." + error; - } - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.GenesisState) - return object; - var message = new $root.neutron.interchainqueries.GenesisState(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.interchainqueries.GenesisState.params: object expected"); - message.params = $root.neutron.interchainqueries.Params.fromObject(object.params); - } - if (object.registered_queries) { - if (!Array.isArray(object.registered_queries)) - throw TypeError(".neutron.interchainqueries.GenesisState.registered_queries: array expected"); - message.registered_queries = []; - for (var i = 0; i < object.registered_queries.length; ++i) { - if (typeof object.registered_queries[i] !== "object") - throw TypeError(".neutron.interchainqueries.GenesisState.registered_queries: object expected"); - message.registered_queries[i] = $root.neutron.interchainqueries.RegisteredQuery.fromObject(object.registered_queries[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.GenesisState - * @static - * @param {neutron.interchainqueries.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.registered_queries = []; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.interchainqueries.Params.toObject(message.params, options); - if (message.registered_queries && message.registered_queries.length) { - object.registered_queries = []; - for (var j = 0; j < message.registered_queries.length; ++j) - object.registered_queries[j] = $root.neutron.interchainqueries.RegisteredQuery.toObject(message.registered_queries[j], options); - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - interchainqueries.Params = (function() { - - /** - * Properties of a Params. - * @memberof neutron.interchainqueries - * @interface IParams - * @property {Long|null} [query_submit_timeout] Params query_submit_timeout - * @property {Array.|null} [query_deposit] Params query_deposit - * @property {Long|null} [tx_query_removal_limit] Params tx_query_removal_limit - */ - - /** - * Constructs a new Params. - * @memberof neutron.interchainqueries - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {neutron.interchainqueries.IParams=} [properties] Properties to set - */ - function Params(properties) { - this.query_deposit = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params query_submit_timeout. - * @member {Long} query_submit_timeout - * @memberof neutron.interchainqueries.Params - * @instance - */ - Params.prototype.query_submit_timeout = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Params query_deposit. - * @member {Array.} query_deposit - * @memberof neutron.interchainqueries.Params - * @instance - */ - Params.prototype.query_deposit = $util.emptyArray; - - /** - * Params tx_query_removal_limit. - * @member {Long} tx_query_removal_limit - * @memberof neutron.interchainqueries.Params - * @instance - */ - Params.prototype.tx_query_removal_limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.interchainqueries.Params.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.Params - * @static - * @param {neutron.interchainqueries.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query_submit_timeout != null && Object.hasOwnProperty.call(message, "query_submit_timeout")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.query_submit_timeout); - if (message.query_deposit != null && message.query_deposit.length) - for (var i = 0; i < message.query_deposit.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.query_deposit[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tx_query_removal_limit != null && Object.hasOwnProperty.call(message, "tx_query_removal_limit")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.tx_query_removal_limit); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.interchainqueries.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.Params - * @static - * @param {neutron.interchainqueries.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.query_submit_timeout = reader.uint64(); - break; - case 2: - if (!(message.query_deposit && message.query_deposit.length)) - message.query_deposit = []; - message.query_deposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 3: - message.tx_query_removal_limit = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof neutron.interchainqueries.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query_submit_timeout != null && message.hasOwnProperty("query_submit_timeout")) - if (!$util.isInteger(message.query_submit_timeout) && !(message.query_submit_timeout && $util.isInteger(message.query_submit_timeout.low) && $util.isInteger(message.query_submit_timeout.high))) - return "query_submit_timeout: integer|Long expected"; - if (message.query_deposit != null && message.hasOwnProperty("query_deposit")) { - if (!Array.isArray(message.query_deposit)) - return "query_deposit: array expected"; - for (var i = 0; i < message.query_deposit.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.query_deposit[i]); - if (error) - return "query_deposit." + error; - } - } - if (message.tx_query_removal_limit != null && message.hasOwnProperty("tx_query_removal_limit")) - if (!$util.isInteger(message.tx_query_removal_limit) && !(message.tx_query_removal_limit && $util.isInteger(message.tx_query_removal_limit.low) && $util.isInteger(message.tx_query_removal_limit.high))) - return "tx_query_removal_limit: integer|Long expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.Params - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.Params) - return object; - var message = new $root.neutron.interchainqueries.Params(); - if (object.query_submit_timeout != null) - if ($util.Long) - (message.query_submit_timeout = $util.Long.fromValue(object.query_submit_timeout)).unsigned = true; - else if (typeof object.query_submit_timeout === "string") - message.query_submit_timeout = parseInt(object.query_submit_timeout, 10); - else if (typeof object.query_submit_timeout === "number") - message.query_submit_timeout = object.query_submit_timeout; - else if (typeof object.query_submit_timeout === "object") - message.query_submit_timeout = new $util.LongBits(object.query_submit_timeout.low >>> 0, object.query_submit_timeout.high >>> 0).toNumber(true); - if (object.query_deposit) { - if (!Array.isArray(object.query_deposit)) - throw TypeError(".neutron.interchainqueries.Params.query_deposit: array expected"); - message.query_deposit = []; - for (var i = 0; i < object.query_deposit.length; ++i) { - if (typeof object.query_deposit[i] !== "object") - throw TypeError(".neutron.interchainqueries.Params.query_deposit: object expected"); - message.query_deposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.query_deposit[i]); - } - } - if (object.tx_query_removal_limit != null) - if ($util.Long) - (message.tx_query_removal_limit = $util.Long.fromValue(object.tx_query_removal_limit)).unsigned = true; - else if (typeof object.tx_query_removal_limit === "string") - message.tx_query_removal_limit = parseInt(object.tx_query_removal_limit, 10); - else if (typeof object.tx_query_removal_limit === "number") - message.tx_query_removal_limit = object.tx_query_removal_limit; - else if (typeof object.tx_query_removal_limit === "object") - message.tx_query_removal_limit = new $util.LongBits(object.tx_query_removal_limit.low >>> 0, object.tx_query_removal_limit.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.Params - * @static - * @param {neutron.interchainqueries.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.query_deposit = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_submit_timeout = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_submit_timeout = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tx_query_removal_limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tx_query_removal_limit = options.longs === String ? "0" : 0; - } - if (message.query_submit_timeout != null && message.hasOwnProperty("query_submit_timeout")) - if (typeof message.query_submit_timeout === "number") - object.query_submit_timeout = options.longs === String ? String(message.query_submit_timeout) : message.query_submit_timeout; - else - object.query_submit_timeout = options.longs === String ? $util.Long.prototype.toString.call(message.query_submit_timeout) : options.longs === Number ? new $util.LongBits(message.query_submit_timeout.low >>> 0, message.query_submit_timeout.high >>> 0).toNumber(true) : message.query_submit_timeout; - if (message.query_deposit && message.query_deposit.length) { - object.query_deposit = []; - for (var j = 0; j < message.query_deposit.length; ++j) - object.query_deposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.query_deposit[j], options); - } - if (message.tx_query_removal_limit != null && message.hasOwnProperty("tx_query_removal_limit")) - if (typeof message.tx_query_removal_limit === "number") - object.tx_query_removal_limit = options.longs === String ? String(message.tx_query_removal_limit) : message.tx_query_removal_limit; - else - object.tx_query_removal_limit = options.longs === String ? $util.Long.prototype.toString.call(message.tx_query_removal_limit) : options.longs === Number ? new $util.LongBits(message.tx_query_removal_limit.low >>> 0, message.tx_query_removal_limit.high >>> 0).toNumber(true) : message.tx_query_removal_limit; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - interchainqueries.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof neutron.interchainqueries - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link neutron.interchainqueries.Msg#registerInterchainQuery}. - * @memberof neutron.interchainqueries.Msg - * @typedef RegisterInterchainQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchainqueries.MsgRegisterInterchainQueryResponse} [response] MsgRegisterInterchainQueryResponse - */ - - /** - * Calls RegisterInterchainQuery. - * @function registerInterchainQuery - * @memberof neutron.interchainqueries.Msg - * @instance - * @param {neutron.interchainqueries.IMsgRegisterInterchainQuery} request MsgRegisterInterchainQuery message or plain object - * @param {neutron.interchainqueries.Msg.RegisterInterchainQueryCallback} callback Node-style callback called with the error, if any, and MsgRegisterInterchainQueryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.registerInterchainQuery = function registerInterchainQuery(request, callback) { - return this.rpcCall(registerInterchainQuery, $root.neutron.interchainqueries.MsgRegisterInterchainQuery, $root.neutron.interchainqueries.MsgRegisterInterchainQueryResponse, request, callback); - }, "name", { value: "RegisterInterchainQuery" }); - - /** - * Calls RegisterInterchainQuery. - * @function registerInterchainQuery - * @memberof neutron.interchainqueries.Msg - * @instance - * @param {neutron.interchainqueries.IMsgRegisterInterchainQuery} request MsgRegisterInterchainQuery message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.interchainqueries.Msg#submitQueryResult}. - * @memberof neutron.interchainqueries.Msg - * @typedef SubmitQueryResultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchainqueries.MsgSubmitQueryResultResponse} [response] MsgSubmitQueryResultResponse - */ - - /** - * Calls SubmitQueryResult. - * @function submitQueryResult - * @memberof neutron.interchainqueries.Msg - * @instance - * @param {neutron.interchainqueries.IMsgSubmitQueryResult} request MsgSubmitQueryResult message or plain object - * @param {neutron.interchainqueries.Msg.SubmitQueryResultCallback} callback Node-style callback called with the error, if any, and MsgSubmitQueryResultResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.submitQueryResult = function submitQueryResult(request, callback) { - return this.rpcCall(submitQueryResult, $root.neutron.interchainqueries.MsgSubmitQueryResult, $root.neutron.interchainqueries.MsgSubmitQueryResultResponse, request, callback); - }, "name", { value: "SubmitQueryResult" }); - - /** - * Calls SubmitQueryResult. - * @function submitQueryResult - * @memberof neutron.interchainqueries.Msg - * @instance - * @param {neutron.interchainqueries.IMsgSubmitQueryResult} request MsgSubmitQueryResult message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.interchainqueries.Msg#removeInterchainQuery}. - * @memberof neutron.interchainqueries.Msg - * @typedef RemoveInterchainQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchainqueries.MsgRemoveInterchainQueryResponse} [response] MsgRemoveInterchainQueryResponse - */ - - /** - * Calls RemoveInterchainQuery. - * @function removeInterchainQuery - * @memberof neutron.interchainqueries.Msg - * @instance - * @param {neutron.interchainqueries.IMsgRemoveInterchainQueryRequest} request MsgRemoveInterchainQueryRequest message or plain object - * @param {neutron.interchainqueries.Msg.RemoveInterchainQueryCallback} callback Node-style callback called with the error, if any, and MsgRemoveInterchainQueryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.removeInterchainQuery = function removeInterchainQuery(request, callback) { - return this.rpcCall(removeInterchainQuery, $root.neutron.interchainqueries.MsgRemoveInterchainQueryRequest, $root.neutron.interchainqueries.MsgRemoveInterchainQueryResponse, request, callback); - }, "name", { value: "RemoveInterchainQuery" }); - - /** - * Calls RemoveInterchainQuery. - * @function removeInterchainQuery - * @memberof neutron.interchainqueries.Msg - * @instance - * @param {neutron.interchainqueries.IMsgRemoveInterchainQueryRequest} request MsgRemoveInterchainQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.interchainqueries.Msg#updateInterchainQuery}. - * @memberof neutron.interchainqueries.Msg - * @typedef UpdateInterchainQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchainqueries.MsgUpdateInterchainQueryResponse} [response] MsgUpdateInterchainQueryResponse - */ - - /** - * Calls UpdateInterchainQuery. - * @function updateInterchainQuery - * @memberof neutron.interchainqueries.Msg - * @instance - * @param {neutron.interchainqueries.IMsgUpdateInterchainQueryRequest} request MsgUpdateInterchainQueryRequest message or plain object - * @param {neutron.interchainqueries.Msg.UpdateInterchainQueryCallback} callback Node-style callback called with the error, if any, and MsgUpdateInterchainQueryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.updateInterchainQuery = function updateInterchainQuery(request, callback) { - return this.rpcCall(updateInterchainQuery, $root.neutron.interchainqueries.MsgUpdateInterchainQueryRequest, $root.neutron.interchainqueries.MsgUpdateInterchainQueryResponse, request, callback); - }, "name", { value: "UpdateInterchainQuery" }); - - /** - * Calls UpdateInterchainQuery. - * @function updateInterchainQuery - * @memberof neutron.interchainqueries.Msg - * @instance - * @param {neutron.interchainqueries.IMsgUpdateInterchainQueryRequest} request MsgUpdateInterchainQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - interchainqueries.MsgRegisterInterchainQuery = (function() { - - /** - * Properties of a MsgRegisterInterchainQuery. - * @memberof neutron.interchainqueries - * @interface IMsgRegisterInterchainQuery - * @property {string|null} [query_type] MsgRegisterInterchainQuery query_type - * @property {Array.|null} [keys] MsgRegisterInterchainQuery keys - * @property {string|null} [transactions_filter] MsgRegisterInterchainQuery transactions_filter - * @property {string|null} [connection_id] MsgRegisterInterchainQuery connection_id - * @property {Long|null} [update_period] MsgRegisterInterchainQuery update_period - * @property {string|null} [sender] MsgRegisterInterchainQuery sender - */ - - /** - * Constructs a new MsgRegisterInterchainQuery. - * @memberof neutron.interchainqueries - * @classdesc Represents a MsgRegisterInterchainQuery. - * @implements IMsgRegisterInterchainQuery - * @constructor - * @param {neutron.interchainqueries.IMsgRegisterInterchainQuery=} [properties] Properties to set - */ - function MsgRegisterInterchainQuery(properties) { - this.keys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRegisterInterchainQuery query_type. - * @member {string} query_type - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @instance - */ - MsgRegisterInterchainQuery.prototype.query_type = ""; - - /** - * MsgRegisterInterchainQuery keys. - * @member {Array.} keys - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @instance - */ - MsgRegisterInterchainQuery.prototype.keys = $util.emptyArray; - - /** - * MsgRegisterInterchainQuery transactions_filter. - * @member {string} transactions_filter - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @instance - */ - MsgRegisterInterchainQuery.prototype.transactions_filter = ""; - - /** - * MsgRegisterInterchainQuery connection_id. - * @member {string} connection_id - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @instance - */ - MsgRegisterInterchainQuery.prototype.connection_id = ""; - - /** - * MsgRegisterInterchainQuery update_period. - * @member {Long} update_period - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @instance - */ - MsgRegisterInterchainQuery.prototype.update_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgRegisterInterchainQuery sender. - * @member {string} sender - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @instance - */ - MsgRegisterInterchainQuery.prototype.sender = ""; - - /** - * Encodes the specified MsgRegisterInterchainQuery message. Does not implicitly {@link neutron.interchainqueries.MsgRegisterInterchainQuery.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @static - * @param {neutron.interchainqueries.IMsgRegisterInterchainQuery} message MsgRegisterInterchainQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterInterchainQuery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query_type != null && Object.hasOwnProperty.call(message, "query_type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.query_type); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.neutron.interchainqueries.KVKey.encode(message.keys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.transactions_filter != null && Object.hasOwnProperty.call(message, "transactions_filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactions_filter); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.connection_id); - if (message.update_period != null && Object.hasOwnProperty.call(message, "update_period")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.update_period); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.sender); - return writer; - }; - - /** - * Encodes the specified MsgRegisterInterchainQuery message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgRegisterInterchainQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @static - * @param {neutron.interchainqueries.IMsgRegisterInterchainQuery} message MsgRegisterInterchainQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterInterchainQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterInterchainQuery message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.MsgRegisterInterchainQuery} MsgRegisterInterchainQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterInterchainQuery.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.MsgRegisterInterchainQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.query_type = reader.string(); - break; - case 2: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.neutron.interchainqueries.KVKey.decode(reader, reader.uint32())); - break; - case 3: - message.transactions_filter = reader.string(); - break; - case 4: - message.connection_id = reader.string(); - break; - case 5: - message.update_period = reader.uint64(); - break; - case 6: - message.sender = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterInterchainQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.MsgRegisterInterchainQuery} MsgRegisterInterchainQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterInterchainQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterInterchainQuery message. - * @function verify - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterInterchainQuery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query_type != null && message.hasOwnProperty("query_type")) - if (!$util.isString(message.query_type)) - return "query_type: string expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.neutron.interchainqueries.KVKey.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - if (message.transactions_filter != null && message.hasOwnProperty("transactions_filter")) - if (!$util.isString(message.transactions_filter)) - return "transactions_filter: string expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.update_period != null && message.hasOwnProperty("update_period")) - if (!$util.isInteger(message.update_period) && !(message.update_period && $util.isInteger(message.update_period.low) && $util.isInteger(message.update_period.high))) - return "update_period: integer|Long expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - return null; - }; - - /** - * Creates a MsgRegisterInterchainQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.MsgRegisterInterchainQuery} MsgRegisterInterchainQuery - */ - MsgRegisterInterchainQuery.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.MsgRegisterInterchainQuery) - return object; - var message = new $root.neutron.interchainqueries.MsgRegisterInterchainQuery(); - if (object.query_type != null) - message.query_type = String(object.query_type); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".neutron.interchainqueries.MsgRegisterInterchainQuery.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".neutron.interchainqueries.MsgRegisterInterchainQuery.keys: object expected"); - message.keys[i] = $root.neutron.interchainqueries.KVKey.fromObject(object.keys[i]); - } - } - if (object.transactions_filter != null) - message.transactions_filter = String(object.transactions_filter); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.update_period != null) - if ($util.Long) - (message.update_period = $util.Long.fromValue(object.update_period)).unsigned = true; - else if (typeof object.update_period === "string") - message.update_period = parseInt(object.update_period, 10); - else if (typeof object.update_period === "number") - message.update_period = object.update_period; - else if (typeof object.update_period === "object") - message.update_period = new $util.LongBits(object.update_period.low >>> 0, object.update_period.high >>> 0).toNumber(true); - if (object.sender != null) - message.sender = String(object.sender); - return message; - }; - - /** - * Creates a plain object from a MsgRegisterInterchainQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @static - * @param {neutron.interchainqueries.MsgRegisterInterchainQuery} message MsgRegisterInterchainQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterInterchainQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) { - object.query_type = ""; - object.transactions_filter = ""; - object.connection_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.update_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.update_period = options.longs === String ? "0" : 0; - object.sender = ""; - } - if (message.query_type != null && message.hasOwnProperty("query_type")) - object.query_type = message.query_type; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.neutron.interchainqueries.KVKey.toObject(message.keys[j], options); - } - if (message.transactions_filter != null && message.hasOwnProperty("transactions_filter")) - object.transactions_filter = message.transactions_filter; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.update_period != null && message.hasOwnProperty("update_period")) - if (typeof message.update_period === "number") - object.update_period = options.longs === String ? String(message.update_period) : message.update_period; - else - object.update_period = options.longs === String ? $util.Long.prototype.toString.call(message.update_period) : options.longs === Number ? new $util.LongBits(message.update_period.low >>> 0, message.update_period.high >>> 0).toNumber(true) : message.update_period; - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - return object; - }; - - /** - * Converts this MsgRegisterInterchainQuery to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.MsgRegisterInterchainQuery - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterInterchainQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterInterchainQuery; - })(); - - interchainqueries.MsgRegisterInterchainQueryResponse = (function() { - - /** - * Properties of a MsgRegisterInterchainQueryResponse. - * @memberof neutron.interchainqueries - * @interface IMsgRegisterInterchainQueryResponse - * @property {Long|null} [id] MsgRegisterInterchainQueryResponse id - */ - - /** - * Constructs a new MsgRegisterInterchainQueryResponse. - * @memberof neutron.interchainqueries - * @classdesc Represents a MsgRegisterInterchainQueryResponse. - * @implements IMsgRegisterInterchainQueryResponse - * @constructor - * @param {neutron.interchainqueries.IMsgRegisterInterchainQueryResponse=} [properties] Properties to set - */ - function MsgRegisterInterchainQueryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRegisterInterchainQueryResponse id. - * @member {Long} id - * @memberof neutron.interchainqueries.MsgRegisterInterchainQueryResponse - * @instance - */ - MsgRegisterInterchainQueryResponse.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified MsgRegisterInterchainQueryResponse message. Does not implicitly {@link neutron.interchainqueries.MsgRegisterInterchainQueryResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.MsgRegisterInterchainQueryResponse - * @static - * @param {neutron.interchainqueries.IMsgRegisterInterchainQueryResponse} message MsgRegisterInterchainQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterInterchainQueryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.id); - return writer; - }; - - /** - * Encodes the specified MsgRegisterInterchainQueryResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgRegisterInterchainQueryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.MsgRegisterInterchainQueryResponse - * @static - * @param {neutron.interchainqueries.IMsgRegisterInterchainQueryResponse} message MsgRegisterInterchainQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterInterchainQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterInterchainQueryResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.MsgRegisterInterchainQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.MsgRegisterInterchainQueryResponse} MsgRegisterInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterInterchainQueryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.MsgRegisterInterchainQueryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterInterchainQueryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.MsgRegisterInterchainQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.MsgRegisterInterchainQueryResponse} MsgRegisterInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterInterchainQueryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterInterchainQueryResponse message. - * @function verify - * @memberof neutron.interchainqueries.MsgRegisterInterchainQueryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterInterchainQueryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) - return "id: integer|Long expected"; - return null; - }; - - /** - * Creates a MsgRegisterInterchainQueryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.MsgRegisterInterchainQueryResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.MsgRegisterInterchainQueryResponse} MsgRegisterInterchainQueryResponse - */ - MsgRegisterInterchainQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.MsgRegisterInterchainQueryResponse) - return object; - var message = new $root.neutron.interchainqueries.MsgRegisterInterchainQueryResponse(); - if (object.id != null) - if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = true; - else if (typeof object.id === "string") - message.id = parseInt(object.id, 10); - else if (typeof object.id === "number") - message.id = object.id; - else if (typeof object.id === "object") - message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a MsgRegisterInterchainQueryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.MsgRegisterInterchainQueryResponse - * @static - * @param {neutron.interchainqueries.MsgRegisterInterchainQueryResponse} message MsgRegisterInterchainQueryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterInterchainQueryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.id = options.longs === String ? "0" : 0; - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") - object.id = options.longs === String ? String(message.id) : message.id; - else - object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; - return object; - }; - - /** - * Converts this MsgRegisterInterchainQueryResponse to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.MsgRegisterInterchainQueryResponse - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterInterchainQueryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterInterchainQueryResponse; - })(); - - interchainqueries.MsgSubmitQueryResult = (function() { - - /** - * Properties of a MsgSubmitQueryResult. - * @memberof neutron.interchainqueries - * @interface IMsgSubmitQueryResult - * @property {Long|null} [query_id] MsgSubmitQueryResult query_id - * @property {string|null} [sender] MsgSubmitQueryResult sender - * @property {string|null} [client_id] MsgSubmitQueryResult client_id - * @property {neutron.interchainqueries.IQueryResult|null} [result] MsgSubmitQueryResult result - */ - - /** - * Constructs a new MsgSubmitQueryResult. - * @memberof neutron.interchainqueries - * @classdesc Represents a MsgSubmitQueryResult. - * @implements IMsgSubmitQueryResult - * @constructor - * @param {neutron.interchainqueries.IMsgSubmitQueryResult=} [properties] Properties to set - */ - function MsgSubmitQueryResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitQueryResult query_id. - * @member {Long} query_id - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @instance - */ - MsgSubmitQueryResult.prototype.query_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgSubmitQueryResult sender. - * @member {string} sender - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @instance - */ - MsgSubmitQueryResult.prototype.sender = ""; - - /** - * MsgSubmitQueryResult client_id. - * @member {string} client_id - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @instance - */ - MsgSubmitQueryResult.prototype.client_id = ""; - - /** - * MsgSubmitQueryResult result. - * @member {neutron.interchainqueries.IQueryResult|null|undefined} result - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @instance - */ - MsgSubmitQueryResult.prototype.result = null; - - /** - * Encodes the specified MsgSubmitQueryResult message. Does not implicitly {@link neutron.interchainqueries.MsgSubmitQueryResult.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @static - * @param {neutron.interchainqueries.IMsgSubmitQueryResult} message MsgSubmitQueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitQueryResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query_id != null && Object.hasOwnProperty.call(message, "query_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.query_id); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sender); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.client_id); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - $root.neutron.interchainqueries.QueryResult.encode(message.result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MsgSubmitQueryResult message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgSubmitQueryResult.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @static - * @param {neutron.interchainqueries.IMsgSubmitQueryResult} message MsgSubmitQueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitQueryResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitQueryResult message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.MsgSubmitQueryResult} MsgSubmitQueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitQueryResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.MsgSubmitQueryResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.query_id = reader.uint64(); - break; - case 2: - message.sender = reader.string(); - break; - case 3: - message.client_id = reader.string(); - break; - case 4: - message.result = $root.neutron.interchainqueries.QueryResult.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitQueryResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.MsgSubmitQueryResult} MsgSubmitQueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitQueryResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitQueryResult message. - * @function verify - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitQueryResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (!$util.isInteger(message.query_id) && !(message.query_id && $util.isInteger(message.query_id.low) && $util.isInteger(message.query_id.high))) - return "query_id: integer|Long expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.result != null && message.hasOwnProperty("result")) { - var error = $root.neutron.interchainqueries.QueryResult.verify(message.result); - if (error) - return "result." + error; - } - return null; - }; - - /** - * Creates a MsgSubmitQueryResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.MsgSubmitQueryResult} MsgSubmitQueryResult - */ - MsgSubmitQueryResult.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.MsgSubmitQueryResult) - return object; - var message = new $root.neutron.interchainqueries.MsgSubmitQueryResult(); - if (object.query_id != null) - if ($util.Long) - (message.query_id = $util.Long.fromValue(object.query_id)).unsigned = true; - else if (typeof object.query_id === "string") - message.query_id = parseInt(object.query_id, 10); - else if (typeof object.query_id === "number") - message.query_id = object.query_id; - else if (typeof object.query_id === "object") - message.query_id = new $util.LongBits(object.query_id.low >>> 0, object.query_id.high >>> 0).toNumber(true); - if (object.sender != null) - message.sender = String(object.sender); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.result != null) { - if (typeof object.result !== "object") - throw TypeError(".neutron.interchainqueries.MsgSubmitQueryResult.result: object expected"); - message.result = $root.neutron.interchainqueries.QueryResult.fromObject(object.result); - } - return message; - }; - - /** - * Creates a plain object from a MsgSubmitQueryResult message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @static - * @param {neutron.interchainqueries.MsgSubmitQueryResult} message MsgSubmitQueryResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitQueryResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_id = options.longs === String ? "0" : 0; - object.sender = ""; - object.client_id = ""; - object.result = null; - } - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (typeof message.query_id === "number") - object.query_id = options.longs === String ? String(message.query_id) : message.query_id; - else - object.query_id = options.longs === String ? $util.Long.prototype.toString.call(message.query_id) : options.longs === Number ? new $util.LongBits(message.query_id.low >>> 0, message.query_id.high >>> 0).toNumber(true) : message.query_id; - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.result != null && message.hasOwnProperty("result")) - object.result = $root.neutron.interchainqueries.QueryResult.toObject(message.result, options); - return object; - }; - - /** - * Converts this MsgSubmitQueryResult to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.MsgSubmitQueryResult - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitQueryResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitQueryResult; - })(); - - interchainqueries.QueryResult = (function() { - - /** - * Properties of a QueryResult. - * @memberof neutron.interchainqueries - * @interface IQueryResult - * @property {Array.|null} [kv_results] QueryResult kv_results - * @property {neutron.interchainqueries.IBlock|null} [block] QueryResult block - * @property {Long|null} [height] QueryResult height - * @property {Long|null} [revision] QueryResult revision - * @property {boolean|null} [allow_kv_callbacks] QueryResult allow_kv_callbacks - */ - - /** - * Constructs a new QueryResult. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryResult. - * @implements IQueryResult - * @constructor - * @param {neutron.interchainqueries.IQueryResult=} [properties] Properties to set - */ - function QueryResult(properties) { - this.kv_results = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryResult kv_results. - * @member {Array.} kv_results - * @memberof neutron.interchainqueries.QueryResult - * @instance - */ - QueryResult.prototype.kv_results = $util.emptyArray; - - /** - * QueryResult block. - * @member {neutron.interchainqueries.IBlock|null|undefined} block - * @memberof neutron.interchainqueries.QueryResult - * @instance - */ - QueryResult.prototype.block = null; - - /** - * QueryResult height. - * @member {Long} height - * @memberof neutron.interchainqueries.QueryResult - * @instance - */ - QueryResult.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryResult revision. - * @member {Long} revision - * @memberof neutron.interchainqueries.QueryResult - * @instance - */ - QueryResult.prototype.revision = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * QueryResult allow_kv_callbacks. - * @member {boolean} allow_kv_callbacks - * @memberof neutron.interchainqueries.QueryResult - * @instance - */ - QueryResult.prototype.allow_kv_callbacks = false; - - /** - * Encodes the specified QueryResult message. Does not implicitly {@link neutron.interchainqueries.QueryResult.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryResult - * @static - * @param {neutron.interchainqueries.IQueryResult} message QueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kv_results != null && message.kv_results.length) - for (var i = 0; i < message.kv_results.length; ++i) - $root.neutron.interchainqueries.StorageValue.encode(message.kv_results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - $root.neutron.interchainqueries.Block.encode(message.block, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.height); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.revision); - if (message.allow_kv_callbacks != null && Object.hasOwnProperty.call(message, "allow_kv_callbacks")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allow_kv_callbacks); - return writer; - }; - - /** - * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryResult.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryResult - * @static - * @param {neutron.interchainqueries.IQueryResult} message QueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryResult message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryResult} QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.kv_results && message.kv_results.length)) - message.kv_results = []; - message.kv_results.push($root.neutron.interchainqueries.StorageValue.decode(reader, reader.uint32())); - break; - case 2: - message.block = $root.neutron.interchainqueries.Block.decode(reader, reader.uint32()); - break; - case 3: - message.height = reader.uint64(); - break; - case 4: - message.revision = reader.uint64(); - break; - case 5: - message.allow_kv_callbacks = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryResult} QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryResult message. - * @function verify - * @memberof neutron.interchainqueries.QueryResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kv_results != null && message.hasOwnProperty("kv_results")) { - if (!Array.isArray(message.kv_results)) - return "kv_results: array expected"; - for (var i = 0; i < message.kv_results.length; ++i) { - var error = $root.neutron.interchainqueries.StorageValue.verify(message.kv_results[i]); - if (error) - return "kv_results." + error; - } - } - if (message.block != null && message.hasOwnProperty("block")) { - var error = $root.neutron.interchainqueries.Block.verify(message.block); - if (error) - return "block." + error; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isInteger(message.revision) && !(message.revision && $util.isInteger(message.revision.low) && $util.isInteger(message.revision.high))) - return "revision: integer|Long expected"; - if (message.allow_kv_callbacks != null && message.hasOwnProperty("allow_kv_callbacks")) - if (typeof message.allow_kv_callbacks !== "boolean") - return "allow_kv_callbacks: boolean expected"; - return null; - }; - - /** - * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryResult - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryResult} QueryResult - */ - QueryResult.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryResult) - return object; - var message = new $root.neutron.interchainqueries.QueryResult(); - if (object.kv_results) { - if (!Array.isArray(object.kv_results)) - throw TypeError(".neutron.interchainqueries.QueryResult.kv_results: array expected"); - message.kv_results = []; - for (var i = 0; i < object.kv_results.length; ++i) { - if (typeof object.kv_results[i] !== "object") - throw TypeError(".neutron.interchainqueries.QueryResult.kv_results: object expected"); - message.kv_results[i] = $root.neutron.interchainqueries.StorageValue.fromObject(object.kv_results[i]); - } - } - if (object.block != null) { - if (typeof object.block !== "object") - throw TypeError(".neutron.interchainqueries.QueryResult.block: object expected"); - message.block = $root.neutron.interchainqueries.Block.fromObject(object.block); - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = true; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); - if (object.revision != null) - if ($util.Long) - (message.revision = $util.Long.fromValue(object.revision)).unsigned = true; - else if (typeof object.revision === "string") - message.revision = parseInt(object.revision, 10); - else if (typeof object.revision === "number") - message.revision = object.revision; - else if (typeof object.revision === "object") - message.revision = new $util.LongBits(object.revision.low >>> 0, object.revision.high >>> 0).toNumber(true); - if (object.allow_kv_callbacks != null) - message.allow_kv_callbacks = Boolean(object.allow_kv_callbacks); - return message; - }; - - /** - * Creates a plain object from a QueryResult message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryResult - * @static - * @param {neutron.interchainqueries.QueryResult} message QueryResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.kv_results = []; - if (options.defaults) { - object.block = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision = options.longs === String ? "0" : 0; - object.allow_kv_callbacks = false; - } - if (message.kv_results && message.kv_results.length) { - object.kv_results = []; - for (var j = 0; j < message.kv_results.length; ++j) - object.kv_results[j] = $root.neutron.interchainqueries.StorageValue.toObject(message.kv_results[j], options); - } - if (message.block != null && message.hasOwnProperty("block")) - object.block = $root.neutron.interchainqueries.Block.toObject(message.block, options); - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; - if (message.revision != null && message.hasOwnProperty("revision")) - if (typeof message.revision === "number") - object.revision = options.longs === String ? String(message.revision) : message.revision; - else - object.revision = options.longs === String ? $util.Long.prototype.toString.call(message.revision) : options.longs === Number ? new $util.LongBits(message.revision.low >>> 0, message.revision.high >>> 0).toNumber(true) : message.revision; - if (message.allow_kv_callbacks != null && message.hasOwnProperty("allow_kv_callbacks")) - object.allow_kv_callbacks = message.allow_kv_callbacks; - return object; - }; - - /** - * Converts this QueryResult to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryResult - * @instance - * @returns {Object.} JSON object - */ - QueryResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryResult; - })(); - - interchainqueries.StorageValue = (function() { - - /** - * Properties of a StorageValue. - * @memberof neutron.interchainqueries - * @interface IStorageValue - * @property {string|null} [storage_prefix] StorageValue storage_prefix - * @property {Uint8Array|null} [key] StorageValue key - * @property {Uint8Array|null} [value] StorageValue value - * @property {tendermint.crypto.IProofOps|null} [Proof] StorageValue Proof - */ - - /** - * Constructs a new StorageValue. - * @memberof neutron.interchainqueries - * @classdesc Represents a StorageValue. - * @implements IStorageValue - * @constructor - * @param {neutron.interchainqueries.IStorageValue=} [properties] Properties to set - */ - function StorageValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StorageValue storage_prefix. - * @member {string} storage_prefix - * @memberof neutron.interchainqueries.StorageValue - * @instance - */ - StorageValue.prototype.storage_prefix = ""; - - /** - * StorageValue key. - * @member {Uint8Array} key - * @memberof neutron.interchainqueries.StorageValue - * @instance - */ - StorageValue.prototype.key = $util.newBuffer([]); - - /** - * StorageValue value. - * @member {Uint8Array} value - * @memberof neutron.interchainqueries.StorageValue - * @instance - */ - StorageValue.prototype.value = $util.newBuffer([]); - - /** - * StorageValue Proof. - * @member {tendermint.crypto.IProofOps|null|undefined} Proof - * @memberof neutron.interchainqueries.StorageValue - * @instance - */ - StorageValue.prototype.Proof = null; - - /** - * Encodes the specified StorageValue message. Does not implicitly {@link neutron.interchainqueries.StorageValue.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.StorageValue - * @static - * @param {neutron.interchainqueries.IStorageValue} message StorageValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StorageValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.storage_prefix != null && Object.hasOwnProperty.call(message, "storage_prefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.storage_prefix); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.value); - if (message.Proof != null && Object.hasOwnProperty.call(message, "Proof")) - $root.tendermint.crypto.ProofOps.encode(message.Proof, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StorageValue message, length delimited. Does not implicitly {@link neutron.interchainqueries.StorageValue.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.StorageValue - * @static - * @param {neutron.interchainqueries.IStorageValue} message StorageValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StorageValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StorageValue message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.StorageValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.StorageValue} StorageValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StorageValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.StorageValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.storage_prefix = reader.string(); - break; - case 2: - message.key = reader.bytes(); - break; - case 3: - message.value = reader.bytes(); - break; - case 4: - message.Proof = $root.tendermint.crypto.ProofOps.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StorageValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.StorageValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.StorageValue} StorageValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StorageValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StorageValue message. - * @function verify - * @memberof neutron.interchainqueries.StorageValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StorageValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.storage_prefix != null && message.hasOwnProperty("storage_prefix")) - if (!$util.isString(message.storage_prefix)) - return "storage_prefix: string expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - if (message.Proof != null && message.hasOwnProperty("Proof")) { - var error = $root.tendermint.crypto.ProofOps.verify(message.Proof); - if (error) - return "Proof." + error; - } - return null; - }; - - /** - * Creates a StorageValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.StorageValue - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.StorageValue} StorageValue - */ - StorageValue.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.StorageValue) - return object; - var message = new $root.neutron.interchainqueries.StorageValue(); - if (object.storage_prefix != null) - message.storage_prefix = String(object.storage_prefix); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - if (object.Proof != null) { - if (typeof object.Proof !== "object") - throw TypeError(".neutron.interchainqueries.StorageValue.Proof: object expected"); - message.Proof = $root.tendermint.crypto.ProofOps.fromObject(object.Proof); - } - return message; - }; - - /** - * Creates a plain object from a StorageValue message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.StorageValue - * @static - * @param {neutron.interchainqueries.StorageValue} message StorageValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StorageValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.storage_prefix = ""; - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - object.Proof = null; - } - if (message.storage_prefix != null && message.hasOwnProperty("storage_prefix")) - object.storage_prefix = message.storage_prefix; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - if (message.Proof != null && message.hasOwnProperty("Proof")) - object.Proof = $root.tendermint.crypto.ProofOps.toObject(message.Proof, options); - return object; - }; - - /** - * Converts this StorageValue to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.StorageValue - * @instance - * @returns {Object.} JSON object - */ - StorageValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return StorageValue; - })(); - - interchainqueries.Block = (function() { - - /** - * Properties of a Block. - * @memberof neutron.interchainqueries - * @interface IBlock - * @property {google.protobuf.IAny|null} [next_block_header] Block next_block_header - * @property {google.protobuf.IAny|null} [header] Block header - * @property {neutron.interchainqueries.ITxValue|null} [tx] Block tx - */ - - /** - * Constructs a new Block. - * @memberof neutron.interchainqueries - * @classdesc Represents a Block. - * @implements IBlock - * @constructor - * @param {neutron.interchainqueries.IBlock=} [properties] Properties to set - */ - function Block(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Block next_block_header. - * @member {google.protobuf.IAny|null|undefined} next_block_header - * @memberof neutron.interchainqueries.Block - * @instance - */ - Block.prototype.next_block_header = null; - - /** - * Block header. - * @member {google.protobuf.IAny|null|undefined} header - * @memberof neutron.interchainqueries.Block - * @instance - */ - Block.prototype.header = null; - - /** - * Block tx. - * @member {neutron.interchainqueries.ITxValue|null|undefined} tx - * @memberof neutron.interchainqueries.Block - * @instance - */ - Block.prototype.tx = null; - - /** - * Encodes the specified Block message. Does not implicitly {@link neutron.interchainqueries.Block.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.Block - * @static - * @param {neutron.interchainqueries.IBlock} message Block message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Block.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.next_block_header != null && Object.hasOwnProperty.call(message, "next_block_header")) - $root.google.protobuf.Any.encode(message.next_block_header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) - $root.neutron.interchainqueries.TxValue.encode(message.tx, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Block message, length delimited. Does not implicitly {@link neutron.interchainqueries.Block.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.Block - * @static - * @param {neutron.interchainqueries.IBlock} message Block message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Block.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Block message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.Block - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.Block} Block - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Block.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.Block(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_block_header = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 2: - message.header = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.tx = $root.neutron.interchainqueries.TxValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Block message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.Block - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.Block} Block - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Block.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Block message. - * @function verify - * @memberof neutron.interchainqueries.Block - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Block.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.next_block_header != null && message.hasOwnProperty("next_block_header")) { - var error = $root.google.protobuf.Any.verify(message.next_block_header); - if (error) - return "next_block_header." + error; - } - if (message.header != null && message.hasOwnProperty("header")) { - var error = $root.google.protobuf.Any.verify(message.header); - if (error) - return "header." + error; - } - if (message.tx != null && message.hasOwnProperty("tx")) { - var error = $root.neutron.interchainqueries.TxValue.verify(message.tx); - if (error) - return "tx." + error; - } - return null; - }; - - /** - * Creates a Block message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.Block - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.Block} Block - */ - Block.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.Block) - return object; - var message = new $root.neutron.interchainqueries.Block(); - if (object.next_block_header != null) { - if (typeof object.next_block_header !== "object") - throw TypeError(".neutron.interchainqueries.Block.next_block_header: object expected"); - message.next_block_header = $root.google.protobuf.Any.fromObject(object.next_block_header); - } - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".neutron.interchainqueries.Block.header: object expected"); - message.header = $root.google.protobuf.Any.fromObject(object.header); - } - if (object.tx != null) { - if (typeof object.tx !== "object") - throw TypeError(".neutron.interchainqueries.Block.tx: object expected"); - message.tx = $root.neutron.interchainqueries.TxValue.fromObject(object.tx); - } - return message; - }; - - /** - * Creates a plain object from a Block message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.Block - * @static - * @param {neutron.interchainqueries.Block} message Block - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Block.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.next_block_header = null; - object.header = null; - object.tx = null; - } - if (message.next_block_header != null && message.hasOwnProperty("next_block_header")) - object.next_block_header = $root.google.protobuf.Any.toObject(message.next_block_header, options); - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.google.protobuf.Any.toObject(message.header, options); - if (message.tx != null && message.hasOwnProperty("tx")) - object.tx = $root.neutron.interchainqueries.TxValue.toObject(message.tx, options); - return object; - }; - - /** - * Converts this Block to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.Block - * @instance - * @returns {Object.} JSON object - */ - Block.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Block; - })(); - - interchainqueries.TxValue = (function() { - - /** - * Properties of a TxValue. - * @memberof neutron.interchainqueries - * @interface ITxValue - * @property {tendermint.abci.IResponseDeliverTx|null} [response] TxValue response - * @property {tendermint.crypto.IProof|null} [delivery_proof] TxValue delivery_proof - * @property {tendermint.crypto.IProof|null} [inclusion_proof] TxValue inclusion_proof - * @property {Uint8Array|null} [data] TxValue data - */ - - /** - * Constructs a new TxValue. - * @memberof neutron.interchainqueries - * @classdesc Represents a TxValue. - * @implements ITxValue - * @constructor - * @param {neutron.interchainqueries.ITxValue=} [properties] Properties to set - */ - function TxValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TxValue response. - * @member {tendermint.abci.IResponseDeliverTx|null|undefined} response - * @memberof neutron.interchainqueries.TxValue - * @instance - */ - TxValue.prototype.response = null; - - /** - * TxValue delivery_proof. - * @member {tendermint.crypto.IProof|null|undefined} delivery_proof - * @memberof neutron.interchainqueries.TxValue - * @instance - */ - TxValue.prototype.delivery_proof = null; - - /** - * TxValue inclusion_proof. - * @member {tendermint.crypto.IProof|null|undefined} inclusion_proof - * @memberof neutron.interchainqueries.TxValue - * @instance - */ - TxValue.prototype.inclusion_proof = null; - - /** - * TxValue data. - * @member {Uint8Array} data - * @memberof neutron.interchainqueries.TxValue - * @instance - */ - TxValue.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified TxValue message. Does not implicitly {@link neutron.interchainqueries.TxValue.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.TxValue - * @static - * @param {neutron.interchainqueries.ITxValue} message TxValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.tendermint.abci.ResponseDeliverTx.encode(message.response, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.delivery_proof != null && Object.hasOwnProperty.call(message, "delivery_proof")) - $root.tendermint.crypto.Proof.encode(message.delivery_proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.inclusion_proof != null && Object.hasOwnProperty.call(message, "inclusion_proof")) - $root.tendermint.crypto.Proof.encode(message.inclusion_proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified TxValue message, length delimited. Does not implicitly {@link neutron.interchainqueries.TxValue.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.TxValue - * @static - * @param {neutron.interchainqueries.ITxValue} message TxValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TxValue message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.TxValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.TxValue} TxValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.TxValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.response = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32()); - break; - case 2: - message.delivery_proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.inclusion_proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - case 4: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TxValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.TxValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.TxValue} TxValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TxValue message. - * @function verify - * @memberof neutron.interchainqueries.TxValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TxValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.response != null && message.hasOwnProperty("response")) { - var error = $root.tendermint.abci.ResponseDeliverTx.verify(message.response); - if (error) - return "response." + error; - } - if (message.delivery_proof != null && message.hasOwnProperty("delivery_proof")) { - var error = $root.tendermint.crypto.Proof.verify(message.delivery_proof); - if (error) - return "delivery_proof." + error; - } - if (message.inclusion_proof != null && message.hasOwnProperty("inclusion_proof")) { - var error = $root.tendermint.crypto.Proof.verify(message.inclusion_proof); - if (error) - return "inclusion_proof." + error; - } - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a TxValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.TxValue - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.TxValue} TxValue - */ - TxValue.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.TxValue) - return object; - var message = new $root.neutron.interchainqueries.TxValue(); - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".neutron.interchainqueries.TxValue.response: object expected"); - message.response = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.response); - } - if (object.delivery_proof != null) { - if (typeof object.delivery_proof !== "object") - throw TypeError(".neutron.interchainqueries.TxValue.delivery_proof: object expected"); - message.delivery_proof = $root.tendermint.crypto.Proof.fromObject(object.delivery_proof); - } - if (object.inclusion_proof != null) { - if (typeof object.inclusion_proof !== "object") - throw TypeError(".neutron.interchainqueries.TxValue.inclusion_proof: object expected"); - message.inclusion_proof = $root.tendermint.crypto.Proof.fromObject(object.inclusion_proof); - } - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a TxValue message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.TxValue - * @static - * @param {neutron.interchainqueries.TxValue} message TxValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TxValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.response = null; - object.delivery_proof = null; - object.inclusion_proof = null; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.response != null && message.hasOwnProperty("response")) - object.response = $root.tendermint.abci.ResponseDeliverTx.toObject(message.response, options); - if (message.delivery_proof != null && message.hasOwnProperty("delivery_proof")) - object.delivery_proof = $root.tendermint.crypto.Proof.toObject(message.delivery_proof, options); - if (message.inclusion_proof != null && message.hasOwnProperty("inclusion_proof")) - object.inclusion_proof = $root.tendermint.crypto.Proof.toObject(message.inclusion_proof, options); - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this TxValue to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.TxValue - * @instance - * @returns {Object.} JSON object - */ - TxValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TxValue; - })(); - - interchainqueries.MsgSubmitQueryResultResponse = (function() { - - /** - * Properties of a MsgSubmitQueryResultResponse. - * @memberof neutron.interchainqueries - * @interface IMsgSubmitQueryResultResponse - */ - - /** - * Constructs a new MsgSubmitQueryResultResponse. - * @memberof neutron.interchainqueries - * @classdesc Represents a MsgSubmitQueryResultResponse. - * @implements IMsgSubmitQueryResultResponse - * @constructor - * @param {neutron.interchainqueries.IMsgSubmitQueryResultResponse=} [properties] Properties to set - */ - function MsgSubmitQueryResultResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgSubmitQueryResultResponse message. Does not implicitly {@link neutron.interchainqueries.MsgSubmitQueryResultResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.MsgSubmitQueryResultResponse - * @static - * @param {neutron.interchainqueries.IMsgSubmitQueryResultResponse} message MsgSubmitQueryResultResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitQueryResultResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgSubmitQueryResultResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgSubmitQueryResultResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.MsgSubmitQueryResultResponse - * @static - * @param {neutron.interchainqueries.IMsgSubmitQueryResultResponse} message MsgSubmitQueryResultResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitQueryResultResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitQueryResultResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.MsgSubmitQueryResultResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.MsgSubmitQueryResultResponse} MsgSubmitQueryResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitQueryResultResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.MsgSubmitQueryResultResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitQueryResultResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.MsgSubmitQueryResultResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.MsgSubmitQueryResultResponse} MsgSubmitQueryResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitQueryResultResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitQueryResultResponse message. - * @function verify - * @memberof neutron.interchainqueries.MsgSubmitQueryResultResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitQueryResultResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgSubmitQueryResultResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.MsgSubmitQueryResultResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.MsgSubmitQueryResultResponse} MsgSubmitQueryResultResponse - */ - MsgSubmitQueryResultResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.MsgSubmitQueryResultResponse) - return object; - return new $root.neutron.interchainqueries.MsgSubmitQueryResultResponse(); - }; - - /** - * Creates a plain object from a MsgSubmitQueryResultResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.MsgSubmitQueryResultResponse - * @static - * @param {neutron.interchainqueries.MsgSubmitQueryResultResponse} message MsgSubmitQueryResultResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitQueryResultResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgSubmitQueryResultResponse to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.MsgSubmitQueryResultResponse - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitQueryResultResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitQueryResultResponse; - })(); - - interchainqueries.MsgRemoveInterchainQueryRequest = (function() { - - /** - * Properties of a MsgRemoveInterchainQueryRequest. - * @memberof neutron.interchainqueries - * @interface IMsgRemoveInterchainQueryRequest - * @property {Long|null} [query_id] MsgRemoveInterchainQueryRequest query_id - * @property {string|null} [sender] MsgRemoveInterchainQueryRequest sender - */ - - /** - * Constructs a new MsgRemoveInterchainQueryRequest. - * @memberof neutron.interchainqueries - * @classdesc Represents a MsgRemoveInterchainQueryRequest. - * @implements IMsgRemoveInterchainQueryRequest - * @constructor - * @param {neutron.interchainqueries.IMsgRemoveInterchainQueryRequest=} [properties] Properties to set - */ - function MsgRemoveInterchainQueryRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRemoveInterchainQueryRequest query_id. - * @member {Long} query_id - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @instance - */ - MsgRemoveInterchainQueryRequest.prototype.query_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgRemoveInterchainQueryRequest sender. - * @member {string} sender - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @instance - */ - MsgRemoveInterchainQueryRequest.prototype.sender = ""; - - /** - * Encodes the specified MsgRemoveInterchainQueryRequest message. Does not implicitly {@link neutron.interchainqueries.MsgRemoveInterchainQueryRequest.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @static - * @param {neutron.interchainqueries.IMsgRemoveInterchainQueryRequest} message MsgRemoveInterchainQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRemoveInterchainQueryRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query_id != null && Object.hasOwnProperty.call(message, "query_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.query_id); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sender); - return writer; - }; - - /** - * Encodes the specified MsgRemoveInterchainQueryRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgRemoveInterchainQueryRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @static - * @param {neutron.interchainqueries.IMsgRemoveInterchainQueryRequest} message MsgRemoveInterchainQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRemoveInterchainQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRemoveInterchainQueryRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.MsgRemoveInterchainQueryRequest} MsgRemoveInterchainQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRemoveInterchainQueryRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.MsgRemoveInterchainQueryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.query_id = reader.uint64(); - break; - case 2: - message.sender = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRemoveInterchainQueryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.MsgRemoveInterchainQueryRequest} MsgRemoveInterchainQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRemoveInterchainQueryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRemoveInterchainQueryRequest message. - * @function verify - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRemoveInterchainQueryRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (!$util.isInteger(message.query_id) && !(message.query_id && $util.isInteger(message.query_id.low) && $util.isInteger(message.query_id.high))) - return "query_id: integer|Long expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - return null; - }; - - /** - * Creates a MsgRemoveInterchainQueryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.MsgRemoveInterchainQueryRequest} MsgRemoveInterchainQueryRequest - */ - MsgRemoveInterchainQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.MsgRemoveInterchainQueryRequest) - return object; - var message = new $root.neutron.interchainqueries.MsgRemoveInterchainQueryRequest(); - if (object.query_id != null) - if ($util.Long) - (message.query_id = $util.Long.fromValue(object.query_id)).unsigned = true; - else if (typeof object.query_id === "string") - message.query_id = parseInt(object.query_id, 10); - else if (typeof object.query_id === "number") - message.query_id = object.query_id; - else if (typeof object.query_id === "object") - message.query_id = new $util.LongBits(object.query_id.low >>> 0, object.query_id.high >>> 0).toNumber(true); - if (object.sender != null) - message.sender = String(object.sender); - return message; - }; - - /** - * Creates a plain object from a MsgRemoveInterchainQueryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @static - * @param {neutron.interchainqueries.MsgRemoveInterchainQueryRequest} message MsgRemoveInterchainQueryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRemoveInterchainQueryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_id = options.longs === String ? "0" : 0; - object.sender = ""; - } - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (typeof message.query_id === "number") - object.query_id = options.longs === String ? String(message.query_id) : message.query_id; - else - object.query_id = options.longs === String ? $util.Long.prototype.toString.call(message.query_id) : options.longs === Number ? new $util.LongBits(message.query_id.low >>> 0, message.query_id.high >>> 0).toNumber(true) : message.query_id; - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - return object; - }; - - /** - * Converts this MsgRemoveInterchainQueryRequest to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryRequest - * @instance - * @returns {Object.} JSON object - */ - MsgRemoveInterchainQueryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRemoveInterchainQueryRequest; - })(); - - interchainqueries.MsgRemoveInterchainQueryResponse = (function() { - - /** - * Properties of a MsgRemoveInterchainQueryResponse. - * @memberof neutron.interchainqueries - * @interface IMsgRemoveInterchainQueryResponse - */ - - /** - * Constructs a new MsgRemoveInterchainQueryResponse. - * @memberof neutron.interchainqueries - * @classdesc Represents a MsgRemoveInterchainQueryResponse. - * @implements IMsgRemoveInterchainQueryResponse - * @constructor - * @param {neutron.interchainqueries.IMsgRemoveInterchainQueryResponse=} [properties] Properties to set - */ - function MsgRemoveInterchainQueryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgRemoveInterchainQueryResponse message. Does not implicitly {@link neutron.interchainqueries.MsgRemoveInterchainQueryResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryResponse - * @static - * @param {neutron.interchainqueries.IMsgRemoveInterchainQueryResponse} message MsgRemoveInterchainQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRemoveInterchainQueryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgRemoveInterchainQueryResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgRemoveInterchainQueryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryResponse - * @static - * @param {neutron.interchainqueries.IMsgRemoveInterchainQueryResponse} message MsgRemoveInterchainQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRemoveInterchainQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRemoveInterchainQueryResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.MsgRemoveInterchainQueryResponse} MsgRemoveInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRemoveInterchainQueryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.MsgRemoveInterchainQueryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRemoveInterchainQueryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.MsgRemoveInterchainQueryResponse} MsgRemoveInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRemoveInterchainQueryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRemoveInterchainQueryResponse message. - * @function verify - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRemoveInterchainQueryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgRemoveInterchainQueryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.MsgRemoveInterchainQueryResponse} MsgRemoveInterchainQueryResponse - */ - MsgRemoveInterchainQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.MsgRemoveInterchainQueryResponse) - return object; - return new $root.neutron.interchainqueries.MsgRemoveInterchainQueryResponse(); - }; - - /** - * Creates a plain object from a MsgRemoveInterchainQueryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryResponse - * @static - * @param {neutron.interchainqueries.MsgRemoveInterchainQueryResponse} message MsgRemoveInterchainQueryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRemoveInterchainQueryResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgRemoveInterchainQueryResponse to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.MsgRemoveInterchainQueryResponse - * @instance - * @returns {Object.} JSON object - */ - MsgRemoveInterchainQueryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRemoveInterchainQueryResponse; - })(); - - interchainqueries.MsgUpdateInterchainQueryRequest = (function() { - - /** - * Properties of a MsgUpdateInterchainQueryRequest. - * @memberof neutron.interchainqueries - * @interface IMsgUpdateInterchainQueryRequest - * @property {Long|null} [query_id] MsgUpdateInterchainQueryRequest query_id - * @property {Array.|null} [new_keys] MsgUpdateInterchainQueryRequest new_keys - * @property {Long|null} [new_update_period] MsgUpdateInterchainQueryRequest new_update_period - * @property {string|null} [new_transactions_filter] MsgUpdateInterchainQueryRequest new_transactions_filter - * @property {string|null} [sender] MsgUpdateInterchainQueryRequest sender - */ - - /** - * Constructs a new MsgUpdateInterchainQueryRequest. - * @memberof neutron.interchainqueries - * @classdesc Represents a MsgUpdateInterchainQueryRequest. - * @implements IMsgUpdateInterchainQueryRequest - * @constructor - * @param {neutron.interchainqueries.IMsgUpdateInterchainQueryRequest=} [properties] Properties to set - */ - function MsgUpdateInterchainQueryRequest(properties) { - this.new_keys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgUpdateInterchainQueryRequest query_id. - * @member {Long} query_id - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @instance - */ - MsgUpdateInterchainQueryRequest.prototype.query_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgUpdateInterchainQueryRequest new_keys. - * @member {Array.} new_keys - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @instance - */ - MsgUpdateInterchainQueryRequest.prototype.new_keys = $util.emptyArray; - - /** - * MsgUpdateInterchainQueryRequest new_update_period. - * @member {Long} new_update_period - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @instance - */ - MsgUpdateInterchainQueryRequest.prototype.new_update_period = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgUpdateInterchainQueryRequest new_transactions_filter. - * @member {string} new_transactions_filter - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @instance - */ - MsgUpdateInterchainQueryRequest.prototype.new_transactions_filter = ""; - - /** - * MsgUpdateInterchainQueryRequest sender. - * @member {string} sender - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @instance - */ - MsgUpdateInterchainQueryRequest.prototype.sender = ""; - - /** - * Encodes the specified MsgUpdateInterchainQueryRequest message. Does not implicitly {@link neutron.interchainqueries.MsgUpdateInterchainQueryRequest.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @static - * @param {neutron.interchainqueries.IMsgUpdateInterchainQueryRequest} message MsgUpdateInterchainQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateInterchainQueryRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query_id != null && Object.hasOwnProperty.call(message, "query_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.query_id); - if (message.new_keys != null && message.new_keys.length) - for (var i = 0; i < message.new_keys.length; ++i) - $root.neutron.interchainqueries.KVKey.encode(message.new_keys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.new_update_period != null && Object.hasOwnProperty.call(message, "new_update_period")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.new_update_period); - if (message.new_transactions_filter != null && Object.hasOwnProperty.call(message, "new_transactions_filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.new_transactions_filter); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.sender); - return writer; - }; - - /** - * Encodes the specified MsgUpdateInterchainQueryRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgUpdateInterchainQueryRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @static - * @param {neutron.interchainqueries.IMsgUpdateInterchainQueryRequest} message MsgUpdateInterchainQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateInterchainQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpdateInterchainQueryRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.MsgUpdateInterchainQueryRequest} MsgUpdateInterchainQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateInterchainQueryRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.MsgUpdateInterchainQueryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.query_id = reader.uint64(); - break; - case 2: - if (!(message.new_keys && message.new_keys.length)) - message.new_keys = []; - message.new_keys.push($root.neutron.interchainqueries.KVKey.decode(reader, reader.uint32())); - break; - case 3: - message.new_update_period = reader.uint64(); - break; - case 4: - message.new_transactions_filter = reader.string(); - break; - case 5: - message.sender = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpdateInterchainQueryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.MsgUpdateInterchainQueryRequest} MsgUpdateInterchainQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateInterchainQueryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpdateInterchainQueryRequest message. - * @function verify - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpdateInterchainQueryRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (!$util.isInteger(message.query_id) && !(message.query_id && $util.isInteger(message.query_id.low) && $util.isInteger(message.query_id.high))) - return "query_id: integer|Long expected"; - if (message.new_keys != null && message.hasOwnProperty("new_keys")) { - if (!Array.isArray(message.new_keys)) - return "new_keys: array expected"; - for (var i = 0; i < message.new_keys.length; ++i) { - var error = $root.neutron.interchainqueries.KVKey.verify(message.new_keys[i]); - if (error) - return "new_keys." + error; - } - } - if (message.new_update_period != null && message.hasOwnProperty("new_update_period")) - if (!$util.isInteger(message.new_update_period) && !(message.new_update_period && $util.isInteger(message.new_update_period.low) && $util.isInteger(message.new_update_period.high))) - return "new_update_period: integer|Long expected"; - if (message.new_transactions_filter != null && message.hasOwnProperty("new_transactions_filter")) - if (!$util.isString(message.new_transactions_filter)) - return "new_transactions_filter: string expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - return null; - }; - - /** - * Creates a MsgUpdateInterchainQueryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.MsgUpdateInterchainQueryRequest} MsgUpdateInterchainQueryRequest - */ - MsgUpdateInterchainQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.MsgUpdateInterchainQueryRequest) - return object; - var message = new $root.neutron.interchainqueries.MsgUpdateInterchainQueryRequest(); - if (object.query_id != null) - if ($util.Long) - (message.query_id = $util.Long.fromValue(object.query_id)).unsigned = true; - else if (typeof object.query_id === "string") - message.query_id = parseInt(object.query_id, 10); - else if (typeof object.query_id === "number") - message.query_id = object.query_id; - else if (typeof object.query_id === "object") - message.query_id = new $util.LongBits(object.query_id.low >>> 0, object.query_id.high >>> 0).toNumber(true); - if (object.new_keys) { - if (!Array.isArray(object.new_keys)) - throw TypeError(".neutron.interchainqueries.MsgUpdateInterchainQueryRequest.new_keys: array expected"); - message.new_keys = []; - for (var i = 0; i < object.new_keys.length; ++i) { - if (typeof object.new_keys[i] !== "object") - throw TypeError(".neutron.interchainqueries.MsgUpdateInterchainQueryRequest.new_keys: object expected"); - message.new_keys[i] = $root.neutron.interchainqueries.KVKey.fromObject(object.new_keys[i]); - } - } - if (object.new_update_period != null) - if ($util.Long) - (message.new_update_period = $util.Long.fromValue(object.new_update_period)).unsigned = true; - else if (typeof object.new_update_period === "string") - message.new_update_period = parseInt(object.new_update_period, 10); - else if (typeof object.new_update_period === "number") - message.new_update_period = object.new_update_period; - else if (typeof object.new_update_period === "object") - message.new_update_period = new $util.LongBits(object.new_update_period.low >>> 0, object.new_update_period.high >>> 0).toNumber(true); - if (object.new_transactions_filter != null) - message.new_transactions_filter = String(object.new_transactions_filter); - if (object.sender != null) - message.sender = String(object.sender); - return message; - }; - - /** - * Creates a plain object from a MsgUpdateInterchainQueryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @static - * @param {neutron.interchainqueries.MsgUpdateInterchainQueryRequest} message MsgUpdateInterchainQueryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpdateInterchainQueryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.new_keys = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_id = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.new_update_period = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.new_update_period = options.longs === String ? "0" : 0; - object.new_transactions_filter = ""; - object.sender = ""; - } - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (typeof message.query_id === "number") - object.query_id = options.longs === String ? String(message.query_id) : message.query_id; - else - object.query_id = options.longs === String ? $util.Long.prototype.toString.call(message.query_id) : options.longs === Number ? new $util.LongBits(message.query_id.low >>> 0, message.query_id.high >>> 0).toNumber(true) : message.query_id; - if (message.new_keys && message.new_keys.length) { - object.new_keys = []; - for (var j = 0; j < message.new_keys.length; ++j) - object.new_keys[j] = $root.neutron.interchainqueries.KVKey.toObject(message.new_keys[j], options); - } - if (message.new_update_period != null && message.hasOwnProperty("new_update_period")) - if (typeof message.new_update_period === "number") - object.new_update_period = options.longs === String ? String(message.new_update_period) : message.new_update_period; - else - object.new_update_period = options.longs === String ? $util.Long.prototype.toString.call(message.new_update_period) : options.longs === Number ? new $util.LongBits(message.new_update_period.low >>> 0, message.new_update_period.high >>> 0).toNumber(true) : message.new_update_period; - if (message.new_transactions_filter != null && message.hasOwnProperty("new_transactions_filter")) - object.new_transactions_filter = message.new_transactions_filter; - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - return object; - }; - - /** - * Converts this MsgUpdateInterchainQueryRequest to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryRequest - * @instance - * @returns {Object.} JSON object - */ - MsgUpdateInterchainQueryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpdateInterchainQueryRequest; - })(); - - interchainqueries.MsgUpdateInterchainQueryResponse = (function() { - - /** - * Properties of a MsgUpdateInterchainQueryResponse. - * @memberof neutron.interchainqueries - * @interface IMsgUpdateInterchainQueryResponse - */ - - /** - * Constructs a new MsgUpdateInterchainQueryResponse. - * @memberof neutron.interchainqueries - * @classdesc Represents a MsgUpdateInterchainQueryResponse. - * @implements IMsgUpdateInterchainQueryResponse - * @constructor - * @param {neutron.interchainqueries.IMsgUpdateInterchainQueryResponse=} [properties] Properties to set - */ - function MsgUpdateInterchainQueryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgUpdateInterchainQueryResponse message. Does not implicitly {@link neutron.interchainqueries.MsgUpdateInterchainQueryResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryResponse - * @static - * @param {neutron.interchainqueries.IMsgUpdateInterchainQueryResponse} message MsgUpdateInterchainQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateInterchainQueryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgUpdateInterchainQueryResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgUpdateInterchainQueryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryResponse - * @static - * @param {neutron.interchainqueries.IMsgUpdateInterchainQueryResponse} message MsgUpdateInterchainQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgUpdateInterchainQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgUpdateInterchainQueryResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.MsgUpdateInterchainQueryResponse} MsgUpdateInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateInterchainQueryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.MsgUpdateInterchainQueryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgUpdateInterchainQueryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.MsgUpdateInterchainQueryResponse} MsgUpdateInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgUpdateInterchainQueryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgUpdateInterchainQueryResponse message. - * @function verify - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgUpdateInterchainQueryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgUpdateInterchainQueryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.MsgUpdateInterchainQueryResponse} MsgUpdateInterchainQueryResponse - */ - MsgUpdateInterchainQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.MsgUpdateInterchainQueryResponse) - return object; - return new $root.neutron.interchainqueries.MsgUpdateInterchainQueryResponse(); - }; - - /** - * Creates a plain object from a MsgUpdateInterchainQueryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryResponse - * @static - * @param {neutron.interchainqueries.MsgUpdateInterchainQueryResponse} message MsgUpdateInterchainQueryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgUpdateInterchainQueryResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgUpdateInterchainQueryResponse to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.MsgUpdateInterchainQueryResponse - * @instance - * @returns {Object.} JSON object - */ - MsgUpdateInterchainQueryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgUpdateInterchainQueryResponse; - })(); - - interchainqueries.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof neutron.interchainqueries - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link neutron.interchainqueries.Query#params}. - * @memberof neutron.interchainqueries.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchainqueries.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {neutron.interchainqueries.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.neutron.interchainqueries.QueryParamsRequest, $root.neutron.interchainqueries.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.interchainqueries.Query#registeredQueries}. - * @memberof neutron.interchainqueries.Query - * @typedef RegisteredQueriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchainqueries.QueryRegisteredQueriesResponse} [response] QueryRegisteredQueriesResponse - */ - - /** - * Calls RegisteredQueries. - * @function registeredQueries - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryRegisteredQueriesRequest} request QueryRegisteredQueriesRequest message or plain object - * @param {neutron.interchainqueries.Query.RegisteredQueriesCallback} callback Node-style callback called with the error, if any, and QueryRegisteredQueriesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.registeredQueries = function registeredQueries(request, callback) { - return this.rpcCall(registeredQueries, $root.neutron.interchainqueries.QueryRegisteredQueriesRequest, $root.neutron.interchainqueries.QueryRegisteredQueriesResponse, request, callback); - }, "name", { value: "RegisteredQueries" }); - - /** - * Calls RegisteredQueries. - * @function registeredQueries - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryRegisteredQueriesRequest} request QueryRegisteredQueriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.interchainqueries.Query#registeredQuery}. - * @memberof neutron.interchainqueries.Query - * @typedef RegisteredQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchainqueries.QueryRegisteredQueryResponse} [response] QueryRegisteredQueryResponse - */ - - /** - * Calls RegisteredQuery. - * @function registeredQuery - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryRegisteredQueryRequest} request QueryRegisteredQueryRequest message or plain object - * @param {neutron.interchainqueries.Query.RegisteredQueryCallback} callback Node-style callback called with the error, if any, and QueryRegisteredQueryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.registeredQuery = function registeredQuery(request, callback) { - return this.rpcCall(registeredQuery, $root.neutron.interchainqueries.QueryRegisteredQueryRequest, $root.neutron.interchainqueries.QueryRegisteredQueryResponse, request, callback); - }, "name", { value: "RegisteredQuery" }); - - /** - * Calls RegisteredQuery. - * @function registeredQuery - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryRegisteredQueryRequest} request QueryRegisteredQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.interchainqueries.Query#queryResult}. - * @memberof neutron.interchainqueries.Query - * @typedef QueryResultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchainqueries.QueryRegisteredQueryResultResponse} [response] QueryRegisteredQueryResultResponse - */ - - /** - * Calls QueryResult. - * @function queryResult - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryRegisteredQueryResultRequest} request QueryRegisteredQueryResultRequest message or plain object - * @param {neutron.interchainqueries.Query.QueryResultCallback} callback Node-style callback called with the error, if any, and QueryRegisteredQueryResultResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.queryResult = function queryResult(request, callback) { - return this.rpcCall(queryResult, $root.neutron.interchainqueries.QueryRegisteredQueryResultRequest, $root.neutron.interchainqueries.QueryRegisteredQueryResultResponse, request, callback); - }, "name", { value: "QueryResult" }); - - /** - * Calls QueryResult. - * @function queryResult - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryRegisteredQueryResultRequest} request QueryRegisteredQueryResultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.interchainqueries.Query#lastRemoteHeight}. - * @memberof neutron.interchainqueries.Query - * @typedef LastRemoteHeightCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchainqueries.QueryLastRemoteHeightResponse} [response] QueryLastRemoteHeightResponse - */ - - /** - * Calls LastRemoteHeight. - * @function lastRemoteHeight - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryLastRemoteHeight} request QueryLastRemoteHeight message or plain object - * @param {neutron.interchainqueries.Query.LastRemoteHeightCallback} callback Node-style callback called with the error, if any, and QueryLastRemoteHeightResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.lastRemoteHeight = function lastRemoteHeight(request, callback) { - return this.rpcCall(lastRemoteHeight, $root.neutron.interchainqueries.QueryLastRemoteHeight, $root.neutron.interchainqueries.QueryLastRemoteHeightResponse, request, callback); - }, "name", { value: "LastRemoteHeight" }); - - /** - * Calls LastRemoteHeight. - * @function lastRemoteHeight - * @memberof neutron.interchainqueries.Query - * @instance - * @param {neutron.interchainqueries.IQueryLastRemoteHeight} request QueryLastRemoteHeight message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - interchainqueries.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof neutron.interchainqueries - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {neutron.interchainqueries.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.interchainqueries.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryParamsRequest - * @static - * @param {neutron.interchainqueries.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryParamsRequest - * @static - * @param {neutron.interchainqueries.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof neutron.interchainqueries.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryParamsRequest) - return object; - return new $root.neutron.interchainqueries.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryParamsRequest - * @static - * @param {neutron.interchainqueries.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - interchainqueries.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof neutron.interchainqueries - * @interface IQueryParamsResponse - * @property {neutron.interchainqueries.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {neutron.interchainqueries.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {neutron.interchainqueries.IParams|null|undefined} params - * @memberof neutron.interchainqueries.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.interchainqueries.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryParamsResponse - * @static - * @param {neutron.interchainqueries.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.interchainqueries.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryParamsResponse - * @static - * @param {neutron.interchainqueries.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.interchainqueries.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof neutron.interchainqueries.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.interchainqueries.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryParamsResponse) - return object; - var message = new $root.neutron.interchainqueries.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.interchainqueries.QueryParamsResponse.params: object expected"); - message.params = $root.neutron.interchainqueries.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryParamsResponse - * @static - * @param {neutron.interchainqueries.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.interchainqueries.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - interchainqueries.QueryRegisteredQueriesRequest = (function() { - - /** - * Properties of a QueryRegisteredQueriesRequest. - * @memberof neutron.interchainqueries - * @interface IQueryRegisteredQueriesRequest - * @property {Array.|null} [owners] QueryRegisteredQueriesRequest owners - * @property {string|null} [connection_id] QueryRegisteredQueriesRequest connection_id - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryRegisteredQueriesRequest pagination - */ - - /** - * Constructs a new QueryRegisteredQueriesRequest. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryRegisteredQueriesRequest. - * @implements IQueryRegisteredQueriesRequest - * @constructor - * @param {neutron.interchainqueries.IQueryRegisteredQueriesRequest=} [properties] Properties to set - */ - function QueryRegisteredQueriesRequest(properties) { - this.owners = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryRegisteredQueriesRequest owners. - * @member {Array.} owners - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @instance - */ - QueryRegisteredQueriesRequest.prototype.owners = $util.emptyArray; - - /** - * QueryRegisteredQueriesRequest connection_id. - * @member {string} connection_id - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @instance - */ - QueryRegisteredQueriesRequest.prototype.connection_id = ""; - - /** - * QueryRegisteredQueriesRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @instance - */ - QueryRegisteredQueriesRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryRegisteredQueriesRequest message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueriesRequest.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueriesRequest} message QueryRegisteredQueriesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueriesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.owners != null && message.owners.length) - for (var i = 0; i < message.owners.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.owners[i]); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.connection_id); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryRegisteredQueriesRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueriesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueriesRequest} message QueryRegisteredQueriesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueriesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryRegisteredQueriesRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryRegisteredQueriesRequest} QueryRegisteredQueriesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueriesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryRegisteredQueriesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.owners && message.owners.length)) - message.owners = []; - message.owners.push(reader.string()); - break; - case 2: - message.connection_id = reader.string(); - break; - case 3: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryRegisteredQueriesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryRegisteredQueriesRequest} QueryRegisteredQueriesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueriesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryRegisteredQueriesRequest message. - * @function verify - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryRegisteredQueriesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.owners != null && message.hasOwnProperty("owners")) { - if (!Array.isArray(message.owners)) - return "owners: array expected"; - for (var i = 0; i < message.owners.length; ++i) - if (!$util.isString(message.owners[i])) - return "owners: string[] expected"; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryRegisteredQueriesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryRegisteredQueriesRequest} QueryRegisteredQueriesRequest - */ - QueryRegisteredQueriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryRegisteredQueriesRequest) - return object; - var message = new $root.neutron.interchainqueries.QueryRegisteredQueriesRequest(); - if (object.owners) { - if (!Array.isArray(object.owners)) - throw TypeError(".neutron.interchainqueries.QueryRegisteredQueriesRequest.owners: array expected"); - message.owners = []; - for (var i = 0; i < object.owners.length; ++i) - message.owners[i] = String(object.owners[i]); - } - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".neutron.interchainqueries.QueryRegisteredQueriesRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryRegisteredQueriesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @static - * @param {neutron.interchainqueries.QueryRegisteredQueriesRequest} message QueryRegisteredQueriesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryRegisteredQueriesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.owners = []; - if (options.defaults) { - object.connection_id = ""; - object.pagination = null; - } - if (message.owners && message.owners.length) { - object.owners = []; - for (var j = 0; j < message.owners.length; ++j) - object.owners[j] = message.owners[j]; - } - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryRegisteredQueriesRequest to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryRegisteredQueriesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryRegisteredQueriesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryRegisteredQueriesRequest; - })(); - - interchainqueries.QueryRegisteredQueriesResponse = (function() { - - /** - * Properties of a QueryRegisteredQueriesResponse. - * @memberof neutron.interchainqueries - * @interface IQueryRegisteredQueriesResponse - * @property {Array.|null} [registered_queries] QueryRegisteredQueriesResponse registered_queries - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryRegisteredQueriesResponse pagination - */ - - /** - * Constructs a new QueryRegisteredQueriesResponse. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryRegisteredQueriesResponse. - * @implements IQueryRegisteredQueriesResponse - * @constructor - * @param {neutron.interchainqueries.IQueryRegisteredQueriesResponse=} [properties] Properties to set - */ - function QueryRegisteredQueriesResponse(properties) { - this.registered_queries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryRegisteredQueriesResponse registered_queries. - * @member {Array.} registered_queries - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @instance - */ - QueryRegisteredQueriesResponse.prototype.registered_queries = $util.emptyArray; - - /** - * QueryRegisteredQueriesResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @instance - */ - QueryRegisteredQueriesResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryRegisteredQueriesResponse message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueriesResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueriesResponse} message QueryRegisteredQueriesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueriesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.registered_queries != null && message.registered_queries.length) - for (var i = 0; i < message.registered_queries.length; ++i) - $root.neutron.interchainqueries.RegisteredQuery.encode(message.registered_queries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryRegisteredQueriesResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueriesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueriesResponse} message QueryRegisteredQueriesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueriesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryRegisteredQueriesResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryRegisteredQueriesResponse} QueryRegisteredQueriesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueriesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryRegisteredQueriesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.registered_queries && message.registered_queries.length)) - message.registered_queries = []; - message.registered_queries.push($root.neutron.interchainqueries.RegisteredQuery.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryRegisteredQueriesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryRegisteredQueriesResponse} QueryRegisteredQueriesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueriesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryRegisteredQueriesResponse message. - * @function verify - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryRegisteredQueriesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.registered_queries != null && message.hasOwnProperty("registered_queries")) { - if (!Array.isArray(message.registered_queries)) - return "registered_queries: array expected"; - for (var i = 0; i < message.registered_queries.length; ++i) { - var error = $root.neutron.interchainqueries.RegisteredQuery.verify(message.registered_queries[i]); - if (error) - return "registered_queries." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryRegisteredQueriesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryRegisteredQueriesResponse} QueryRegisteredQueriesResponse - */ - QueryRegisteredQueriesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryRegisteredQueriesResponse) - return object; - var message = new $root.neutron.interchainqueries.QueryRegisteredQueriesResponse(); - if (object.registered_queries) { - if (!Array.isArray(object.registered_queries)) - throw TypeError(".neutron.interchainqueries.QueryRegisteredQueriesResponse.registered_queries: array expected"); - message.registered_queries = []; - for (var i = 0; i < object.registered_queries.length; ++i) { - if (typeof object.registered_queries[i] !== "object") - throw TypeError(".neutron.interchainqueries.QueryRegisteredQueriesResponse.registered_queries: object expected"); - message.registered_queries[i] = $root.neutron.interchainqueries.RegisteredQuery.fromObject(object.registered_queries[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".neutron.interchainqueries.QueryRegisteredQueriesResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryRegisteredQueriesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @static - * @param {neutron.interchainqueries.QueryRegisteredQueriesResponse} message QueryRegisteredQueriesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryRegisteredQueriesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.registered_queries = []; - if (options.defaults) - object.pagination = null; - if (message.registered_queries && message.registered_queries.length) { - object.registered_queries = []; - for (var j = 0; j < message.registered_queries.length; ++j) - object.registered_queries[j] = $root.neutron.interchainqueries.RegisteredQuery.toObject(message.registered_queries[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryRegisteredQueriesResponse to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryRegisteredQueriesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryRegisteredQueriesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryRegisteredQueriesResponse; - })(); - - interchainqueries.QueryRegisteredQueryRequest = (function() { - - /** - * Properties of a QueryRegisteredQueryRequest. - * @memberof neutron.interchainqueries - * @interface IQueryRegisteredQueryRequest - * @property {Long|null} [query_id] QueryRegisteredQueryRequest query_id - */ - - /** - * Constructs a new QueryRegisteredQueryRequest. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryRegisteredQueryRequest. - * @implements IQueryRegisteredQueryRequest - * @constructor - * @param {neutron.interchainqueries.IQueryRegisteredQueryRequest=} [properties] Properties to set - */ - function QueryRegisteredQueryRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryRegisteredQueryRequest query_id. - * @member {Long} query_id - * @memberof neutron.interchainqueries.QueryRegisteredQueryRequest - * @instance - */ - QueryRegisteredQueryRequest.prototype.query_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryRegisteredQueryRequest message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryRequest.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryRegisteredQueryRequest - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueryRequest} message QueryRegisteredQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueryRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query_id != null && Object.hasOwnProperty.call(message, "query_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.query_id); - return writer; - }; - - /** - * Encodes the specified QueryRegisteredQueryRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueryRequest - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueryRequest} message QueryRegisteredQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryRegisteredQueryRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryRegisteredQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryRegisteredQueryRequest} QueryRegisteredQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueryRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryRegisteredQueryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.query_id = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryRegisteredQueryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryRegisteredQueryRequest} QueryRegisteredQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryRegisteredQueryRequest message. - * @function verify - * @memberof neutron.interchainqueries.QueryRegisteredQueryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryRegisteredQueryRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (!$util.isInteger(message.query_id) && !(message.query_id && $util.isInteger(message.query_id.low) && $util.isInteger(message.query_id.high))) - return "query_id: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryRegisteredQueryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryRegisteredQueryRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryRegisteredQueryRequest} QueryRegisteredQueryRequest - */ - QueryRegisteredQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryRegisteredQueryRequest) - return object; - var message = new $root.neutron.interchainqueries.QueryRegisteredQueryRequest(); - if (object.query_id != null) - if ($util.Long) - (message.query_id = $util.Long.fromValue(object.query_id)).unsigned = true; - else if (typeof object.query_id === "string") - message.query_id = parseInt(object.query_id, 10); - else if (typeof object.query_id === "number") - message.query_id = object.query_id; - else if (typeof object.query_id === "object") - message.query_id = new $util.LongBits(object.query_id.low >>> 0, object.query_id.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryRegisteredQueryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryRegisteredQueryRequest - * @static - * @param {neutron.interchainqueries.QueryRegisteredQueryRequest} message QueryRegisteredQueryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryRegisteredQueryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_id = options.longs === String ? "0" : 0; - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (typeof message.query_id === "number") - object.query_id = options.longs === String ? String(message.query_id) : message.query_id; - else - object.query_id = options.longs === String ? $util.Long.prototype.toString.call(message.query_id) : options.longs === Number ? new $util.LongBits(message.query_id.low >>> 0, message.query_id.high >>> 0).toNumber(true) : message.query_id; - return object; - }; - - /** - * Converts this QueryRegisteredQueryRequest to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryRegisteredQueryRequest - * @instance - * @returns {Object.} JSON object - */ - QueryRegisteredQueryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryRegisteredQueryRequest; - })(); - - interchainqueries.QueryRegisteredQueryResponse = (function() { - - /** - * Properties of a QueryRegisteredQueryResponse. - * @memberof neutron.interchainqueries - * @interface IQueryRegisteredQueryResponse - * @property {neutron.interchainqueries.IRegisteredQuery|null} [registered_query] QueryRegisteredQueryResponse registered_query - */ - - /** - * Constructs a new QueryRegisteredQueryResponse. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryRegisteredQueryResponse. - * @implements IQueryRegisteredQueryResponse - * @constructor - * @param {neutron.interchainqueries.IQueryRegisteredQueryResponse=} [properties] Properties to set - */ - function QueryRegisteredQueryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryRegisteredQueryResponse registered_query. - * @member {neutron.interchainqueries.IRegisteredQuery|null|undefined} registered_query - * @memberof neutron.interchainqueries.QueryRegisteredQueryResponse - * @instance - */ - QueryRegisteredQueryResponse.prototype.registered_query = null; - - /** - * Encodes the specified QueryRegisteredQueryResponse message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryRegisteredQueryResponse - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueryResponse} message QueryRegisteredQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.registered_query != null && Object.hasOwnProperty.call(message, "registered_query")) - $root.neutron.interchainqueries.RegisteredQuery.encode(message.registered_query, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryRegisteredQueryResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueryResponse - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueryResponse} message QueryRegisteredQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryRegisteredQueryResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryRegisteredQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryRegisteredQueryResponse} QueryRegisteredQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryRegisteredQueryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.registered_query = $root.neutron.interchainqueries.RegisteredQuery.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryRegisteredQueryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryRegisteredQueryResponse} QueryRegisteredQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryRegisteredQueryResponse message. - * @function verify - * @memberof neutron.interchainqueries.QueryRegisteredQueryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryRegisteredQueryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.registered_query != null && message.hasOwnProperty("registered_query")) { - var error = $root.neutron.interchainqueries.RegisteredQuery.verify(message.registered_query); - if (error) - return "registered_query." + error; - } - return null; - }; - - /** - * Creates a QueryRegisteredQueryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryRegisteredQueryResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryRegisteredQueryResponse} QueryRegisteredQueryResponse - */ - QueryRegisteredQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryRegisteredQueryResponse) - return object; - var message = new $root.neutron.interchainqueries.QueryRegisteredQueryResponse(); - if (object.registered_query != null) { - if (typeof object.registered_query !== "object") - throw TypeError(".neutron.interchainqueries.QueryRegisteredQueryResponse.registered_query: object expected"); - message.registered_query = $root.neutron.interchainqueries.RegisteredQuery.fromObject(object.registered_query); - } - return message; - }; - - /** - * Creates a plain object from a QueryRegisteredQueryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryRegisteredQueryResponse - * @static - * @param {neutron.interchainqueries.QueryRegisteredQueryResponse} message QueryRegisteredQueryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryRegisteredQueryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.registered_query = null; - if (message.registered_query != null && message.hasOwnProperty("registered_query")) - object.registered_query = $root.neutron.interchainqueries.RegisteredQuery.toObject(message.registered_query, options); - return object; - }; - - /** - * Converts this QueryRegisteredQueryResponse to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryRegisteredQueryResponse - * @instance - * @returns {Object.} JSON object - */ - QueryRegisteredQueryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryRegisteredQueryResponse; - })(); - - interchainqueries.QueryRegisteredQueryResultRequest = (function() { - - /** - * Properties of a QueryRegisteredQueryResultRequest. - * @memberof neutron.interchainqueries - * @interface IQueryRegisteredQueryResultRequest - * @property {Long|null} [query_id] QueryRegisteredQueryResultRequest query_id - */ - - /** - * Constructs a new QueryRegisteredQueryResultRequest. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryRegisteredQueryResultRequest. - * @implements IQueryRegisteredQueryResultRequest - * @constructor - * @param {neutron.interchainqueries.IQueryRegisteredQueryResultRequest=} [properties] Properties to set - */ - function QueryRegisteredQueryResultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryRegisteredQueryResultRequest query_id. - * @member {Long} query_id - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultRequest - * @instance - */ - QueryRegisteredQueryResultRequest.prototype.query_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryRegisteredQueryResultRequest message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResultRequest.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultRequest - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueryResultRequest} message QueryRegisteredQueryResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueryResultRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.query_id != null && Object.hasOwnProperty.call(message, "query_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.query_id); - return writer; - }; - - /** - * Encodes the specified QueryRegisteredQueryResultRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultRequest - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueryResultRequest} message QueryRegisteredQueryResultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueryResultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryRegisteredQueryResultRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryRegisteredQueryResultRequest} QueryRegisteredQueryResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueryResultRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryRegisteredQueryResultRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.query_id = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryRegisteredQueryResultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryRegisteredQueryResultRequest} QueryRegisteredQueryResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueryResultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryRegisteredQueryResultRequest message. - * @function verify - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryRegisteredQueryResultRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (!$util.isInteger(message.query_id) && !(message.query_id && $util.isInteger(message.query_id.low) && $util.isInteger(message.query_id.high))) - return "query_id: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryRegisteredQueryResultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryRegisteredQueryResultRequest} QueryRegisteredQueryResultRequest - */ - QueryRegisteredQueryResultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryRegisteredQueryResultRequest) - return object; - var message = new $root.neutron.interchainqueries.QueryRegisteredQueryResultRequest(); - if (object.query_id != null) - if ($util.Long) - (message.query_id = $util.Long.fromValue(object.query_id)).unsigned = true; - else if (typeof object.query_id === "string") - message.query_id = parseInt(object.query_id, 10); - else if (typeof object.query_id === "number") - message.query_id = object.query_id; - else if (typeof object.query_id === "object") - message.query_id = new $util.LongBits(object.query_id.low >>> 0, object.query_id.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryRegisteredQueryResultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultRequest - * @static - * @param {neutron.interchainqueries.QueryRegisteredQueryResultRequest} message QueryRegisteredQueryResultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryRegisteredQueryResultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.query_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.query_id = options.longs === String ? "0" : 0; - if (message.query_id != null && message.hasOwnProperty("query_id")) - if (typeof message.query_id === "number") - object.query_id = options.longs === String ? String(message.query_id) : message.query_id; - else - object.query_id = options.longs === String ? $util.Long.prototype.toString.call(message.query_id) : options.longs === Number ? new $util.LongBits(message.query_id.low >>> 0, message.query_id.high >>> 0).toNumber(true) : message.query_id; - return object; - }; - - /** - * Converts this QueryRegisteredQueryResultRequest to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultRequest - * @instance - * @returns {Object.} JSON object - */ - QueryRegisteredQueryResultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryRegisteredQueryResultRequest; - })(); - - interchainqueries.QueryRegisteredQueryResultResponse = (function() { - - /** - * Properties of a QueryRegisteredQueryResultResponse. - * @memberof neutron.interchainqueries - * @interface IQueryRegisteredQueryResultResponse - * @property {neutron.interchainqueries.IQueryResult|null} [result] QueryRegisteredQueryResultResponse result - */ - - /** - * Constructs a new QueryRegisteredQueryResultResponse. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryRegisteredQueryResultResponse. - * @implements IQueryRegisteredQueryResultResponse - * @constructor - * @param {neutron.interchainqueries.IQueryRegisteredQueryResultResponse=} [properties] Properties to set - */ - function QueryRegisteredQueryResultResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryRegisteredQueryResultResponse result. - * @member {neutron.interchainqueries.IQueryResult|null|undefined} result - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultResponse - * @instance - */ - QueryRegisteredQueryResultResponse.prototype.result = null; - - /** - * Encodes the specified QueryRegisteredQueryResultResponse message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResultResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultResponse - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueryResultResponse} message QueryRegisteredQueryResultResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueryResultResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - $root.neutron.interchainqueries.QueryResult.encode(message.result, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryRegisteredQueryResultResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResultResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultResponse - * @static - * @param {neutron.interchainqueries.IQueryRegisteredQueryResultResponse} message QueryRegisteredQueryResultResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryRegisteredQueryResultResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryRegisteredQueryResultResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryRegisteredQueryResultResponse} QueryRegisteredQueryResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueryResultResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryRegisteredQueryResultResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = $root.neutron.interchainqueries.QueryResult.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryRegisteredQueryResultResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryRegisteredQueryResultResponse} QueryRegisteredQueryResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryRegisteredQueryResultResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryRegisteredQueryResultResponse message. - * @function verify - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryRegisteredQueryResultResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) { - var error = $root.neutron.interchainqueries.QueryResult.verify(message.result); - if (error) - return "result." + error; - } - return null; - }; - - /** - * Creates a QueryRegisteredQueryResultResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryRegisteredQueryResultResponse} QueryRegisteredQueryResultResponse - */ - QueryRegisteredQueryResultResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryRegisteredQueryResultResponse) - return object; - var message = new $root.neutron.interchainqueries.QueryRegisteredQueryResultResponse(); - if (object.result != null) { - if (typeof object.result !== "object") - throw TypeError(".neutron.interchainqueries.QueryRegisteredQueryResultResponse.result: object expected"); - message.result = $root.neutron.interchainqueries.QueryResult.fromObject(object.result); - } - return message; - }; - - /** - * Creates a plain object from a QueryRegisteredQueryResultResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultResponse - * @static - * @param {neutron.interchainqueries.QueryRegisteredQueryResultResponse} message QueryRegisteredQueryResultResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryRegisteredQueryResultResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.result = null; - if (message.result != null && message.hasOwnProperty("result")) - object.result = $root.neutron.interchainqueries.QueryResult.toObject(message.result, options); - return object; - }; - - /** - * Converts this QueryRegisteredQueryResultResponse to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryRegisteredQueryResultResponse - * @instance - * @returns {Object.} JSON object - */ - QueryRegisteredQueryResultResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryRegisteredQueryResultResponse; - })(); - - interchainqueries.Transaction = (function() { - - /** - * Properties of a Transaction. - * @memberof neutron.interchainqueries - * @interface ITransaction - * @property {Long|null} [id] Transaction id - * @property {Long|null} [height] Transaction height - * @property {Uint8Array|null} [data] Transaction data - */ - - /** - * Constructs a new Transaction. - * @memberof neutron.interchainqueries - * @classdesc Represents a Transaction. - * @implements ITransaction - * @constructor - * @param {neutron.interchainqueries.ITransaction=} [properties] Properties to set - */ - function Transaction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Transaction id. - * @member {Long} id - * @memberof neutron.interchainqueries.Transaction - * @instance - */ - Transaction.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Transaction height. - * @member {Long} height - * @memberof neutron.interchainqueries.Transaction - * @instance - */ - Transaction.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Transaction data. - * @member {Uint8Array} data - * @memberof neutron.interchainqueries.Transaction - * @instance - */ - Transaction.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified Transaction message. Does not implicitly {@link neutron.interchainqueries.Transaction.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.Transaction - * @static - * @param {neutron.interchainqueries.ITransaction} message Transaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Transaction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.id); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.height); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified Transaction message, length delimited. Does not implicitly {@link neutron.interchainqueries.Transaction.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.Transaction - * @static - * @param {neutron.interchainqueries.ITransaction} message Transaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Transaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Transaction message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.Transaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.Transaction} Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Transaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.Transaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.uint64(); - break; - case 2: - message.height = reader.uint64(); - break; - case 3: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Transaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.Transaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.Transaction} Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Transaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Transaction message. - * @function verify - * @memberof neutron.interchainqueries.Transaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Transaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) - return "id: integer|Long expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a Transaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.Transaction - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.Transaction} Transaction - */ - Transaction.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.Transaction) - return object; - var message = new $root.neutron.interchainqueries.Transaction(); - if (object.id != null) - if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = true; - else if (typeof object.id === "string") - message.id = parseInt(object.id, 10); - else if (typeof object.id === "number") - message.id = object.id; - else if (typeof object.id === "object") - message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = true; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a Transaction message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.Transaction - * @static - * @param {neutron.interchainqueries.Transaction} message Transaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Transaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.id = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") - object.id = options.longs === String ? String(message.id) : message.id; - else - object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this Transaction to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.Transaction - * @instance - * @returns {Object.} JSON object - */ - Transaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Transaction; - })(); - - interchainqueries.QueryLastRemoteHeight = (function() { - - /** - * Properties of a QueryLastRemoteHeight. - * @memberof neutron.interchainqueries - * @interface IQueryLastRemoteHeight - * @property {string|null} [connection_id] QueryLastRemoteHeight connection_id - */ - - /** - * Constructs a new QueryLastRemoteHeight. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryLastRemoteHeight. - * @implements IQueryLastRemoteHeight - * @constructor - * @param {neutron.interchainqueries.IQueryLastRemoteHeight=} [properties] Properties to set - */ - function QueryLastRemoteHeight(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryLastRemoteHeight connection_id. - * @member {string} connection_id - * @memberof neutron.interchainqueries.QueryLastRemoteHeight - * @instance - */ - QueryLastRemoteHeight.prototype.connection_id = ""; - - /** - * Encodes the specified QueryLastRemoteHeight message. Does not implicitly {@link neutron.interchainqueries.QueryLastRemoteHeight.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryLastRemoteHeight - * @static - * @param {neutron.interchainqueries.IQueryLastRemoteHeight} message QueryLastRemoteHeight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryLastRemoteHeight.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection_id); - return writer; - }; - - /** - * Encodes the specified QueryLastRemoteHeight message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryLastRemoteHeight.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryLastRemoteHeight - * @static - * @param {neutron.interchainqueries.IQueryLastRemoteHeight} message QueryLastRemoteHeight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryLastRemoteHeight.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryLastRemoteHeight message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryLastRemoteHeight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryLastRemoteHeight} QueryLastRemoteHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryLastRemoteHeight.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryLastRemoteHeight(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryLastRemoteHeight message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryLastRemoteHeight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryLastRemoteHeight} QueryLastRemoteHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryLastRemoteHeight.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryLastRemoteHeight message. - * @function verify - * @memberof neutron.interchainqueries.QueryLastRemoteHeight - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryLastRemoteHeight.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - return null; - }; - - /** - * Creates a QueryLastRemoteHeight message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryLastRemoteHeight - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryLastRemoteHeight} QueryLastRemoteHeight - */ - QueryLastRemoteHeight.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryLastRemoteHeight) - return object; - var message = new $root.neutron.interchainqueries.QueryLastRemoteHeight(); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - return message; - }; - - /** - * Creates a plain object from a QueryLastRemoteHeight message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryLastRemoteHeight - * @static - * @param {neutron.interchainqueries.QueryLastRemoteHeight} message QueryLastRemoteHeight - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryLastRemoteHeight.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.connection_id = ""; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - return object; - }; - - /** - * Converts this QueryLastRemoteHeight to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryLastRemoteHeight - * @instance - * @returns {Object.} JSON object - */ - QueryLastRemoteHeight.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryLastRemoteHeight; - })(); - - interchainqueries.QueryLastRemoteHeightResponse = (function() { - - /** - * Properties of a QueryLastRemoteHeightResponse. - * @memberof neutron.interchainqueries - * @interface IQueryLastRemoteHeightResponse - * @property {Long|null} [height] QueryLastRemoteHeightResponse height - */ - - /** - * Constructs a new QueryLastRemoteHeightResponse. - * @memberof neutron.interchainqueries - * @classdesc Represents a QueryLastRemoteHeightResponse. - * @implements IQueryLastRemoteHeightResponse - * @constructor - * @param {neutron.interchainqueries.IQueryLastRemoteHeightResponse=} [properties] Properties to set - */ - function QueryLastRemoteHeightResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryLastRemoteHeightResponse height. - * @member {Long} height - * @memberof neutron.interchainqueries.QueryLastRemoteHeightResponse - * @instance - */ - QueryLastRemoteHeightResponse.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified QueryLastRemoteHeightResponse message. Does not implicitly {@link neutron.interchainqueries.QueryLastRemoteHeightResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchainqueries.QueryLastRemoteHeightResponse - * @static - * @param {neutron.interchainqueries.IQueryLastRemoteHeightResponse} message QueryLastRemoteHeightResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryLastRemoteHeightResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); - return writer; - }; - - /** - * Encodes the specified QueryLastRemoteHeightResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryLastRemoteHeightResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchainqueries.QueryLastRemoteHeightResponse - * @static - * @param {neutron.interchainqueries.IQueryLastRemoteHeightResponse} message QueryLastRemoteHeightResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryLastRemoteHeightResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryLastRemoteHeightResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchainqueries.QueryLastRemoteHeightResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchainqueries.QueryLastRemoteHeightResponse} QueryLastRemoteHeightResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryLastRemoteHeightResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchainqueries.QueryLastRemoteHeightResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryLastRemoteHeightResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchainqueries.QueryLastRemoteHeightResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchainqueries.QueryLastRemoteHeightResponse} QueryLastRemoteHeightResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryLastRemoteHeightResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryLastRemoteHeightResponse message. - * @function verify - * @memberof neutron.interchainqueries.QueryLastRemoteHeightResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryLastRemoteHeightResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - return null; - }; - - /** - * Creates a QueryLastRemoteHeightResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchainqueries.QueryLastRemoteHeightResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchainqueries.QueryLastRemoteHeightResponse} QueryLastRemoteHeightResponse - */ - QueryLastRemoteHeightResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchainqueries.QueryLastRemoteHeightResponse) - return object; - var message = new $root.neutron.interchainqueries.QueryLastRemoteHeightResponse(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = true; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a QueryLastRemoteHeightResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchainqueries.QueryLastRemoteHeightResponse - * @static - * @param {neutron.interchainqueries.QueryLastRemoteHeightResponse} message QueryLastRemoteHeightResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryLastRemoteHeightResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; - return object; - }; - - /** - * Converts this QueryLastRemoteHeightResponse to JSON. - * @function toJSON - * @memberof neutron.interchainqueries.QueryLastRemoteHeightResponse - * @instance - * @returns {Object.} JSON object - */ - QueryLastRemoteHeightResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryLastRemoteHeightResponse; - })(); - - return interchainqueries; - })(); - - neutron.interchaintxs = (function() { - - /** - * Namespace interchaintxs. - * @memberof neutron - * @namespace - */ - var interchaintxs = {}; - - interchaintxs.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof neutron.interchaintxs - * @interface IGenesisState - * @property {neutron.interchaintxs.IParams|null} [params] GenesisState params - */ - - /** - * Constructs a new GenesisState. - * @memberof neutron.interchaintxs - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {neutron.interchaintxs.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState params. - * @member {neutron.interchaintxs.IParams|null|undefined} params - * @memberof neutron.interchaintxs.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.interchaintxs.GenesisState.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.GenesisState - * @static - * @param {neutron.interchaintxs.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.interchaintxs.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.interchaintxs.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.GenesisState - * @static - * @param {neutron.interchaintxs.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.interchaintxs.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof neutron.interchaintxs.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.interchaintxs.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.GenesisState) - return object; - var message = new $root.neutron.interchaintxs.GenesisState(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.interchaintxs.GenesisState.params: object expected"); - message.params = $root.neutron.interchaintxs.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.GenesisState - * @static - * @param {neutron.interchaintxs.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.interchaintxs.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - interchaintxs.Params = (function() { - - /** - * Properties of a Params. - * @memberof neutron.interchaintxs - * @interface IParams - * @property {Long|null} [msg_submit_tx_max_messages] Params msg_submit_tx_max_messages - */ - - /** - * Constructs a new Params. - * @memberof neutron.interchaintxs - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {neutron.interchaintxs.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params msg_submit_tx_max_messages. - * @member {Long} msg_submit_tx_max_messages - * @memberof neutron.interchaintxs.Params - * @instance - */ - Params.prototype.msg_submit_tx_max_messages = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.interchaintxs.Params.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.Params - * @static - * @param {neutron.interchaintxs.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.msg_submit_tx_max_messages != null && Object.hasOwnProperty.call(message, "msg_submit_tx_max_messages")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.msg_submit_tx_max_messages); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.interchaintxs.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.Params - * @static - * @param {neutron.interchaintxs.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.msg_submit_tx_max_messages = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof neutron.interchaintxs.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.msg_submit_tx_max_messages != null && message.hasOwnProperty("msg_submit_tx_max_messages")) - if (!$util.isInteger(message.msg_submit_tx_max_messages) && !(message.msg_submit_tx_max_messages && $util.isInteger(message.msg_submit_tx_max_messages.low) && $util.isInteger(message.msg_submit_tx_max_messages.high))) - return "msg_submit_tx_max_messages: integer|Long expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.Params - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.Params) - return object; - var message = new $root.neutron.interchaintxs.Params(); - if (object.msg_submit_tx_max_messages != null) - if ($util.Long) - (message.msg_submit_tx_max_messages = $util.Long.fromValue(object.msg_submit_tx_max_messages)).unsigned = true; - else if (typeof object.msg_submit_tx_max_messages === "string") - message.msg_submit_tx_max_messages = parseInt(object.msg_submit_tx_max_messages, 10); - else if (typeof object.msg_submit_tx_max_messages === "number") - message.msg_submit_tx_max_messages = object.msg_submit_tx_max_messages; - else if (typeof object.msg_submit_tx_max_messages === "object") - message.msg_submit_tx_max_messages = new $util.LongBits(object.msg_submit_tx_max_messages.low >>> 0, object.msg_submit_tx_max_messages.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.Params - * @static - * @param {neutron.interchaintxs.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.msg_submit_tx_max_messages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.msg_submit_tx_max_messages = options.longs === String ? "0" : 0; - if (message.msg_submit_tx_max_messages != null && message.hasOwnProperty("msg_submit_tx_max_messages")) - if (typeof message.msg_submit_tx_max_messages === "number") - object.msg_submit_tx_max_messages = options.longs === String ? String(message.msg_submit_tx_max_messages) : message.msg_submit_tx_max_messages; - else - object.msg_submit_tx_max_messages = options.longs === String ? $util.Long.prototype.toString.call(message.msg_submit_tx_max_messages) : options.longs === Number ? new $util.LongBits(message.msg_submit_tx_max_messages.low >>> 0, message.msg_submit_tx_max_messages.high >>> 0).toNumber(true) : message.msg_submit_tx_max_messages; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - interchaintxs.v1 = (function() { - - /** - * Namespace v1. - * @memberof neutron.interchaintxs - * @namespace - */ - var v1 = {}; - - v1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof neutron.interchaintxs.v1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link neutron.interchaintxs.v1.Msg#registerInterchainAccount}. - * @memberof neutron.interchaintxs.v1.Msg - * @typedef RegisterInterchainAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse} [response] MsgRegisterInterchainAccountResponse - */ - - /** - * Calls RegisterInterchainAccount. - * @function registerInterchainAccount - * @memberof neutron.interchaintxs.v1.Msg - * @instance - * @param {neutron.interchaintxs.v1.IMsgRegisterInterchainAccount} request MsgRegisterInterchainAccount message or plain object - * @param {neutron.interchaintxs.v1.Msg.RegisterInterchainAccountCallback} callback Node-style callback called with the error, if any, and MsgRegisterInterchainAccountResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.registerInterchainAccount = function registerInterchainAccount(request, callback) { - return this.rpcCall(registerInterchainAccount, $root.neutron.interchaintxs.v1.MsgRegisterInterchainAccount, $root.neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse, request, callback); - }, "name", { value: "RegisterInterchainAccount" }); - - /** - * Calls RegisterInterchainAccount. - * @function registerInterchainAccount - * @memberof neutron.interchaintxs.v1.Msg - * @instance - * @param {neutron.interchaintxs.v1.IMsgRegisterInterchainAccount} request MsgRegisterInterchainAccount message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.interchaintxs.v1.Msg#submitTx}. - * @memberof neutron.interchaintxs.v1.Msg - * @typedef SubmitTxCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchaintxs.v1.MsgSubmitTxResponse} [response] MsgSubmitTxResponse - */ - - /** - * Calls SubmitTx. - * @function submitTx - * @memberof neutron.interchaintxs.v1.Msg - * @instance - * @param {neutron.interchaintxs.v1.IMsgSubmitTx} request MsgSubmitTx message or plain object - * @param {neutron.interchaintxs.v1.Msg.SubmitTxCallback} callback Node-style callback called with the error, if any, and MsgSubmitTxResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.submitTx = function submitTx(request, callback) { - return this.rpcCall(submitTx, $root.neutron.interchaintxs.v1.MsgSubmitTx, $root.neutron.interchaintxs.v1.MsgSubmitTxResponse, request, callback); - }, "name", { value: "SubmitTx" }); - - /** - * Calls SubmitTx. - * @function submitTx - * @memberof neutron.interchaintxs.v1.Msg - * @instance - * @param {neutron.interchaintxs.v1.IMsgSubmitTx} request MsgSubmitTx message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1.MsgRegisterInterchainAccount = (function() { - - /** - * Properties of a MsgRegisterInterchainAccount. - * @memberof neutron.interchaintxs.v1 - * @interface IMsgRegisterInterchainAccount - * @property {string|null} [from_address] MsgRegisterInterchainAccount from_address - * @property {string|null} [connection_id] MsgRegisterInterchainAccount connection_id - * @property {string|null} [interchain_account_id] MsgRegisterInterchainAccount interchain_account_id - */ - - /** - * Constructs a new MsgRegisterInterchainAccount. - * @memberof neutron.interchaintxs.v1 - * @classdesc Represents a MsgRegisterInterchainAccount. - * @implements IMsgRegisterInterchainAccount - * @constructor - * @param {neutron.interchaintxs.v1.IMsgRegisterInterchainAccount=} [properties] Properties to set - */ - function MsgRegisterInterchainAccount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgRegisterInterchainAccount from_address. - * @member {string} from_address - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @instance - */ - MsgRegisterInterchainAccount.prototype.from_address = ""; - - /** - * MsgRegisterInterchainAccount connection_id. - * @member {string} connection_id - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @instance - */ - MsgRegisterInterchainAccount.prototype.connection_id = ""; - - /** - * MsgRegisterInterchainAccount interchain_account_id. - * @member {string} interchain_account_id - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @instance - */ - MsgRegisterInterchainAccount.prototype.interchain_account_id = ""; - - /** - * Encodes the specified MsgRegisterInterchainAccount message. Does not implicitly {@link neutron.interchaintxs.v1.MsgRegisterInterchainAccount.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @static - * @param {neutron.interchaintxs.v1.IMsgRegisterInterchainAccount} message MsgRegisterInterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterInterchainAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.from_address != null && Object.hasOwnProperty.call(message, "from_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.from_address); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.connection_id); - if (message.interchain_account_id != null && Object.hasOwnProperty.call(message, "interchain_account_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.interchain_account_id); - return writer; - }; - - /** - * Encodes the specified MsgRegisterInterchainAccount message, length delimited. Does not implicitly {@link neutron.interchaintxs.v1.MsgRegisterInterchainAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @static - * @param {neutron.interchaintxs.v1.IMsgRegisterInterchainAccount} message MsgRegisterInterchainAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterInterchainAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterInterchainAccount message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.v1.MsgRegisterInterchainAccount} MsgRegisterInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterInterchainAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.v1.MsgRegisterInterchainAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.from_address = reader.string(); - break; - case 2: - message.connection_id = reader.string(); - break; - case 3: - message.interchain_account_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterInterchainAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.v1.MsgRegisterInterchainAccount} MsgRegisterInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterInterchainAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterInterchainAccount message. - * @function verify - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterInterchainAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.from_address != null && message.hasOwnProperty("from_address")) - if (!$util.isString(message.from_address)) - return "from_address: string expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.interchain_account_id != null && message.hasOwnProperty("interchain_account_id")) - if (!$util.isString(message.interchain_account_id)) - return "interchain_account_id: string expected"; - return null; - }; - - /** - * Creates a MsgRegisterInterchainAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.v1.MsgRegisterInterchainAccount} MsgRegisterInterchainAccount - */ - MsgRegisterInterchainAccount.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.v1.MsgRegisterInterchainAccount) - return object; - var message = new $root.neutron.interchaintxs.v1.MsgRegisterInterchainAccount(); - if (object.from_address != null) - message.from_address = String(object.from_address); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.interchain_account_id != null) - message.interchain_account_id = String(object.interchain_account_id); - return message; - }; - - /** - * Creates a plain object from a MsgRegisterInterchainAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @static - * @param {neutron.interchaintxs.v1.MsgRegisterInterchainAccount} message MsgRegisterInterchainAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterInterchainAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.from_address = ""; - object.connection_id = ""; - object.interchain_account_id = ""; - } - if (message.from_address != null && message.hasOwnProperty("from_address")) - object.from_address = message.from_address; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.interchain_account_id != null && message.hasOwnProperty("interchain_account_id")) - object.interchain_account_id = message.interchain_account_id; - return object; - }; - - /** - * Converts this MsgRegisterInterchainAccount to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccount - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterInterchainAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterInterchainAccount; - })(); - - v1.MsgRegisterInterchainAccountResponse = (function() { - - /** - * Properties of a MsgRegisterInterchainAccountResponse. - * @memberof neutron.interchaintxs.v1 - * @interface IMsgRegisterInterchainAccountResponse - */ - - /** - * Constructs a new MsgRegisterInterchainAccountResponse. - * @memberof neutron.interchaintxs.v1 - * @classdesc Represents a MsgRegisterInterchainAccountResponse. - * @implements IMsgRegisterInterchainAccountResponse - * @constructor - * @param {neutron.interchaintxs.v1.IMsgRegisterInterchainAccountResponse=} [properties] Properties to set - */ - function MsgRegisterInterchainAccountResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgRegisterInterchainAccountResponse message. Does not implicitly {@link neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse - * @static - * @param {neutron.interchaintxs.v1.IMsgRegisterInterchainAccountResponse} message MsgRegisterInterchainAccountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterInterchainAccountResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgRegisterInterchainAccountResponse message, length delimited. Does not implicitly {@link neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse - * @static - * @param {neutron.interchaintxs.v1.IMsgRegisterInterchainAccountResponse} message MsgRegisterInterchainAccountResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgRegisterInterchainAccountResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgRegisterInterchainAccountResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse} MsgRegisterInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterInterchainAccountResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgRegisterInterchainAccountResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse} MsgRegisterInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgRegisterInterchainAccountResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgRegisterInterchainAccountResponse message. - * @function verify - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgRegisterInterchainAccountResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgRegisterInterchainAccountResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse} MsgRegisterInterchainAccountResponse - */ - MsgRegisterInterchainAccountResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse) - return object; - return new $root.neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse(); - }; - - /** - * Creates a plain object from a MsgRegisterInterchainAccountResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse - * @static - * @param {neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse} message MsgRegisterInterchainAccountResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgRegisterInterchainAccountResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgRegisterInterchainAccountResponse to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse - * @instance - * @returns {Object.} JSON object - */ - MsgRegisterInterchainAccountResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgRegisterInterchainAccountResponse; - })(); - - v1.MsgSubmitTx = (function() { - - /** - * Properties of a MsgSubmitTx. - * @memberof neutron.interchaintxs.v1 - * @interface IMsgSubmitTx - * @property {string|null} [from_address] MsgSubmitTx from_address - * @property {string|null} [interchain_account_id] MsgSubmitTx interchain_account_id - * @property {string|null} [connection_id] MsgSubmitTx connection_id - * @property {Array.|null} [msgs] MsgSubmitTx msgs - * @property {string|null} [memo] MsgSubmitTx memo - * @property {Long|null} [timeout] MsgSubmitTx timeout - * @property {neutron.feerefunder.IFee|null} [fee] MsgSubmitTx fee - */ - - /** - * Constructs a new MsgSubmitTx. - * @memberof neutron.interchaintxs.v1 - * @classdesc Represents a MsgSubmitTx. - * @implements IMsgSubmitTx - * @constructor - * @param {neutron.interchaintxs.v1.IMsgSubmitTx=} [properties] Properties to set - */ - function MsgSubmitTx(properties) { - this.msgs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitTx from_address. - * @member {string} from_address - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @instance - */ - MsgSubmitTx.prototype.from_address = ""; - - /** - * MsgSubmitTx interchain_account_id. - * @member {string} interchain_account_id - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @instance - */ - MsgSubmitTx.prototype.interchain_account_id = ""; - - /** - * MsgSubmitTx connection_id. - * @member {string} connection_id - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @instance - */ - MsgSubmitTx.prototype.connection_id = ""; - - /** - * MsgSubmitTx msgs. - * @member {Array.} msgs - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @instance - */ - MsgSubmitTx.prototype.msgs = $util.emptyArray; - - /** - * MsgSubmitTx memo. - * @member {string} memo - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @instance - */ - MsgSubmitTx.prototype.memo = ""; - - /** - * MsgSubmitTx timeout. - * @member {Long} timeout - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @instance - */ - MsgSubmitTx.prototype.timeout = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgSubmitTx fee. - * @member {neutron.feerefunder.IFee|null|undefined} fee - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @instance - */ - MsgSubmitTx.prototype.fee = null; - - /** - * Encodes the specified MsgSubmitTx message. Does not implicitly {@link neutron.interchaintxs.v1.MsgSubmitTx.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @static - * @param {neutron.interchaintxs.v1.IMsgSubmitTx} message MsgSubmitTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.from_address != null && Object.hasOwnProperty.call(message, "from_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.from_address); - if (message.interchain_account_id != null && Object.hasOwnProperty.call(message, "interchain_account_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.interchain_account_id); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.connection_id); - if (message.msgs != null && message.msgs.length) - for (var i = 0; i < message.msgs.length; ++i) - $root.google.protobuf.Any.encode(message.msgs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.memo); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.timeout); - if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) - $root.neutron.feerefunder.Fee.encode(message.fee, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MsgSubmitTx message, length delimited. Does not implicitly {@link neutron.interchaintxs.v1.MsgSubmitTx.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @static - * @param {neutron.interchaintxs.v1.IMsgSubmitTx} message MsgSubmitTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitTx message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.v1.MsgSubmitTx} MsgSubmitTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitTx.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.v1.MsgSubmitTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.from_address = reader.string(); - break; - case 2: - message.interchain_account_id = reader.string(); - break; - case 3: - message.connection_id = reader.string(); - break; - case 4: - if (!(message.msgs && message.msgs.length)) - message.msgs = []; - message.msgs.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - case 5: - message.memo = reader.string(); - break; - case 6: - message.timeout = reader.uint64(); - break; - case 7: - message.fee = $root.neutron.feerefunder.Fee.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.v1.MsgSubmitTx} MsgSubmitTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitTx message. - * @function verify - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.from_address != null && message.hasOwnProperty("from_address")) - if (!$util.isString(message.from_address)) - return "from_address: string expected"; - if (message.interchain_account_id != null && message.hasOwnProperty("interchain_account_id")) - if (!$util.isString(message.interchain_account_id)) - return "interchain_account_id: string expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - if (message.msgs != null && message.hasOwnProperty("msgs")) { - if (!Array.isArray(message.msgs)) - return "msgs: array expected"; - for (var i = 0; i < message.msgs.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.msgs[i]); - if (error) - return "msgs." + error; - } - } - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) - if (!$util.isInteger(message.timeout) && !(message.timeout && $util.isInteger(message.timeout.low) && $util.isInteger(message.timeout.high))) - return "timeout: integer|Long expected"; - if (message.fee != null && message.hasOwnProperty("fee")) { - var error = $root.neutron.feerefunder.Fee.verify(message.fee); - if (error) - return "fee." + error; - } - return null; - }; - - /** - * Creates a MsgSubmitTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.v1.MsgSubmitTx} MsgSubmitTx - */ - MsgSubmitTx.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.v1.MsgSubmitTx) - return object; - var message = new $root.neutron.interchaintxs.v1.MsgSubmitTx(); - if (object.from_address != null) - message.from_address = String(object.from_address); - if (object.interchain_account_id != null) - message.interchain_account_id = String(object.interchain_account_id); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - if (object.msgs) { - if (!Array.isArray(object.msgs)) - throw TypeError(".neutron.interchaintxs.v1.MsgSubmitTx.msgs: array expected"); - message.msgs = []; - for (var i = 0; i < object.msgs.length; ++i) { - if (typeof object.msgs[i] !== "object") - throw TypeError(".neutron.interchaintxs.v1.MsgSubmitTx.msgs: object expected"); - message.msgs[i] = $root.google.protobuf.Any.fromObject(object.msgs[i]); - } - } - if (object.memo != null) - message.memo = String(object.memo); - if (object.timeout != null) - if ($util.Long) - (message.timeout = $util.Long.fromValue(object.timeout)).unsigned = true; - else if (typeof object.timeout === "string") - message.timeout = parseInt(object.timeout, 10); - else if (typeof object.timeout === "number") - message.timeout = object.timeout; - else if (typeof object.timeout === "object") - message.timeout = new $util.LongBits(object.timeout.low >>> 0, object.timeout.high >>> 0).toNumber(true); - if (object.fee != null) { - if (typeof object.fee !== "object") - throw TypeError(".neutron.interchaintxs.v1.MsgSubmitTx.fee: object expected"); - message.fee = $root.neutron.feerefunder.Fee.fromObject(object.fee); - } - return message; - }; - - /** - * Creates a plain object from a MsgSubmitTx message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @static - * @param {neutron.interchaintxs.v1.MsgSubmitTx} message MsgSubmitTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.msgs = []; - if (options.defaults) { - object.from_address = ""; - object.interchain_account_id = ""; - object.connection_id = ""; - object.memo = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timeout = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timeout = options.longs === String ? "0" : 0; - object.fee = null; - } - if (message.from_address != null && message.hasOwnProperty("from_address")) - object.from_address = message.from_address; - if (message.interchain_account_id != null && message.hasOwnProperty("interchain_account_id")) - object.interchain_account_id = message.interchain_account_id; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - if (message.msgs && message.msgs.length) { - object.msgs = []; - for (var j = 0; j < message.msgs.length; ++j) - object.msgs[j] = $root.google.protobuf.Any.toObject(message.msgs[j], options); - } - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - if (message.timeout != null && message.hasOwnProperty("timeout")) - if (typeof message.timeout === "number") - object.timeout = options.longs === String ? String(message.timeout) : message.timeout; - else - object.timeout = options.longs === String ? $util.Long.prototype.toString.call(message.timeout) : options.longs === Number ? new $util.LongBits(message.timeout.low >>> 0, message.timeout.high >>> 0).toNumber(true) : message.timeout; - if (message.fee != null && message.hasOwnProperty("fee")) - object.fee = $root.neutron.feerefunder.Fee.toObject(message.fee, options); - return object; - }; - - /** - * Converts this MsgSubmitTx to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.v1.MsgSubmitTx - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitTx; - })(); - - v1.MsgSubmitTxResponse = (function() { - - /** - * Properties of a MsgSubmitTxResponse. - * @memberof neutron.interchaintxs.v1 - * @interface IMsgSubmitTxResponse - * @property {Long|null} [sequence_id] MsgSubmitTxResponse sequence_id - * @property {string|null} [channel] MsgSubmitTxResponse channel - */ - - /** - * Constructs a new MsgSubmitTxResponse. - * @memberof neutron.interchaintxs.v1 - * @classdesc Represents a MsgSubmitTxResponse. - * @implements IMsgSubmitTxResponse - * @constructor - * @param {neutron.interchaintxs.v1.IMsgSubmitTxResponse=} [properties] Properties to set - */ - function MsgSubmitTxResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgSubmitTxResponse sequence_id. - * @member {Long} sequence_id - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @instance - */ - MsgSubmitTxResponse.prototype.sequence_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgSubmitTxResponse channel. - * @member {string} channel - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @instance - */ - MsgSubmitTxResponse.prototype.channel = ""; - - /** - * Encodes the specified MsgSubmitTxResponse message. Does not implicitly {@link neutron.interchaintxs.v1.MsgSubmitTxResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @static - * @param {neutron.interchaintxs.v1.IMsgSubmitTxResponse} message MsgSubmitTxResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitTxResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence_id != null && Object.hasOwnProperty.call(message, "sequence_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence_id); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel); - return writer; - }; - - /** - * Encodes the specified MsgSubmitTxResponse message, length delimited. Does not implicitly {@link neutron.interchaintxs.v1.MsgSubmitTxResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @static - * @param {neutron.interchaintxs.v1.IMsgSubmitTxResponse} message MsgSubmitTxResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSubmitTxResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSubmitTxResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.v1.MsgSubmitTxResponse} MsgSubmitTxResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitTxResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.v1.MsgSubmitTxResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence_id = reader.uint64(); - break; - case 2: - message.channel = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSubmitTxResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.v1.MsgSubmitTxResponse} MsgSubmitTxResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSubmitTxResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSubmitTxResponse message. - * @function verify - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSubmitTxResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence_id != null && message.hasOwnProperty("sequence_id")) - if (!$util.isInteger(message.sequence_id) && !(message.sequence_id && $util.isInteger(message.sequence_id.low) && $util.isInteger(message.sequence_id.high))) - return "sequence_id: integer|Long expected"; - if (message.channel != null && message.hasOwnProperty("channel")) - if (!$util.isString(message.channel)) - return "channel: string expected"; - return null; - }; - - /** - * Creates a MsgSubmitTxResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.v1.MsgSubmitTxResponse} MsgSubmitTxResponse - */ - MsgSubmitTxResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.v1.MsgSubmitTxResponse) - return object; - var message = new $root.neutron.interchaintxs.v1.MsgSubmitTxResponse(); - if (object.sequence_id != null) - if ($util.Long) - (message.sequence_id = $util.Long.fromValue(object.sequence_id)).unsigned = true; - else if (typeof object.sequence_id === "string") - message.sequence_id = parseInt(object.sequence_id, 10); - else if (typeof object.sequence_id === "number") - message.sequence_id = object.sequence_id; - else if (typeof object.sequence_id === "object") - message.sequence_id = new $util.LongBits(object.sequence_id.low >>> 0, object.sequence_id.high >>> 0).toNumber(true); - if (object.channel != null) - message.channel = String(object.channel); - return message; - }; - - /** - * Creates a plain object from a MsgSubmitTxResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @static - * @param {neutron.interchaintxs.v1.MsgSubmitTxResponse} message MsgSubmitTxResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSubmitTxResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence_id = options.longs === String ? "0" : 0; - object.channel = ""; - } - if (message.sequence_id != null && message.hasOwnProperty("sequence_id")) - if (typeof message.sequence_id === "number") - object.sequence_id = options.longs === String ? String(message.sequence_id) : message.sequence_id; - else - object.sequence_id = options.longs === String ? $util.Long.prototype.toString.call(message.sequence_id) : options.longs === Number ? new $util.LongBits(message.sequence_id.low >>> 0, message.sequence_id.high >>> 0).toNumber(true) : message.sequence_id; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = message.channel; - return object; - }; - - /** - * Converts this MsgSubmitTxResponse to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.v1.MsgSubmitTxResponse - * @instance - * @returns {Object.} JSON object - */ - MsgSubmitTxResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSubmitTxResponse; - })(); - - return v1; - })(); - - interchaintxs.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof neutron.interchaintxs - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link neutron.interchaintxs.Query#params}. - * @memberof neutron.interchaintxs.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchaintxs.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof neutron.interchaintxs.Query - * @instance - * @param {neutron.interchaintxs.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {neutron.interchaintxs.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.neutron.interchaintxs.QueryParamsRequest, $root.neutron.interchaintxs.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof neutron.interchaintxs.Query - * @instance - * @param {neutron.interchaintxs.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.interchaintxs.Query#interchainAccountAddress}. - * @memberof neutron.interchaintxs.Query - * @typedef InterchainAccountAddressCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.interchaintxs.QueryInterchainAccountAddressResponse} [response] QueryInterchainAccountAddressResponse - */ - - /** - * Calls InterchainAccountAddress. - * @function interchainAccountAddress - * @memberof neutron.interchaintxs.Query - * @instance - * @param {neutron.interchaintxs.IQueryInterchainAccountAddressRequest} request QueryInterchainAccountAddressRequest message or plain object - * @param {neutron.interchaintxs.Query.InterchainAccountAddressCallback} callback Node-style callback called with the error, if any, and QueryInterchainAccountAddressResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.interchainAccountAddress = function interchainAccountAddress(request, callback) { - return this.rpcCall(interchainAccountAddress, $root.neutron.interchaintxs.QueryInterchainAccountAddressRequest, $root.neutron.interchaintxs.QueryInterchainAccountAddressResponse, request, callback); - }, "name", { value: "InterchainAccountAddress" }); - - /** - * Calls InterchainAccountAddress. - * @function interchainAccountAddress - * @memberof neutron.interchaintxs.Query - * @instance - * @param {neutron.interchaintxs.IQueryInterchainAccountAddressRequest} request QueryInterchainAccountAddressRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - interchaintxs.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof neutron.interchaintxs - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof neutron.interchaintxs - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {neutron.interchaintxs.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.interchaintxs.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.QueryParamsRequest - * @static - * @param {neutron.interchaintxs.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.interchaintxs.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.QueryParamsRequest - * @static - * @param {neutron.interchaintxs.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof neutron.interchaintxs.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.QueryParamsRequest) - return object; - return new $root.neutron.interchaintxs.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.QueryParamsRequest - * @static - * @param {neutron.interchaintxs.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - interchaintxs.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof neutron.interchaintxs - * @interface IQueryParamsResponse - * @property {neutron.interchaintxs.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof neutron.interchaintxs - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {neutron.interchaintxs.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {neutron.interchaintxs.IParams|null|undefined} params - * @memberof neutron.interchaintxs.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.interchaintxs.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.QueryParamsResponse - * @static - * @param {neutron.interchaintxs.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.neutron.interchaintxs.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.interchaintxs.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.QueryParamsResponse - * @static - * @param {neutron.interchaintxs.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.neutron.interchaintxs.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof neutron.interchaintxs.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.neutron.interchaintxs.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.QueryParamsResponse) - return object; - var message = new $root.neutron.interchaintxs.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".neutron.interchaintxs.QueryParamsResponse.params: object expected"); - message.params = $root.neutron.interchaintxs.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.QueryParamsResponse - * @static - * @param {neutron.interchaintxs.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.neutron.interchaintxs.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - interchaintxs.QueryInterchainAccountAddressRequest = (function() { - - /** - * Properties of a QueryInterchainAccountAddressRequest. - * @memberof neutron.interchaintxs - * @interface IQueryInterchainAccountAddressRequest - * @property {string|null} [owner_address] QueryInterchainAccountAddressRequest owner_address - * @property {string|null} [interchain_account_id] QueryInterchainAccountAddressRequest interchain_account_id - * @property {string|null} [connection_id] QueryInterchainAccountAddressRequest connection_id - */ - - /** - * Constructs a new QueryInterchainAccountAddressRequest. - * @memberof neutron.interchaintxs - * @classdesc Represents a QueryInterchainAccountAddressRequest. - * @implements IQueryInterchainAccountAddressRequest - * @constructor - * @param {neutron.interchaintxs.IQueryInterchainAccountAddressRequest=} [properties] Properties to set - */ - function QueryInterchainAccountAddressRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryInterchainAccountAddressRequest owner_address. - * @member {string} owner_address - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @instance - */ - QueryInterchainAccountAddressRequest.prototype.owner_address = ""; - - /** - * QueryInterchainAccountAddressRequest interchain_account_id. - * @member {string} interchain_account_id - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @instance - */ - QueryInterchainAccountAddressRequest.prototype.interchain_account_id = ""; - - /** - * QueryInterchainAccountAddressRequest connection_id. - * @member {string} connection_id - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @instance - */ - QueryInterchainAccountAddressRequest.prototype.connection_id = ""; - - /** - * Encodes the specified QueryInterchainAccountAddressRequest message. Does not implicitly {@link neutron.interchaintxs.QueryInterchainAccountAddressRequest.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @static - * @param {neutron.interchaintxs.IQueryInterchainAccountAddressRequest} message QueryInterchainAccountAddressRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountAddressRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.owner_address != null && Object.hasOwnProperty.call(message, "owner_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.owner_address); - if (message.interchain_account_id != null && Object.hasOwnProperty.call(message, "interchain_account_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.interchain_account_id); - if (message.connection_id != null && Object.hasOwnProperty.call(message, "connection_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.connection_id); - return writer; - }; - - /** - * Encodes the specified QueryInterchainAccountAddressRequest message, length delimited. Does not implicitly {@link neutron.interchaintxs.QueryInterchainAccountAddressRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @static - * @param {neutron.interchaintxs.IQueryInterchainAccountAddressRequest} message QueryInterchainAccountAddressRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryInterchainAccountAddressRequest message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.QueryInterchainAccountAddressRequest} QueryInterchainAccountAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountAddressRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.QueryInterchainAccountAddressRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.owner_address = reader.string(); - break; - case 2: - message.interchain_account_id = reader.string(); - break; - case 3: - message.connection_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryInterchainAccountAddressRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.QueryInterchainAccountAddressRequest} QueryInterchainAccountAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountAddressRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryInterchainAccountAddressRequest message. - * @function verify - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInterchainAccountAddressRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.owner_address != null && message.hasOwnProperty("owner_address")) - if (!$util.isString(message.owner_address)) - return "owner_address: string expected"; - if (message.interchain_account_id != null && message.hasOwnProperty("interchain_account_id")) - if (!$util.isString(message.interchain_account_id)) - return "interchain_account_id: string expected"; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - if (!$util.isString(message.connection_id)) - return "connection_id: string expected"; - return null; - }; - - /** - * Creates a QueryInterchainAccountAddressRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.QueryInterchainAccountAddressRequest} QueryInterchainAccountAddressRequest - */ - QueryInterchainAccountAddressRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.QueryInterchainAccountAddressRequest) - return object; - var message = new $root.neutron.interchaintxs.QueryInterchainAccountAddressRequest(); - if (object.owner_address != null) - message.owner_address = String(object.owner_address); - if (object.interchain_account_id != null) - message.interchain_account_id = String(object.interchain_account_id); - if (object.connection_id != null) - message.connection_id = String(object.connection_id); - return message; - }; - - /** - * Creates a plain object from a QueryInterchainAccountAddressRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @static - * @param {neutron.interchaintxs.QueryInterchainAccountAddressRequest} message QueryInterchainAccountAddressRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInterchainAccountAddressRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.owner_address = ""; - object.interchain_account_id = ""; - object.connection_id = ""; - } - if (message.owner_address != null && message.hasOwnProperty("owner_address")) - object.owner_address = message.owner_address; - if (message.interchain_account_id != null && message.hasOwnProperty("interchain_account_id")) - object.interchain_account_id = message.interchain_account_id; - if (message.connection_id != null && message.hasOwnProperty("connection_id")) - object.connection_id = message.connection_id; - return object; - }; - - /** - * Converts this QueryInterchainAccountAddressRequest to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressRequest - * @instance - * @returns {Object.} JSON object - */ - QueryInterchainAccountAddressRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryInterchainAccountAddressRequest; - })(); - - interchaintxs.QueryInterchainAccountAddressResponse = (function() { - - /** - * Properties of a QueryInterchainAccountAddressResponse. - * @memberof neutron.interchaintxs - * @interface IQueryInterchainAccountAddressResponse - * @property {string|null} [interchain_account_address] QueryInterchainAccountAddressResponse interchain_account_address - */ - - /** - * Constructs a new QueryInterchainAccountAddressResponse. - * @memberof neutron.interchaintxs - * @classdesc Represents a QueryInterchainAccountAddressResponse. - * @implements IQueryInterchainAccountAddressResponse - * @constructor - * @param {neutron.interchaintxs.IQueryInterchainAccountAddressResponse=} [properties] Properties to set - */ - function QueryInterchainAccountAddressResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryInterchainAccountAddressResponse interchain_account_address. - * @member {string} interchain_account_address - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressResponse - * @instance - */ - QueryInterchainAccountAddressResponse.prototype.interchain_account_address = ""; - - /** - * Encodes the specified QueryInterchainAccountAddressResponse message. Does not implicitly {@link neutron.interchaintxs.QueryInterchainAccountAddressResponse.verify|verify} messages. - * @function encode - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressResponse - * @static - * @param {neutron.interchaintxs.IQueryInterchainAccountAddressResponse} message QueryInterchainAccountAddressResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountAddressResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.interchain_account_address != null && Object.hasOwnProperty.call(message, "interchain_account_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.interchain_account_address); - return writer; - }; - - /** - * Encodes the specified QueryInterchainAccountAddressResponse message, length delimited. Does not implicitly {@link neutron.interchaintxs.QueryInterchainAccountAddressResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressResponse - * @static - * @param {neutron.interchaintxs.IQueryInterchainAccountAddressResponse} message QueryInterchainAccountAddressResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInterchainAccountAddressResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryInterchainAccountAddressResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.interchaintxs.QueryInterchainAccountAddressResponse} QueryInterchainAccountAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountAddressResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.interchaintxs.QueryInterchainAccountAddressResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.interchain_account_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryInterchainAccountAddressResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.interchaintxs.QueryInterchainAccountAddressResponse} QueryInterchainAccountAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInterchainAccountAddressResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryInterchainAccountAddressResponse message. - * @function verify - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInterchainAccountAddressResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.interchain_account_address != null && message.hasOwnProperty("interchain_account_address")) - if (!$util.isString(message.interchain_account_address)) - return "interchain_account_address: string expected"; - return null; - }; - - /** - * Creates a QueryInterchainAccountAddressResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.interchaintxs.QueryInterchainAccountAddressResponse} QueryInterchainAccountAddressResponse - */ - QueryInterchainAccountAddressResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.interchaintxs.QueryInterchainAccountAddressResponse) - return object; - var message = new $root.neutron.interchaintxs.QueryInterchainAccountAddressResponse(); - if (object.interchain_account_address != null) - message.interchain_account_address = String(object.interchain_account_address); - return message; - }; - - /** - * Creates a plain object from a QueryInterchainAccountAddressResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressResponse - * @static - * @param {neutron.interchaintxs.QueryInterchainAccountAddressResponse} message QueryInterchainAccountAddressResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInterchainAccountAddressResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.interchain_account_address = ""; - if (message.interchain_account_address != null && message.hasOwnProperty("interchain_account_address")) - object.interchain_account_address = message.interchain_account_address; - return object; - }; - - /** - * Converts this QueryInterchainAccountAddressResponse to JSON. - * @function toJSON - * @memberof neutron.interchaintxs.QueryInterchainAccountAddressResponse - * @instance - * @returns {Object.} JSON object - */ - QueryInterchainAccountAddressResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryInterchainAccountAddressResponse; - })(); - - return interchaintxs; - })(); - - neutron.transfer = (function() { - - /** - * Namespace transfer. - * @memberof neutron - * @namespace - */ - var transfer = {}; - - transfer.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof neutron.transfer - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link neutron.transfer.Msg#transfer}. - * @memberof neutron.transfer.Msg - * @typedef TransferCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutron.transfer.MsgTransferResponse} [response] MsgTransferResponse - */ - - /** - * Calls Transfer. - * @function transfer - * @memberof neutron.transfer.Msg - * @instance - * @param {neutron.transfer.IMsgTransfer} request MsgTransfer message or plain object - * @param {neutron.transfer.Msg.TransferCallback} callback Node-style callback called with the error, if any, and MsgTransferResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.transfer = function transfer(request, callback) { - return this.rpcCall(transfer, $root.neutron.transfer.MsgTransfer, $root.neutron.transfer.MsgTransferResponse, request, callback); - }, "name", { value: "Transfer" }); - - /** - * Calls Transfer. - * @function transfer - * @memberof neutron.transfer.Msg - * @instance - * @param {neutron.transfer.IMsgTransfer} request MsgTransfer message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - transfer.MsgTransfer = (function() { - - /** - * Properties of a MsgTransfer. - * @memberof neutron.transfer - * @interface IMsgTransfer - * @property {string|null} [source_port] MsgTransfer source_port - * @property {string|null} [source_channel] MsgTransfer source_channel - * @property {cosmos.base.v1beta1.ICoin|null} [token] MsgTransfer token - * @property {string|null} [sender] MsgTransfer sender - * @property {string|null} [receiver] MsgTransfer receiver - * @property {ibc.core.client.v1.IHeight|null} [timeout_height] MsgTransfer timeout_height - * @property {Long|null} [timeout_timestamp] MsgTransfer timeout_timestamp - * @property {string|null} [memo] MsgTransfer memo - * @property {neutron.feerefunder.IFee|null} [fee] MsgTransfer fee - */ - - /** - * Constructs a new MsgTransfer. - * @memberof neutron.transfer - * @classdesc Represents a MsgTransfer. - * @implements IMsgTransfer - * @constructor - * @param {neutron.transfer.IMsgTransfer=} [properties] Properties to set - */ - function MsgTransfer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTransfer source_port. - * @member {string} source_port - * @memberof neutron.transfer.MsgTransfer - * @instance - */ - MsgTransfer.prototype.source_port = ""; - - /** - * MsgTransfer source_channel. - * @member {string} source_channel - * @memberof neutron.transfer.MsgTransfer - * @instance - */ - MsgTransfer.prototype.source_channel = ""; - - /** - * MsgTransfer token. - * @member {cosmos.base.v1beta1.ICoin|null|undefined} token - * @memberof neutron.transfer.MsgTransfer - * @instance - */ - MsgTransfer.prototype.token = null; - - /** - * MsgTransfer sender. - * @member {string} sender - * @memberof neutron.transfer.MsgTransfer - * @instance - */ - MsgTransfer.prototype.sender = ""; - - /** - * MsgTransfer receiver. - * @member {string} receiver - * @memberof neutron.transfer.MsgTransfer - * @instance - */ - MsgTransfer.prototype.receiver = ""; - - /** - * MsgTransfer timeout_height. - * @member {ibc.core.client.v1.IHeight|null|undefined} timeout_height - * @memberof neutron.transfer.MsgTransfer - * @instance - */ - MsgTransfer.prototype.timeout_height = null; - - /** - * MsgTransfer timeout_timestamp. - * @member {Long} timeout_timestamp - * @memberof neutron.transfer.MsgTransfer - * @instance - */ - MsgTransfer.prototype.timeout_timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgTransfer memo. - * @member {string} memo - * @memberof neutron.transfer.MsgTransfer - * @instance - */ - MsgTransfer.prototype.memo = ""; - - /** - * MsgTransfer fee. - * @member {neutron.feerefunder.IFee|null|undefined} fee - * @memberof neutron.transfer.MsgTransfer - * @instance - */ - MsgTransfer.prototype.fee = null; - - /** - * Encodes the specified MsgTransfer message. Does not implicitly {@link neutron.transfer.MsgTransfer.verify|verify} messages. - * @function encode - * @memberof neutron.transfer.MsgTransfer - * @static - * @param {neutron.transfer.IMsgTransfer} message MsgTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransfer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.source_port != null && Object.hasOwnProperty.call(message, "source_port")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.source_port); - if (message.source_channel != null && Object.hasOwnProperty.call(message, "source_channel")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_channel); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - $root.cosmos.base.v1beta1.Coin.encode(message.token, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sender); - if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.receiver); - if (message.timeout_height != null && Object.hasOwnProperty.call(message, "timeout_height")) - $root.ibc.core.client.v1.Height.encode(message.timeout_height, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.timeout_timestamp != null && Object.hasOwnProperty.call(message, "timeout_timestamp")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.timeout_timestamp); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.memo); - if (message.fee != null && Object.hasOwnProperty.call(message, "fee")) - $root.neutron.feerefunder.Fee.encode(message.fee, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MsgTransfer message, length delimited. Does not implicitly {@link neutron.transfer.MsgTransfer.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.transfer.MsgTransfer - * @static - * @param {neutron.transfer.IMsgTransfer} message MsgTransfer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransfer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer. - * @function decode - * @memberof neutron.transfer.MsgTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.transfer.MsgTransfer} MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransfer.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.transfer.MsgTransfer(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.source_port = reader.string(); - break; - case 2: - message.source_channel = reader.string(); - break; - case 3: - message.token = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); - break; - case 4: - message.sender = reader.string(); - break; - case 5: - message.receiver = reader.string(); - break; - case 6: - message.timeout_height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 7: - message.timeout_timestamp = reader.uint64(); - break; - case 8: - message.memo = reader.string(); - break; - case 9: - message.fee = $root.neutron.feerefunder.Fee.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.transfer.MsgTransfer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.transfer.MsgTransfer} MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransfer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTransfer message. - * @function verify - * @memberof neutron.transfer.MsgTransfer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTransfer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.source_port != null && message.hasOwnProperty("source_port")) - if (!$util.isString(message.source_port)) - return "source_port: string expected"; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - if (!$util.isString(message.source_channel)) - return "source_channel: string expected"; - if (message.token != null && message.hasOwnProperty("token")) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.token); - if (error) - return "token." + error; - } - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.receiver != null && message.hasOwnProperty("receiver")) - if (!$util.isString(message.receiver)) - return "receiver: string expected"; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.timeout_height); - if (error) - return "timeout_height." + error; - } - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (!$util.isInteger(message.timeout_timestamp) && !(message.timeout_timestamp && $util.isInteger(message.timeout_timestamp.low) && $util.isInteger(message.timeout_timestamp.high))) - return "timeout_timestamp: integer|Long expected"; - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - if (message.fee != null && message.hasOwnProperty("fee")) { - var error = $root.neutron.feerefunder.Fee.verify(message.fee); - if (error) - return "fee." + error; - } - return null; - }; - - /** - * Creates a MsgTransfer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.transfer.MsgTransfer - * @static - * @param {Object.} object Plain object - * @returns {neutron.transfer.MsgTransfer} MsgTransfer - */ - MsgTransfer.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.transfer.MsgTransfer) - return object; - var message = new $root.neutron.transfer.MsgTransfer(); - if (object.source_port != null) - message.source_port = String(object.source_port); - if (object.source_channel != null) - message.source_channel = String(object.source_channel); - if (object.token != null) { - if (typeof object.token !== "object") - throw TypeError(".neutron.transfer.MsgTransfer.token: object expected"); - message.token = $root.cosmos.base.v1beta1.Coin.fromObject(object.token); - } - if (object.sender != null) - message.sender = String(object.sender); - if (object.receiver != null) - message.receiver = String(object.receiver); - if (object.timeout_height != null) { - if (typeof object.timeout_height !== "object") - throw TypeError(".neutron.transfer.MsgTransfer.timeout_height: object expected"); - message.timeout_height = $root.ibc.core.client.v1.Height.fromObject(object.timeout_height); - } - if (object.timeout_timestamp != null) - if ($util.Long) - (message.timeout_timestamp = $util.Long.fromValue(object.timeout_timestamp)).unsigned = true; - else if (typeof object.timeout_timestamp === "string") - message.timeout_timestamp = parseInt(object.timeout_timestamp, 10); - else if (typeof object.timeout_timestamp === "number") - message.timeout_timestamp = object.timeout_timestamp; - else if (typeof object.timeout_timestamp === "object") - message.timeout_timestamp = new $util.LongBits(object.timeout_timestamp.low >>> 0, object.timeout_timestamp.high >>> 0).toNumber(true); - if (object.memo != null) - message.memo = String(object.memo); - if (object.fee != null) { - if (typeof object.fee !== "object") - throw TypeError(".neutron.transfer.MsgTransfer.fee: object expected"); - message.fee = $root.neutron.feerefunder.Fee.fromObject(object.fee); - } - return message; - }; - - /** - * Creates a plain object from a MsgTransfer message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.transfer.MsgTransfer - * @static - * @param {neutron.transfer.MsgTransfer} message MsgTransfer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTransfer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.source_port = ""; - object.source_channel = ""; - object.token = null; - object.sender = ""; - object.receiver = ""; - object.timeout_height = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timeout_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timeout_timestamp = options.longs === String ? "0" : 0; - object.memo = ""; - object.fee = null; - } - if (message.source_port != null && message.hasOwnProperty("source_port")) - object.source_port = message.source_port; - if (message.source_channel != null && message.hasOwnProperty("source_channel")) - object.source_channel = message.source_channel; - if (message.token != null && message.hasOwnProperty("token")) - object.token = $root.cosmos.base.v1beta1.Coin.toObject(message.token, options); - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.receiver != null && message.hasOwnProperty("receiver")) - object.receiver = message.receiver; - if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) - object.timeout_height = $root.ibc.core.client.v1.Height.toObject(message.timeout_height, options); - if (message.timeout_timestamp != null && message.hasOwnProperty("timeout_timestamp")) - if (typeof message.timeout_timestamp === "number") - object.timeout_timestamp = options.longs === String ? String(message.timeout_timestamp) : message.timeout_timestamp; - else - object.timeout_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeout_timestamp) : options.longs === Number ? new $util.LongBits(message.timeout_timestamp.low >>> 0, message.timeout_timestamp.high >>> 0).toNumber(true) : message.timeout_timestamp; - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - if (message.fee != null && message.hasOwnProperty("fee")) - object.fee = $root.neutron.feerefunder.Fee.toObject(message.fee, options); - return object; - }; - - /** - * Converts this MsgTransfer to JSON. - * @function toJSON - * @memberof neutron.transfer.MsgTransfer - * @instance - * @returns {Object.} JSON object - */ - MsgTransfer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTransfer; - })(); - - transfer.MsgTransferResponse = (function() { - - /** - * Properties of a MsgTransferResponse. - * @memberof neutron.transfer - * @interface IMsgTransferResponse - * @property {Long|null} [sequence_id] MsgTransferResponse sequence_id - * @property {string|null} [channel] MsgTransferResponse channel - */ - - /** - * Constructs a new MsgTransferResponse. - * @memberof neutron.transfer - * @classdesc Represents a MsgTransferResponse. - * @implements IMsgTransferResponse - * @constructor - * @param {neutron.transfer.IMsgTransferResponse=} [properties] Properties to set - */ - function MsgTransferResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgTransferResponse sequence_id. - * @member {Long} sequence_id - * @memberof neutron.transfer.MsgTransferResponse - * @instance - */ - MsgTransferResponse.prototype.sequence_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MsgTransferResponse channel. - * @member {string} channel - * @memberof neutron.transfer.MsgTransferResponse - * @instance - */ - MsgTransferResponse.prototype.channel = ""; - - /** - * Encodes the specified MsgTransferResponse message. Does not implicitly {@link neutron.transfer.MsgTransferResponse.verify|verify} messages. - * @function encode - * @memberof neutron.transfer.MsgTransferResponse - * @static - * @param {neutron.transfer.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransferResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sequence_id != null && Object.hasOwnProperty.call(message, "sequence_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sequence_id); - if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel); - return writer; - }; - - /** - * Encodes the specified MsgTransferResponse message, length delimited. Does not implicitly {@link neutron.transfer.MsgTransferResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutron.transfer.MsgTransferResponse - * @static - * @param {neutron.transfer.IMsgTransferResponse} message MsgTransferResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgTransferResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer. - * @function decode - * @memberof neutron.transfer.MsgTransferResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutron.transfer.MsgTransferResponse} MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransferResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutron.transfer.MsgTransferResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sequence_id = reader.uint64(); - break; - case 2: - message.channel = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutron.transfer.MsgTransferResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutron.transfer.MsgTransferResponse} MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgTransferResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgTransferResponse message. - * @function verify - * @memberof neutron.transfer.MsgTransferResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgTransferResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sequence_id != null && message.hasOwnProperty("sequence_id")) - if (!$util.isInteger(message.sequence_id) && !(message.sequence_id && $util.isInteger(message.sequence_id.low) && $util.isInteger(message.sequence_id.high))) - return "sequence_id: integer|Long expected"; - if (message.channel != null && message.hasOwnProperty("channel")) - if (!$util.isString(message.channel)) - return "channel: string expected"; - return null; - }; - - /** - * Creates a MsgTransferResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutron.transfer.MsgTransferResponse - * @static - * @param {Object.} object Plain object - * @returns {neutron.transfer.MsgTransferResponse} MsgTransferResponse - */ - MsgTransferResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutron.transfer.MsgTransferResponse) - return object; - var message = new $root.neutron.transfer.MsgTransferResponse(); - if (object.sequence_id != null) - if ($util.Long) - (message.sequence_id = $util.Long.fromValue(object.sequence_id)).unsigned = true; - else if (typeof object.sequence_id === "string") - message.sequence_id = parseInt(object.sequence_id, 10); - else if (typeof object.sequence_id === "number") - message.sequence_id = object.sequence_id; - else if (typeof object.sequence_id === "object") - message.sequence_id = new $util.LongBits(object.sequence_id.low >>> 0, object.sequence_id.high >>> 0).toNumber(true); - if (object.channel != null) - message.channel = String(object.channel); - return message; - }; - - /** - * Creates a plain object from a MsgTransferResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutron.transfer.MsgTransferResponse - * @static - * @param {neutron.transfer.MsgTransferResponse} message MsgTransferResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgTransferResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.sequence_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sequence_id = options.longs === String ? "0" : 0; - object.channel = ""; - } - if (message.sequence_id != null && message.hasOwnProperty("sequence_id")) - if (typeof message.sequence_id === "number") - object.sequence_id = options.longs === String ? String(message.sequence_id) : message.sequence_id; - else - object.sequence_id = options.longs === String ? $util.Long.prototype.toString.call(message.sequence_id) : options.longs === Number ? new $util.LongBits(message.sequence_id.low >>> 0, message.sequence_id.high >>> 0).toNumber(true) : message.sequence_id; - if (message.channel != null && message.hasOwnProperty("channel")) - object.channel = message.channel; - return object; - }; - - /** - * Converts this MsgTransferResponse to JSON. - * @function toJSON - * @memberof neutron.transfer.MsgTransferResponse - * @instance - * @returns {Object.} JSON object - */ - MsgTransferResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgTransferResponse; - })(); - - transfer.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof neutron.transfer - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link neutron.transfer.Query#denomTrace}. - * @memberof neutron.transfer.Query - * @typedef DenomTraceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomTraceResponse} [response] QueryDenomTraceResponse - */ - - /** - * Calls DenomTrace. - * @function denomTrace - * @memberof neutron.transfer.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object - * @param {neutron.transfer.Query.DenomTraceCallback} callback Node-style callback called with the error, if any, and QueryDenomTraceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomTrace = function denomTrace(request, callback) { - return this.rpcCall(denomTrace, $root.ibc.applications.transfer.v1.QueryDenomTraceRequest, $root.ibc.applications.transfer.v1.QueryDenomTraceResponse, request, callback); - }, "name", { value: "DenomTrace" }); - - /** - * Calls DenomTrace. - * @function denomTrace - * @memberof neutron.transfer.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.transfer.Query#denomTraces}. - * @memberof neutron.transfer.Query - * @typedef DenomTracesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomTracesResponse} [response] QueryDenomTracesResponse - */ - - /** - * Calls DenomTraces. - * @function denomTraces - * @memberof neutron.transfer.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object - * @param {neutron.transfer.Query.DenomTracesCallback} callback Node-style callback called with the error, if any, and QueryDenomTracesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomTraces = function denomTraces(request, callback) { - return this.rpcCall(denomTraces, $root.ibc.applications.transfer.v1.QueryDenomTracesRequest, $root.ibc.applications.transfer.v1.QueryDenomTracesResponse, request, callback); - }, "name", { value: "DenomTraces" }); - - /** - * Calls DenomTraces. - * @function denomTraces - * @memberof neutron.transfer.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.transfer.Query#params}. - * @memberof neutron.transfer.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof neutron.transfer.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {neutron.transfer.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.ibc.applications.transfer.v1.QueryParamsRequest, $root.ibc.applications.transfer.v1.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof neutron.transfer.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutron.transfer.Query#denomHash}. - * @memberof neutron.transfer.Query - * @typedef DenomHashCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomHashResponse} [response] QueryDenomHashResponse - */ - - /** - * Calls DenomHash. - * @function denomHash - * @memberof neutron.transfer.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} request QueryDenomHashRequest message or plain object - * @param {neutron.transfer.Query.DenomHashCallback} callback Node-style callback called with the error, if any, and QueryDenomHashResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomHash = function denomHash(request, callback) { - return this.rpcCall(denomHash, $root.ibc.applications.transfer.v1.QueryDenomHashRequest, $root.ibc.applications.transfer.v1.QueryDenomHashResponse, request, callback); - }, "name", { value: "DenomHash" }); - - /** - * Calls DenomHash. - * @function denomHash - * @memberof neutron.transfer.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} request QueryDenomHashRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - return transfer; - })(); - - return neutron; - })(); - - $root.gogoproto = (function() { - - /** - * Namespace gogoproto. - * @exports gogoproto - * @namespace - */ - var gogoproto = {}; - - return gogoproto; - })(); - - $root.cosmos = (function() { - - /** - * Namespace cosmos. - * @exports cosmos - * @namespace - */ - var cosmos = {}; - - cosmos.base = (function() { - - /** - * Namespace base. - * @memberof cosmos - * @namespace - */ - var base = {}; - - base.query = (function() { - - /** - * Namespace query. - * @memberof cosmos.base - * @namespace - */ - var query = {}; - - query.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base.query - * @namespace - */ - var v1beta1 = {}; - - v1beta1.PageRequest = (function() { - - /** - * Properties of a PageRequest. - * @memberof cosmos.base.query.v1beta1 - * @interface IPageRequest - * @property {Uint8Array|null} [key] PageRequest key - * @property {Long|null} [offset] PageRequest offset - * @property {Long|null} [limit] PageRequest limit - * @property {boolean|null} [count_total] PageRequest count_total - * @property {boolean|null} [reverse] PageRequest reverse - */ - - /** - * Constructs a new PageRequest. - * @memberof cosmos.base.query.v1beta1 - * @classdesc Represents a PageRequest. - * @implements IPageRequest - * @constructor - * @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set - */ - function PageRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PageRequest key. - * @member {Uint8Array} key - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.key = $util.newBuffer([]); - - /** - * PageRequest offset. - * @member {Long} offset - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PageRequest limit. - * @member {Long} limit - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PageRequest count_total. - * @member {boolean} count_total - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.count_total = false; - - /** - * PageRequest reverse. - * @member {boolean} reverse - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - */ - PageRequest.prototype.reverse = false; - - /** - * Encodes the specified PageRequest message. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @function encode - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.offset); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.limit); - if (message.count_total != null && Object.hasOwnProperty.call(message, "count_total")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.count_total); - if (message.reverse != null && Object.hasOwnProperty.call(message, "reverse")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reverse); - return writer; - }; - - /** - * Encodes the specified PageRequest message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {cosmos.base.query.v1beta1.IPageRequest} message PageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PageRequest message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.offset = reader.uint64(); - break; - case 3: - message.limit = reader.uint64(); - break; - case 4: - message.count_total = reader.bool(); - break; - case 5: - message.reverse = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PageRequest message. - * @function verify - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PageRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) - return "offset: integer|Long expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) - return "limit: integer|Long expected"; - if (message.count_total != null && message.hasOwnProperty("count_total")) - if (typeof message.count_total !== "boolean") - return "count_total: boolean expected"; - if (message.reverse != null && message.hasOwnProperty("reverse")) - if (typeof message.reverse !== "boolean") - return "reverse: boolean expected"; - return null; - }; - - /** - * Creates a PageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest - */ - PageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.query.v1beta1.PageRequest) - return object; - var message = new $root.cosmos.base.query.v1beta1.PageRequest(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.offset != null) - if ($util.Long) - (message.offset = $util.Long.fromValue(object.offset)).unsigned = true; - else if (typeof object.offset === "string") - message.offset = parseInt(object.offset, 10); - else if (typeof object.offset === "number") - message.offset = object.offset; - else if (typeof object.offset === "object") - message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(true); - if (object.limit != null) - if ($util.Long) - (message.limit = $util.Long.fromValue(object.limit)).unsigned = true; - else if (typeof object.limit === "string") - message.limit = parseInt(object.limit, 10); - else if (typeof object.limit === "number") - message.limit = object.limit; - else if (typeof object.limit === "object") - message.limit = new $util.LongBits(object.limit.low >>> 0, object.limit.high >>> 0).toNumber(true); - if (object.count_total != null) - message.count_total = Boolean(object.count_total); - if (object.reverse != null) - message.reverse = Boolean(object.reverse); - return message; - }; - - /** - * Creates a plain object from a PageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.query.v1beta1.PageRequest - * @static - * @param {cosmos.base.query.v1beta1.PageRequest} message PageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PageRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.offset = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.limit = options.longs === String ? "0" : 0; - object.count_total = false; - object.reverse = false; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.offset != null && message.hasOwnProperty("offset")) - if (typeof message.offset === "number") - object.offset = options.longs === String ? String(message.offset) : message.offset; - else - object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber(true) : message.offset; - if (message.limit != null && message.hasOwnProperty("limit")) - if (typeof message.limit === "number") - object.limit = options.longs === String ? String(message.limit) : message.limit; - else - object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber(true) : message.limit; - if (message.count_total != null && message.hasOwnProperty("count_total")) - object.count_total = message.count_total; - if (message.reverse != null && message.hasOwnProperty("reverse")) - object.reverse = message.reverse; - return object; - }; - - /** - * Converts this PageRequest to JSON. - * @function toJSON - * @memberof cosmos.base.query.v1beta1.PageRequest - * @instance - * @returns {Object.} JSON object - */ - PageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PageRequest; - })(); - - v1beta1.PageResponse = (function() { - - /** - * Properties of a PageResponse. - * @memberof cosmos.base.query.v1beta1 - * @interface IPageResponse - * @property {Uint8Array|null} [next_key] PageResponse next_key - * @property {Long|null} [total] PageResponse total - */ - - /** - * Constructs a new PageResponse. - * @memberof cosmos.base.query.v1beta1 - * @classdesc Represents a PageResponse. - * @implements IPageResponse - * @constructor - * @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set - */ - function PageResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PageResponse next_key. - * @member {Uint8Array} next_key - * @memberof cosmos.base.query.v1beta1.PageResponse - * @instance - */ - PageResponse.prototype.next_key = $util.newBuffer([]); - - /** - * PageResponse total. - * @member {Long} total - * @memberof cosmos.base.query.v1beta1.PageResponse - * @instance - */ - PageResponse.prototype.total = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified PageResponse message. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @function encode - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.next_key != null && Object.hasOwnProperty.call(message, "next_key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.next_key); - if (message.total != null && Object.hasOwnProperty.call(message, "total")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.total); - return writer; - }; - - /** - * Encodes the specified PageResponse message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {cosmos.base.query.v1beta1.IPageResponse} message PageResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PageResponse message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.query.v1beta1.PageResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.next_key = reader.bytes(); - break; - case 2: - message.total = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PageResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PageResponse message. - * @function verify - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PageResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.next_key != null && message.hasOwnProperty("next_key")) - if (!(message.next_key && typeof message.next_key.length === "number" || $util.isString(message.next_key))) - return "next_key: buffer expected"; - if (message.total != null && message.hasOwnProperty("total")) - if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) - return "total: integer|Long expected"; - return null; - }; - - /** - * Creates a PageResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse - */ - PageResponse.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.query.v1beta1.PageResponse) - return object; - var message = new $root.cosmos.base.query.v1beta1.PageResponse(); - if (object.next_key != null) - if (typeof object.next_key === "string") - $util.base64.decode(object.next_key, message.next_key = $util.newBuffer($util.base64.length(object.next_key)), 0); - else if (object.next_key.length) - message.next_key = object.next_key; - if (object.total != null) - if ($util.Long) - (message.total = $util.Long.fromValue(object.total)).unsigned = true; - else if (typeof object.total === "string") - message.total = parseInt(object.total, 10); - else if (typeof object.total === "number") - message.total = object.total; - else if (typeof object.total === "object") - message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a PageResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.query.v1beta1.PageResponse - * @static - * @param {cosmos.base.query.v1beta1.PageResponse} message PageResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PageResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.next_key = ""; - else { - object.next_key = []; - if (options.bytes !== Array) - object.next_key = $util.newBuffer(object.next_key); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total = options.longs === String ? "0" : 0; - } - if (message.next_key != null && message.hasOwnProperty("next_key")) - object.next_key = options.bytes === String ? $util.base64.encode(message.next_key, 0, message.next_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.next_key) : message.next_key; - if (message.total != null && message.hasOwnProperty("total")) - if (typeof message.total === "number") - object.total = options.longs === String ? String(message.total) : message.total; - else - object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber(true) : message.total; - return object; - }; - - /** - * Converts this PageResponse to JSON. - * @function toJSON - * @memberof cosmos.base.query.v1beta1.PageResponse - * @instance - * @returns {Object.} JSON object - */ - PageResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PageResponse; - })(); - - return v1beta1; - })(); - - return query; - })(); - - base.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base - * @namespace - */ - var v1beta1 = {}; - - v1beta1.Coin = (function() { - - /** - * Properties of a Coin. - * @memberof cosmos.base.v1beta1 - * @interface ICoin - * @property {string|null} [denom] Coin denom - * @property {string|null} [amount] Coin amount - */ - - /** - * Constructs a new Coin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a Coin. - * @implements ICoin - * @constructor - * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set - */ - function Coin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Coin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.denom = ""; - - /** - * Coin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.amount = ""; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Coin message. - * @function verify - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Coin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.Coin} Coin - */ - Coin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.Coin) - return object; - var message = new $root.cosmos.base.v1beta1.Coin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.Coin} message Coin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Coin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this Coin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.Coin - * @instance - * @returns {Object.} JSON object - */ - Coin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Coin; - })(); - - v1beta1.DecCoin = (function() { - - /** - * Properties of a DecCoin. - * @memberof cosmos.base.v1beta1 - * @interface IDecCoin - * @property {string|null} [denom] DecCoin denom - * @property {string|null} [amount] DecCoin amount - */ - - /** - * Constructs a new DecCoin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecCoin. - * @implements IDecCoin - * @constructor - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - */ - function DecCoin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecCoin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.denom = ""; - - /** - * DecCoin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.amount = ""; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecCoin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecCoin message. - * @function verify - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecCoin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - */ - DecCoin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecCoin) - return object; - var message = new $root.cosmos.base.v1beta1.DecCoin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.DecCoin} message DecCoin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecCoin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this DecCoin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - * @returns {Object.} JSON object - */ - DecCoin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecCoin; - })(); - - v1beta1.IntProto = (function() { - - /** - * Properties of an IntProto. - * @memberof cosmos.base.v1beta1 - * @interface IIntProto - * @property {string|null} [int] IntProto int - */ - - /** - * Constructs a new IntProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents an IntProto. - * @implements IIntProto - * @constructor - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - */ - function IntProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IntProto int. - * @member {string} int - * @memberof cosmos.base.v1beta1.IntProto - * @instance - */ - IntProto.prototype.int = ""; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.int != null && Object.hasOwnProperty.call(message, "int")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); - return writer; - }; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.IntProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntProto message. - * @function verify - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.int != null && message.hasOwnProperty("int")) - if (!$util.isString(message.int)) - return "int: string expected"; - return null; - }; - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.IntProto} IntProto - */ - IntProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.IntProto) - return object; - var message = new $root.cosmos.base.v1beta1.IntProto(); - if (object.int != null) - message.int = String(object.int); - return message; - }; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IntProto} message IntProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.int = ""; - if (message.int != null && message.hasOwnProperty("int")) - object.int = message.int; - return object; - }; - - /** - * Converts this IntProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.IntProto - * @instance - * @returns {Object.} JSON object - */ - IntProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IntProto; - })(); - - v1beta1.DecProto = (function() { - - /** - * Properties of a DecProto. - * @memberof cosmos.base.v1beta1 - * @interface IDecProto - * @property {string|null} [dec] DecProto dec - */ - - /** - * Constructs a new DecProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecProto. - * @implements IDecProto - * @constructor - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - */ - function DecProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DecProto dec. - * @member {string} dec - * @memberof cosmos.base.v1beta1.DecProto - * @instance - */ - DecProto.prototype.dec = ""; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); - return writer; - }; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.DecProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dec = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecProto message. - * @function verify - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dec != null && message.hasOwnProperty("dec")) - if (!$util.isString(message.dec)) - return "dec: string expected"; - return null; - }; - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecProto} DecProto - */ - DecProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecProto) - return object; - var message = new $root.cosmos.base.v1beta1.DecProto(); - if (object.dec != null) - message.dec = String(object.dec); - return message; - }; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.DecProto} message DecProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.dec = ""; - if (message.dec != null && message.hasOwnProperty("dec")) - object.dec = message.dec; - return object; - }; - - /** - * Converts this DecProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecProto - * @instance - * @returns {Object.} JSON object - */ - DecProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecProto; - })(); - - return v1beta1; - })(); - - return base; - })(); - - cosmos.upgrade = (function() { - - /** - * Namespace upgrade. - * @memberof cosmos - * @namespace - */ - var upgrade = {}; - - upgrade.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.upgrade - * @namespace - */ - var v1beta1 = {}; - - v1beta1.Plan = (function() { - - /** - * Properties of a Plan. - * @memberof cosmos.upgrade.v1beta1 - * @interface IPlan - * @property {string|null} [name] Plan name - * @property {google.protobuf.ITimestamp|null} [time] Plan time - * @property {Long|null} [height] Plan height - * @property {string|null} [info] Plan info - * @property {google.protobuf.IAny|null} [upgraded_client_state] Plan upgraded_client_state - */ - - /** - * Constructs a new Plan. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a Plan. - * @implements IPlan - * @constructor - * @param {cosmos.upgrade.v1beta1.IPlan=} [properties] Properties to set - */ - function Plan(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Plan name. - * @member {string} name - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.name = ""; - - /** - * Plan time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.time = null; - - /** - * Plan height. - * @member {Long} height - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Plan info. - * @member {string} info - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.info = ""; - - /** - * Plan upgraded_client_state. - * @member {google.protobuf.IAny|null|undefined} upgraded_client_state - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - */ - Plan.prototype.upgraded_client_state = null; - - /** - * Encodes the specified Plan message. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {cosmos.upgrade.v1beta1.IPlan} message Plan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Plan.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); - if (message.upgraded_client_state != null && Object.hasOwnProperty.call(message, "upgraded_client_state")) - $root.google.protobuf.Any.encode(message.upgraded_client_state, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Plan message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {cosmos.upgrade.v1beta1.IPlan} message Plan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Plan.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Plan message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.Plan} Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Plan.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.Plan(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.height = reader.int64(); - break; - case 4: - message.info = reader.string(); - break; - case 5: - message.upgraded_client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Plan message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.Plan} Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Plan.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Plan message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Plan.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.info != null && message.hasOwnProperty("info")) - if (!$util.isString(message.info)) - return "info: string expected"; - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) { - var error = $root.google.protobuf.Any.verify(message.upgraded_client_state); - if (error) - return "upgraded_client_state." + error; - } - return null; - }; - - /** - * Creates a Plan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.Plan} Plan - */ - Plan.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.Plan) - return object; - var message = new $root.cosmos.upgrade.v1beta1.Plan(); - if (object.name != null) - message.name = String(object.name); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".cosmos.upgrade.v1beta1.Plan.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.info != null) - message.info = String(object.info); - if (object.upgraded_client_state != null) { - if (typeof object.upgraded_client_state !== "object") - throw TypeError(".cosmos.upgrade.v1beta1.Plan.upgraded_client_state: object expected"); - message.upgraded_client_state = $root.google.protobuf.Any.fromObject(object.upgraded_client_state); - } - return message; - }; - - /** - * Creates a plain object from a Plan message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.Plan - * @static - * @param {cosmos.upgrade.v1beta1.Plan} message Plan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Plan.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.time = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.info = ""; - object.upgraded_client_state = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.info != null && message.hasOwnProperty("info")) - object.info = message.info; - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) - object.upgraded_client_state = $root.google.protobuf.Any.toObject(message.upgraded_client_state, options); - return object; - }; - - /** - * Converts this Plan to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.Plan - * @instance - * @returns {Object.} JSON object - */ - Plan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Plan; - })(); - - v1beta1.SoftwareUpgradeProposal = (function() { - - /** - * Properties of a SoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @interface ISoftwareUpgradeProposal - * @property {string|null} [title] SoftwareUpgradeProposal title - * @property {string|null} [description] SoftwareUpgradeProposal description - * @property {cosmos.upgrade.v1beta1.IPlan|null} [plan] SoftwareUpgradeProposal plan - */ - - /** - * Constructs a new SoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a SoftwareUpgradeProposal. - * @implements ISoftwareUpgradeProposal - * @constructor - * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal=} [properties] Properties to set - */ - function SoftwareUpgradeProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SoftwareUpgradeProposal title. - * @member {string} title - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - */ - SoftwareUpgradeProposal.prototype.title = ""; - - /** - * SoftwareUpgradeProposal description. - * @member {string} description - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - */ - SoftwareUpgradeProposal.prototype.description = ""; - - /** - * SoftwareUpgradeProposal plan. - * @member {cosmos.upgrade.v1beta1.IPlan|null|undefined} plan - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - */ - SoftwareUpgradeProposal.prototype.plan = null; - - /** - * Encodes the specified SoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal} message SoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SoftwareUpgradeProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) - $root.cosmos.upgrade.v1beta1.Plan.encode(message.plan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal} message SoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SoftwareUpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SoftwareUpgradeProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = $root.cosmos.upgrade.v1beta1.Plan.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SoftwareUpgradeProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SoftwareUpgradeProposal message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SoftwareUpgradeProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.plan != null && message.hasOwnProperty("plan")) { - var error = $root.cosmos.upgrade.v1beta1.Plan.verify(message.plan); - if (error) - return "plan." + error; - } - return null; - }; - - /** - * Creates a SoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} SoftwareUpgradeProposal - */ - SoftwareUpgradeProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) - return object; - var message = new $root.cosmos.upgrade.v1beta1.SoftwareUpgradeProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.plan != null) { - if (typeof object.plan !== "object") - throw TypeError(".cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.plan: object expected"); - message.plan = $root.cosmos.upgrade.v1beta1.Plan.fromObject(object.plan); - } - return message; - }; - - /** - * Creates a plain object from a SoftwareUpgradeProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.SoftwareUpgradeProposal} message SoftwareUpgradeProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SoftwareUpgradeProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.plan = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.plan != null && message.hasOwnProperty("plan")) - object.plan = $root.cosmos.upgrade.v1beta1.Plan.toObject(message.plan, options); - return object; - }; - - /** - * Converts this SoftwareUpgradeProposal to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - * @instance - * @returns {Object.} JSON object - */ - SoftwareUpgradeProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SoftwareUpgradeProposal; - })(); - - v1beta1.CancelSoftwareUpgradeProposal = (function() { - - /** - * Properties of a CancelSoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @interface ICancelSoftwareUpgradeProposal - * @property {string|null} [title] CancelSoftwareUpgradeProposal title - * @property {string|null} [description] CancelSoftwareUpgradeProposal description - */ - - /** - * Constructs a new CancelSoftwareUpgradeProposal. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a CancelSoftwareUpgradeProposal. - * @implements ICancelSoftwareUpgradeProposal - * @constructor - * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal=} [properties] Properties to set - */ - function CancelSoftwareUpgradeProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelSoftwareUpgradeProposal title. - * @member {string} title - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @instance - */ - CancelSoftwareUpgradeProposal.prototype.title = ""; - - /** - * CancelSoftwareUpgradeProposal description. - * @member {string} description - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @instance - */ - CancelSoftwareUpgradeProposal.prototype.description = ""; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelSoftwareUpgradeProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelSoftwareUpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelSoftwareUpgradeProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelSoftwareUpgradeProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelSoftwareUpgradeProposal message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelSoftwareUpgradeProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates a CancelSoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} CancelSoftwareUpgradeProposal - */ - CancelSoftwareUpgradeProposal.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) - return object; - var message = new $root.cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from a CancelSoftwareUpgradeProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @static - * @param {cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal} message CancelSoftwareUpgradeProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelSoftwareUpgradeProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this CancelSoftwareUpgradeProposal to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - * @instance - * @returns {Object.} JSON object - */ - CancelSoftwareUpgradeProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CancelSoftwareUpgradeProposal; - })(); - - v1beta1.ModuleVersion = (function() { - - /** - * Properties of a ModuleVersion. - * @memberof cosmos.upgrade.v1beta1 - * @interface IModuleVersion - * @property {string|null} [name] ModuleVersion name - * @property {Long|null} [version] ModuleVersion version - */ - - /** - * Constructs a new ModuleVersion. - * @memberof cosmos.upgrade.v1beta1 - * @classdesc Represents a ModuleVersion. - * @implements IModuleVersion - * @constructor - * @param {cosmos.upgrade.v1beta1.IModuleVersion=} [properties] Properties to set - */ - function ModuleVersion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ModuleVersion name. - * @member {string} name - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @instance - */ - ModuleVersion.prototype.name = ""; - - /** - * ModuleVersion version. - * @member {Long} version - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @instance - */ - ModuleVersion.prototype.version = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified ModuleVersion message. Does not implicitly {@link cosmos.upgrade.v1beta1.ModuleVersion.verify|verify} messages. - * @function encode - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @static - * @param {cosmos.upgrade.v1beta1.IModuleVersion} message ModuleVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModuleVersion.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.version); - return writer; - }; - - /** - * Encodes the specified ModuleVersion message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.ModuleVersion.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @static - * @param {cosmos.upgrade.v1beta1.IModuleVersion} message ModuleVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ModuleVersion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ModuleVersion message from the specified reader or buffer. - * @function decode - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.upgrade.v1beta1.ModuleVersion} ModuleVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModuleVersion.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.upgrade.v1beta1.ModuleVersion(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.version = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ModuleVersion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.upgrade.v1beta1.ModuleVersion} ModuleVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ModuleVersion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ModuleVersion message. - * @function verify - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ModuleVersion.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) - return "version: integer|Long expected"; - return null; - }; - - /** - * Creates a ModuleVersion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @static - * @param {Object.} object Plain object - * @returns {cosmos.upgrade.v1beta1.ModuleVersion} ModuleVersion - */ - ModuleVersion.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.upgrade.v1beta1.ModuleVersion) - return object; - var message = new $root.cosmos.upgrade.v1beta1.ModuleVersion(); - if (object.name != null) - message.name = String(object.name); - if (object.version != null) - if ($util.Long) - (message.version = $util.Long.fromValue(object.version)).unsigned = true; - else if (typeof object.version === "string") - message.version = parseInt(object.version, 10); - else if (typeof object.version === "number") - message.version = object.version; - else if (typeof object.version === "object") - message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a ModuleVersion message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @static - * @param {cosmos.upgrade.v1beta1.ModuleVersion} message ModuleVersion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ModuleVersion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.version = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) - if (typeof message.version === "number") - object.version = options.longs === String ? String(message.version) : message.version; - else - object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber(true) : message.version; - return object; - }; - - /** - * Converts this ModuleVersion to JSON. - * @function toJSON - * @memberof cosmos.upgrade.v1beta1.ModuleVersion - * @instance - * @returns {Object.} JSON object - */ - ModuleVersion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ModuleVersion; - })(); - - return v1beta1; - })(); - - return upgrade; - })(); - - return cosmos; - })(); - - $root.ibc = (function() { - - /** - * Namespace ibc. - * @exports ibc - * @namespace - */ - var ibc = {}; - - ibc.core = (function() { - - /** - * Namespace core. - * @memberof ibc - * @namespace - */ - var core = {}; - - core.client = (function() { - - /** - * Namespace client. - * @memberof ibc.core - * @namespace - */ - var client = {}; - - client.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.core.client - * @namespace - */ - var v1 = {}; - - v1.IdentifiedClientState = (function() { - - /** - * Properties of an IdentifiedClientState. - * @memberof ibc.core.client.v1 - * @interface IIdentifiedClientState - * @property {string|null} [client_id] IdentifiedClientState client_id - * @property {google.protobuf.IAny|null} [client_state] IdentifiedClientState client_state - */ - - /** - * Constructs a new IdentifiedClientState. - * @memberof ibc.core.client.v1 - * @classdesc Represents an IdentifiedClientState. - * @implements IIdentifiedClientState - * @constructor - * @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set - */ - function IdentifiedClientState(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentifiedClientState client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.IdentifiedClientState - * @instance - */ - IdentifiedClientState.prototype.client_id = ""; - - /** - * IdentifiedClientState client_state. - * @member {google.protobuf.IAny|null|undefined} client_state - * @memberof ibc.core.client.v1.IdentifiedClientState - * @instance - */ - IdentifiedClientState.prototype.client_state = null; - - /** - * Encodes the specified IdentifiedClientState message. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedClientState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.client_state != null && Object.hasOwnProperty.call(message, "client_state")) - $root.google.protobuf.Any.encode(message.client_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentifiedClientState message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {ibc.core.client.v1.IIdentifiedClientState} message IdentifiedClientState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentifiedClientState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedClientState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.IdentifiedClientState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - message.client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentifiedClientState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentifiedClientState message. - * @function verify - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentifiedClientState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.client_state != null && message.hasOwnProperty("client_state")) { - var error = $root.google.protobuf.Any.verify(message.client_state); - if (error) - return "client_state." + error; - } - return null; - }; - - /** - * Creates an IdentifiedClientState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState - */ - IdentifiedClientState.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.IdentifiedClientState) - return object; - var message = new $root.ibc.core.client.v1.IdentifiedClientState(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.client_state != null) { - if (typeof object.client_state !== "object") - throw TypeError(".ibc.core.client.v1.IdentifiedClientState.client_state: object expected"); - message.client_state = $root.google.protobuf.Any.fromObject(object.client_state); - } - return message; - }; - - /** - * Creates a plain object from an IdentifiedClientState message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.IdentifiedClientState - * @static - * @param {ibc.core.client.v1.IdentifiedClientState} message IdentifiedClientState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentifiedClientState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.client_id = ""; - object.client_state = null; - } - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.client_state != null && message.hasOwnProperty("client_state")) - object.client_state = $root.google.protobuf.Any.toObject(message.client_state, options); - return object; - }; - - /** - * Converts this IdentifiedClientState to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.IdentifiedClientState - * @instance - * @returns {Object.} JSON object - */ - IdentifiedClientState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IdentifiedClientState; - })(); - - v1.ConsensusStateWithHeight = (function() { - - /** - * Properties of a ConsensusStateWithHeight. - * @memberof ibc.core.client.v1 - * @interface IConsensusStateWithHeight - * @property {ibc.core.client.v1.IHeight|null} [height] ConsensusStateWithHeight height - * @property {google.protobuf.IAny|null} [consensus_state] ConsensusStateWithHeight consensus_state - */ - - /** - * Constructs a new ConsensusStateWithHeight. - * @memberof ibc.core.client.v1 - * @classdesc Represents a ConsensusStateWithHeight. - * @implements IConsensusStateWithHeight - * @constructor - * @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set - */ - function ConsensusStateWithHeight(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusStateWithHeight height. - * @member {ibc.core.client.v1.IHeight|null|undefined} height - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @instance - */ - ConsensusStateWithHeight.prototype.height = null; - - /** - * ConsensusStateWithHeight consensus_state. - * @member {google.protobuf.IAny|null|undefined} consensus_state - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @instance - */ - ConsensusStateWithHeight.prototype.consensus_state = null; - - /** - * Encodes the specified ConsensusStateWithHeight message. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateWithHeight.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - $root.ibc.core.client.v1.Height.encode(message.height, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.consensus_state != null && Object.hasOwnProperty.call(message, "consensus_state")) - $root.google.protobuf.Any.encode(message.consensus_state, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConsensusStateWithHeight message, length delimited. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {ibc.core.client.v1.IConsensusStateWithHeight} message ConsensusStateWithHeight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusStateWithHeight.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateWithHeight.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32()); - break; - case 2: - message.consensus_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusStateWithHeight.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusStateWithHeight message. - * @function verify - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusStateWithHeight.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) { - var error = $root.ibc.core.client.v1.Height.verify(message.height); - if (error) - return "height." + error; - } - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) { - var error = $root.google.protobuf.Any.verify(message.consensus_state); - if (error) - return "consensus_state." + error; - } - return null; - }; - - /** - * Creates a ConsensusStateWithHeight message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight - */ - ConsensusStateWithHeight.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.ConsensusStateWithHeight) - return object; - var message = new $root.ibc.core.client.v1.ConsensusStateWithHeight(); - if (object.height != null) { - if (typeof object.height !== "object") - throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.height: object expected"); - message.height = $root.ibc.core.client.v1.Height.fromObject(object.height); - } - if (object.consensus_state != null) { - if (typeof object.consensus_state !== "object") - throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.consensus_state: object expected"); - message.consensus_state = $root.google.protobuf.Any.fromObject(object.consensus_state); - } - return message; - }; - - /** - * Creates a plain object from a ConsensusStateWithHeight message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @static - * @param {ibc.core.client.v1.ConsensusStateWithHeight} message ConsensusStateWithHeight - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusStateWithHeight.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.height = null; - object.consensus_state = null; - } - if (message.height != null && message.hasOwnProperty("height")) - object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options); - if (message.consensus_state != null && message.hasOwnProperty("consensus_state")) - object.consensus_state = $root.google.protobuf.Any.toObject(message.consensus_state, options); - return object; - }; - - /** - * Converts this ConsensusStateWithHeight to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.ConsensusStateWithHeight - * @instance - * @returns {Object.} JSON object - */ - ConsensusStateWithHeight.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusStateWithHeight; - })(); - - v1.ClientConsensusStates = (function() { - - /** - * Properties of a ClientConsensusStates. - * @memberof ibc.core.client.v1 - * @interface IClientConsensusStates - * @property {string|null} [client_id] ClientConsensusStates client_id - * @property {Array.|null} [consensus_states] ClientConsensusStates consensus_states - */ - - /** - * Constructs a new ClientConsensusStates. - * @memberof ibc.core.client.v1 - * @classdesc Represents a ClientConsensusStates. - * @implements IClientConsensusStates - * @constructor - * @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set - */ - function ClientConsensusStates(properties) { - this.consensus_states = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientConsensusStates client_id. - * @member {string} client_id - * @memberof ibc.core.client.v1.ClientConsensusStates - * @instance - */ - ClientConsensusStates.prototype.client_id = ""; - - /** - * ClientConsensusStates consensus_states. - * @member {Array.} consensus_states - * @memberof ibc.core.client.v1.ClientConsensusStates - * @instance - */ - ClientConsensusStates.prototype.consensus_states = $util.emptyArray; - - /** - * Encodes the specified ClientConsensusStates message. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConsensusStates.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.client_id != null && Object.hasOwnProperty.call(message, "client_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.client_id); - if (message.consensus_states != null && message.consensus_states.length) - for (var i = 0; i < message.consensus_states.length; ++i) - $root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensus_states[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientConsensusStates message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {ibc.core.client.v1.IClientConsensusStates} message ClientConsensusStates message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientConsensusStates.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConsensusStates.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientConsensusStates(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.client_id = reader.string(); - break; - case 2: - if (!(message.consensus_states && message.consensus_states.length)) - message.consensus_states = []; - message.consensus_states.push($root.ibc.core.client.v1.ConsensusStateWithHeight.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientConsensusStates.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientConsensusStates message. - * @function verify - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientConsensusStates.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.client_id != null && message.hasOwnProperty("client_id")) - if (!$util.isString(message.client_id)) - return "client_id: string expected"; - if (message.consensus_states != null && message.hasOwnProperty("consensus_states")) { - if (!Array.isArray(message.consensus_states)) - return "consensus_states: array expected"; - for (var i = 0; i < message.consensus_states.length; ++i) { - var error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensus_states[i]); - if (error) - return "consensus_states." + error; - } - } - return null; - }; - - /** - * Creates a ClientConsensusStates message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates - */ - ClientConsensusStates.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.ClientConsensusStates) - return object; - var message = new $root.ibc.core.client.v1.ClientConsensusStates(); - if (object.client_id != null) - message.client_id = String(object.client_id); - if (object.consensus_states) { - if (!Array.isArray(object.consensus_states)) - throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensus_states: array expected"); - message.consensus_states = []; - for (var i = 0; i < object.consensus_states.length; ++i) { - if (typeof object.consensus_states[i] !== "object") - throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensus_states: object expected"); - message.consensus_states[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensus_states[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ClientConsensusStates message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.ClientConsensusStates - * @static - * @param {ibc.core.client.v1.ClientConsensusStates} message ClientConsensusStates - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientConsensusStates.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.consensus_states = []; - if (options.defaults) - object.client_id = ""; - if (message.client_id != null && message.hasOwnProperty("client_id")) - object.client_id = message.client_id; - if (message.consensus_states && message.consensus_states.length) { - object.consensus_states = []; - for (var j = 0; j < message.consensus_states.length; ++j) - object.consensus_states[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensus_states[j], options); - } - return object; - }; - - /** - * Converts this ClientConsensusStates to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.ClientConsensusStates - * @instance - * @returns {Object.} JSON object - */ - ClientConsensusStates.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientConsensusStates; - })(); - - v1.ClientUpdateProposal = (function() { - - /** - * Properties of a ClientUpdateProposal. - * @memberof ibc.core.client.v1 - * @interface IClientUpdateProposal - * @property {string|null} [title] ClientUpdateProposal title - * @property {string|null} [description] ClientUpdateProposal description - * @property {string|null} [subject_client_id] ClientUpdateProposal subject_client_id - * @property {string|null} [substitute_client_id] ClientUpdateProposal substitute_client_id - */ - - /** - * Constructs a new ClientUpdateProposal. - * @memberof ibc.core.client.v1 - * @classdesc Represents a ClientUpdateProposal. - * @implements IClientUpdateProposal - * @constructor - * @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set - */ - function ClientUpdateProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientUpdateProposal title. - * @member {string} title - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.title = ""; - - /** - * ClientUpdateProposal description. - * @member {string} description - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.description = ""; - - /** - * ClientUpdateProposal subject_client_id. - * @member {string} subject_client_id - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.subject_client_id = ""; - - /** - * ClientUpdateProposal substitute_client_id. - * @member {string} substitute_client_id - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - */ - ClientUpdateProposal.prototype.substitute_client_id = ""; - - /** - * Encodes the specified ClientUpdateProposal message. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientUpdateProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.subject_client_id != null && Object.hasOwnProperty.call(message, "subject_client_id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.subject_client_id); - if (message.substitute_client_id != null && Object.hasOwnProperty.call(message, "substitute_client_id")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.substitute_client_id); - return writer; - }; - - /** - * Encodes the specified ClientUpdateProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {ibc.core.client.v1.IClientUpdateProposal} message ClientUpdateProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientUpdateProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientUpdateProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.ClientUpdateProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.subject_client_id = reader.string(); - break; - case 4: - message.substitute_client_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientUpdateProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientUpdateProposal message. - * @function verify - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientUpdateProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.subject_client_id != null && message.hasOwnProperty("subject_client_id")) - if (!$util.isString(message.subject_client_id)) - return "subject_client_id: string expected"; - if (message.substitute_client_id != null && message.hasOwnProperty("substitute_client_id")) - if (!$util.isString(message.substitute_client_id)) - return "substitute_client_id: string expected"; - return null; - }; - - /** - * Creates a ClientUpdateProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal - */ - ClientUpdateProposal.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.ClientUpdateProposal) - return object; - var message = new $root.ibc.core.client.v1.ClientUpdateProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.subject_client_id != null) - message.subject_client_id = String(object.subject_client_id); - if (object.substitute_client_id != null) - message.substitute_client_id = String(object.substitute_client_id); - return message; - }; - - /** - * Creates a plain object from a ClientUpdateProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @static - * @param {ibc.core.client.v1.ClientUpdateProposal} message ClientUpdateProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientUpdateProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.subject_client_id = ""; - object.substitute_client_id = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.subject_client_id != null && message.hasOwnProperty("subject_client_id")) - object.subject_client_id = message.subject_client_id; - if (message.substitute_client_id != null && message.hasOwnProperty("substitute_client_id")) - object.substitute_client_id = message.substitute_client_id; - return object; - }; - - /** - * Converts this ClientUpdateProposal to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.ClientUpdateProposal - * @instance - * @returns {Object.} JSON object - */ - ClientUpdateProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClientUpdateProposal; - })(); - - v1.UpgradeProposal = (function() { - - /** - * Properties of an UpgradeProposal. - * @memberof ibc.core.client.v1 - * @interface IUpgradeProposal - * @property {string|null} [title] UpgradeProposal title - * @property {string|null} [description] UpgradeProposal description - * @property {cosmos.upgrade.v1beta1.IPlan|null} [plan] UpgradeProposal plan - * @property {google.protobuf.IAny|null} [upgraded_client_state] UpgradeProposal upgraded_client_state - */ - - /** - * Constructs a new UpgradeProposal. - * @memberof ibc.core.client.v1 - * @classdesc Represents an UpgradeProposal. - * @implements IUpgradeProposal - * @constructor - * @param {ibc.core.client.v1.IUpgradeProposal=} [properties] Properties to set - */ - function UpgradeProposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpgradeProposal title. - * @member {string} title - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.title = ""; - - /** - * UpgradeProposal description. - * @member {string} description - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.description = ""; - - /** - * UpgradeProposal plan. - * @member {cosmos.upgrade.v1beta1.IPlan|null|undefined} plan - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.plan = null; - - /** - * UpgradeProposal upgraded_client_state. - * @member {google.protobuf.IAny|null|undefined} upgraded_client_state - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - */ - UpgradeProposal.prototype.upgraded_client_state = null; - - /** - * Encodes the specified UpgradeProposal message. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {ibc.core.client.v1.IUpgradeProposal} message UpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeProposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) - $root.cosmos.upgrade.v1beta1.Plan.encode(message.plan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.upgraded_client_state != null && Object.hasOwnProperty.call(message, "upgraded_client_state")) - $root.google.protobuf.Any.encode(message.upgraded_client_state, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpgradeProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {ibc.core.client.v1.IUpgradeProposal} message UpgradeProposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpgradeProposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.UpgradeProposal} UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeProposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.UpgradeProposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.plan = $root.cosmos.upgrade.v1beta1.Plan.decode(reader, reader.uint32()); - break; - case 4: - message.upgraded_client_state = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.UpgradeProposal} UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpgradeProposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpgradeProposal message. - * @function verify - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpgradeProposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.plan != null && message.hasOwnProperty("plan")) { - var error = $root.cosmos.upgrade.v1beta1.Plan.verify(message.plan); - if (error) - return "plan." + error; - } - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) { - var error = $root.google.protobuf.Any.verify(message.upgraded_client_state); - if (error) - return "upgraded_client_state." + error; - } - return null; - }; - - /** - * Creates an UpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.UpgradeProposal} UpgradeProposal - */ - UpgradeProposal.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.UpgradeProposal) - return object; - var message = new $root.ibc.core.client.v1.UpgradeProposal(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.plan != null) { - if (typeof object.plan !== "object") - throw TypeError(".ibc.core.client.v1.UpgradeProposal.plan: object expected"); - message.plan = $root.cosmos.upgrade.v1beta1.Plan.fromObject(object.plan); - } - if (object.upgraded_client_state != null) { - if (typeof object.upgraded_client_state !== "object") - throw TypeError(".ibc.core.client.v1.UpgradeProposal.upgraded_client_state: object expected"); - message.upgraded_client_state = $root.google.protobuf.Any.fromObject(object.upgraded_client_state); - } - return message; - }; - - /** - * Creates a plain object from an UpgradeProposal message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.UpgradeProposal - * @static - * @param {ibc.core.client.v1.UpgradeProposal} message UpgradeProposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpgradeProposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.plan = null; - object.upgraded_client_state = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.plan != null && message.hasOwnProperty("plan")) - object.plan = $root.cosmos.upgrade.v1beta1.Plan.toObject(message.plan, options); - if (message.upgraded_client_state != null && message.hasOwnProperty("upgraded_client_state")) - object.upgraded_client_state = $root.google.protobuf.Any.toObject(message.upgraded_client_state, options); - return object; - }; - - /** - * Converts this UpgradeProposal to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.UpgradeProposal - * @instance - * @returns {Object.} JSON object - */ - UpgradeProposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpgradeProposal; - })(); - - v1.Height = (function() { - - /** - * Properties of an Height. - * @memberof ibc.core.client.v1 - * @interface IHeight - * @property {Long|null} [revision_number] Height revision_number - * @property {Long|null} [revision_height] Height revision_height - */ - - /** - * Constructs a new Height. - * @memberof ibc.core.client.v1 - * @classdesc Represents an Height. - * @implements IHeight - * @constructor - * @param {ibc.core.client.v1.IHeight=} [properties] Properties to set - */ - function Height(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Height revision_number. - * @member {Long} revision_number - * @memberof ibc.core.client.v1.Height - * @instance - */ - Height.prototype.revision_number = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Height revision_height. - * @member {Long} revision_height - * @memberof ibc.core.client.v1.Height - * @instance - */ - Height.prototype.revision_height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Height message. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.Height - * @static - * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Height.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision_number != null && Object.hasOwnProperty.call(message, "revision_number")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.revision_number); - if (message.revision_height != null && Object.hasOwnProperty.call(message, "revision_height")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revision_height); - return writer; - }; - - /** - * Encodes the specified Height message, length delimited. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.Height - * @static - * @param {ibc.core.client.v1.IHeight} message Height message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Height.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Height message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.Height - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.Height} Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Height.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Height(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revision_number = reader.uint64(); - break; - case 2: - message.revision_height = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Height message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.Height - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.Height} Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Height.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Height message. - * @function verify - * @memberof ibc.core.client.v1.Height - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Height.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (!$util.isInteger(message.revision_number) && !(message.revision_number && $util.isInteger(message.revision_number.low) && $util.isInteger(message.revision_number.high))) - return "revision_number: integer|Long expected"; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (!$util.isInteger(message.revision_height) && !(message.revision_height && $util.isInteger(message.revision_height.low) && $util.isInteger(message.revision_height.high))) - return "revision_height: integer|Long expected"; - return null; - }; - - /** - * Creates an Height message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.Height - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.Height} Height - */ - Height.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.Height) - return object; - var message = new $root.ibc.core.client.v1.Height(); - if (object.revision_number != null) - if ($util.Long) - (message.revision_number = $util.Long.fromValue(object.revision_number)).unsigned = true; - else if (typeof object.revision_number === "string") - message.revision_number = parseInt(object.revision_number, 10); - else if (typeof object.revision_number === "number") - message.revision_number = object.revision_number; - else if (typeof object.revision_number === "object") - message.revision_number = new $util.LongBits(object.revision_number.low >>> 0, object.revision_number.high >>> 0).toNumber(true); - if (object.revision_height != null) - if ($util.Long) - (message.revision_height = $util.Long.fromValue(object.revision_height)).unsigned = true; - else if (typeof object.revision_height === "string") - message.revision_height = parseInt(object.revision_height, 10); - else if (typeof object.revision_height === "number") - message.revision_height = object.revision_height; - else if (typeof object.revision_height === "object") - message.revision_height = new $util.LongBits(object.revision_height.low >>> 0, object.revision_height.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from an Height message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.Height - * @static - * @param {ibc.core.client.v1.Height} message Height - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Height.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_number = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_number = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.revision_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.revision_height = options.longs === String ? "0" : 0; - } - if (message.revision_number != null && message.hasOwnProperty("revision_number")) - if (typeof message.revision_number === "number") - object.revision_number = options.longs === String ? String(message.revision_number) : message.revision_number; - else - object.revision_number = options.longs === String ? $util.Long.prototype.toString.call(message.revision_number) : options.longs === Number ? new $util.LongBits(message.revision_number.low >>> 0, message.revision_number.high >>> 0).toNumber(true) : message.revision_number; - if (message.revision_height != null && message.hasOwnProperty("revision_height")) - if (typeof message.revision_height === "number") - object.revision_height = options.longs === String ? String(message.revision_height) : message.revision_height; - else - object.revision_height = options.longs === String ? $util.Long.prototype.toString.call(message.revision_height) : options.longs === Number ? new $util.LongBits(message.revision_height.low >>> 0, message.revision_height.high >>> 0).toNumber(true) : message.revision_height; - return object; - }; - - /** - * Converts this Height to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.Height - * @instance - * @returns {Object.} JSON object - */ - Height.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Height; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.core.client.v1 - * @interface IParams - * @property {Array.|null} [allowed_clients] Params allowed_clients - */ - - /** - * Constructs a new Params. - * @memberof ibc.core.client.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.core.client.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - this.allowed_clients = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params allowed_clients. - * @member {Array.} allowed_clients - * @memberof ibc.core.client.v1.Params - * @instance - */ - Params.prototype.allowed_clients = $util.emptyArray; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.core.client.v1.Params - * @static - * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowed_clients != null && message.allowed_clients.length) - for (var i = 0; i < message.allowed_clients.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowed_clients[i]); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.core.client.v1.Params - * @static - * @param {ibc.core.client.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.core.client.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.core.client.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.core.client.v1.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.allowed_clients && message.allowed_clients.length)) - message.allowed_clients = []; - message.allowed_clients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.core.client.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.core.client.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.core.client.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowed_clients != null && message.hasOwnProperty("allowed_clients")) { - if (!Array.isArray(message.allowed_clients)) - return "allowed_clients: array expected"; - for (var i = 0; i < message.allowed_clients.length; ++i) - if (!$util.isString(message.allowed_clients[i])) - return "allowed_clients: string[] expected"; - } - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.core.client.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.core.client.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.core.client.v1.Params) - return object; - var message = new $root.ibc.core.client.v1.Params(); - if (object.allowed_clients) { - if (!Array.isArray(object.allowed_clients)) - throw TypeError(".ibc.core.client.v1.Params.allowed_clients: array expected"); - message.allowed_clients = []; - for (var i = 0; i < object.allowed_clients.length; ++i) - message.allowed_clients[i] = String(object.allowed_clients[i]); - } - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.core.client.v1.Params - * @static - * @param {ibc.core.client.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowed_clients = []; - if (message.allowed_clients && message.allowed_clients.length) { - object.allowed_clients = []; - for (var j = 0; j < message.allowed_clients.length; ++j) - object.allowed_clients[j] = message.allowed_clients[j]; - } - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.core.client.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - return v1; - })(); - - return client; - })(); - - return core; - })(); - - ibc.applications = (function() { - - /** - * Namespace applications. - * @memberof ibc - * @namespace - */ - var applications = {}; - - applications.transfer = (function() { - - /** - * Namespace transfer. - * @memberof ibc.applications - * @namespace - */ - var transfer = {}; - - transfer.v1 = (function() { - - /** - * Namespace v1. - * @memberof ibc.applications.transfer - * @namespace - */ - var v1 = {}; - - v1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTrace}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef DenomTraceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomTraceResponse} [response] QueryDenomTraceResponse - */ - - /** - * Calls DenomTrace. - * @function denomTrace - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.DenomTraceCallback} callback Node-style callback called with the error, if any, and QueryDenomTraceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomTrace = function denomTrace(request, callback) { - return this.rpcCall(denomTrace, $root.ibc.applications.transfer.v1.QueryDenomTraceRequest, $root.ibc.applications.transfer.v1.QueryDenomTraceResponse, request, callback); - }, "name", { value: "DenomTrace" }); - - /** - * Calls DenomTrace. - * @function denomTrace - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} request QueryDenomTraceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTraces}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef DenomTracesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomTracesResponse} [response] QueryDenomTracesResponse - */ - - /** - * Calls DenomTraces. - * @function denomTraces - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.DenomTracesCallback} callback Node-style callback called with the error, if any, and QueryDenomTracesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomTraces = function denomTraces(request, callback) { - return this.rpcCall(denomTraces, $root.ibc.applications.transfer.v1.QueryDenomTracesRequest, $root.ibc.applications.transfer.v1.QueryDenomTracesResponse, request, callback); - }, "name", { value: "DenomTraces" }); - - /** - * Calls DenomTraces. - * @function denomTraces - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} request QueryDenomTracesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#params}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.ibc.applications.transfer.v1.QueryParamsRequest, $root.ibc.applications.transfer.v1.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomHash}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef DenomHashCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryDenomHashResponse} [response] QueryDenomHashResponse - */ - - /** - * Calls DenomHash. - * @function denomHash - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} request QueryDenomHashRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.DenomHashCallback} callback Node-style callback called with the error, if any, and QueryDenomHashResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomHash = function denomHash(request, callback) { - return this.rpcCall(denomHash, $root.ibc.applications.transfer.v1.QueryDenomHashRequest, $root.ibc.applications.transfer.v1.QueryDenomHashResponse, request, callback); - }, "name", { value: "DenomHash" }); - - /** - * Calls DenomHash. - * @function denomHash - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} request QueryDenomHashRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#escrowAddress}. - * @memberof ibc.applications.transfer.v1.Query - * @typedef EscrowAddressCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {ibc.applications.transfer.v1.QueryEscrowAddressResponse} [response] QueryEscrowAddressResponse - */ - - /** - * Calls EscrowAddress. - * @function escrowAddress - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} request QueryEscrowAddressRequest message or plain object - * @param {ibc.applications.transfer.v1.Query.EscrowAddressCallback} callback Node-style callback called with the error, if any, and QueryEscrowAddressResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.escrowAddress = function escrowAddress(request, callback) { - return this.rpcCall(escrowAddress, $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest, $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse, request, callback); - }, "name", { value: "EscrowAddress" }); - - /** - * Calls EscrowAddress. - * @function escrowAddress - * @memberof ibc.applications.transfer.v1.Query - * @instance - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} request QueryEscrowAddressRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1.QueryDenomTraceRequest = (function() { - - /** - * Properties of a QueryDenomTraceRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTraceRequest - * @property {string|null} [hash] QueryDenomTraceRequest hash - */ - - /** - * Constructs a new QueryDenomTraceRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTraceRequest. - * @implements IQueryDenomTraceRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest=} [properties] Properties to set - */ - function QueryDenomTraceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTraceRequest hash. - * @member {string} hash - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @instance - */ - QueryDenomTraceRequest.prototype.hash = ""; - - /** - * Encodes the specified QueryDenomTraceRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} message QueryDenomTraceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); - return writer; - }; - - /** - * Encodes the specified QueryDenomTraceRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceRequest} message QueryDenomTraceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTraceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTraceRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTraceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; - return null; - }; - - /** - * Creates a QueryDenomTraceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTraceRequest} QueryDenomTraceRequest - */ - QueryDenomTraceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTraceRequest) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomTraceRequest(); - if (object.hash != null) - message.hash = String(object.hash); - return message; - }; - - /** - * Creates a plain object from a QueryDenomTraceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTraceRequest} message QueryDenomTraceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTraceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.hash = ""; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; - return object; - }; - - /** - * Converts this QueryDenomTraceRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTraceRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTraceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTraceRequest; - })(); - - v1.QueryDenomTraceResponse = (function() { - - /** - * Properties of a QueryDenomTraceResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTraceResponse - * @property {ibc.applications.transfer.v1.IDenomTrace|null} [denom_trace] QueryDenomTraceResponse denom_trace - */ - - /** - * Constructs a new QueryDenomTraceResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTraceResponse. - * @implements IQueryDenomTraceResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse=} [properties] Properties to set - */ - function QueryDenomTraceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTraceResponse denom_trace. - * @member {ibc.applications.transfer.v1.IDenomTrace|null|undefined} denom_trace - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @instance - */ - QueryDenomTraceResponse.prototype.denom_trace = null; - - /** - * Encodes the specified QueryDenomTraceResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse} message QueryDenomTraceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom_trace != null && Object.hasOwnProperty.call(message, "denom_trace")) - $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denom_trace, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomTraceResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTraceResponse} message QueryDenomTraceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTraceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTraceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom_trace = $root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTraceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTraceResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTraceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom_trace != null && message.hasOwnProperty("denom_trace")) { - var error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denom_trace); - if (error) - return "denom_trace." + error; - } - return null; - }; - - /** - * Creates a QueryDenomTraceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTraceResponse} QueryDenomTraceResponse - */ - QueryDenomTraceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTraceResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomTraceResponse(); - if (object.denom_trace != null) { - if (typeof object.denom_trace !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTraceResponse.denom_trace: object expected"); - message.denom_trace = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denom_trace); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomTraceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTraceResponse} message QueryDenomTraceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTraceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.denom_trace = null; - if (message.denom_trace != null && message.hasOwnProperty("denom_trace")) - object.denom_trace = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denom_trace, options); - return object; - }; - - /** - * Converts this QueryDenomTraceResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTraceResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTraceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTraceResponse; - })(); - - v1.QueryDenomTracesRequest = (function() { - - /** - * Properties of a QueryDenomTracesRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTracesRequest - * @property {cosmos.base.query.v1beta1.IPageRequest|null} [pagination] QueryDenomTracesRequest pagination - */ - - /** - * Constructs a new QueryDenomTracesRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTracesRequest. - * @implements IQueryDenomTracesRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest=} [properties] Properties to set - */ - function QueryDenomTracesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTracesRequest pagination. - * @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @instance - */ - QueryDenomTracesRequest.prototype.pagination = null; - - /** - * Encodes the specified QueryDenomTracesRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} message QueryDenomTracesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageRequest.encode(message.pagination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomTracesRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesRequest} message QueryDenomTracesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTracesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTracesRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTracesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageRequest.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryDenomTracesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTracesRequest} QueryDenomTracesRequest - */ - QueryDenomTracesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTracesRequest) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomTracesRequest(); - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesRequest.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageRequest.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomTracesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTracesRequest} message QueryDenomTracesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTracesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pagination = null; - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageRequest.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryDenomTracesRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTracesRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTracesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTracesRequest; - })(); - - v1.QueryDenomTracesResponse = (function() { - - /** - * Properties of a QueryDenomTracesResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomTracesResponse - * @property {Array.|null} [denom_traces] QueryDenomTracesResponse denom_traces - * @property {cosmos.base.query.v1beta1.IPageResponse|null} [pagination] QueryDenomTracesResponse pagination - */ - - /** - * Constructs a new QueryDenomTracesResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomTracesResponse. - * @implements IQueryDenomTracesResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse=} [properties] Properties to set - */ - function QueryDenomTracesResponse(properties) { - this.denom_traces = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomTracesResponse denom_traces. - * @member {Array.} denom_traces - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @instance - */ - QueryDenomTracesResponse.prototype.denom_traces = $util.emptyArray; - - /** - * QueryDenomTracesResponse pagination. - * @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @instance - */ - QueryDenomTracesResponse.prototype.pagination = null; - - /** - * Encodes the specified QueryDenomTracesResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse} message QueryDenomTracesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom_traces != null && message.denom_traces.length) - for (var i = 0; i < message.denom_traces.length; ++i) - $root.ibc.applications.transfer.v1.DenomTrace.encode(message.denom_traces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pagination != null && Object.hasOwnProperty.call(message, "pagination")) - $root.cosmos.base.query.v1beta1.PageResponse.encode(message.pagination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomTracesResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomTracesResponse} message QueryDenomTracesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomTracesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomTracesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.denom_traces && message.denom_traces.length)) - message.denom_traces = []; - message.denom_traces.push($root.ibc.applications.transfer.v1.DenomTrace.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomTracesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomTracesResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomTracesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom_traces != null && message.hasOwnProperty("denom_traces")) { - if (!Array.isArray(message.denom_traces)) - return "denom_traces: array expected"; - for (var i = 0; i < message.denom_traces.length; ++i) { - var error = $root.ibc.applications.transfer.v1.DenomTrace.verify(message.denom_traces[i]); - if (error) - return "denom_traces." + error; - } - } - if (message.pagination != null && message.hasOwnProperty("pagination")) { - var error = $root.cosmos.base.query.v1beta1.PageResponse.verify(message.pagination); - if (error) - return "pagination." + error; - } - return null; - }; - - /** - * Creates a QueryDenomTracesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomTracesResponse} QueryDenomTracesResponse - */ - QueryDenomTracesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomTracesResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomTracesResponse(); - if (object.denom_traces) { - if (!Array.isArray(object.denom_traces)) - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.denom_traces: array expected"); - message.denom_traces = []; - for (var i = 0; i < object.denom_traces.length; ++i) { - if (typeof object.denom_traces[i] !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.denom_traces: object expected"); - message.denom_traces[i] = $root.ibc.applications.transfer.v1.DenomTrace.fromObject(object.denom_traces[i]); - } - } - if (object.pagination != null) { - if (typeof object.pagination !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryDenomTracesResponse.pagination: object expected"); - message.pagination = $root.cosmos.base.query.v1beta1.PageResponse.fromObject(object.pagination); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomTracesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @static - * @param {ibc.applications.transfer.v1.QueryDenomTracesResponse} message QueryDenomTracesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomTracesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.denom_traces = []; - if (options.defaults) - object.pagination = null; - if (message.denom_traces && message.denom_traces.length) { - object.denom_traces = []; - for (var j = 0; j < message.denom_traces.length; ++j) - object.denom_traces[j] = $root.ibc.applications.transfer.v1.DenomTrace.toObject(message.denom_traces[j], options); - } - if (message.pagination != null && message.hasOwnProperty("pagination")) - object.pagination = $root.cosmos.base.query.v1beta1.PageResponse.toObject(message.pagination, options); - return object; - }; - - /** - * Converts this QueryDenomTracesResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomTracesResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomTracesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomTracesResponse; - })(); - - v1.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryParamsRequest) - return object; - return new $root.ibc.applications.transfer.v1.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @static - * @param {ibc.applications.transfer.v1.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - v1.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryParamsResponse - * @property {ibc.applications.transfer.v1.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {ibc.applications.transfer.v1.IParams|null|undefined} params - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.ibc.applications.transfer.v1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.ibc.applications.transfer.v1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.ibc.applications.transfer.v1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryParamsResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".ibc.applications.transfer.v1.QueryParamsResponse.params: object expected"); - message.params = $root.ibc.applications.transfer.v1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @static - * @param {ibc.applications.transfer.v1.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.ibc.applications.transfer.v1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - v1.QueryDenomHashRequest = (function() { - - /** - * Properties of a QueryDenomHashRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomHashRequest - * @property {string|null} [trace] QueryDenomHashRequest trace - */ - - /** - * Constructs a new QueryDenomHashRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomHashRequest. - * @implements IQueryDenomHashRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest=} [properties] Properties to set - */ - function QueryDenomHashRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomHashRequest trace. - * @member {string} trace - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @instance - */ - QueryDenomHashRequest.prototype.trace = ""; - - /** - * Encodes the specified QueryDenomHashRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} message QueryDenomHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trace != null && Object.hasOwnProperty.call(message, "trace")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.trace); - return writer; - }; - - /** - * Encodes the specified QueryDenomHashRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashRequest} message QueryDenomHashRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomHashRequest} QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomHashRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.trace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomHashRequest} QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomHashRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomHashRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trace != null && message.hasOwnProperty("trace")) - if (!$util.isString(message.trace)) - return "trace: string expected"; - return null; - }; - - /** - * Creates a QueryDenomHashRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomHashRequest} QueryDenomHashRequest - */ - QueryDenomHashRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomHashRequest) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomHashRequest(); - if (object.trace != null) - message.trace = String(object.trace); - return message; - }; - - /** - * Creates a plain object from a QueryDenomHashRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @static - * @param {ibc.applications.transfer.v1.QueryDenomHashRequest} message QueryDenomHashRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomHashRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.trace = ""; - if (message.trace != null && message.hasOwnProperty("trace")) - object.trace = message.trace; - return object; - }; - - /** - * Converts this QueryDenomHashRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomHashRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomHashRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomHashRequest; - })(); - - v1.QueryDenomHashResponse = (function() { - - /** - * Properties of a QueryDenomHashResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryDenomHashResponse - * @property {string|null} [hash] QueryDenomHashResponse hash - */ - - /** - * Constructs a new QueryDenomHashResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryDenomHashResponse. - * @implements IQueryDenomHashResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryDenomHashResponse=} [properties] Properties to set - */ - function QueryDenomHashResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomHashResponse hash. - * @member {string} hash - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @instance - */ - QueryDenomHashResponse.prototype.hash = ""; - - /** - * Encodes the specified QueryDenomHashResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashResponse} message QueryDenomHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); - return writer; - }; - - /** - * Encodes the specified QueryDenomHashResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryDenomHashResponse} message QueryDenomHashResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomHashResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryDenomHashResponse} QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryDenomHashResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryDenomHashResponse} QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomHashResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomHashResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomHashResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; - return null; - }; - - /** - * Creates a QueryDenomHashResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryDenomHashResponse} QueryDenomHashResponse - */ - QueryDenomHashResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryDenomHashResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryDenomHashResponse(); - if (object.hash != null) - message.hash = String(object.hash); - return message; - }; - - /** - * Creates a plain object from a QueryDenomHashResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @static - * @param {ibc.applications.transfer.v1.QueryDenomHashResponse} message QueryDenomHashResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomHashResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.hash = ""; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; - return object; - }; - - /** - * Converts this QueryDenomHashResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryDenomHashResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomHashResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomHashResponse; - })(); - - v1.QueryEscrowAddressRequest = (function() { - - /** - * Properties of a QueryEscrowAddressRequest. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryEscrowAddressRequest - * @property {string|null} [port_id] QueryEscrowAddressRequest port_id - * @property {string|null} [channel_id] QueryEscrowAddressRequest channel_id - */ - - /** - * Constructs a new QueryEscrowAddressRequest. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryEscrowAddressRequest. - * @implements IQueryEscrowAddressRequest - * @constructor - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest=} [properties] Properties to set - */ - function QueryEscrowAddressRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryEscrowAddressRequest port_id. - * @member {string} port_id - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @instance - */ - QueryEscrowAddressRequest.prototype.port_id = ""; - - /** - * QueryEscrowAddressRequest channel_id. - * @member {string} channel_id - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @instance - */ - QueryEscrowAddressRequest.prototype.channel_id = ""; - - /** - * Encodes the specified QueryEscrowAddressRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} message QueryEscrowAddressRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port_id != null && Object.hasOwnProperty.call(message, "port_id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.port_id); - if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_id); - return writer; - }; - - /** - * Encodes the specified QueryEscrowAddressRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressRequest} message QueryEscrowAddressRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressRequest} QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.port_id = reader.string(); - break; - case 2: - message.channel_id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressRequest} QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryEscrowAddressRequest message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryEscrowAddressRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port_id != null && message.hasOwnProperty("port_id")) - if (!$util.isString(message.port_id)) - return "port_id: string expected"; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - if (!$util.isString(message.channel_id)) - return "channel_id: string expected"; - return null; - }; - - /** - * Creates a QueryEscrowAddressRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressRequest} QueryEscrowAddressRequest - */ - QueryEscrowAddressRequest.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressRequest(); - if (object.port_id != null) - message.port_id = String(object.port_id); - if (object.channel_id != null) - message.channel_id = String(object.channel_id); - return message; - }; - - /** - * Creates a plain object from a QueryEscrowAddressRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @static - * @param {ibc.applications.transfer.v1.QueryEscrowAddressRequest} message QueryEscrowAddressRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryEscrowAddressRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port_id = ""; - object.channel_id = ""; - } - if (message.port_id != null && message.hasOwnProperty("port_id")) - object.port_id = message.port_id; - if (message.channel_id != null && message.hasOwnProperty("channel_id")) - object.channel_id = message.channel_id; - return object; - }; - - /** - * Converts this QueryEscrowAddressRequest to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressRequest - * @instance - * @returns {Object.} JSON object - */ - QueryEscrowAddressRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryEscrowAddressRequest; - })(); - - v1.QueryEscrowAddressResponse = (function() { - - /** - * Properties of a QueryEscrowAddressResponse. - * @memberof ibc.applications.transfer.v1 - * @interface IQueryEscrowAddressResponse - * @property {string|null} [escrow_address] QueryEscrowAddressResponse escrow_address - */ - - /** - * Constructs a new QueryEscrowAddressResponse. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a QueryEscrowAddressResponse. - * @implements IQueryEscrowAddressResponse - * @constructor - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressResponse=} [properties] Properties to set - */ - function QueryEscrowAddressResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryEscrowAddressResponse escrow_address. - * @member {string} escrow_address - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @instance - */ - QueryEscrowAddressResponse.prototype.escrow_address = ""; - - /** - * Encodes the specified QueryEscrowAddressResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressResponse} message QueryEscrowAddressResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.escrow_address != null && Object.hasOwnProperty.call(message, "escrow_address")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.escrow_address); - return writer; - }; - - /** - * Encodes the specified QueryEscrowAddressResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {ibc.applications.transfer.v1.IQueryEscrowAddressResponse} message QueryEscrowAddressResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryEscrowAddressResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressResponse} QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.escrow_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressResponse} QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryEscrowAddressResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryEscrowAddressResponse message. - * @function verify - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryEscrowAddressResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.escrow_address != null && message.hasOwnProperty("escrow_address")) - if (!$util.isString(message.escrow_address)) - return "escrow_address: string expected"; - return null; - }; - - /** - * Creates a QueryEscrowAddressResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.QueryEscrowAddressResponse} QueryEscrowAddressResponse - */ - QueryEscrowAddressResponse.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse) - return object; - var message = new $root.ibc.applications.transfer.v1.QueryEscrowAddressResponse(); - if (object.escrow_address != null) - message.escrow_address = String(object.escrow_address); - return message; - }; - - /** - * Creates a plain object from a QueryEscrowAddressResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @static - * @param {ibc.applications.transfer.v1.QueryEscrowAddressResponse} message QueryEscrowAddressResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryEscrowAddressResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.escrow_address = ""; - if (message.escrow_address != null && message.hasOwnProperty("escrow_address")) - object.escrow_address = message.escrow_address; - return object; - }; - - /** - * Converts this QueryEscrowAddressResponse to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.QueryEscrowAddressResponse - * @instance - * @returns {Object.} JSON object - */ - QueryEscrowAddressResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryEscrowAddressResponse; - })(); - - v1.DenomTrace = (function() { - - /** - * Properties of a DenomTrace. - * @memberof ibc.applications.transfer.v1 - * @interface IDenomTrace - * @property {string|null} [path] DenomTrace path - * @property {string|null} [base_denom] DenomTrace base_denom - */ - - /** - * Constructs a new DenomTrace. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a DenomTrace. - * @implements IDenomTrace - * @constructor - * @param {ibc.applications.transfer.v1.IDenomTrace=} [properties] Properties to set - */ - function DenomTrace(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DenomTrace path. - * @member {string} path - * @memberof ibc.applications.transfer.v1.DenomTrace - * @instance - */ - DenomTrace.prototype.path = ""; - - /** - * DenomTrace base_denom. - * @member {string} base_denom - * @memberof ibc.applications.transfer.v1.DenomTrace - * @instance - */ - DenomTrace.prototype.base_denom = ""; - - /** - * Encodes the specified DenomTrace message. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {ibc.applications.transfer.v1.IDenomTrace} message DenomTrace message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenomTrace.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.base_denom != null && Object.hasOwnProperty.call(message, "base_denom")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.base_denom); - return writer; - }; - - /** - * Encodes the specified DenomTrace message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {ibc.applications.transfer.v1.IDenomTrace} message DenomTrace message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenomTrace.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DenomTrace message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenomTrace.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.DenomTrace(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.path = reader.string(); - break; - case 2: - message.base_denom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DenomTrace message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenomTrace.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DenomTrace message. - * @function verify - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DenomTrace.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.base_denom != null && message.hasOwnProperty("base_denom")) - if (!$util.isString(message.base_denom)) - return "base_denom: string expected"; - return null; - }; - - /** - * Creates a DenomTrace message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.DenomTrace} DenomTrace - */ - DenomTrace.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.DenomTrace) - return object; - var message = new $root.ibc.applications.transfer.v1.DenomTrace(); - if (object.path != null) - message.path = String(object.path); - if (object.base_denom != null) - message.base_denom = String(object.base_denom); - return message; - }; - - /** - * Creates a plain object from a DenomTrace message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.DenomTrace - * @static - * @param {ibc.applications.transfer.v1.DenomTrace} message DenomTrace - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DenomTrace.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.path = ""; - object.base_denom = ""; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.base_denom != null && message.hasOwnProperty("base_denom")) - object.base_denom = message.base_denom; - return object; - }; - - /** - * Converts this DenomTrace to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.DenomTrace - * @instance - * @returns {Object.} JSON object - */ - DenomTrace.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DenomTrace; - })(); - - v1.Params = (function() { - - /** - * Properties of a Params. - * @memberof ibc.applications.transfer.v1 - * @interface IParams - * @property {boolean|null} [send_enabled] Params send_enabled - * @property {boolean|null} [receive_enabled] Params receive_enabled - */ - - /** - * Constructs a new Params. - * @memberof ibc.applications.transfer.v1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {ibc.applications.transfer.v1.IParams=} [properties] Properties to set - */ - function Params(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params send_enabled. - * @member {boolean} send_enabled - * @memberof ibc.applications.transfer.v1.Params - * @instance - */ - Params.prototype.send_enabled = false; - - /** - * Params receive_enabled. - * @member {boolean} receive_enabled - * @memberof ibc.applications.transfer.v1.Params - * @instance - */ - Params.prototype.receive_enabled = false; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @function encode - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {ibc.applications.transfer.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.send_enabled != null && Object.hasOwnProperty.call(message, "send_enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.send_enabled); - if (message.receive_enabled != null && Object.hasOwnProperty.call(message, "receive_enabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.receive_enabled); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {ibc.applications.transfer.v1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ibc.applications.transfer.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ibc.applications.transfer.v1.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.send_enabled = reader.bool(); - break; - case 2: - message.receive_enabled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ibc.applications.transfer.v1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.send_enabled != null && message.hasOwnProperty("send_enabled")) - if (typeof message.send_enabled !== "boolean") - return "send_enabled: boolean expected"; - if (message.receive_enabled != null && message.hasOwnProperty("receive_enabled")) - if (typeof message.receive_enabled !== "boolean") - return "receive_enabled: boolean expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {Object.} object Plain object - * @returns {ibc.applications.transfer.v1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.ibc.applications.transfer.v1.Params) - return object; - var message = new $root.ibc.applications.transfer.v1.Params(); - if (object.send_enabled != null) - message.send_enabled = Boolean(object.send_enabled); - if (object.receive_enabled != null) - message.receive_enabled = Boolean(object.receive_enabled); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof ibc.applications.transfer.v1.Params - * @static - * @param {ibc.applications.transfer.v1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.send_enabled = false; - object.receive_enabled = false; - } - if (message.send_enabled != null && message.hasOwnProperty("send_enabled")) - object.send_enabled = message.send_enabled; - if (message.receive_enabled != null && message.hasOwnProperty("receive_enabled")) - object.receive_enabled = message.receive_enabled; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof ibc.applications.transfer.v1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - return v1; - })(); - - return transfer; - })(); - - return applications; - })(); - - return ibc; - })(); - - $root.cosmos_proto = (function() { - - /** - * Namespace cosmos_proto. - * @exports cosmos_proto - * @namespace - */ - var cosmos_proto = {}; - - cosmos_proto.InterfaceDescriptor = (function() { - - /** - * Properties of an InterfaceDescriptor. - * @memberof cosmos_proto - * @interface IInterfaceDescriptor - * @property {string|null} [name] InterfaceDescriptor name - * @property {string|null} [description] InterfaceDescriptor description - */ - - /** - * Constructs a new InterfaceDescriptor. - * @memberof cosmos_proto - * @classdesc Represents an InterfaceDescriptor. - * @implements IInterfaceDescriptor - * @constructor - * @param {cosmos_proto.IInterfaceDescriptor=} [properties] Properties to set - */ - function InterfaceDescriptor(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InterfaceDescriptor name. - * @member {string} name - * @memberof cosmos_proto.InterfaceDescriptor - * @instance - */ - InterfaceDescriptor.prototype.name = ""; - - /** - * InterfaceDescriptor description. - * @member {string} description - * @memberof cosmos_proto.InterfaceDescriptor - * @instance - */ - InterfaceDescriptor.prototype.description = ""; - - /** - * Encodes the specified InterfaceDescriptor message. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @function encode - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {cosmos_proto.IInterfaceDescriptor} message InterfaceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterfaceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified InterfaceDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {cosmos_proto.IInterfaceDescriptor} message InterfaceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InterfaceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos_proto.InterfaceDescriptor} InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterfaceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos_proto.InterfaceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos_proto.InterfaceDescriptor} InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InterfaceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InterfaceDescriptor message. - * @function verify - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InterfaceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates an InterfaceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {cosmos_proto.InterfaceDescriptor} InterfaceDescriptor - */ - InterfaceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos_proto.InterfaceDescriptor) - return object; - var message = new $root.cosmos_proto.InterfaceDescriptor(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from an InterfaceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos_proto.InterfaceDescriptor - * @static - * @param {cosmos_proto.InterfaceDescriptor} message InterfaceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InterfaceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this InterfaceDescriptor to JSON. - * @function toJSON - * @memberof cosmos_proto.InterfaceDescriptor - * @instance - * @returns {Object.} JSON object - */ - InterfaceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return InterfaceDescriptor; - })(); - - cosmos_proto.ScalarDescriptor = (function() { - - /** - * Properties of a ScalarDescriptor. - * @memberof cosmos_proto - * @interface IScalarDescriptor - * @property {string|null} [name] ScalarDescriptor name - * @property {string|null} [description] ScalarDescriptor description - * @property {Array.|null} [field_type] ScalarDescriptor field_type - * @property {string|null} [legacy_amino_encoding] ScalarDescriptor legacy_amino_encoding - */ - - /** - * Constructs a new ScalarDescriptor. - * @memberof cosmos_proto - * @classdesc Represents a ScalarDescriptor. - * @implements IScalarDescriptor - * @constructor - * @param {cosmos_proto.IScalarDescriptor=} [properties] Properties to set - */ - function ScalarDescriptor(properties) { - this.field_type = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScalarDescriptor name. - * @member {string} name - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.name = ""; - - /** - * ScalarDescriptor description. - * @member {string} description - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.description = ""; - - /** - * ScalarDescriptor field_type. - * @member {Array.} field_type - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.field_type = $util.emptyArray; - - /** - * ScalarDescriptor legacy_amino_encoding. - * @member {string} legacy_amino_encoding - * @memberof cosmos_proto.ScalarDescriptor - * @instance - */ - ScalarDescriptor.prototype.legacy_amino_encoding = ""; - - /** - * Encodes the specified ScalarDescriptor message. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @function encode - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {cosmos_proto.IScalarDescriptor} message ScalarDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScalarDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.field_type != null && message.field_type.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.field_type.length; ++i) - writer.int32(message.field_type[i]); - writer.ldelim(); - } - if (message.legacy_amino_encoding != null && Object.hasOwnProperty.call(message, "legacy_amino_encoding")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.legacy_amino_encoding); - return writer; - }; - - /** - * Encodes the specified ScalarDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {cosmos_proto.IScalarDescriptor} message ScalarDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScalarDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer. - * @function decode - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos_proto.ScalarDescriptor} ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScalarDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos_proto.ScalarDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - if (!(message.field_type && message.field_type.length)) - message.field_type = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.field_type.push(reader.int32()); - } else - message.field_type.push(reader.int32()); - break; - case 4: - message.legacy_amino_encoding = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos_proto.ScalarDescriptor} ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScalarDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScalarDescriptor message. - * @function verify - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScalarDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.field_type != null && message.hasOwnProperty("field_type")) { - if (!Array.isArray(message.field_type)) - return "field_type: array expected"; - for (var i = 0; i < message.field_type.length; ++i) - switch (message.field_type[i]) { - default: - return "field_type: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.legacy_amino_encoding != null && message.hasOwnProperty("legacy_amino_encoding")) - if (!$util.isString(message.legacy_amino_encoding)) - return "legacy_amino_encoding: string expected"; - return null; - }; - - /** - * Creates a ScalarDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {Object.} object Plain object - * @returns {cosmos_proto.ScalarDescriptor} ScalarDescriptor - */ - ScalarDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos_proto.ScalarDescriptor) - return object; - var message = new $root.cosmos_proto.ScalarDescriptor(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.field_type) { - if (!Array.isArray(object.field_type)) - throw TypeError(".cosmos_proto.ScalarDescriptor.field_type: array expected"); - message.field_type = []; - for (var i = 0; i < object.field_type.length; ++i) - switch (object.field_type[i]) { - default: - case "SCALAR_TYPE_UNSPECIFIED": - case 0: - message.field_type[i] = 0; - break; - case "SCALAR_TYPE_STRING": - case 1: - message.field_type[i] = 1; - break; - case "SCALAR_TYPE_BYTES": - case 2: - message.field_type[i] = 2; - break; - } - } - if (object.legacy_amino_encoding != null) - message.legacy_amino_encoding = String(object.legacy_amino_encoding); - return message; - }; - - /** - * Creates a plain object from a ScalarDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos_proto.ScalarDescriptor - * @static - * @param {cosmos_proto.ScalarDescriptor} message ScalarDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScalarDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.field_type = []; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.legacy_amino_encoding = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.field_type && message.field_type.length) { - object.field_type = []; - for (var j = 0; j < message.field_type.length; ++j) - object.field_type[j] = options.enums === String ? $root.cosmos_proto.ScalarType[message.field_type[j]] : message.field_type[j]; - } - if (message.legacy_amino_encoding != null && message.hasOwnProperty("legacy_amino_encoding")) - object.legacy_amino_encoding = message.legacy_amino_encoding; - return object; - }; - - /** - * Converts this ScalarDescriptor to JSON. - * @function toJSON - * @memberof cosmos_proto.ScalarDescriptor - * @instance - * @returns {Object.} JSON object - */ - ScalarDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ScalarDescriptor; - })(); - - /** - * ScalarType enum. - * @name cosmos_proto.ScalarType - * @enum {number} - * @property {number} SCALAR_TYPE_UNSPECIFIED=0 SCALAR_TYPE_UNSPECIFIED value - * @property {number} SCALAR_TYPE_STRING=1 SCALAR_TYPE_STRING value - * @property {number} SCALAR_TYPE_BYTES=2 SCALAR_TYPE_BYTES value - */ - cosmos_proto.ScalarType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCALAR_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCALAR_TYPE_STRING"] = 1; - values[valuesById[2] = "SCALAR_TYPE_BYTES"] = 2; - return values; - })(); - - return cosmos_proto; - })(); - - $root.tendermint = (function() { - - /** - * Namespace tendermint. - * @exports tendermint - * @namespace - */ - var tendermint = {}; - - tendermint.crypto = (function() { - - /** - * Namespace crypto. - * @memberof tendermint - * @namespace - */ - var crypto = {}; - - crypto.Proof = (function() { - - /** - * Properties of a Proof. - * @memberof tendermint.crypto - * @interface IProof - * @property {Long|null} [total] Proof total - * @property {Long|null} [index] Proof index - * @property {Uint8Array|null} [leaf_hash] Proof leaf_hash - * @property {Array.|null} [aunts] Proof aunts - */ - - /** - * Constructs a new Proof. - * @memberof tendermint.crypto - * @classdesc Represents a Proof. - * @implements IProof - * @constructor - * @param {tendermint.crypto.IProof=} [properties] Properties to set - */ - function Proof(properties) { - this.aunts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proof total. - * @member {Long} total - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.total = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Proof index. - * @member {Long} index - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Proof leaf_hash. - * @member {Uint8Array} leaf_hash - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.leaf_hash = $util.newBuffer([]); - - /** - * Proof aunts. - * @member {Array.} aunts - * @memberof tendermint.crypto.Proof - * @instance - */ - Proof.prototype.aunts = $util.emptyArray; - - /** - * Encodes the specified Proof message. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.Proof - * @static - * @param {tendermint.crypto.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.total != null && Object.hasOwnProperty.call(message, "total")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.total); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.index); - if (message.leaf_hash != null && Object.hasOwnProperty.call(message, "leaf_hash")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.leaf_hash); - if (message.aunts != null && message.aunts.length) - for (var i = 0; i < message.aunts.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.aunts[i]); - return writer; - }; - - /** - * Encodes the specified Proof message, length delimited. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.Proof - * @static - * @param {tendermint.crypto.IProof} message Proof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proof message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.Proof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = reader.int64(); - break; - case 2: - message.index = reader.int64(); - break; - case 3: - message.leaf_hash = reader.bytes(); - break; - case 4: - if (!(message.aunts && message.aunts.length)) - message.aunts = []; - message.aunts.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.Proof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.Proof} Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proof message. - * @function verify - * @memberof tendermint.crypto.Proof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.total != null && message.hasOwnProperty("total")) - if (!$util.isInteger(message.total) && !(message.total && $util.isInteger(message.total.low) && $util.isInteger(message.total.high))) - return "total: integer|Long expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) - return "index: integer|Long expected"; - if (message.leaf_hash != null && message.hasOwnProperty("leaf_hash")) - if (!(message.leaf_hash && typeof message.leaf_hash.length === "number" || $util.isString(message.leaf_hash))) - return "leaf_hash: buffer expected"; - if (message.aunts != null && message.hasOwnProperty("aunts")) { - if (!Array.isArray(message.aunts)) - return "aunts: array expected"; - for (var i = 0; i < message.aunts.length; ++i) - if (!(message.aunts[i] && typeof message.aunts[i].length === "number" || $util.isString(message.aunts[i]))) - return "aunts: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Proof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.Proof - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.Proof} Proof - */ - Proof.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.Proof) - return object; - var message = new $root.tendermint.crypto.Proof(); - if (object.total != null) - if ($util.Long) - (message.total = $util.Long.fromValue(object.total)).unsigned = false; - else if (typeof object.total === "string") - message.total = parseInt(object.total, 10); - else if (typeof object.total === "number") - message.total = object.total; - else if (typeof object.total === "object") - message.total = new $util.LongBits(object.total.low >>> 0, object.total.high >>> 0).toNumber(); - if (object.index != null) - if ($util.Long) - (message.index = $util.Long.fromValue(object.index)).unsigned = false; - else if (typeof object.index === "string") - message.index = parseInt(object.index, 10); - else if (typeof object.index === "number") - message.index = object.index; - else if (typeof object.index === "object") - message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); - if (object.leaf_hash != null) - if (typeof object.leaf_hash === "string") - $util.base64.decode(object.leaf_hash, message.leaf_hash = $util.newBuffer($util.base64.length(object.leaf_hash)), 0); - else if (object.leaf_hash.length) - message.leaf_hash = object.leaf_hash; - if (object.aunts) { - if (!Array.isArray(object.aunts)) - throw TypeError(".tendermint.crypto.Proof.aunts: array expected"); - message.aunts = []; - for (var i = 0; i < object.aunts.length; ++i) - if (typeof object.aunts[i] === "string") - $util.base64.decode(object.aunts[i], message.aunts[i] = $util.newBuffer($util.base64.length(object.aunts[i])), 0); - else if (object.aunts[i].length) - message.aunts[i] = object.aunts[i]; - } - return message; - }; - - /** - * Creates a plain object from a Proof message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.Proof - * @static - * @param {tendermint.crypto.Proof} message Proof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.aunts = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.total = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.index = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.leaf_hash = ""; - else { - object.leaf_hash = []; - if (options.bytes !== Array) - object.leaf_hash = $util.newBuffer(object.leaf_hash); - } - } - if (message.total != null && message.hasOwnProperty("total")) - if (typeof message.total === "number") - object.total = options.longs === String ? String(message.total) : message.total; - else - object.total = options.longs === String ? $util.Long.prototype.toString.call(message.total) : options.longs === Number ? new $util.LongBits(message.total.low >>> 0, message.total.high >>> 0).toNumber() : message.total; - if (message.index != null && message.hasOwnProperty("index")) - if (typeof message.index === "number") - object.index = options.longs === String ? String(message.index) : message.index; - else - object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; - if (message.leaf_hash != null && message.hasOwnProperty("leaf_hash")) - object.leaf_hash = options.bytes === String ? $util.base64.encode(message.leaf_hash, 0, message.leaf_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.leaf_hash) : message.leaf_hash; - if (message.aunts && message.aunts.length) { - object.aunts = []; - for (var j = 0; j < message.aunts.length; ++j) - object.aunts[j] = options.bytes === String ? $util.base64.encode(message.aunts[j], 0, message.aunts[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.aunts[j]) : message.aunts[j]; - } - return object; - }; - - /** - * Converts this Proof to JSON. - * @function toJSON - * @memberof tendermint.crypto.Proof - * @instance - * @returns {Object.} JSON object - */ - Proof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proof; - })(); - - crypto.ValueOp = (function() { - - /** - * Properties of a ValueOp. - * @memberof tendermint.crypto - * @interface IValueOp - * @property {Uint8Array|null} [key] ValueOp key - * @property {tendermint.crypto.IProof|null} [proof] ValueOp proof - */ - - /** - * Constructs a new ValueOp. - * @memberof tendermint.crypto - * @classdesc Represents a ValueOp. - * @implements IValueOp - * @constructor - * @param {tendermint.crypto.IValueOp=} [properties] Properties to set - */ - function ValueOp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValueOp key. - * @member {Uint8Array} key - * @memberof tendermint.crypto.ValueOp - * @instance - */ - ValueOp.prototype.key = $util.newBuffer([]); - - /** - * ValueOp proof. - * @member {tendermint.crypto.IProof|null|undefined} proof - * @memberof tendermint.crypto.ValueOp - * @instance - */ - ValueOp.prototype.proof = null; - - /** - * Encodes the specified ValueOp message. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.ValueOp - * @static - * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ValueOp message, length delimited. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.ValueOp - * @static - * @param {tendermint.crypto.IValueOp} message ValueOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValueOp message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.ValueOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.ValueOp} ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ValueOp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValueOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.ValueOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.ValueOp} ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValueOp message. - * @function verify - * @memberof tendermint.crypto.ValueOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValueOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - var error = $root.tendermint.crypto.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - return null; - }; - - /** - * Creates a ValueOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.ValueOp - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.ValueOp} ValueOp - */ - ValueOp.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.ValueOp) - return object; - var message = new $root.tendermint.crypto.ValueOp(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".tendermint.crypto.ValueOp.proof: object expected"); - message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); - } - return message; - }; - - /** - * Creates a plain object from a ValueOp message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.ValueOp - * @static - * @param {tendermint.crypto.ValueOp} message ValueOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValueOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - object.proof = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); - return object; - }; - - /** - * Converts this ValueOp to JSON. - * @function toJSON - * @memberof tendermint.crypto.ValueOp - * @instance - * @returns {Object.} JSON object - */ - ValueOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValueOp; - })(); - - crypto.DominoOp = (function() { - - /** - * Properties of a DominoOp. - * @memberof tendermint.crypto - * @interface IDominoOp - * @property {string|null} [key] DominoOp key - * @property {string|null} [input] DominoOp input - * @property {string|null} [output] DominoOp output - */ - - /** - * Constructs a new DominoOp. - * @memberof tendermint.crypto - * @classdesc Represents a DominoOp. - * @implements IDominoOp - * @constructor - * @param {tendermint.crypto.IDominoOp=} [properties] Properties to set - */ - function DominoOp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DominoOp key. - * @member {string} key - * @memberof tendermint.crypto.DominoOp - * @instance - */ - DominoOp.prototype.key = ""; - - /** - * DominoOp input. - * @member {string} input - * @memberof tendermint.crypto.DominoOp - * @instance - */ - DominoOp.prototype.input = ""; - - /** - * DominoOp output. - * @member {string} output - * @memberof tendermint.crypto.DominoOp - * @instance - */ - DominoOp.prototype.output = ""; - - /** - * Encodes the specified DominoOp message. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.DominoOp - * @static - * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DominoOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.input != null && Object.hasOwnProperty.call(message, "input")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.input); - if (message.output != null && Object.hasOwnProperty.call(message, "output")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.output); - return writer; - }; - - /** - * Encodes the specified DominoOp message, length delimited. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.DominoOp - * @static - * @param {tendermint.crypto.IDominoOp} message DominoOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DominoOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DominoOp message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.DominoOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.DominoOp} DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DominoOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.DominoOp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.input = reader.string(); - break; - case 3: - message.output = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DominoOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.DominoOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.DominoOp} DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DominoOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DominoOp message. - * @function verify - * @memberof tendermint.crypto.DominoOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DominoOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.input != null && message.hasOwnProperty("input")) - if (!$util.isString(message.input)) - return "input: string expected"; - if (message.output != null && message.hasOwnProperty("output")) - if (!$util.isString(message.output)) - return "output: string expected"; - return null; - }; - - /** - * Creates a DominoOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.DominoOp - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.DominoOp} DominoOp - */ - DominoOp.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.DominoOp) - return object; - var message = new $root.tendermint.crypto.DominoOp(); - if (object.key != null) - message.key = String(object.key); - if (object.input != null) - message.input = String(object.input); - if (object.output != null) - message.output = String(object.output); - return message; - }; - - /** - * Creates a plain object from a DominoOp message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.DominoOp - * @static - * @param {tendermint.crypto.DominoOp} message DominoOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DominoOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.key = ""; - object.input = ""; - object.output = ""; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.input != null && message.hasOwnProperty("input")) - object.input = message.input; - if (message.output != null && message.hasOwnProperty("output")) - object.output = message.output; - return object; - }; - - /** - * Converts this DominoOp to JSON. - * @function toJSON - * @memberof tendermint.crypto.DominoOp - * @instance - * @returns {Object.} JSON object - */ - DominoOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DominoOp; - })(); - - crypto.ProofOp = (function() { - - /** - * Properties of a ProofOp. - * @memberof tendermint.crypto - * @interface IProofOp - * @property {string|null} [type] ProofOp type - * @property {Uint8Array|null} [key] ProofOp key - * @property {Uint8Array|null} [data] ProofOp data - */ - - /** - * Constructs a new ProofOp. - * @memberof tendermint.crypto - * @classdesc Represents a ProofOp. - * @implements IProofOp - * @constructor - * @param {tendermint.crypto.IProofOp=} [properties] Properties to set - */ - function ProofOp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProofOp type. - * @member {string} type - * @memberof tendermint.crypto.ProofOp - * @instance - */ - ProofOp.prototype.type = ""; - - /** - * ProofOp key. - * @member {Uint8Array} key - * @memberof tendermint.crypto.ProofOp - * @instance - */ - ProofOp.prototype.key = $util.newBuffer([]); - - /** - * ProofOp data. - * @member {Uint8Array} data - * @memberof tendermint.crypto.ProofOp - * @instance - */ - ProofOp.prototype.data = $util.newBuffer([]); - - /** - * Encodes the specified ProofOp message. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.ProofOp - * @static - * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.key); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); - return writer; - }; - - /** - * Encodes the specified ProofOp message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.ProofOp - * @static - * @param {tendermint.crypto.IProofOp} message ProofOp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProofOp message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.ProofOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.ProofOp} ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.key = reader.bytes(); - break; - case 3: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProofOp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.ProofOp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.ProofOp} ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProofOp message. - * @function verify - * @memberof tendermint.crypto.ProofOp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProofOp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; - - /** - * Creates a ProofOp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.ProofOp - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.ProofOp} ProofOp - */ - ProofOp.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.ProofOp) - return object; - var message = new $root.tendermint.crypto.ProofOp(); - if (object.type != null) - message.type = String(object.type); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - return message; - }; - - /** - * Creates a plain object from a ProofOp message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.ProofOp - * @static - * @param {tendermint.crypto.ProofOp} message ProofOp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProofOp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; - - /** - * Converts this ProofOp to JSON. - * @function toJSON - * @memberof tendermint.crypto.ProofOp - * @instance - * @returns {Object.} JSON object - */ - ProofOp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProofOp; - })(); - - crypto.ProofOps = (function() { - - /** - * Properties of a ProofOps. - * @memberof tendermint.crypto - * @interface IProofOps - * @property {Array.|null} [ops] ProofOps ops - */ - - /** - * Constructs a new ProofOps. - * @memberof tendermint.crypto - * @classdesc Represents a ProofOps. - * @implements IProofOps - * @constructor - * @param {tendermint.crypto.IProofOps=} [properties] Properties to set - */ - function ProofOps(properties) { - this.ops = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProofOps ops. - * @member {Array.} ops - * @memberof tendermint.crypto.ProofOps - * @instance - */ - ProofOps.prototype.ops = $util.emptyArray; - - /** - * Encodes the specified ProofOps message. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.ProofOps - * @static - * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOps.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ops != null && message.ops.length) - for (var i = 0; i < message.ops.length; ++i) - $root.tendermint.crypto.ProofOp.encode(message.ops[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProofOps message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.ProofOps - * @static - * @param {tendermint.crypto.IProofOps} message ProofOps message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProofOps.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProofOps message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.ProofOps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.ProofOps} ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOps.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.ProofOps(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.ops && message.ops.length)) - message.ops = []; - message.ops.push($root.tendermint.crypto.ProofOp.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProofOps message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.ProofOps - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.ProofOps} ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProofOps.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProofOps message. - * @function verify - * @memberof tendermint.crypto.ProofOps - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProofOps.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ops != null && message.hasOwnProperty("ops")) { - if (!Array.isArray(message.ops)) - return "ops: array expected"; - for (var i = 0; i < message.ops.length; ++i) { - var error = $root.tendermint.crypto.ProofOp.verify(message.ops[i]); - if (error) - return "ops." + error; - } - } - return null; - }; - - /** - * Creates a ProofOps message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.ProofOps - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.ProofOps} ProofOps - */ - ProofOps.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.ProofOps) - return object; - var message = new $root.tendermint.crypto.ProofOps(); - if (object.ops) { - if (!Array.isArray(object.ops)) - throw TypeError(".tendermint.crypto.ProofOps.ops: array expected"); - message.ops = []; - for (var i = 0; i < object.ops.length; ++i) { - if (typeof object.ops[i] !== "object") - throw TypeError(".tendermint.crypto.ProofOps.ops: object expected"); - message.ops[i] = $root.tendermint.crypto.ProofOp.fromObject(object.ops[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ProofOps message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.ProofOps - * @static - * @param {tendermint.crypto.ProofOps} message ProofOps - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProofOps.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ops = []; - if (message.ops && message.ops.length) { - object.ops = []; - for (var j = 0; j < message.ops.length; ++j) - object.ops[j] = $root.tendermint.crypto.ProofOp.toObject(message.ops[j], options); - } - return object; - }; - - /** - * Converts this ProofOps to JSON. - * @function toJSON - * @memberof tendermint.crypto.ProofOps - * @instance - * @returns {Object.} JSON object - */ - ProofOps.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProofOps; - })(); - - crypto.PublicKey = (function() { - - /** - * Properties of a PublicKey. - * @memberof tendermint.crypto - * @interface IPublicKey - * @property {Uint8Array|null} [ed25519] PublicKey ed25519 - * @property {Uint8Array|null} [secp256k1] PublicKey secp256k1 - */ - - /** - * Constructs a new PublicKey. - * @memberof tendermint.crypto - * @classdesc Represents a PublicKey. - * @implements IPublicKey - * @constructor - * @param {tendermint.crypto.IPublicKey=} [properties] Properties to set - */ - function PublicKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PublicKey ed25519. - * @member {Uint8Array|null|undefined} ed25519 - * @memberof tendermint.crypto.PublicKey - * @instance - */ - PublicKey.prototype.ed25519 = null; - - /** - * PublicKey secp256k1. - * @member {Uint8Array|null|undefined} secp256k1 - * @memberof tendermint.crypto.PublicKey - * @instance - */ - PublicKey.prototype.secp256k1 = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PublicKey sum. - * @member {"ed25519"|"secp256k1"|undefined} sum - * @memberof tendermint.crypto.PublicKey - * @instance - */ - Object.defineProperty(PublicKey.prototype, "sum", { - get: $util.oneOfGetter($oneOfFields = ["ed25519", "secp256k1"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @function encode - * @memberof tendermint.crypto.PublicKey - * @static - * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublicKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ed25519 != null && Object.hasOwnProperty.call(message, "ed25519")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ed25519); - if (message.secp256k1 != null && Object.hasOwnProperty.call(message, "secp256k1")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.secp256k1); - return writer; - }; - - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.crypto.PublicKey - * @static - * @param {tendermint.crypto.IPublicKey} message PublicKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PublicKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @function decode - * @memberof tendermint.crypto.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.crypto.PublicKey} PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublicKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.crypto.PublicKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ed25519 = reader.bytes(); - break; - case 2: - message.secp256k1 = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PublicKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.crypto.PublicKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.crypto.PublicKey} PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PublicKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PublicKey message. - * @function verify - * @memberof tendermint.crypto.PublicKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PublicKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { - properties.sum = 1; - if (!(message.ed25519 && typeof message.ed25519.length === "number" || $util.isString(message.ed25519))) - return "ed25519: buffer expected"; - } - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { - if (properties.sum === 1) - return "sum: multiple values"; - properties.sum = 1; - if (!(message.secp256k1 && typeof message.secp256k1.length === "number" || $util.isString(message.secp256k1))) - return "secp256k1: buffer expected"; - } - return null; - }; - - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.crypto.PublicKey - * @static - * @param {Object.} object Plain object - * @returns {tendermint.crypto.PublicKey} PublicKey - */ - PublicKey.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.crypto.PublicKey) - return object; - var message = new $root.tendermint.crypto.PublicKey(); - if (object.ed25519 != null) - if (typeof object.ed25519 === "string") - $util.base64.decode(object.ed25519, message.ed25519 = $util.newBuffer($util.base64.length(object.ed25519)), 0); - else if (object.ed25519.length) - message.ed25519 = object.ed25519; - if (object.secp256k1 != null) - if (typeof object.secp256k1 === "string") - $util.base64.decode(object.secp256k1, message.secp256k1 = $util.newBuffer($util.base64.length(object.secp256k1)), 0); - else if (object.secp256k1.length) - message.secp256k1 = object.secp256k1; - return message; - }; - - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.crypto.PublicKey - * @static - * @param {tendermint.crypto.PublicKey} message PublicKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PublicKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) { - object.ed25519 = options.bytes === String ? $util.base64.encode(message.ed25519, 0, message.ed25519.length) : options.bytes === Array ? Array.prototype.slice.call(message.ed25519) : message.ed25519; - if (options.oneofs) - object.sum = "ed25519"; - } - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) { - object.secp256k1 = options.bytes === String ? $util.base64.encode(message.secp256k1, 0, message.secp256k1.length) : options.bytes === Array ? Array.prototype.slice.call(message.secp256k1) : message.secp256k1; - if (options.oneofs) - object.sum = "secp256k1"; - } - return object; - }; - - /** - * Converts this PublicKey to JSON. - * @function toJSON - * @memberof tendermint.crypto.PublicKey - * @instance - * @returns {Object.} JSON object - */ - PublicKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PublicKey; - })(); - - return crypto; - })(); - - tendermint.abci = (function() { - - /** - * Namespace abci. - * @memberof tendermint - * @namespace - */ - var abci = {}; - - abci.Request = (function() { - - /** - * Properties of a Request. - * @memberof tendermint.abci - * @interface IRequest - * @property {tendermint.abci.IRequestEcho|null} [echo] Request echo - * @property {tendermint.abci.IRequestFlush|null} [flush] Request flush - * @property {tendermint.abci.IRequestInfo|null} [info] Request info - * @property {tendermint.abci.IRequestSetOption|null} [set_option] Request set_option - * @property {tendermint.abci.IRequestInitChain|null} [init_chain] Request init_chain - * @property {tendermint.abci.IRequestQuery|null} [query] Request query - * @property {tendermint.abci.IRequestBeginBlock|null} [begin_block] Request begin_block - * @property {tendermint.abci.IRequestCheckTx|null} [check_tx] Request check_tx - * @property {tendermint.abci.IRequestDeliverTx|null} [deliver_tx] Request deliver_tx - * @property {tendermint.abci.IRequestEndBlock|null} [end_block] Request end_block - * @property {tendermint.abci.IRequestCommit|null} [commit] Request commit - * @property {tendermint.abci.IRequestListSnapshots|null} [list_snapshots] Request list_snapshots - * @property {tendermint.abci.IRequestOfferSnapshot|null} [offer_snapshot] Request offer_snapshot - * @property {tendermint.abci.IRequestLoadSnapshotChunk|null} [load_snapshot_chunk] Request load_snapshot_chunk - * @property {tendermint.abci.IRequestApplySnapshotChunk|null} [apply_snapshot_chunk] Request apply_snapshot_chunk - */ - - /** - * Constructs a new Request. - * @memberof tendermint.abci - * @classdesc Represents a Request. - * @implements IRequest - * @constructor - * @param {tendermint.abci.IRequest=} [properties] Properties to set - */ - function Request(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Request echo. - * @member {tendermint.abci.IRequestEcho|null|undefined} echo - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.echo = null; - - /** - * Request flush. - * @member {tendermint.abci.IRequestFlush|null|undefined} flush - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.flush = null; - - /** - * Request info. - * @member {tendermint.abci.IRequestInfo|null|undefined} info - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.info = null; - - /** - * Request set_option. - * @member {tendermint.abci.IRequestSetOption|null|undefined} set_option - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.set_option = null; - - /** - * Request init_chain. - * @member {tendermint.abci.IRequestInitChain|null|undefined} init_chain - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.init_chain = null; - - /** - * Request query. - * @member {tendermint.abci.IRequestQuery|null|undefined} query - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.query = null; - - /** - * Request begin_block. - * @member {tendermint.abci.IRequestBeginBlock|null|undefined} begin_block - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.begin_block = null; - - /** - * Request check_tx. - * @member {tendermint.abci.IRequestCheckTx|null|undefined} check_tx - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.check_tx = null; - - /** - * Request deliver_tx. - * @member {tendermint.abci.IRequestDeliverTx|null|undefined} deliver_tx - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.deliver_tx = null; - - /** - * Request end_block. - * @member {tendermint.abci.IRequestEndBlock|null|undefined} end_block - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.end_block = null; - - /** - * Request commit. - * @member {tendermint.abci.IRequestCommit|null|undefined} commit - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.commit = null; - - /** - * Request list_snapshots. - * @member {tendermint.abci.IRequestListSnapshots|null|undefined} list_snapshots - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.list_snapshots = null; - - /** - * Request offer_snapshot. - * @member {tendermint.abci.IRequestOfferSnapshot|null|undefined} offer_snapshot - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.offer_snapshot = null; - - /** - * Request load_snapshot_chunk. - * @member {tendermint.abci.IRequestLoadSnapshotChunk|null|undefined} load_snapshot_chunk - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.load_snapshot_chunk = null; - - /** - * Request apply_snapshot_chunk. - * @member {tendermint.abci.IRequestApplySnapshotChunk|null|undefined} apply_snapshot_chunk - * @memberof tendermint.abci.Request - * @instance - */ - Request.prototype.apply_snapshot_chunk = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Request value. - * @member {"echo"|"flush"|"info"|"set_option"|"init_chain"|"query"|"begin_block"|"check_tx"|"deliver_tx"|"end_block"|"commit"|"list_snapshots"|"offer_snapshot"|"load_snapshot_chunk"|"apply_snapshot_chunk"|undefined} value - * @memberof tendermint.abci.Request - * @instance - */ - Object.defineProperty(Request.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["echo", "flush", "info", "set_option", "init_chain", "query", "begin_block", "check_tx", "deliver_tx", "end_block", "commit", "list_snapshots", "offer_snapshot", "load_snapshot_chunk", "apply_snapshot_chunk"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified Request message. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.Request - * @static - * @param {tendermint.abci.IRequest} message Request message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Request.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.echo != null && Object.hasOwnProperty.call(message, "echo")) - $root.tendermint.abci.RequestEcho.encode(message.echo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) - $root.tendermint.abci.RequestFlush.encode(message.flush, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.tendermint.abci.RequestInfo.encode(message.info, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.set_option != null && Object.hasOwnProperty.call(message, "set_option")) - $root.tendermint.abci.RequestSetOption.encode(message.set_option, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.init_chain != null && Object.hasOwnProperty.call(message, "init_chain")) - $root.tendermint.abci.RequestInitChain.encode(message.init_chain, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.tendermint.abci.RequestQuery.encode(message.query, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.begin_block != null && Object.hasOwnProperty.call(message, "begin_block")) - $root.tendermint.abci.RequestBeginBlock.encode(message.begin_block, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.check_tx != null && Object.hasOwnProperty.call(message, "check_tx")) - $root.tendermint.abci.RequestCheckTx.encode(message.check_tx, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deliver_tx != null && Object.hasOwnProperty.call(message, "deliver_tx")) - $root.tendermint.abci.RequestDeliverTx.encode(message.deliver_tx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.end_block != null && Object.hasOwnProperty.call(message, "end_block")) - $root.tendermint.abci.RequestEndBlock.encode(message.end_block, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) - $root.tendermint.abci.RequestCommit.encode(message.commit, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.list_snapshots != null && Object.hasOwnProperty.call(message, "list_snapshots")) - $root.tendermint.abci.RequestListSnapshots.encode(message.list_snapshots, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.offer_snapshot != null && Object.hasOwnProperty.call(message, "offer_snapshot")) - $root.tendermint.abci.RequestOfferSnapshot.encode(message.offer_snapshot, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.load_snapshot_chunk != null && Object.hasOwnProperty.call(message, "load_snapshot_chunk")) - $root.tendermint.abci.RequestLoadSnapshotChunk.encode(message.load_snapshot_chunk, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.apply_snapshot_chunk != null && Object.hasOwnProperty.call(message, "apply_snapshot_chunk")) - $root.tendermint.abci.RequestApplySnapshotChunk.encode(message.apply_snapshot_chunk, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Request message, length delimited. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.Request - * @static - * @param {tendermint.abci.IRequest} message Request message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Request.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Request message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.Request - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.Request} Request - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Request.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Request(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.echo = $root.tendermint.abci.RequestEcho.decode(reader, reader.uint32()); - break; - case 2: - message.flush = $root.tendermint.abci.RequestFlush.decode(reader, reader.uint32()); - break; - case 3: - message.info = $root.tendermint.abci.RequestInfo.decode(reader, reader.uint32()); - break; - case 4: - message.set_option = $root.tendermint.abci.RequestSetOption.decode(reader, reader.uint32()); - break; - case 5: - message.init_chain = $root.tendermint.abci.RequestInitChain.decode(reader, reader.uint32()); - break; - case 6: - message.query = $root.tendermint.abci.RequestQuery.decode(reader, reader.uint32()); - break; - case 7: - message.begin_block = $root.tendermint.abci.RequestBeginBlock.decode(reader, reader.uint32()); - break; - case 8: - message.check_tx = $root.tendermint.abci.RequestCheckTx.decode(reader, reader.uint32()); - break; - case 9: - message.deliver_tx = $root.tendermint.abci.RequestDeliverTx.decode(reader, reader.uint32()); - break; - case 10: - message.end_block = $root.tendermint.abci.RequestEndBlock.decode(reader, reader.uint32()); - break; - case 11: - message.commit = $root.tendermint.abci.RequestCommit.decode(reader, reader.uint32()); - break; - case 12: - message.list_snapshots = $root.tendermint.abci.RequestListSnapshots.decode(reader, reader.uint32()); - break; - case 13: - message.offer_snapshot = $root.tendermint.abci.RequestOfferSnapshot.decode(reader, reader.uint32()); - break; - case 14: - message.load_snapshot_chunk = $root.tendermint.abci.RequestLoadSnapshotChunk.decode(reader, reader.uint32()); - break; - case 15: - message.apply_snapshot_chunk = $root.tendermint.abci.RequestApplySnapshotChunk.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Request message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.Request - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.Request} Request - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Request.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Request message. - * @function verify - * @memberof tendermint.abci.Request - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Request.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.echo != null && message.hasOwnProperty("echo")) { - properties.value = 1; - { - var error = $root.tendermint.abci.RequestEcho.verify(message.echo); - if (error) - return "echo." + error; - } - } - if (message.flush != null && message.hasOwnProperty("flush")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestFlush.verify(message.flush); - if (error) - return "flush." + error; - } - } - if (message.info != null && message.hasOwnProperty("info")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestInfo.verify(message.info); - if (error) - return "info." + error; - } - } - if (message.set_option != null && message.hasOwnProperty("set_option")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestSetOption.verify(message.set_option); - if (error) - return "set_option." + error; - } - } - if (message.init_chain != null && message.hasOwnProperty("init_chain")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestInitChain.verify(message.init_chain); - if (error) - return "init_chain." + error; - } - } - if (message.query != null && message.hasOwnProperty("query")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestQuery.verify(message.query); - if (error) - return "query." + error; - } - } - if (message.begin_block != null && message.hasOwnProperty("begin_block")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestBeginBlock.verify(message.begin_block); - if (error) - return "begin_block." + error; - } - } - if (message.check_tx != null && message.hasOwnProperty("check_tx")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestCheckTx.verify(message.check_tx); - if (error) - return "check_tx." + error; - } - } - if (message.deliver_tx != null && message.hasOwnProperty("deliver_tx")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestDeliverTx.verify(message.deliver_tx); - if (error) - return "deliver_tx." + error; - } - } - if (message.end_block != null && message.hasOwnProperty("end_block")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestEndBlock.verify(message.end_block); - if (error) - return "end_block." + error; - } - } - if (message.commit != null && message.hasOwnProperty("commit")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestCommit.verify(message.commit); - if (error) - return "commit." + error; - } - } - if (message.list_snapshots != null && message.hasOwnProperty("list_snapshots")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestListSnapshots.verify(message.list_snapshots); - if (error) - return "list_snapshots." + error; - } - } - if (message.offer_snapshot != null && message.hasOwnProperty("offer_snapshot")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestOfferSnapshot.verify(message.offer_snapshot); - if (error) - return "offer_snapshot." + error; - } - } - if (message.load_snapshot_chunk != null && message.hasOwnProperty("load_snapshot_chunk")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestLoadSnapshotChunk.verify(message.load_snapshot_chunk); - if (error) - return "load_snapshot_chunk." + error; - } - } - if (message.apply_snapshot_chunk != null && message.hasOwnProperty("apply_snapshot_chunk")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.RequestApplySnapshotChunk.verify(message.apply_snapshot_chunk); - if (error) - return "apply_snapshot_chunk." + error; - } - } - return null; - }; - - /** - * Creates a Request message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.Request - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.Request} Request - */ - Request.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.Request) - return object; - var message = new $root.tendermint.abci.Request(); - if (object.echo != null) { - if (typeof object.echo !== "object") - throw TypeError(".tendermint.abci.Request.echo: object expected"); - message.echo = $root.tendermint.abci.RequestEcho.fromObject(object.echo); - } - if (object.flush != null) { - if (typeof object.flush !== "object") - throw TypeError(".tendermint.abci.Request.flush: object expected"); - message.flush = $root.tendermint.abci.RequestFlush.fromObject(object.flush); - } - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".tendermint.abci.Request.info: object expected"); - message.info = $root.tendermint.abci.RequestInfo.fromObject(object.info); - } - if (object.set_option != null) { - if (typeof object.set_option !== "object") - throw TypeError(".tendermint.abci.Request.set_option: object expected"); - message.set_option = $root.tendermint.abci.RequestSetOption.fromObject(object.set_option); - } - if (object.init_chain != null) { - if (typeof object.init_chain !== "object") - throw TypeError(".tendermint.abci.Request.init_chain: object expected"); - message.init_chain = $root.tendermint.abci.RequestInitChain.fromObject(object.init_chain); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".tendermint.abci.Request.query: object expected"); - message.query = $root.tendermint.abci.RequestQuery.fromObject(object.query); - } - if (object.begin_block != null) { - if (typeof object.begin_block !== "object") - throw TypeError(".tendermint.abci.Request.begin_block: object expected"); - message.begin_block = $root.tendermint.abci.RequestBeginBlock.fromObject(object.begin_block); - } - if (object.check_tx != null) { - if (typeof object.check_tx !== "object") - throw TypeError(".tendermint.abci.Request.check_tx: object expected"); - message.check_tx = $root.tendermint.abci.RequestCheckTx.fromObject(object.check_tx); - } - if (object.deliver_tx != null) { - if (typeof object.deliver_tx !== "object") - throw TypeError(".tendermint.abci.Request.deliver_tx: object expected"); - message.deliver_tx = $root.tendermint.abci.RequestDeliverTx.fromObject(object.deliver_tx); - } - if (object.end_block != null) { - if (typeof object.end_block !== "object") - throw TypeError(".tendermint.abci.Request.end_block: object expected"); - message.end_block = $root.tendermint.abci.RequestEndBlock.fromObject(object.end_block); - } - if (object.commit != null) { - if (typeof object.commit !== "object") - throw TypeError(".tendermint.abci.Request.commit: object expected"); - message.commit = $root.tendermint.abci.RequestCommit.fromObject(object.commit); - } - if (object.list_snapshots != null) { - if (typeof object.list_snapshots !== "object") - throw TypeError(".tendermint.abci.Request.list_snapshots: object expected"); - message.list_snapshots = $root.tendermint.abci.RequestListSnapshots.fromObject(object.list_snapshots); - } - if (object.offer_snapshot != null) { - if (typeof object.offer_snapshot !== "object") - throw TypeError(".tendermint.abci.Request.offer_snapshot: object expected"); - message.offer_snapshot = $root.tendermint.abci.RequestOfferSnapshot.fromObject(object.offer_snapshot); - } - if (object.load_snapshot_chunk != null) { - if (typeof object.load_snapshot_chunk !== "object") - throw TypeError(".tendermint.abci.Request.load_snapshot_chunk: object expected"); - message.load_snapshot_chunk = $root.tendermint.abci.RequestLoadSnapshotChunk.fromObject(object.load_snapshot_chunk); - } - if (object.apply_snapshot_chunk != null) { - if (typeof object.apply_snapshot_chunk !== "object") - throw TypeError(".tendermint.abci.Request.apply_snapshot_chunk: object expected"); - message.apply_snapshot_chunk = $root.tendermint.abci.RequestApplySnapshotChunk.fromObject(object.apply_snapshot_chunk); - } - return message; - }; - - /** - * Creates a plain object from a Request message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.Request - * @static - * @param {tendermint.abci.Request} message Request - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Request.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.echo != null && message.hasOwnProperty("echo")) { - object.echo = $root.tendermint.abci.RequestEcho.toObject(message.echo, options); - if (options.oneofs) - object.value = "echo"; - } - if (message.flush != null && message.hasOwnProperty("flush")) { - object.flush = $root.tendermint.abci.RequestFlush.toObject(message.flush, options); - if (options.oneofs) - object.value = "flush"; - } - if (message.info != null && message.hasOwnProperty("info")) { - object.info = $root.tendermint.abci.RequestInfo.toObject(message.info, options); - if (options.oneofs) - object.value = "info"; - } - if (message.set_option != null && message.hasOwnProperty("set_option")) { - object.set_option = $root.tendermint.abci.RequestSetOption.toObject(message.set_option, options); - if (options.oneofs) - object.value = "set_option"; - } - if (message.init_chain != null && message.hasOwnProperty("init_chain")) { - object.init_chain = $root.tendermint.abci.RequestInitChain.toObject(message.init_chain, options); - if (options.oneofs) - object.value = "init_chain"; - } - if (message.query != null && message.hasOwnProperty("query")) { - object.query = $root.tendermint.abci.RequestQuery.toObject(message.query, options); - if (options.oneofs) - object.value = "query"; - } - if (message.begin_block != null && message.hasOwnProperty("begin_block")) { - object.begin_block = $root.tendermint.abci.RequestBeginBlock.toObject(message.begin_block, options); - if (options.oneofs) - object.value = "begin_block"; - } - if (message.check_tx != null && message.hasOwnProperty("check_tx")) { - object.check_tx = $root.tendermint.abci.RequestCheckTx.toObject(message.check_tx, options); - if (options.oneofs) - object.value = "check_tx"; - } - if (message.deliver_tx != null && message.hasOwnProperty("deliver_tx")) { - object.deliver_tx = $root.tendermint.abci.RequestDeliverTx.toObject(message.deliver_tx, options); - if (options.oneofs) - object.value = "deliver_tx"; - } - if (message.end_block != null && message.hasOwnProperty("end_block")) { - object.end_block = $root.tendermint.abci.RequestEndBlock.toObject(message.end_block, options); - if (options.oneofs) - object.value = "end_block"; - } - if (message.commit != null && message.hasOwnProperty("commit")) { - object.commit = $root.tendermint.abci.RequestCommit.toObject(message.commit, options); - if (options.oneofs) - object.value = "commit"; - } - if (message.list_snapshots != null && message.hasOwnProperty("list_snapshots")) { - object.list_snapshots = $root.tendermint.abci.RequestListSnapshots.toObject(message.list_snapshots, options); - if (options.oneofs) - object.value = "list_snapshots"; - } - if (message.offer_snapshot != null && message.hasOwnProperty("offer_snapshot")) { - object.offer_snapshot = $root.tendermint.abci.RequestOfferSnapshot.toObject(message.offer_snapshot, options); - if (options.oneofs) - object.value = "offer_snapshot"; - } - if (message.load_snapshot_chunk != null && message.hasOwnProperty("load_snapshot_chunk")) { - object.load_snapshot_chunk = $root.tendermint.abci.RequestLoadSnapshotChunk.toObject(message.load_snapshot_chunk, options); - if (options.oneofs) - object.value = "load_snapshot_chunk"; - } - if (message.apply_snapshot_chunk != null && message.hasOwnProperty("apply_snapshot_chunk")) { - object.apply_snapshot_chunk = $root.tendermint.abci.RequestApplySnapshotChunk.toObject(message.apply_snapshot_chunk, options); - if (options.oneofs) - object.value = "apply_snapshot_chunk"; - } - return object; - }; - - /** - * Converts this Request to JSON. - * @function toJSON - * @memberof tendermint.abci.Request - * @instance - * @returns {Object.} JSON object - */ - Request.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Request; - })(); - - abci.RequestEcho = (function() { - - /** - * Properties of a RequestEcho. - * @memberof tendermint.abci - * @interface IRequestEcho - * @property {string|null} [message] RequestEcho message - */ - - /** - * Constructs a new RequestEcho. - * @memberof tendermint.abci - * @classdesc Represents a RequestEcho. - * @implements IRequestEcho - * @constructor - * @param {tendermint.abci.IRequestEcho=} [properties] Properties to set - */ - function RequestEcho(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestEcho message. - * @member {string} message - * @memberof tendermint.abci.RequestEcho - * @instance - */ - RequestEcho.prototype.message = ""; - - /** - * Encodes the specified RequestEcho message. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestEcho - * @static - * @param {tendermint.abci.IRequestEcho} message RequestEcho message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestEcho.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); - return writer; - }; - - /** - * Encodes the specified RequestEcho message, length delimited. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestEcho - * @static - * @param {tendermint.abci.IRequestEcho} message RequestEcho message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestEcho.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestEcho message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestEcho - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestEcho} RequestEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestEcho.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestEcho(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestEcho message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestEcho - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestEcho} RequestEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestEcho.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestEcho message. - * @function verify - * @memberof tendermint.abci.RequestEcho - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestEcho.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - return null; - }; - - /** - * Creates a RequestEcho message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestEcho - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestEcho} RequestEcho - */ - RequestEcho.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestEcho) - return object; - var message = new $root.tendermint.abci.RequestEcho(); - if (object.message != null) - message.message = String(object.message); - return message; - }; - - /** - * Creates a plain object from a RequestEcho message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestEcho - * @static - * @param {tendermint.abci.RequestEcho} message RequestEcho - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestEcho.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.message = ""; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - return object; - }; - - /** - * Converts this RequestEcho to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestEcho - * @instance - * @returns {Object.} JSON object - */ - RequestEcho.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestEcho; - })(); - - abci.RequestFlush = (function() { - - /** - * Properties of a RequestFlush. - * @memberof tendermint.abci - * @interface IRequestFlush - */ - - /** - * Constructs a new RequestFlush. - * @memberof tendermint.abci - * @classdesc Represents a RequestFlush. - * @implements IRequestFlush - * @constructor - * @param {tendermint.abci.IRequestFlush=} [properties] Properties to set - */ - function RequestFlush(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified RequestFlush message. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestFlush - * @static - * @param {tendermint.abci.IRequestFlush} message RequestFlush message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestFlush.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified RequestFlush message, length delimited. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestFlush - * @static - * @param {tendermint.abci.IRequestFlush} message RequestFlush message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestFlush.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestFlush message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestFlush - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestFlush} RequestFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestFlush.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestFlush(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestFlush message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestFlush - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestFlush} RequestFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestFlush.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestFlush message. - * @function verify - * @memberof tendermint.abci.RequestFlush - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestFlush.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a RequestFlush message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestFlush - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestFlush} RequestFlush - */ - RequestFlush.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestFlush) - return object; - return new $root.tendermint.abci.RequestFlush(); - }; - - /** - * Creates a plain object from a RequestFlush message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestFlush - * @static - * @param {tendermint.abci.RequestFlush} message RequestFlush - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestFlush.toObject = function toObject() { - return {}; - }; - - /** - * Converts this RequestFlush to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestFlush - * @instance - * @returns {Object.} JSON object - */ - RequestFlush.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestFlush; - })(); - - abci.RequestInfo = (function() { - - /** - * Properties of a RequestInfo. - * @memberof tendermint.abci - * @interface IRequestInfo - * @property {string|null} [version] RequestInfo version - * @property {Long|null} [block_version] RequestInfo block_version - * @property {Long|null} [p2p_version] RequestInfo p2p_version - */ - - /** - * Constructs a new RequestInfo. - * @memberof tendermint.abci - * @classdesc Represents a RequestInfo. - * @implements IRequestInfo - * @constructor - * @param {tendermint.abci.IRequestInfo=} [properties] Properties to set - */ - function RequestInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestInfo version. - * @member {string} version - * @memberof tendermint.abci.RequestInfo - * @instance - */ - RequestInfo.prototype.version = ""; - - /** - * RequestInfo block_version. - * @member {Long} block_version - * @memberof tendermint.abci.RequestInfo - * @instance - */ - RequestInfo.prototype.block_version = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RequestInfo p2p_version. - * @member {Long} p2p_version - * @memberof tendermint.abci.RequestInfo - * @instance - */ - RequestInfo.prototype.p2p_version = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified RequestInfo message. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestInfo - * @static - * @param {tendermint.abci.IRequestInfo} message RequestInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.block_version != null && Object.hasOwnProperty.call(message, "block_version")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block_version); - if (message.p2p_version != null && Object.hasOwnProperty.call(message, "p2p_version")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.p2p_version); - return writer; - }; - - /** - * Encodes the specified RequestInfo message, length delimited. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestInfo - * @static - * @param {tendermint.abci.IRequestInfo} message RequestInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestInfo message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestInfo} RequestInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.string(); - break; - case 2: - message.block_version = reader.uint64(); - break; - case 3: - message.p2p_version = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestInfo} RequestInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestInfo message. - * @function verify - * @memberof tendermint.abci.RequestInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.block_version != null && message.hasOwnProperty("block_version")) - if (!$util.isInteger(message.block_version) && !(message.block_version && $util.isInteger(message.block_version.low) && $util.isInteger(message.block_version.high))) - return "block_version: integer|Long expected"; - if (message.p2p_version != null && message.hasOwnProperty("p2p_version")) - if (!$util.isInteger(message.p2p_version) && !(message.p2p_version && $util.isInteger(message.p2p_version.low) && $util.isInteger(message.p2p_version.high))) - return "p2p_version: integer|Long expected"; - return null; - }; - - /** - * Creates a RequestInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestInfo - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestInfo} RequestInfo - */ - RequestInfo.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestInfo) - return object; - var message = new $root.tendermint.abci.RequestInfo(); - if (object.version != null) - message.version = String(object.version); - if (object.block_version != null) - if ($util.Long) - (message.block_version = $util.Long.fromValue(object.block_version)).unsigned = true; - else if (typeof object.block_version === "string") - message.block_version = parseInt(object.block_version, 10); - else if (typeof object.block_version === "number") - message.block_version = object.block_version; - else if (typeof object.block_version === "object") - message.block_version = new $util.LongBits(object.block_version.low >>> 0, object.block_version.high >>> 0).toNumber(true); - if (object.p2p_version != null) - if ($util.Long) - (message.p2p_version = $util.Long.fromValue(object.p2p_version)).unsigned = true; - else if (typeof object.p2p_version === "string") - message.p2p_version = parseInt(object.p2p_version, 10); - else if (typeof object.p2p_version === "number") - message.p2p_version = object.p2p_version; - else if (typeof object.p2p_version === "object") - message.p2p_version = new $util.LongBits(object.p2p_version.low >>> 0, object.p2p_version.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a RequestInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestInfo - * @static - * @param {tendermint.abci.RequestInfo} message RequestInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.block_version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block_version = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.p2p_version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.p2p_version = options.longs === String ? "0" : 0; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.block_version != null && message.hasOwnProperty("block_version")) - if (typeof message.block_version === "number") - object.block_version = options.longs === String ? String(message.block_version) : message.block_version; - else - object.block_version = options.longs === String ? $util.Long.prototype.toString.call(message.block_version) : options.longs === Number ? new $util.LongBits(message.block_version.low >>> 0, message.block_version.high >>> 0).toNumber(true) : message.block_version; - if (message.p2p_version != null && message.hasOwnProperty("p2p_version")) - if (typeof message.p2p_version === "number") - object.p2p_version = options.longs === String ? String(message.p2p_version) : message.p2p_version; - else - object.p2p_version = options.longs === String ? $util.Long.prototype.toString.call(message.p2p_version) : options.longs === Number ? new $util.LongBits(message.p2p_version.low >>> 0, message.p2p_version.high >>> 0).toNumber(true) : message.p2p_version; - return object; - }; - - /** - * Converts this RequestInfo to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestInfo - * @instance - * @returns {Object.} JSON object - */ - RequestInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestInfo; - })(); - - abci.RequestSetOption = (function() { - - /** - * Properties of a RequestSetOption. - * @memberof tendermint.abci - * @interface IRequestSetOption - * @property {string|null} [key] RequestSetOption key - * @property {string|null} [value] RequestSetOption value - */ - - /** - * Constructs a new RequestSetOption. - * @memberof tendermint.abci - * @classdesc Represents a RequestSetOption. - * @implements IRequestSetOption - * @constructor - * @param {tendermint.abci.IRequestSetOption=} [properties] Properties to set - */ - function RequestSetOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestSetOption key. - * @member {string} key - * @memberof tendermint.abci.RequestSetOption - * @instance - */ - RequestSetOption.prototype.key = ""; - - /** - * RequestSetOption value. - * @member {string} value - * @memberof tendermint.abci.RequestSetOption - * @instance - */ - RequestSetOption.prototype.value = ""; - - /** - * Encodes the specified RequestSetOption message. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestSetOption - * @static - * @param {tendermint.abci.IRequestSetOption} message RequestSetOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestSetOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - return writer; - }; - - /** - * Encodes the specified RequestSetOption message, length delimited. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestSetOption - * @static - * @param {tendermint.abci.IRequestSetOption} message RequestSetOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestSetOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestSetOption message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestSetOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestSetOption} RequestSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestSetOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestSetOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestSetOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestSetOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestSetOption} RequestSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestSetOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestSetOption message. - * @function verify - * @memberof tendermint.abci.RequestSetOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestSetOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a RequestSetOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestSetOption - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestSetOption} RequestSetOption - */ - RequestSetOption.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestSetOption) - return object; - var message = new $root.tendermint.abci.RequestSetOption(); - if (object.key != null) - message.key = String(object.key); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a RequestSetOption message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestSetOption - * @static - * @param {tendermint.abci.RequestSetOption} message RequestSetOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestSetOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.key = ""; - object.value = ""; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this RequestSetOption to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestSetOption - * @instance - * @returns {Object.} JSON object - */ - RequestSetOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestSetOption; - })(); - - abci.RequestInitChain = (function() { - - /** - * Properties of a RequestInitChain. - * @memberof tendermint.abci - * @interface IRequestInitChain - * @property {google.protobuf.ITimestamp|null} [time] RequestInitChain time - * @property {string|null} [chain_id] RequestInitChain chain_id - * @property {tendermint.abci.IConsensusParams|null} [consensus_params] RequestInitChain consensus_params - * @property {Array.|null} [validators] RequestInitChain validators - * @property {Uint8Array|null} [app_state_bytes] RequestInitChain app_state_bytes - * @property {Long|null} [initial_height] RequestInitChain initial_height - */ - - /** - * Constructs a new RequestInitChain. - * @memberof tendermint.abci - * @classdesc Represents a RequestInitChain. - * @implements IRequestInitChain - * @constructor - * @param {tendermint.abci.IRequestInitChain=} [properties] Properties to set - */ - function RequestInitChain(properties) { - this.validators = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestInitChain time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof tendermint.abci.RequestInitChain - * @instance - */ - RequestInitChain.prototype.time = null; - - /** - * RequestInitChain chain_id. - * @member {string} chain_id - * @memberof tendermint.abci.RequestInitChain - * @instance - */ - RequestInitChain.prototype.chain_id = ""; - - /** - * RequestInitChain consensus_params. - * @member {tendermint.abci.IConsensusParams|null|undefined} consensus_params - * @memberof tendermint.abci.RequestInitChain - * @instance - */ - RequestInitChain.prototype.consensus_params = null; - - /** - * RequestInitChain validators. - * @member {Array.} validators - * @memberof tendermint.abci.RequestInitChain - * @instance - */ - RequestInitChain.prototype.validators = $util.emptyArray; - - /** - * RequestInitChain app_state_bytes. - * @member {Uint8Array} app_state_bytes - * @memberof tendermint.abci.RequestInitChain - * @instance - */ - RequestInitChain.prototype.app_state_bytes = $util.newBuffer([]); - - /** - * RequestInitChain initial_height. - * @member {Long} initial_height - * @memberof tendermint.abci.RequestInitChain - * @instance - */ - RequestInitChain.prototype.initial_height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified RequestInitChain message. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestInitChain - * @static - * @param {tendermint.abci.IRequestInitChain} message RequestInitChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestInitChain.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.chain_id != null && Object.hasOwnProperty.call(message, "chain_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain_id); - if (message.consensus_params != null && Object.hasOwnProperty.call(message, "consensus_params")) - $root.tendermint.abci.ConsensusParams.encode(message.consensus_params, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.validators != null && message.validators.length) - for (var i = 0; i < message.validators.length; ++i) - $root.tendermint.abci.ValidatorUpdate.encode(message.validators[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.app_state_bytes != null && Object.hasOwnProperty.call(message, "app_state_bytes")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.app_state_bytes); - if (message.initial_height != null && Object.hasOwnProperty.call(message, "initial_height")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.initial_height); - return writer; - }; - - /** - * Encodes the specified RequestInitChain message, length delimited. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestInitChain - * @static - * @param {tendermint.abci.IRequestInitChain} message RequestInitChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestInitChain.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestInitChain message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestInitChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestInitChain} RequestInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestInitChain.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestInitChain(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.chain_id = reader.string(); - break; - case 3: - message.consensus_params = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.validators && message.validators.length)) - message.validators = []; - message.validators.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); - break; - case 5: - message.app_state_bytes = reader.bytes(); - break; - case 6: - message.initial_height = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestInitChain message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestInitChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestInitChain} RequestInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestInitChain.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestInitChain message. - * @function verify - * @memberof tendermint.abci.RequestInitChain - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestInitChain.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - if (!$util.isString(message.chain_id)) - return "chain_id: string expected"; - if (message.consensus_params != null && message.hasOwnProperty("consensus_params")) { - var error = $root.tendermint.abci.ConsensusParams.verify(message.consensus_params); - if (error) - return "consensus_params." + error; - } - if (message.validators != null && message.hasOwnProperty("validators")) { - if (!Array.isArray(message.validators)) - return "validators: array expected"; - for (var i = 0; i < message.validators.length; ++i) { - var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validators[i]); - if (error) - return "validators." + error; - } - } - if (message.app_state_bytes != null && message.hasOwnProperty("app_state_bytes")) - if (!(message.app_state_bytes && typeof message.app_state_bytes.length === "number" || $util.isString(message.app_state_bytes))) - return "app_state_bytes: buffer expected"; - if (message.initial_height != null && message.hasOwnProperty("initial_height")) - if (!$util.isInteger(message.initial_height) && !(message.initial_height && $util.isInteger(message.initial_height.low) && $util.isInteger(message.initial_height.high))) - return "initial_height: integer|Long expected"; - return null; - }; - - /** - * Creates a RequestInitChain message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestInitChain - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestInitChain} RequestInitChain - */ - RequestInitChain.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestInitChain) - return object; - var message = new $root.tendermint.abci.RequestInitChain(); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".tendermint.abci.RequestInitChain.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.chain_id != null) - message.chain_id = String(object.chain_id); - if (object.consensus_params != null) { - if (typeof object.consensus_params !== "object") - throw TypeError(".tendermint.abci.RequestInitChain.consensus_params: object expected"); - message.consensus_params = $root.tendermint.abci.ConsensusParams.fromObject(object.consensus_params); - } - if (object.validators) { - if (!Array.isArray(object.validators)) - throw TypeError(".tendermint.abci.RequestInitChain.validators: array expected"); - message.validators = []; - for (var i = 0; i < object.validators.length; ++i) { - if (typeof object.validators[i] !== "object") - throw TypeError(".tendermint.abci.RequestInitChain.validators: object expected"); - message.validators[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validators[i]); - } - } - if (object.app_state_bytes != null) - if (typeof object.app_state_bytes === "string") - $util.base64.decode(object.app_state_bytes, message.app_state_bytes = $util.newBuffer($util.base64.length(object.app_state_bytes)), 0); - else if (object.app_state_bytes.length) - message.app_state_bytes = object.app_state_bytes; - if (object.initial_height != null) - if ($util.Long) - (message.initial_height = $util.Long.fromValue(object.initial_height)).unsigned = false; - else if (typeof object.initial_height === "string") - message.initial_height = parseInt(object.initial_height, 10); - else if (typeof object.initial_height === "number") - message.initial_height = object.initial_height; - else if (typeof object.initial_height === "object") - message.initial_height = new $util.LongBits(object.initial_height.low >>> 0, object.initial_height.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a RequestInitChain message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestInitChain - * @static - * @param {tendermint.abci.RequestInitChain} message RequestInitChain - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestInitChain.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.validators = []; - if (options.defaults) { - object.time = null; - object.chain_id = ""; - object.consensus_params = null; - if (options.bytes === String) - object.app_state_bytes = ""; - else { - object.app_state_bytes = []; - if (options.bytes !== Array) - object.app_state_bytes = $util.newBuffer(object.app_state_bytes); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.initial_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.initial_height = options.longs === String ? "0" : 0; - } - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - object.chain_id = message.chain_id; - if (message.consensus_params != null && message.hasOwnProperty("consensus_params")) - object.consensus_params = $root.tendermint.abci.ConsensusParams.toObject(message.consensus_params, options); - if (message.validators && message.validators.length) { - object.validators = []; - for (var j = 0; j < message.validators.length; ++j) - object.validators[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validators[j], options); - } - if (message.app_state_bytes != null && message.hasOwnProperty("app_state_bytes")) - object.app_state_bytes = options.bytes === String ? $util.base64.encode(message.app_state_bytes, 0, message.app_state_bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.app_state_bytes) : message.app_state_bytes; - if (message.initial_height != null && message.hasOwnProperty("initial_height")) - if (typeof message.initial_height === "number") - object.initial_height = options.longs === String ? String(message.initial_height) : message.initial_height; - else - object.initial_height = options.longs === String ? $util.Long.prototype.toString.call(message.initial_height) : options.longs === Number ? new $util.LongBits(message.initial_height.low >>> 0, message.initial_height.high >>> 0).toNumber() : message.initial_height; - return object; - }; - - /** - * Converts this RequestInitChain to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestInitChain - * @instance - * @returns {Object.} JSON object - */ - RequestInitChain.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestInitChain; - })(); - - abci.RequestQuery = (function() { - - /** - * Properties of a RequestQuery. - * @memberof tendermint.abci - * @interface IRequestQuery - * @property {Uint8Array|null} [data] RequestQuery data - * @property {string|null} [path] RequestQuery path - * @property {Long|null} [height] RequestQuery height - * @property {boolean|null} [prove] RequestQuery prove - */ - - /** - * Constructs a new RequestQuery. - * @memberof tendermint.abci - * @classdesc Represents a RequestQuery. - * @implements IRequestQuery - * @constructor - * @param {tendermint.abci.IRequestQuery=} [properties] Properties to set - */ - function RequestQuery(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestQuery data. - * @member {Uint8Array} data - * @memberof tendermint.abci.RequestQuery - * @instance - */ - RequestQuery.prototype.data = $util.newBuffer([]); - - /** - * RequestQuery path. - * @member {string} path - * @memberof tendermint.abci.RequestQuery - * @instance - */ - RequestQuery.prototype.path = ""; - - /** - * RequestQuery height. - * @member {Long} height - * @memberof tendermint.abci.RequestQuery - * @instance - */ - RequestQuery.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * RequestQuery prove. - * @member {boolean} prove - * @memberof tendermint.abci.RequestQuery - * @instance - */ - RequestQuery.prototype.prove = false; - - /** - * Encodes the specified RequestQuery message. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestQuery - * @static - * @param {tendermint.abci.IRequestQuery} message RequestQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestQuery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.prove); - return writer; - }; - - /** - * Encodes the specified RequestQuery message, length delimited. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestQuery - * @static - * @param {tendermint.abci.IRequestQuery} message RequestQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestQuery message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestQuery} RequestQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestQuery.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; - case 2: - message.path = reader.string(); - break; - case 3: - message.height = reader.int64(); - break; - case 4: - message.prove = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestQuery} RequestQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestQuery message. - * @function verify - * @memberof tendermint.abci.RequestQuery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestQuery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; - return null; - }; - - /** - * Creates a RequestQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestQuery - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestQuery} RequestQuery - */ - RequestQuery.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestQuery) - return object; - var message = new $root.tendermint.abci.RequestQuery(); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.path != null) - message.path = String(object.path); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.prove != null) - message.prove = Boolean(object.prove); - return message; - }; - - /** - * Creates a plain object from a RequestQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestQuery - * @static - * @param {tendermint.abci.RequestQuery} message RequestQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.path = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.prove = false; - } - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; - return object; - }; - - /** - * Converts this RequestQuery to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestQuery - * @instance - * @returns {Object.} JSON object - */ - RequestQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestQuery; - })(); - - abci.RequestBeginBlock = (function() { - - /** - * Properties of a RequestBeginBlock. - * @memberof tendermint.abci - * @interface IRequestBeginBlock - * @property {Uint8Array|null} [hash] RequestBeginBlock hash - * @property {tendermint.types.IHeader|null} [header] RequestBeginBlock header - * @property {tendermint.abci.ILastCommitInfo|null} [last_commit_info] RequestBeginBlock last_commit_info - * @property {Array.|null} [byzantine_validators] RequestBeginBlock byzantine_validators - */ - - /** - * Constructs a new RequestBeginBlock. - * @memberof tendermint.abci - * @classdesc Represents a RequestBeginBlock. - * @implements IRequestBeginBlock - * @constructor - * @param {tendermint.abci.IRequestBeginBlock=} [properties] Properties to set - */ - function RequestBeginBlock(properties) { - this.byzantine_validators = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestBeginBlock hash. - * @member {Uint8Array} hash - * @memberof tendermint.abci.RequestBeginBlock - * @instance - */ - RequestBeginBlock.prototype.hash = $util.newBuffer([]); - - /** - * RequestBeginBlock header. - * @member {tendermint.types.IHeader|null|undefined} header - * @memberof tendermint.abci.RequestBeginBlock - * @instance - */ - RequestBeginBlock.prototype.header = null; - - /** - * RequestBeginBlock last_commit_info. - * @member {tendermint.abci.ILastCommitInfo|null|undefined} last_commit_info - * @memberof tendermint.abci.RequestBeginBlock - * @instance - */ - RequestBeginBlock.prototype.last_commit_info = null; - - /** - * RequestBeginBlock byzantine_validators. - * @member {Array.} byzantine_validators - * @memberof tendermint.abci.RequestBeginBlock - * @instance - */ - RequestBeginBlock.prototype.byzantine_validators = $util.emptyArray; - - /** - * Encodes the specified RequestBeginBlock message. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestBeginBlock - * @static - * @param {tendermint.abci.IRequestBeginBlock} message RequestBeginBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestBeginBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.last_commit_info != null && Object.hasOwnProperty.call(message, "last_commit_info")) - $root.tendermint.abci.LastCommitInfo.encode(message.last_commit_info, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.byzantine_validators != null && message.byzantine_validators.length) - for (var i = 0; i < message.byzantine_validators.length; ++i) - $root.tendermint.abci.Evidence.encode(message.byzantine_validators[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RequestBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestBeginBlock - * @static - * @param {tendermint.abci.IRequestBeginBlock} message RequestBeginBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestBeginBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestBeginBlock message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestBeginBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestBeginBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestBeginBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - case 2: - message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); - break; - case 3: - message.last_commit_info = $root.tendermint.abci.LastCommitInfo.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.byzantine_validators && message.byzantine_validators.length)) - message.byzantine_validators = []; - message.byzantine_validators.push($root.tendermint.abci.Evidence.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestBeginBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestBeginBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestBeginBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestBeginBlock message. - * @function verify - * @memberof tendermint.abci.RequestBeginBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestBeginBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - if (message.header != null && message.hasOwnProperty("header")) { - var error = $root.tendermint.types.Header.verify(message.header); - if (error) - return "header." + error; - } - if (message.last_commit_info != null && message.hasOwnProperty("last_commit_info")) { - var error = $root.tendermint.abci.LastCommitInfo.verify(message.last_commit_info); - if (error) - return "last_commit_info." + error; - } - if (message.byzantine_validators != null && message.hasOwnProperty("byzantine_validators")) { - if (!Array.isArray(message.byzantine_validators)) - return "byzantine_validators: array expected"; - for (var i = 0; i < message.byzantine_validators.length; ++i) { - var error = $root.tendermint.abci.Evidence.verify(message.byzantine_validators[i]); - if (error) - return "byzantine_validators." + error; - } - } - return null; - }; - - /** - * Creates a RequestBeginBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestBeginBlock - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock - */ - RequestBeginBlock.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestBeginBlock) - return object; - var message = new $root.tendermint.abci.RequestBeginBlock(); - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".tendermint.abci.RequestBeginBlock.header: object expected"); - message.header = $root.tendermint.types.Header.fromObject(object.header); - } - if (object.last_commit_info != null) { - if (typeof object.last_commit_info !== "object") - throw TypeError(".tendermint.abci.RequestBeginBlock.last_commit_info: object expected"); - message.last_commit_info = $root.tendermint.abci.LastCommitInfo.fromObject(object.last_commit_info); - } - if (object.byzantine_validators) { - if (!Array.isArray(object.byzantine_validators)) - throw TypeError(".tendermint.abci.RequestBeginBlock.byzantine_validators: array expected"); - message.byzantine_validators = []; - for (var i = 0; i < object.byzantine_validators.length; ++i) { - if (typeof object.byzantine_validators[i] !== "object") - throw TypeError(".tendermint.abci.RequestBeginBlock.byzantine_validators: object expected"); - message.byzantine_validators[i] = $root.tendermint.abci.Evidence.fromObject(object.byzantine_validators[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RequestBeginBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestBeginBlock - * @static - * @param {tendermint.abci.RequestBeginBlock} message RequestBeginBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestBeginBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.byzantine_validators = []; - if (options.defaults) { - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - object.header = null; - object.last_commit_info = null; - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.tendermint.types.Header.toObject(message.header, options); - if (message.last_commit_info != null && message.hasOwnProperty("last_commit_info")) - object.last_commit_info = $root.tendermint.abci.LastCommitInfo.toObject(message.last_commit_info, options); - if (message.byzantine_validators && message.byzantine_validators.length) { - object.byzantine_validators = []; - for (var j = 0; j < message.byzantine_validators.length; ++j) - object.byzantine_validators[j] = $root.tendermint.abci.Evidence.toObject(message.byzantine_validators[j], options); - } - return object; - }; - - /** - * Converts this RequestBeginBlock to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestBeginBlock - * @instance - * @returns {Object.} JSON object - */ - RequestBeginBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestBeginBlock; - })(); - - /** - * CheckTxType enum. - * @name tendermint.abci.CheckTxType - * @enum {number} - * @property {number} NEW=0 NEW value - * @property {number} RECHECK=1 RECHECK value - */ - abci.CheckTxType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NEW"] = 0; - values[valuesById[1] = "RECHECK"] = 1; - return values; - })(); - - abci.RequestCheckTx = (function() { - - /** - * Properties of a RequestCheckTx. - * @memberof tendermint.abci - * @interface IRequestCheckTx - * @property {Uint8Array|null} [tx] RequestCheckTx tx - * @property {tendermint.abci.CheckTxType|null} [type] RequestCheckTx type - */ - - /** - * Constructs a new RequestCheckTx. - * @memberof tendermint.abci - * @classdesc Represents a RequestCheckTx. - * @implements IRequestCheckTx - * @constructor - * @param {tendermint.abci.IRequestCheckTx=} [properties] Properties to set - */ - function RequestCheckTx(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestCheckTx tx. - * @member {Uint8Array} tx - * @memberof tendermint.abci.RequestCheckTx - * @instance - */ - RequestCheckTx.prototype.tx = $util.newBuffer([]); - - /** - * RequestCheckTx type. - * @member {tendermint.abci.CheckTxType} type - * @memberof tendermint.abci.RequestCheckTx - * @instance - */ - RequestCheckTx.prototype.type = 0; - - /** - * Encodes the specified RequestCheckTx message. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestCheckTx - * @static - * @param {tendermint.abci.IRequestCheckTx} message RequestCheckTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestCheckTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tx); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - return writer; - }; - - /** - * Encodes the specified RequestCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestCheckTx - * @static - * @param {tendermint.abci.IRequestCheckTx} message RequestCheckTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestCheckTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestCheckTx message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestCheckTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestCheckTx.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestCheckTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx = reader.bytes(); - break; - case 2: - message.type = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestCheckTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestCheckTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestCheckTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestCheckTx message. - * @function verify - * @memberof tendermint.abci.RequestCheckTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestCheckTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tx != null && message.hasOwnProperty("tx")) - if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) - return "tx: buffer expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a RequestCheckTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestCheckTx - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestCheckTx} RequestCheckTx - */ - RequestCheckTx.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestCheckTx) - return object; - var message = new $root.tendermint.abci.RequestCheckTx(); - if (object.tx != null) - if (typeof object.tx === "string") - $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); - else if (object.tx.length) - message.tx = object.tx; - switch (object.type) { - case "NEW": - case 0: - message.type = 0; - break; - case "RECHECK": - case 1: - message.type = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a RequestCheckTx message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestCheckTx - * @static - * @param {tendermint.abci.RequestCheckTx} message RequestCheckTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestCheckTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.tx = ""; - else { - object.tx = []; - if (options.bytes !== Array) - object.tx = $util.newBuffer(object.tx); - } - object.type = options.enums === String ? "NEW" : 0; - } - if (message.tx != null && message.hasOwnProperty("tx")) - object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.tendermint.abci.CheckTxType[message.type] : message.type; - return object; - }; - - /** - * Converts this RequestCheckTx to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestCheckTx - * @instance - * @returns {Object.} JSON object - */ - RequestCheckTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestCheckTx; - })(); - - abci.RequestDeliverTx = (function() { - - /** - * Properties of a RequestDeliverTx. - * @memberof tendermint.abci - * @interface IRequestDeliverTx - * @property {Uint8Array|null} [tx] RequestDeliverTx tx - */ - - /** - * Constructs a new RequestDeliverTx. - * @memberof tendermint.abci - * @classdesc Represents a RequestDeliverTx. - * @implements IRequestDeliverTx - * @constructor - * @param {tendermint.abci.IRequestDeliverTx=} [properties] Properties to set - */ - function RequestDeliverTx(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestDeliverTx tx. - * @member {Uint8Array} tx - * @memberof tendermint.abci.RequestDeliverTx - * @instance - */ - RequestDeliverTx.prototype.tx = $util.newBuffer([]); - - /** - * Encodes the specified RequestDeliverTx message. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestDeliverTx - * @static - * @param {tendermint.abci.IRequestDeliverTx} message RequestDeliverTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestDeliverTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tx); - return writer; - }; - - /** - * Encodes the specified RequestDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestDeliverTx - * @static - * @param {tendermint.abci.IRequestDeliverTx} message RequestDeliverTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestDeliverTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestDeliverTx message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestDeliverTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestDeliverTx.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestDeliverTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestDeliverTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestDeliverTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestDeliverTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestDeliverTx message. - * @function verify - * @memberof tendermint.abci.RequestDeliverTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestDeliverTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tx != null && message.hasOwnProperty("tx")) - if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) - return "tx: buffer expected"; - return null; - }; - - /** - * Creates a RequestDeliverTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestDeliverTx - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx - */ - RequestDeliverTx.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestDeliverTx) - return object; - var message = new $root.tendermint.abci.RequestDeliverTx(); - if (object.tx != null) - if (typeof object.tx === "string") - $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); - else if (object.tx.length) - message.tx = object.tx; - return message; - }; - - /** - * Creates a plain object from a RequestDeliverTx message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestDeliverTx - * @static - * @param {tendermint.abci.RequestDeliverTx} message RequestDeliverTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestDeliverTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.tx = ""; - else { - object.tx = []; - if (options.bytes !== Array) - object.tx = $util.newBuffer(object.tx); - } - if (message.tx != null && message.hasOwnProperty("tx")) - object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; - return object; - }; - - /** - * Converts this RequestDeliverTx to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestDeliverTx - * @instance - * @returns {Object.} JSON object - */ - RequestDeliverTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestDeliverTx; - })(); - - abci.RequestEndBlock = (function() { - - /** - * Properties of a RequestEndBlock. - * @memberof tendermint.abci - * @interface IRequestEndBlock - * @property {Long|null} [height] RequestEndBlock height - */ - - /** - * Constructs a new RequestEndBlock. - * @memberof tendermint.abci - * @classdesc Represents a RequestEndBlock. - * @implements IRequestEndBlock - * @constructor - * @param {tendermint.abci.IRequestEndBlock=} [properties] Properties to set - */ - function RequestEndBlock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestEndBlock height. - * @member {Long} height - * @memberof tendermint.abci.RequestEndBlock - * @instance - */ - RequestEndBlock.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified RequestEndBlock message. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestEndBlock - * @static - * @param {tendermint.abci.IRequestEndBlock} message RequestEndBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestEndBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); - return writer; - }; - - /** - * Encodes the specified RequestEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestEndBlock - * @static - * @param {tendermint.abci.IRequestEndBlock} message RequestEndBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestEndBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestEndBlock message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestEndBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestEndBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestEndBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestEndBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestEndBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestEndBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestEndBlock message. - * @function verify - * @memberof tendermint.abci.RequestEndBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestEndBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - return null; - }; - - /** - * Creates a RequestEndBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestEndBlock - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestEndBlock} RequestEndBlock - */ - RequestEndBlock.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestEndBlock) - return object; - var message = new $root.tendermint.abci.RequestEndBlock(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a RequestEndBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestEndBlock - * @static - * @param {tendermint.abci.RequestEndBlock} message RequestEndBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestEndBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - return object; - }; - - /** - * Converts this RequestEndBlock to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestEndBlock - * @instance - * @returns {Object.} JSON object - */ - RequestEndBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestEndBlock; - })(); - - abci.RequestCommit = (function() { - - /** - * Properties of a RequestCommit. - * @memberof tendermint.abci - * @interface IRequestCommit - */ - - /** - * Constructs a new RequestCommit. - * @memberof tendermint.abci - * @classdesc Represents a RequestCommit. - * @implements IRequestCommit - * @constructor - * @param {tendermint.abci.IRequestCommit=} [properties] Properties to set - */ - function RequestCommit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified RequestCommit message. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestCommit - * @static - * @param {tendermint.abci.IRequestCommit} message RequestCommit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestCommit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified RequestCommit message, length delimited. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestCommit - * @static - * @param {tendermint.abci.IRequestCommit} message RequestCommit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestCommit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestCommit message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestCommit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestCommit} RequestCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestCommit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestCommit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestCommit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestCommit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestCommit} RequestCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestCommit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestCommit message. - * @function verify - * @memberof tendermint.abci.RequestCommit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestCommit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a RequestCommit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestCommit - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestCommit} RequestCommit - */ - RequestCommit.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestCommit) - return object; - return new $root.tendermint.abci.RequestCommit(); - }; - - /** - * Creates a plain object from a RequestCommit message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestCommit - * @static - * @param {tendermint.abci.RequestCommit} message RequestCommit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestCommit.toObject = function toObject() { - return {}; - }; - - /** - * Converts this RequestCommit to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestCommit - * @instance - * @returns {Object.} JSON object - */ - RequestCommit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestCommit; - })(); - - abci.RequestListSnapshots = (function() { - - /** - * Properties of a RequestListSnapshots. - * @memberof tendermint.abci - * @interface IRequestListSnapshots - */ - - /** - * Constructs a new RequestListSnapshots. - * @memberof tendermint.abci - * @classdesc Represents a RequestListSnapshots. - * @implements IRequestListSnapshots - * @constructor - * @param {tendermint.abci.IRequestListSnapshots=} [properties] Properties to set - */ - function RequestListSnapshots(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified RequestListSnapshots message. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestListSnapshots - * @static - * @param {tendermint.abci.IRequestListSnapshots} message RequestListSnapshots message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestListSnapshots.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified RequestListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestListSnapshots - * @static - * @param {tendermint.abci.IRequestListSnapshots} message RequestListSnapshots message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestListSnapshots.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestListSnapshots message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestListSnapshots - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestListSnapshots.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestListSnapshots(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestListSnapshots message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestListSnapshots - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestListSnapshots.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestListSnapshots message. - * @function verify - * @memberof tendermint.abci.RequestListSnapshots - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestListSnapshots.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a RequestListSnapshots message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestListSnapshots - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots - */ - RequestListSnapshots.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestListSnapshots) - return object; - return new $root.tendermint.abci.RequestListSnapshots(); - }; - - /** - * Creates a plain object from a RequestListSnapshots message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestListSnapshots - * @static - * @param {tendermint.abci.RequestListSnapshots} message RequestListSnapshots - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestListSnapshots.toObject = function toObject() { - return {}; - }; - - /** - * Converts this RequestListSnapshots to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestListSnapshots - * @instance - * @returns {Object.} JSON object - */ - RequestListSnapshots.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestListSnapshots; - })(); - - abci.RequestOfferSnapshot = (function() { - - /** - * Properties of a RequestOfferSnapshot. - * @memberof tendermint.abci - * @interface IRequestOfferSnapshot - * @property {tendermint.abci.ISnapshot|null} [snapshot] RequestOfferSnapshot snapshot - * @property {Uint8Array|null} [app_hash] RequestOfferSnapshot app_hash - */ - - /** - * Constructs a new RequestOfferSnapshot. - * @memberof tendermint.abci - * @classdesc Represents a RequestOfferSnapshot. - * @implements IRequestOfferSnapshot - * @constructor - * @param {tendermint.abci.IRequestOfferSnapshot=} [properties] Properties to set - */ - function RequestOfferSnapshot(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestOfferSnapshot snapshot. - * @member {tendermint.abci.ISnapshot|null|undefined} snapshot - * @memberof tendermint.abci.RequestOfferSnapshot - * @instance - */ - RequestOfferSnapshot.prototype.snapshot = null; - - /** - * RequestOfferSnapshot app_hash. - * @member {Uint8Array} app_hash - * @memberof tendermint.abci.RequestOfferSnapshot - * @instance - */ - RequestOfferSnapshot.prototype.app_hash = $util.newBuffer([]); - - /** - * Encodes the specified RequestOfferSnapshot message. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestOfferSnapshot - * @static - * @param {tendermint.abci.IRequestOfferSnapshot} message RequestOfferSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestOfferSnapshot.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - $root.tendermint.abci.Snapshot.encode(message.snapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.app_hash != null && Object.hasOwnProperty.call(message, "app_hash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.app_hash); - return writer; - }; - - /** - * Encodes the specified RequestOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestOfferSnapshot - * @static - * @param {tendermint.abci.IRequestOfferSnapshot} message RequestOfferSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestOfferSnapshot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestOfferSnapshot message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestOfferSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestOfferSnapshot.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestOfferSnapshot(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.snapshot = $root.tendermint.abci.Snapshot.decode(reader, reader.uint32()); - break; - case 2: - message.app_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestOfferSnapshot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestOfferSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestOfferSnapshot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestOfferSnapshot message. - * @function verify - * @memberof tendermint.abci.RequestOfferSnapshot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestOfferSnapshot.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - var error = $root.tendermint.abci.Snapshot.verify(message.snapshot); - if (error) - return "snapshot." + error; - } - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - if (!(message.app_hash && typeof message.app_hash.length === "number" || $util.isString(message.app_hash))) - return "app_hash: buffer expected"; - return null; - }; - - /** - * Creates a RequestOfferSnapshot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestOfferSnapshot - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot - */ - RequestOfferSnapshot.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestOfferSnapshot) - return object; - var message = new $root.tendermint.abci.RequestOfferSnapshot(); - if (object.snapshot != null) { - if (typeof object.snapshot !== "object") - throw TypeError(".tendermint.abci.RequestOfferSnapshot.snapshot: object expected"); - message.snapshot = $root.tendermint.abci.Snapshot.fromObject(object.snapshot); - } - if (object.app_hash != null) - if (typeof object.app_hash === "string") - $util.base64.decode(object.app_hash, message.app_hash = $util.newBuffer($util.base64.length(object.app_hash)), 0); - else if (object.app_hash.length) - message.app_hash = object.app_hash; - return message; - }; - - /** - * Creates a plain object from a RequestOfferSnapshot message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestOfferSnapshot - * @static - * @param {tendermint.abci.RequestOfferSnapshot} message RequestOfferSnapshot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestOfferSnapshot.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.snapshot = null; - if (options.bytes === String) - object.app_hash = ""; - else { - object.app_hash = []; - if (options.bytes !== Array) - object.app_hash = $util.newBuffer(object.app_hash); - } - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) - object.snapshot = $root.tendermint.abci.Snapshot.toObject(message.snapshot, options); - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - object.app_hash = options.bytes === String ? $util.base64.encode(message.app_hash, 0, message.app_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.app_hash) : message.app_hash; - return object; - }; - - /** - * Converts this RequestOfferSnapshot to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestOfferSnapshot - * @instance - * @returns {Object.} JSON object - */ - RequestOfferSnapshot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestOfferSnapshot; - })(); - - abci.RequestLoadSnapshotChunk = (function() { - - /** - * Properties of a RequestLoadSnapshotChunk. - * @memberof tendermint.abci - * @interface IRequestLoadSnapshotChunk - * @property {Long|null} [height] RequestLoadSnapshotChunk height - * @property {number|null} [format] RequestLoadSnapshotChunk format - * @property {number|null} [chunk] RequestLoadSnapshotChunk chunk - */ - - /** - * Constructs a new RequestLoadSnapshotChunk. - * @memberof tendermint.abci - * @classdesc Represents a RequestLoadSnapshotChunk. - * @implements IRequestLoadSnapshotChunk - * @constructor - * @param {tendermint.abci.IRequestLoadSnapshotChunk=} [properties] Properties to set - */ - function RequestLoadSnapshotChunk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestLoadSnapshotChunk height. - * @member {Long} height - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @instance - */ - RequestLoadSnapshotChunk.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * RequestLoadSnapshotChunk format. - * @member {number} format - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @instance - */ - RequestLoadSnapshotChunk.prototype.format = 0; - - /** - * RequestLoadSnapshotChunk chunk. - * @member {number} chunk - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @instance - */ - RequestLoadSnapshotChunk.prototype.chunk = 0; - - /** - * Encodes the specified RequestLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @static - * @param {tendermint.abci.IRequestLoadSnapshotChunk} message RequestLoadSnapshotChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestLoadSnapshotChunk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.format); - if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.chunk); - return writer; - }; - - /** - * Encodes the specified RequestLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @static - * @param {tendermint.abci.IRequestLoadSnapshotChunk} message RequestLoadSnapshotChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestLoadSnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestLoadSnapshotChunk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestLoadSnapshotChunk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.uint64(); - break; - case 2: - message.format = reader.uint32(); - break; - case 3: - message.chunk = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestLoadSnapshotChunk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestLoadSnapshotChunk message. - * @function verify - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestLoadSnapshotChunk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.format != null && message.hasOwnProperty("format")) - if (!$util.isInteger(message.format)) - return "format: integer expected"; - if (message.chunk != null && message.hasOwnProperty("chunk")) - if (!$util.isInteger(message.chunk)) - return "chunk: integer expected"; - return null; - }; - - /** - * Creates a RequestLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk - */ - RequestLoadSnapshotChunk.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestLoadSnapshotChunk) - return object; - var message = new $root.tendermint.abci.RequestLoadSnapshotChunk(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = true; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); - if (object.format != null) - message.format = object.format >>> 0; - if (object.chunk != null) - message.chunk = object.chunk >>> 0; - return message; - }; - - /** - * Creates a plain object from a RequestLoadSnapshotChunk message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @static - * @param {tendermint.abci.RequestLoadSnapshotChunk} message RequestLoadSnapshotChunk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestLoadSnapshotChunk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.format = 0; - object.chunk = 0; - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; - if (message.format != null && message.hasOwnProperty("format")) - object.format = message.format; - if (message.chunk != null && message.hasOwnProperty("chunk")) - object.chunk = message.chunk; - return object; - }; - - /** - * Converts this RequestLoadSnapshotChunk to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestLoadSnapshotChunk - * @instance - * @returns {Object.} JSON object - */ - RequestLoadSnapshotChunk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestLoadSnapshotChunk; - })(); - - abci.RequestApplySnapshotChunk = (function() { - - /** - * Properties of a RequestApplySnapshotChunk. - * @memberof tendermint.abci - * @interface IRequestApplySnapshotChunk - * @property {number|null} [index] RequestApplySnapshotChunk index - * @property {Uint8Array|null} [chunk] RequestApplySnapshotChunk chunk - * @property {string|null} [sender] RequestApplySnapshotChunk sender - */ - - /** - * Constructs a new RequestApplySnapshotChunk. - * @memberof tendermint.abci - * @classdesc Represents a RequestApplySnapshotChunk. - * @implements IRequestApplySnapshotChunk - * @constructor - * @param {tendermint.abci.IRequestApplySnapshotChunk=} [properties] Properties to set - */ - function RequestApplySnapshotChunk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RequestApplySnapshotChunk index. - * @member {number} index - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @instance - */ - RequestApplySnapshotChunk.prototype.index = 0; - - /** - * RequestApplySnapshotChunk chunk. - * @member {Uint8Array} chunk - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @instance - */ - RequestApplySnapshotChunk.prototype.chunk = $util.newBuffer([]); - - /** - * RequestApplySnapshotChunk sender. - * @member {string} sender - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @instance - */ - RequestApplySnapshotChunk.prototype.sender = ""; - - /** - * Encodes the specified RequestApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @static - * @param {tendermint.abci.IRequestApplySnapshotChunk} message RequestApplySnapshotChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestApplySnapshotChunk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); - if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.chunk); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sender); - return writer; - }; - - /** - * Encodes the specified RequestApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @static - * @param {tendermint.abci.IRequestApplySnapshotChunk} message RequestApplySnapshotChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RequestApplySnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestApplySnapshotChunk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.RequestApplySnapshotChunk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.chunk = reader.bytes(); - break; - case 3: - message.sender = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RequestApplySnapshotChunk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RequestApplySnapshotChunk message. - * @function verify - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RequestApplySnapshotChunk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.chunk != null && message.hasOwnProperty("chunk")) - if (!(message.chunk && typeof message.chunk.length === "number" || $util.isString(message.chunk))) - return "chunk: buffer expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - return null; - }; - - /** - * Creates a RequestApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk - */ - RequestApplySnapshotChunk.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.RequestApplySnapshotChunk) - return object; - var message = new $root.tendermint.abci.RequestApplySnapshotChunk(); - if (object.index != null) - message.index = object.index >>> 0; - if (object.chunk != null) - if (typeof object.chunk === "string") - $util.base64.decode(object.chunk, message.chunk = $util.newBuffer($util.base64.length(object.chunk)), 0); - else if (object.chunk.length) - message.chunk = object.chunk; - if (object.sender != null) - message.sender = String(object.sender); - return message; - }; - - /** - * Creates a plain object from a RequestApplySnapshotChunk message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @static - * @param {tendermint.abci.RequestApplySnapshotChunk} message RequestApplySnapshotChunk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestApplySnapshotChunk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.index = 0; - if (options.bytes === String) - object.chunk = ""; - else { - object.chunk = []; - if (options.bytes !== Array) - object.chunk = $util.newBuffer(object.chunk); - } - object.sender = ""; - } - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.chunk != null && message.hasOwnProperty("chunk")) - object.chunk = options.bytes === String ? $util.base64.encode(message.chunk, 0, message.chunk.length) : options.bytes === Array ? Array.prototype.slice.call(message.chunk) : message.chunk; - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - return object; - }; - - /** - * Converts this RequestApplySnapshotChunk to JSON. - * @function toJSON - * @memberof tendermint.abci.RequestApplySnapshotChunk - * @instance - * @returns {Object.} JSON object - */ - RequestApplySnapshotChunk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return RequestApplySnapshotChunk; - })(); - - abci.Response = (function() { - - /** - * Properties of a Response. - * @memberof tendermint.abci - * @interface IResponse - * @property {tendermint.abci.IResponseException|null} [exception] Response exception - * @property {tendermint.abci.IResponseEcho|null} [echo] Response echo - * @property {tendermint.abci.IResponseFlush|null} [flush] Response flush - * @property {tendermint.abci.IResponseInfo|null} [info] Response info - * @property {tendermint.abci.IResponseSetOption|null} [set_option] Response set_option - * @property {tendermint.abci.IResponseInitChain|null} [init_chain] Response init_chain - * @property {tendermint.abci.IResponseQuery|null} [query] Response query - * @property {tendermint.abci.IResponseBeginBlock|null} [begin_block] Response begin_block - * @property {tendermint.abci.IResponseCheckTx|null} [check_tx] Response check_tx - * @property {tendermint.abci.IResponseDeliverTx|null} [deliver_tx] Response deliver_tx - * @property {tendermint.abci.IResponseEndBlock|null} [end_block] Response end_block - * @property {tendermint.abci.IResponseCommit|null} [commit] Response commit - * @property {tendermint.abci.IResponseListSnapshots|null} [list_snapshots] Response list_snapshots - * @property {tendermint.abci.IResponseOfferSnapshot|null} [offer_snapshot] Response offer_snapshot - * @property {tendermint.abci.IResponseLoadSnapshotChunk|null} [load_snapshot_chunk] Response load_snapshot_chunk - * @property {tendermint.abci.IResponseApplySnapshotChunk|null} [apply_snapshot_chunk] Response apply_snapshot_chunk - */ - - /** - * Constructs a new Response. - * @memberof tendermint.abci - * @classdesc Represents a Response. - * @implements IResponse - * @constructor - * @param {tendermint.abci.IResponse=} [properties] Properties to set - */ - function Response(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Response exception. - * @member {tendermint.abci.IResponseException|null|undefined} exception - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.exception = null; - - /** - * Response echo. - * @member {tendermint.abci.IResponseEcho|null|undefined} echo - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.echo = null; - - /** - * Response flush. - * @member {tendermint.abci.IResponseFlush|null|undefined} flush - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.flush = null; - - /** - * Response info. - * @member {tendermint.abci.IResponseInfo|null|undefined} info - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.info = null; - - /** - * Response set_option. - * @member {tendermint.abci.IResponseSetOption|null|undefined} set_option - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.set_option = null; - - /** - * Response init_chain. - * @member {tendermint.abci.IResponseInitChain|null|undefined} init_chain - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.init_chain = null; - - /** - * Response query. - * @member {tendermint.abci.IResponseQuery|null|undefined} query - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.query = null; - - /** - * Response begin_block. - * @member {tendermint.abci.IResponseBeginBlock|null|undefined} begin_block - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.begin_block = null; - - /** - * Response check_tx. - * @member {tendermint.abci.IResponseCheckTx|null|undefined} check_tx - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.check_tx = null; - - /** - * Response deliver_tx. - * @member {tendermint.abci.IResponseDeliverTx|null|undefined} deliver_tx - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.deliver_tx = null; - - /** - * Response end_block. - * @member {tendermint.abci.IResponseEndBlock|null|undefined} end_block - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.end_block = null; - - /** - * Response commit. - * @member {tendermint.abci.IResponseCommit|null|undefined} commit - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.commit = null; - - /** - * Response list_snapshots. - * @member {tendermint.abci.IResponseListSnapshots|null|undefined} list_snapshots - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.list_snapshots = null; - - /** - * Response offer_snapshot. - * @member {tendermint.abci.IResponseOfferSnapshot|null|undefined} offer_snapshot - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.offer_snapshot = null; - - /** - * Response load_snapshot_chunk. - * @member {tendermint.abci.IResponseLoadSnapshotChunk|null|undefined} load_snapshot_chunk - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.load_snapshot_chunk = null; - - /** - * Response apply_snapshot_chunk. - * @member {tendermint.abci.IResponseApplySnapshotChunk|null|undefined} apply_snapshot_chunk - * @memberof tendermint.abci.Response - * @instance - */ - Response.prototype.apply_snapshot_chunk = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Response value. - * @member {"exception"|"echo"|"flush"|"info"|"set_option"|"init_chain"|"query"|"begin_block"|"check_tx"|"deliver_tx"|"end_block"|"commit"|"list_snapshots"|"offer_snapshot"|"load_snapshot_chunk"|"apply_snapshot_chunk"|undefined} value - * @memberof tendermint.abci.Response - * @instance - */ - Object.defineProperty(Response.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["exception", "echo", "flush", "info", "set_option", "init_chain", "query", "begin_block", "check_tx", "deliver_tx", "end_block", "commit", "list_snapshots", "offer_snapshot", "load_snapshot_chunk", "apply_snapshot_chunk"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified Response message. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.Response - * @static - * @param {tendermint.abci.IResponse} message Response message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Response.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exception != null && Object.hasOwnProperty.call(message, "exception")) - $root.tendermint.abci.ResponseException.encode(message.exception, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.echo != null && Object.hasOwnProperty.call(message, "echo")) - $root.tendermint.abci.ResponseEcho.encode(message.echo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.flush != null && Object.hasOwnProperty.call(message, "flush")) - $root.tendermint.abci.ResponseFlush.encode(message.flush, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.tendermint.abci.ResponseInfo.encode(message.info, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.set_option != null && Object.hasOwnProperty.call(message, "set_option")) - $root.tendermint.abci.ResponseSetOption.encode(message.set_option, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.init_chain != null && Object.hasOwnProperty.call(message, "init_chain")) - $root.tendermint.abci.ResponseInitChain.encode(message.init_chain, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.tendermint.abci.ResponseQuery.encode(message.query, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.begin_block != null && Object.hasOwnProperty.call(message, "begin_block")) - $root.tendermint.abci.ResponseBeginBlock.encode(message.begin_block, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.check_tx != null && Object.hasOwnProperty.call(message, "check_tx")) - $root.tendermint.abci.ResponseCheckTx.encode(message.check_tx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.deliver_tx != null && Object.hasOwnProperty.call(message, "deliver_tx")) - $root.tendermint.abci.ResponseDeliverTx.encode(message.deliver_tx, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.end_block != null && Object.hasOwnProperty.call(message, "end_block")) - $root.tendermint.abci.ResponseEndBlock.encode(message.end_block, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) - $root.tendermint.abci.ResponseCommit.encode(message.commit, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.list_snapshots != null && Object.hasOwnProperty.call(message, "list_snapshots")) - $root.tendermint.abci.ResponseListSnapshots.encode(message.list_snapshots, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.offer_snapshot != null && Object.hasOwnProperty.call(message, "offer_snapshot")) - $root.tendermint.abci.ResponseOfferSnapshot.encode(message.offer_snapshot, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.load_snapshot_chunk != null && Object.hasOwnProperty.call(message, "load_snapshot_chunk")) - $root.tendermint.abci.ResponseLoadSnapshotChunk.encode(message.load_snapshot_chunk, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.apply_snapshot_chunk != null && Object.hasOwnProperty.call(message, "apply_snapshot_chunk")) - $root.tendermint.abci.ResponseApplySnapshotChunk.encode(message.apply_snapshot_chunk, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Response message, length delimited. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.Response - * @static - * @param {tendermint.abci.IResponse} message Response message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Response.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Response message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.Response - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.Response} Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Response.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Response(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exception = $root.tendermint.abci.ResponseException.decode(reader, reader.uint32()); - break; - case 2: - message.echo = $root.tendermint.abci.ResponseEcho.decode(reader, reader.uint32()); - break; - case 3: - message.flush = $root.tendermint.abci.ResponseFlush.decode(reader, reader.uint32()); - break; - case 4: - message.info = $root.tendermint.abci.ResponseInfo.decode(reader, reader.uint32()); - break; - case 5: - message.set_option = $root.tendermint.abci.ResponseSetOption.decode(reader, reader.uint32()); - break; - case 6: - message.init_chain = $root.tendermint.abci.ResponseInitChain.decode(reader, reader.uint32()); - break; - case 7: - message.query = $root.tendermint.abci.ResponseQuery.decode(reader, reader.uint32()); - break; - case 8: - message.begin_block = $root.tendermint.abci.ResponseBeginBlock.decode(reader, reader.uint32()); - break; - case 9: - message.check_tx = $root.tendermint.abci.ResponseCheckTx.decode(reader, reader.uint32()); - break; - case 10: - message.deliver_tx = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32()); - break; - case 11: - message.end_block = $root.tendermint.abci.ResponseEndBlock.decode(reader, reader.uint32()); - break; - case 12: - message.commit = $root.tendermint.abci.ResponseCommit.decode(reader, reader.uint32()); - break; - case 13: - message.list_snapshots = $root.tendermint.abci.ResponseListSnapshots.decode(reader, reader.uint32()); - break; - case 14: - message.offer_snapshot = $root.tendermint.abci.ResponseOfferSnapshot.decode(reader, reader.uint32()); - break; - case 15: - message.load_snapshot_chunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); - break; - case 16: - message.apply_snapshot_chunk = $root.tendermint.abci.ResponseApplySnapshotChunk.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Response message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.Response - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.Response} Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Response.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Response message. - * @function verify - * @memberof tendermint.abci.Response - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Response.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.exception != null && message.hasOwnProperty("exception")) { - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseException.verify(message.exception); - if (error) - return "exception." + error; - } - } - if (message.echo != null && message.hasOwnProperty("echo")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseEcho.verify(message.echo); - if (error) - return "echo." + error; - } - } - if (message.flush != null && message.hasOwnProperty("flush")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseFlush.verify(message.flush); - if (error) - return "flush." + error; - } - } - if (message.info != null && message.hasOwnProperty("info")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseInfo.verify(message.info); - if (error) - return "info." + error; - } - } - if (message.set_option != null && message.hasOwnProperty("set_option")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseSetOption.verify(message.set_option); - if (error) - return "set_option." + error; - } - } - if (message.init_chain != null && message.hasOwnProperty("init_chain")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseInitChain.verify(message.init_chain); - if (error) - return "init_chain." + error; - } - } - if (message.query != null && message.hasOwnProperty("query")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseQuery.verify(message.query); - if (error) - return "query." + error; - } - } - if (message.begin_block != null && message.hasOwnProperty("begin_block")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseBeginBlock.verify(message.begin_block); - if (error) - return "begin_block." + error; - } - } - if (message.check_tx != null && message.hasOwnProperty("check_tx")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseCheckTx.verify(message.check_tx); - if (error) - return "check_tx." + error; - } - } - if (message.deliver_tx != null && message.hasOwnProperty("deliver_tx")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseDeliverTx.verify(message.deliver_tx); - if (error) - return "deliver_tx." + error; - } - } - if (message.end_block != null && message.hasOwnProperty("end_block")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseEndBlock.verify(message.end_block); - if (error) - return "end_block." + error; - } - } - if (message.commit != null && message.hasOwnProperty("commit")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseCommit.verify(message.commit); - if (error) - return "commit." + error; - } - } - if (message.list_snapshots != null && message.hasOwnProperty("list_snapshots")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseListSnapshots.verify(message.list_snapshots); - if (error) - return "list_snapshots." + error; - } - } - if (message.offer_snapshot != null && message.hasOwnProperty("offer_snapshot")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseOfferSnapshot.verify(message.offer_snapshot); - if (error) - return "offer_snapshot." + error; - } - } - if (message.load_snapshot_chunk != null && message.hasOwnProperty("load_snapshot_chunk")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseLoadSnapshotChunk.verify(message.load_snapshot_chunk); - if (error) - return "load_snapshot_chunk." + error; - } - } - if (message.apply_snapshot_chunk != null && message.hasOwnProperty("apply_snapshot_chunk")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.tendermint.abci.ResponseApplySnapshotChunk.verify(message.apply_snapshot_chunk); - if (error) - return "apply_snapshot_chunk." + error; - } - } - return null; - }; - - /** - * Creates a Response message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.Response - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.Response} Response - */ - Response.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.Response) - return object; - var message = new $root.tendermint.abci.Response(); - if (object.exception != null) { - if (typeof object.exception !== "object") - throw TypeError(".tendermint.abci.Response.exception: object expected"); - message.exception = $root.tendermint.abci.ResponseException.fromObject(object.exception); - } - if (object.echo != null) { - if (typeof object.echo !== "object") - throw TypeError(".tendermint.abci.Response.echo: object expected"); - message.echo = $root.tendermint.abci.ResponseEcho.fromObject(object.echo); - } - if (object.flush != null) { - if (typeof object.flush !== "object") - throw TypeError(".tendermint.abci.Response.flush: object expected"); - message.flush = $root.tendermint.abci.ResponseFlush.fromObject(object.flush); - } - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".tendermint.abci.Response.info: object expected"); - message.info = $root.tendermint.abci.ResponseInfo.fromObject(object.info); - } - if (object.set_option != null) { - if (typeof object.set_option !== "object") - throw TypeError(".tendermint.abci.Response.set_option: object expected"); - message.set_option = $root.tendermint.abci.ResponseSetOption.fromObject(object.set_option); - } - if (object.init_chain != null) { - if (typeof object.init_chain !== "object") - throw TypeError(".tendermint.abci.Response.init_chain: object expected"); - message.init_chain = $root.tendermint.abci.ResponseInitChain.fromObject(object.init_chain); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".tendermint.abci.Response.query: object expected"); - message.query = $root.tendermint.abci.ResponseQuery.fromObject(object.query); - } - if (object.begin_block != null) { - if (typeof object.begin_block !== "object") - throw TypeError(".tendermint.abci.Response.begin_block: object expected"); - message.begin_block = $root.tendermint.abci.ResponseBeginBlock.fromObject(object.begin_block); - } - if (object.check_tx != null) { - if (typeof object.check_tx !== "object") - throw TypeError(".tendermint.abci.Response.check_tx: object expected"); - message.check_tx = $root.tendermint.abci.ResponseCheckTx.fromObject(object.check_tx); - } - if (object.deliver_tx != null) { - if (typeof object.deliver_tx !== "object") - throw TypeError(".tendermint.abci.Response.deliver_tx: object expected"); - message.deliver_tx = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.deliver_tx); - } - if (object.end_block != null) { - if (typeof object.end_block !== "object") - throw TypeError(".tendermint.abci.Response.end_block: object expected"); - message.end_block = $root.tendermint.abci.ResponseEndBlock.fromObject(object.end_block); - } - if (object.commit != null) { - if (typeof object.commit !== "object") - throw TypeError(".tendermint.abci.Response.commit: object expected"); - message.commit = $root.tendermint.abci.ResponseCommit.fromObject(object.commit); - } - if (object.list_snapshots != null) { - if (typeof object.list_snapshots !== "object") - throw TypeError(".tendermint.abci.Response.list_snapshots: object expected"); - message.list_snapshots = $root.tendermint.abci.ResponseListSnapshots.fromObject(object.list_snapshots); - } - if (object.offer_snapshot != null) { - if (typeof object.offer_snapshot !== "object") - throw TypeError(".tendermint.abci.Response.offer_snapshot: object expected"); - message.offer_snapshot = $root.tendermint.abci.ResponseOfferSnapshot.fromObject(object.offer_snapshot); - } - if (object.load_snapshot_chunk != null) { - if (typeof object.load_snapshot_chunk !== "object") - throw TypeError(".tendermint.abci.Response.load_snapshot_chunk: object expected"); - message.load_snapshot_chunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.fromObject(object.load_snapshot_chunk); - } - if (object.apply_snapshot_chunk != null) { - if (typeof object.apply_snapshot_chunk !== "object") - throw TypeError(".tendermint.abci.Response.apply_snapshot_chunk: object expected"); - message.apply_snapshot_chunk = $root.tendermint.abci.ResponseApplySnapshotChunk.fromObject(object.apply_snapshot_chunk); - } - return message; - }; - - /** - * Creates a plain object from a Response message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.Response - * @static - * @param {tendermint.abci.Response} message Response - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Response.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.exception != null && message.hasOwnProperty("exception")) { - object.exception = $root.tendermint.abci.ResponseException.toObject(message.exception, options); - if (options.oneofs) - object.value = "exception"; - } - if (message.echo != null && message.hasOwnProperty("echo")) { - object.echo = $root.tendermint.abci.ResponseEcho.toObject(message.echo, options); - if (options.oneofs) - object.value = "echo"; - } - if (message.flush != null && message.hasOwnProperty("flush")) { - object.flush = $root.tendermint.abci.ResponseFlush.toObject(message.flush, options); - if (options.oneofs) - object.value = "flush"; - } - if (message.info != null && message.hasOwnProperty("info")) { - object.info = $root.tendermint.abci.ResponseInfo.toObject(message.info, options); - if (options.oneofs) - object.value = "info"; - } - if (message.set_option != null && message.hasOwnProperty("set_option")) { - object.set_option = $root.tendermint.abci.ResponseSetOption.toObject(message.set_option, options); - if (options.oneofs) - object.value = "set_option"; - } - if (message.init_chain != null && message.hasOwnProperty("init_chain")) { - object.init_chain = $root.tendermint.abci.ResponseInitChain.toObject(message.init_chain, options); - if (options.oneofs) - object.value = "init_chain"; - } - if (message.query != null && message.hasOwnProperty("query")) { - object.query = $root.tendermint.abci.ResponseQuery.toObject(message.query, options); - if (options.oneofs) - object.value = "query"; - } - if (message.begin_block != null && message.hasOwnProperty("begin_block")) { - object.begin_block = $root.tendermint.abci.ResponseBeginBlock.toObject(message.begin_block, options); - if (options.oneofs) - object.value = "begin_block"; - } - if (message.check_tx != null && message.hasOwnProperty("check_tx")) { - object.check_tx = $root.tendermint.abci.ResponseCheckTx.toObject(message.check_tx, options); - if (options.oneofs) - object.value = "check_tx"; - } - if (message.deliver_tx != null && message.hasOwnProperty("deliver_tx")) { - object.deliver_tx = $root.tendermint.abci.ResponseDeliverTx.toObject(message.deliver_tx, options); - if (options.oneofs) - object.value = "deliver_tx"; - } - if (message.end_block != null && message.hasOwnProperty("end_block")) { - object.end_block = $root.tendermint.abci.ResponseEndBlock.toObject(message.end_block, options); - if (options.oneofs) - object.value = "end_block"; - } - if (message.commit != null && message.hasOwnProperty("commit")) { - object.commit = $root.tendermint.abci.ResponseCommit.toObject(message.commit, options); - if (options.oneofs) - object.value = "commit"; - } - if (message.list_snapshots != null && message.hasOwnProperty("list_snapshots")) { - object.list_snapshots = $root.tendermint.abci.ResponseListSnapshots.toObject(message.list_snapshots, options); - if (options.oneofs) - object.value = "list_snapshots"; - } - if (message.offer_snapshot != null && message.hasOwnProperty("offer_snapshot")) { - object.offer_snapshot = $root.tendermint.abci.ResponseOfferSnapshot.toObject(message.offer_snapshot, options); - if (options.oneofs) - object.value = "offer_snapshot"; - } - if (message.load_snapshot_chunk != null && message.hasOwnProperty("load_snapshot_chunk")) { - object.load_snapshot_chunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.toObject(message.load_snapshot_chunk, options); - if (options.oneofs) - object.value = "load_snapshot_chunk"; - } - if (message.apply_snapshot_chunk != null && message.hasOwnProperty("apply_snapshot_chunk")) { - object.apply_snapshot_chunk = $root.tendermint.abci.ResponseApplySnapshotChunk.toObject(message.apply_snapshot_chunk, options); - if (options.oneofs) - object.value = "apply_snapshot_chunk"; - } - return object; - }; - - /** - * Converts this Response to JSON. - * @function toJSON - * @memberof tendermint.abci.Response - * @instance - * @returns {Object.} JSON object - */ - Response.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Response; - })(); - - abci.ResponseException = (function() { - - /** - * Properties of a ResponseException. - * @memberof tendermint.abci - * @interface IResponseException - * @property {string|null} [error] ResponseException error - */ - - /** - * Constructs a new ResponseException. - * @memberof tendermint.abci - * @classdesc Represents a ResponseException. - * @implements IResponseException - * @constructor - * @param {tendermint.abci.IResponseException=} [properties] Properties to set - */ - function ResponseException(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseException error. - * @member {string} error - * @memberof tendermint.abci.ResponseException - * @instance - */ - ResponseException.prototype.error = ""; - - /** - * Encodes the specified ResponseException message. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseException - * @static - * @param {tendermint.abci.IResponseException} message ResponseException message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseException.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.error); - return writer; - }; - - /** - * Encodes the specified ResponseException message, length delimited. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseException - * @static - * @param {tendermint.abci.IResponseException} message ResponseException message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseException.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseException message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseException - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseException} ResponseException - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseException.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseException(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.error = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseException message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseException - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseException} ResponseException - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseException.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseException message. - * @function verify - * @memberof tendermint.abci.ResponseException - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseException.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.error != null && message.hasOwnProperty("error")) - if (!$util.isString(message.error)) - return "error: string expected"; - return null; - }; - - /** - * Creates a ResponseException message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseException - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseException} ResponseException - */ - ResponseException.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseException) - return object; - var message = new $root.tendermint.abci.ResponseException(); - if (object.error != null) - message.error = String(object.error); - return message; - }; - - /** - * Creates a plain object from a ResponseException message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseException - * @static - * @param {tendermint.abci.ResponseException} message ResponseException - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseException.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.error = ""; - if (message.error != null && message.hasOwnProperty("error")) - object.error = message.error; - return object; - }; - - /** - * Converts this ResponseException to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseException - * @instance - * @returns {Object.} JSON object - */ - ResponseException.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseException; - })(); - - abci.ResponseEcho = (function() { - - /** - * Properties of a ResponseEcho. - * @memberof tendermint.abci - * @interface IResponseEcho - * @property {string|null} [message] ResponseEcho message - */ - - /** - * Constructs a new ResponseEcho. - * @memberof tendermint.abci - * @classdesc Represents a ResponseEcho. - * @implements IResponseEcho - * @constructor - * @param {tendermint.abci.IResponseEcho=} [properties] Properties to set - */ - function ResponseEcho(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseEcho message. - * @member {string} message - * @memberof tendermint.abci.ResponseEcho - * @instance - */ - ResponseEcho.prototype.message = ""; - - /** - * Encodes the specified ResponseEcho message. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseEcho - * @static - * @param {tendermint.abci.IResponseEcho} message ResponseEcho message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseEcho.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); - return writer; - }; - - /** - * Encodes the specified ResponseEcho message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseEcho - * @static - * @param {tendermint.abci.IResponseEcho} message ResponseEcho message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseEcho.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseEcho message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseEcho - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseEcho} ResponseEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseEcho.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseEcho(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseEcho message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseEcho - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseEcho} ResponseEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseEcho.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseEcho message. - * @function verify - * @memberof tendermint.abci.ResponseEcho - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseEcho.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - return null; - }; - - /** - * Creates a ResponseEcho message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseEcho - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseEcho} ResponseEcho - */ - ResponseEcho.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseEcho) - return object; - var message = new $root.tendermint.abci.ResponseEcho(); - if (object.message != null) - message.message = String(object.message); - return message; - }; - - /** - * Creates a plain object from a ResponseEcho message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseEcho - * @static - * @param {tendermint.abci.ResponseEcho} message ResponseEcho - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseEcho.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.message = ""; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - return object; - }; - - /** - * Converts this ResponseEcho to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseEcho - * @instance - * @returns {Object.} JSON object - */ - ResponseEcho.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseEcho; - })(); - - abci.ResponseFlush = (function() { - - /** - * Properties of a ResponseFlush. - * @memberof tendermint.abci - * @interface IResponseFlush - */ - - /** - * Constructs a new ResponseFlush. - * @memberof tendermint.abci - * @classdesc Represents a ResponseFlush. - * @implements IResponseFlush - * @constructor - * @param {tendermint.abci.IResponseFlush=} [properties] Properties to set - */ - function ResponseFlush(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified ResponseFlush message. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseFlush - * @static - * @param {tendermint.abci.IResponseFlush} message ResponseFlush message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseFlush.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ResponseFlush message, length delimited. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseFlush - * @static - * @param {tendermint.abci.IResponseFlush} message ResponseFlush message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseFlush.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseFlush message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseFlush - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseFlush} ResponseFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseFlush.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseFlush(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseFlush message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseFlush - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseFlush} ResponseFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseFlush.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseFlush message. - * @function verify - * @memberof tendermint.abci.ResponseFlush - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseFlush.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a ResponseFlush message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseFlush - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseFlush} ResponseFlush - */ - ResponseFlush.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseFlush) - return object; - return new $root.tendermint.abci.ResponseFlush(); - }; - - /** - * Creates a plain object from a ResponseFlush message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseFlush - * @static - * @param {tendermint.abci.ResponseFlush} message ResponseFlush - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseFlush.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ResponseFlush to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseFlush - * @instance - * @returns {Object.} JSON object - */ - ResponseFlush.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseFlush; - })(); - - abci.ResponseInfo = (function() { - - /** - * Properties of a ResponseInfo. - * @memberof tendermint.abci - * @interface IResponseInfo - * @property {string|null} [data] ResponseInfo data - * @property {string|null} [version] ResponseInfo version - * @property {Long|null} [app_version] ResponseInfo app_version - * @property {Long|null} [last_block_height] ResponseInfo last_block_height - * @property {Uint8Array|null} [last_block_app_hash] ResponseInfo last_block_app_hash - */ - - /** - * Constructs a new ResponseInfo. - * @memberof tendermint.abci - * @classdesc Represents a ResponseInfo. - * @implements IResponseInfo - * @constructor - * @param {tendermint.abci.IResponseInfo=} [properties] Properties to set - */ - function ResponseInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseInfo data. - * @member {string} data - * @memberof tendermint.abci.ResponseInfo - * @instance - */ - ResponseInfo.prototype.data = ""; - - /** - * ResponseInfo version. - * @member {string} version - * @memberof tendermint.abci.ResponseInfo - * @instance - */ - ResponseInfo.prototype.version = ""; - - /** - * ResponseInfo app_version. - * @member {Long} app_version - * @memberof tendermint.abci.ResponseInfo - * @instance - */ - ResponseInfo.prototype.app_version = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ResponseInfo last_block_height. - * @member {Long} last_block_height - * @memberof tendermint.abci.ResponseInfo - * @instance - */ - ResponseInfo.prototype.last_block_height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ResponseInfo last_block_app_hash. - * @member {Uint8Array} last_block_app_hash - * @memberof tendermint.abci.ResponseInfo - * @instance - */ - ResponseInfo.prototype.last_block_app_hash = $util.newBuffer([]); - - /** - * Encodes the specified ResponseInfo message. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseInfo - * @static - * @param {tendermint.abci.IResponseInfo} message ResponseInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.data); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.app_version != null && Object.hasOwnProperty.call(message, "app_version")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.app_version); - if (message.last_block_height != null && Object.hasOwnProperty.call(message, "last_block_height")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.last_block_height); - if (message.last_block_app_hash != null && Object.hasOwnProperty.call(message, "last_block_app_hash")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.last_block_app_hash); - return writer; - }; - - /** - * Encodes the specified ResponseInfo message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseInfo - * @static - * @param {tendermint.abci.IResponseInfo} message ResponseInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseInfo message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseInfo} ResponseInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.data = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - case 3: - message.app_version = reader.uint64(); - break; - case 4: - message.last_block_height = reader.int64(); - break; - case 5: - message.last_block_app_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseInfo} ResponseInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseInfo message. - * @function verify - * @memberof tendermint.abci.ResponseInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!$util.isString(message.data)) - return "data: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.app_version != null && message.hasOwnProperty("app_version")) - if (!$util.isInteger(message.app_version) && !(message.app_version && $util.isInteger(message.app_version.low) && $util.isInteger(message.app_version.high))) - return "app_version: integer|Long expected"; - if (message.last_block_height != null && message.hasOwnProperty("last_block_height")) - if (!$util.isInteger(message.last_block_height) && !(message.last_block_height && $util.isInteger(message.last_block_height.low) && $util.isInteger(message.last_block_height.high))) - return "last_block_height: integer|Long expected"; - if (message.last_block_app_hash != null && message.hasOwnProperty("last_block_app_hash")) - if (!(message.last_block_app_hash && typeof message.last_block_app_hash.length === "number" || $util.isString(message.last_block_app_hash))) - return "last_block_app_hash: buffer expected"; - return null; - }; - - /** - * Creates a ResponseInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseInfo - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseInfo} ResponseInfo - */ - ResponseInfo.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseInfo) - return object; - var message = new $root.tendermint.abci.ResponseInfo(); - if (object.data != null) - message.data = String(object.data); - if (object.version != null) - message.version = String(object.version); - if (object.app_version != null) - if ($util.Long) - (message.app_version = $util.Long.fromValue(object.app_version)).unsigned = true; - else if (typeof object.app_version === "string") - message.app_version = parseInt(object.app_version, 10); - else if (typeof object.app_version === "number") - message.app_version = object.app_version; - else if (typeof object.app_version === "object") - message.app_version = new $util.LongBits(object.app_version.low >>> 0, object.app_version.high >>> 0).toNumber(true); - if (object.last_block_height != null) - if ($util.Long) - (message.last_block_height = $util.Long.fromValue(object.last_block_height)).unsigned = false; - else if (typeof object.last_block_height === "string") - message.last_block_height = parseInt(object.last_block_height, 10); - else if (typeof object.last_block_height === "number") - message.last_block_height = object.last_block_height; - else if (typeof object.last_block_height === "object") - message.last_block_height = new $util.LongBits(object.last_block_height.low >>> 0, object.last_block_height.high >>> 0).toNumber(); - if (object.last_block_app_hash != null) - if (typeof object.last_block_app_hash === "string") - $util.base64.decode(object.last_block_app_hash, message.last_block_app_hash = $util.newBuffer($util.base64.length(object.last_block_app_hash)), 0); - else if (object.last_block_app_hash.length) - message.last_block_app_hash = object.last_block_app_hash; - return message; - }; - - /** - * Creates a plain object from a ResponseInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseInfo - * @static - * @param {tendermint.abci.ResponseInfo} message ResponseInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.data = ""; - object.version = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.app_version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.app_version = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.last_block_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.last_block_height = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.last_block_app_hash = ""; - else { - object.last_block_app_hash = []; - if (options.bytes !== Array) - object.last_block_app_hash = $util.newBuffer(object.last_block_app_hash); - } - } - if (message.data != null && message.hasOwnProperty("data")) - object.data = message.data; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.app_version != null && message.hasOwnProperty("app_version")) - if (typeof message.app_version === "number") - object.app_version = options.longs === String ? String(message.app_version) : message.app_version; - else - object.app_version = options.longs === String ? $util.Long.prototype.toString.call(message.app_version) : options.longs === Number ? new $util.LongBits(message.app_version.low >>> 0, message.app_version.high >>> 0).toNumber(true) : message.app_version; - if (message.last_block_height != null && message.hasOwnProperty("last_block_height")) - if (typeof message.last_block_height === "number") - object.last_block_height = options.longs === String ? String(message.last_block_height) : message.last_block_height; - else - object.last_block_height = options.longs === String ? $util.Long.prototype.toString.call(message.last_block_height) : options.longs === Number ? new $util.LongBits(message.last_block_height.low >>> 0, message.last_block_height.high >>> 0).toNumber() : message.last_block_height; - if (message.last_block_app_hash != null && message.hasOwnProperty("last_block_app_hash")) - object.last_block_app_hash = options.bytes === String ? $util.base64.encode(message.last_block_app_hash, 0, message.last_block_app_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_block_app_hash) : message.last_block_app_hash; - return object; - }; - - /** - * Converts this ResponseInfo to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseInfo - * @instance - * @returns {Object.} JSON object - */ - ResponseInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseInfo; - })(); - - abci.ResponseSetOption = (function() { - - /** - * Properties of a ResponseSetOption. - * @memberof tendermint.abci - * @interface IResponseSetOption - * @property {number|null} [code] ResponseSetOption code - * @property {string|null} [log] ResponseSetOption log - * @property {string|null} [info] ResponseSetOption info - */ - - /** - * Constructs a new ResponseSetOption. - * @memberof tendermint.abci - * @classdesc Represents a ResponseSetOption. - * @implements IResponseSetOption - * @constructor - * @param {tendermint.abci.IResponseSetOption=} [properties] Properties to set - */ - function ResponseSetOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseSetOption code. - * @member {number} code - * @memberof tendermint.abci.ResponseSetOption - * @instance - */ - ResponseSetOption.prototype.code = 0; - - /** - * ResponseSetOption log. - * @member {string} log - * @memberof tendermint.abci.ResponseSetOption - * @instance - */ - ResponseSetOption.prototype.log = ""; - - /** - * ResponseSetOption info. - * @member {string} info - * @memberof tendermint.abci.ResponseSetOption - * @instance - */ - ResponseSetOption.prototype.info = ""; - - /** - * Encodes the specified ResponseSetOption message. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseSetOption - * @static - * @param {tendermint.abci.IResponseSetOption} message ResponseSetOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseSetOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); - if (message.log != null && Object.hasOwnProperty.call(message, "log")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); - return writer; - }; - - /** - * Encodes the specified ResponseSetOption message, length delimited. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseSetOption - * @static - * @param {tendermint.abci.IResponseSetOption} message ResponseSetOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseSetOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseSetOption message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseSetOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseSetOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseSetOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseSetOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseSetOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseSetOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseSetOption message. - * @function verify - * @memberof tendermint.abci.ResponseSetOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseSetOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.log != null && message.hasOwnProperty("log")) - if (!$util.isString(message.log)) - return "log: string expected"; - if (message.info != null && message.hasOwnProperty("info")) - if (!$util.isString(message.info)) - return "info: string expected"; - return null; - }; - - /** - * Creates a ResponseSetOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseSetOption - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseSetOption} ResponseSetOption - */ - ResponseSetOption.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseSetOption) - return object; - var message = new $root.tendermint.abci.ResponseSetOption(); - if (object.code != null) - message.code = object.code >>> 0; - if (object.log != null) - message.log = String(object.log); - if (object.info != null) - message.info = String(object.info); - return message; - }; - - /** - * Creates a plain object from a ResponseSetOption message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseSetOption - * @static - * @param {tendermint.abci.ResponseSetOption} message ResponseSetOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseSetOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.code = 0; - object.log = ""; - object.info = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.log != null && message.hasOwnProperty("log")) - object.log = message.log; - if (message.info != null && message.hasOwnProperty("info")) - object.info = message.info; - return object; - }; - - /** - * Converts this ResponseSetOption to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseSetOption - * @instance - * @returns {Object.} JSON object - */ - ResponseSetOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseSetOption; - })(); - - abci.ResponseInitChain = (function() { - - /** - * Properties of a ResponseInitChain. - * @memberof tendermint.abci - * @interface IResponseInitChain - * @property {tendermint.abci.IConsensusParams|null} [consensus_params] ResponseInitChain consensus_params - * @property {Array.|null} [validators] ResponseInitChain validators - * @property {Uint8Array|null} [app_hash] ResponseInitChain app_hash - */ - - /** - * Constructs a new ResponseInitChain. - * @memberof tendermint.abci - * @classdesc Represents a ResponseInitChain. - * @implements IResponseInitChain - * @constructor - * @param {tendermint.abci.IResponseInitChain=} [properties] Properties to set - */ - function ResponseInitChain(properties) { - this.validators = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseInitChain consensus_params. - * @member {tendermint.abci.IConsensusParams|null|undefined} consensus_params - * @memberof tendermint.abci.ResponseInitChain - * @instance - */ - ResponseInitChain.prototype.consensus_params = null; - - /** - * ResponseInitChain validators. - * @member {Array.} validators - * @memberof tendermint.abci.ResponseInitChain - * @instance - */ - ResponseInitChain.prototype.validators = $util.emptyArray; - - /** - * ResponseInitChain app_hash. - * @member {Uint8Array} app_hash - * @memberof tendermint.abci.ResponseInitChain - * @instance - */ - ResponseInitChain.prototype.app_hash = $util.newBuffer([]); - - /** - * Encodes the specified ResponseInitChain message. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseInitChain - * @static - * @param {tendermint.abci.IResponseInitChain} message ResponseInitChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseInitChain.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consensus_params != null && Object.hasOwnProperty.call(message, "consensus_params")) - $root.tendermint.abci.ConsensusParams.encode(message.consensus_params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.validators != null && message.validators.length) - for (var i = 0; i < message.validators.length; ++i) - $root.tendermint.abci.ValidatorUpdate.encode(message.validators[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.app_hash != null && Object.hasOwnProperty.call(message, "app_hash")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.app_hash); - return writer; - }; - - /** - * Encodes the specified ResponseInitChain message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseInitChain - * @static - * @param {tendermint.abci.IResponseInitChain} message ResponseInitChain message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseInitChain.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseInitChain message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseInitChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseInitChain.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseInitChain(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.consensus_params = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.validators && message.validators.length)) - message.validators = []; - message.validators.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); - break; - case 3: - message.app_hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseInitChain message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseInitChain - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseInitChain.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseInitChain message. - * @function verify - * @memberof tendermint.abci.ResponseInitChain - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseInitChain.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consensus_params != null && message.hasOwnProperty("consensus_params")) { - var error = $root.tendermint.abci.ConsensusParams.verify(message.consensus_params); - if (error) - return "consensus_params." + error; - } - if (message.validators != null && message.hasOwnProperty("validators")) { - if (!Array.isArray(message.validators)) - return "validators: array expected"; - for (var i = 0; i < message.validators.length; ++i) { - var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validators[i]); - if (error) - return "validators." + error; - } - } - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - if (!(message.app_hash && typeof message.app_hash.length === "number" || $util.isString(message.app_hash))) - return "app_hash: buffer expected"; - return null; - }; - - /** - * Creates a ResponseInitChain message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseInitChain - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseInitChain} ResponseInitChain - */ - ResponseInitChain.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseInitChain) - return object; - var message = new $root.tendermint.abci.ResponseInitChain(); - if (object.consensus_params != null) { - if (typeof object.consensus_params !== "object") - throw TypeError(".tendermint.abci.ResponseInitChain.consensus_params: object expected"); - message.consensus_params = $root.tendermint.abci.ConsensusParams.fromObject(object.consensus_params); - } - if (object.validators) { - if (!Array.isArray(object.validators)) - throw TypeError(".tendermint.abci.ResponseInitChain.validators: array expected"); - message.validators = []; - for (var i = 0; i < object.validators.length; ++i) { - if (typeof object.validators[i] !== "object") - throw TypeError(".tendermint.abci.ResponseInitChain.validators: object expected"); - message.validators[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validators[i]); - } - } - if (object.app_hash != null) - if (typeof object.app_hash === "string") - $util.base64.decode(object.app_hash, message.app_hash = $util.newBuffer($util.base64.length(object.app_hash)), 0); - else if (object.app_hash.length) - message.app_hash = object.app_hash; - return message; - }; - - /** - * Creates a plain object from a ResponseInitChain message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseInitChain - * @static - * @param {tendermint.abci.ResponseInitChain} message ResponseInitChain - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseInitChain.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.validators = []; - if (options.defaults) { - object.consensus_params = null; - if (options.bytes === String) - object.app_hash = ""; - else { - object.app_hash = []; - if (options.bytes !== Array) - object.app_hash = $util.newBuffer(object.app_hash); - } - } - if (message.consensus_params != null && message.hasOwnProperty("consensus_params")) - object.consensus_params = $root.tendermint.abci.ConsensusParams.toObject(message.consensus_params, options); - if (message.validators && message.validators.length) { - object.validators = []; - for (var j = 0; j < message.validators.length; ++j) - object.validators[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validators[j], options); - } - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - object.app_hash = options.bytes === String ? $util.base64.encode(message.app_hash, 0, message.app_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.app_hash) : message.app_hash; - return object; - }; - - /** - * Converts this ResponseInitChain to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseInitChain - * @instance - * @returns {Object.} JSON object - */ - ResponseInitChain.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseInitChain; - })(); - - abci.ResponseQuery = (function() { - - /** - * Properties of a ResponseQuery. - * @memberof tendermint.abci - * @interface IResponseQuery - * @property {number|null} [code] ResponseQuery code - * @property {string|null} [log] ResponseQuery log - * @property {string|null} [info] ResponseQuery info - * @property {Long|null} [index] ResponseQuery index - * @property {Uint8Array|null} [key] ResponseQuery key - * @property {Uint8Array|null} [value] ResponseQuery value - * @property {tendermint.crypto.IProofOps|null} [proof_ops] ResponseQuery proof_ops - * @property {Long|null} [height] ResponseQuery height - * @property {string|null} [codespace] ResponseQuery codespace - */ - - /** - * Constructs a new ResponseQuery. - * @memberof tendermint.abci - * @classdesc Represents a ResponseQuery. - * @implements IResponseQuery - * @constructor - * @param {tendermint.abci.IResponseQuery=} [properties] Properties to set - */ - function ResponseQuery(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseQuery code. - * @member {number} code - * @memberof tendermint.abci.ResponseQuery - * @instance - */ - ResponseQuery.prototype.code = 0; - - /** - * ResponseQuery log. - * @member {string} log - * @memberof tendermint.abci.ResponseQuery - * @instance - */ - ResponseQuery.prototype.log = ""; - - /** - * ResponseQuery info. - * @member {string} info - * @memberof tendermint.abci.ResponseQuery - * @instance - */ - ResponseQuery.prototype.info = ""; - - /** - * ResponseQuery index. - * @member {Long} index - * @memberof tendermint.abci.ResponseQuery - * @instance - */ - ResponseQuery.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ResponseQuery key. - * @member {Uint8Array} key - * @memberof tendermint.abci.ResponseQuery - * @instance - */ - ResponseQuery.prototype.key = $util.newBuffer([]); - - /** - * ResponseQuery value. - * @member {Uint8Array} value - * @memberof tendermint.abci.ResponseQuery - * @instance - */ - ResponseQuery.prototype.value = $util.newBuffer([]); - - /** - * ResponseQuery proof_ops. - * @member {tendermint.crypto.IProofOps|null|undefined} proof_ops - * @memberof tendermint.abci.ResponseQuery - * @instance - */ - ResponseQuery.prototype.proof_ops = null; - - /** - * ResponseQuery height. - * @member {Long} height - * @memberof tendermint.abci.ResponseQuery - * @instance - */ - ResponseQuery.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ResponseQuery codespace. - * @member {string} codespace - * @memberof tendermint.abci.ResponseQuery - * @instance - */ - ResponseQuery.prototype.codespace = ""; - - /** - * Encodes the specified ResponseQuery message. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseQuery - * @static - * @param {tendermint.abci.IResponseQuery} message ResponseQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseQuery.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); - if (message.log != null && Object.hasOwnProperty.call(message, "log")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.index); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.value); - if (message.proof_ops != null && Object.hasOwnProperty.call(message, "proof_ops")) - $root.tendermint.crypto.ProofOps.encode(message.proof_ops, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.height); - if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.codespace); - return writer; - }; - - /** - * Encodes the specified ResponseQuery message, length delimited. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseQuery - * @static - * @param {tendermint.abci.IResponseQuery} message ResponseQuery message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseQuery message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseQuery} ResponseQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseQuery.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - case 5: - message.index = reader.int64(); - break; - case 6: - message.key = reader.bytes(); - break; - case 7: - message.value = reader.bytes(); - break; - case 8: - message.proof_ops = $root.tendermint.crypto.ProofOps.decode(reader, reader.uint32()); - break; - case 9: - message.height = reader.int64(); - break; - case 10: - message.codespace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseQuery} ResponseQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseQuery message. - * @function verify - * @memberof tendermint.abci.ResponseQuery - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseQuery.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.log != null && message.hasOwnProperty("log")) - if (!$util.isString(message.log)) - return "log: string expected"; - if (message.info != null && message.hasOwnProperty("info")) - if (!$util.isString(message.info)) - return "info: string expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) - return "index: integer|Long expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - if (message.proof_ops != null && message.hasOwnProperty("proof_ops")) { - var error = $root.tendermint.crypto.ProofOps.verify(message.proof_ops); - if (error) - return "proof_ops." + error; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.codespace != null && message.hasOwnProperty("codespace")) - if (!$util.isString(message.codespace)) - return "codespace: string expected"; - return null; - }; - - /** - * Creates a ResponseQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseQuery - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseQuery} ResponseQuery - */ - ResponseQuery.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseQuery) - return object; - var message = new $root.tendermint.abci.ResponseQuery(); - if (object.code != null) - message.code = object.code >>> 0; - if (object.log != null) - message.log = String(object.log); - if (object.info != null) - message.info = String(object.info); - if (object.index != null) - if ($util.Long) - (message.index = $util.Long.fromValue(object.index)).unsigned = false; - else if (typeof object.index === "string") - message.index = parseInt(object.index, 10); - else if (typeof object.index === "number") - message.index = object.index; - else if (typeof object.index === "object") - message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - if (object.proof_ops != null) { - if (typeof object.proof_ops !== "object") - throw TypeError(".tendermint.abci.ResponseQuery.proof_ops: object expected"); - message.proof_ops = $root.tendermint.crypto.ProofOps.fromObject(object.proof_ops); - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.codespace != null) - message.codespace = String(object.codespace); - return message; - }; - - /** - * Creates a plain object from a ResponseQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseQuery - * @static - * @param {tendermint.abci.ResponseQuery} message ResponseQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseQuery.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.code = 0; - object.log = ""; - object.info = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.index = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - object.proof_ops = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.codespace = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.log != null && message.hasOwnProperty("log")) - object.log = message.log; - if (message.info != null && message.hasOwnProperty("info")) - object.info = message.info; - if (message.index != null && message.hasOwnProperty("index")) - if (typeof message.index === "number") - object.index = options.longs === String ? String(message.index) : message.index; - else - object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - if (message.proof_ops != null && message.hasOwnProperty("proof_ops")) - object.proof_ops = $root.tendermint.crypto.ProofOps.toObject(message.proof_ops, options); - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.codespace != null && message.hasOwnProperty("codespace")) - object.codespace = message.codespace; - return object; - }; - - /** - * Converts this ResponseQuery to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseQuery - * @instance - * @returns {Object.} JSON object - */ - ResponseQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseQuery; - })(); - - abci.ResponseBeginBlock = (function() { - - /** - * Properties of a ResponseBeginBlock. - * @memberof tendermint.abci - * @interface IResponseBeginBlock - * @property {Array.|null} [events] ResponseBeginBlock events - */ - - /** - * Constructs a new ResponseBeginBlock. - * @memberof tendermint.abci - * @classdesc Represents a ResponseBeginBlock. - * @implements IResponseBeginBlock - * @constructor - * @param {tendermint.abci.IResponseBeginBlock=} [properties] Properties to set - */ - function ResponseBeginBlock(properties) { - this.events = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseBeginBlock events. - * @member {Array.} events - * @memberof tendermint.abci.ResponseBeginBlock - * @instance - */ - ResponseBeginBlock.prototype.events = $util.emptyArray; - - /** - * Encodes the specified ResponseBeginBlock message. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseBeginBlock - * @static - * @param {tendermint.abci.IResponseBeginBlock} message ResponseBeginBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseBeginBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.events != null && message.events.length) - for (var i = 0; i < message.events.length; ++i) - $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResponseBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseBeginBlock - * @static - * @param {tendermint.abci.IResponseBeginBlock} message ResponseBeginBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseBeginBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseBeginBlock message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseBeginBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseBeginBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseBeginBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.events && message.events.length)) - message.events = []; - message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseBeginBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseBeginBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseBeginBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseBeginBlock message. - * @function verify - * @memberof tendermint.abci.ResponseBeginBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseBeginBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.events != null && message.hasOwnProperty("events")) { - if (!Array.isArray(message.events)) - return "events: array expected"; - for (var i = 0; i < message.events.length; ++i) { - var error = $root.tendermint.abci.Event.verify(message.events[i]); - if (error) - return "events." + error; - } - } - return null; - }; - - /** - * Creates a ResponseBeginBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseBeginBlock - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock - */ - ResponseBeginBlock.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseBeginBlock) - return object; - var message = new $root.tendermint.abci.ResponseBeginBlock(); - if (object.events) { - if (!Array.isArray(object.events)) - throw TypeError(".tendermint.abci.ResponseBeginBlock.events: array expected"); - message.events = []; - for (var i = 0; i < object.events.length; ++i) { - if (typeof object.events[i] !== "object") - throw TypeError(".tendermint.abci.ResponseBeginBlock.events: object expected"); - message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ResponseBeginBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseBeginBlock - * @static - * @param {tendermint.abci.ResponseBeginBlock} message ResponseBeginBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseBeginBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.events = []; - if (message.events && message.events.length) { - object.events = []; - for (var j = 0; j < message.events.length; ++j) - object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); - } - return object; - }; - - /** - * Converts this ResponseBeginBlock to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseBeginBlock - * @instance - * @returns {Object.} JSON object - */ - ResponseBeginBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseBeginBlock; - })(); - - abci.ResponseCheckTx = (function() { - - /** - * Properties of a ResponseCheckTx. - * @memberof tendermint.abci - * @interface IResponseCheckTx - * @property {number|null} [code] ResponseCheckTx code - * @property {Uint8Array|null} [data] ResponseCheckTx data - * @property {string|null} [log] ResponseCheckTx log - * @property {string|null} [info] ResponseCheckTx info - * @property {Long|null} [gas_wanted] ResponseCheckTx gas_wanted - * @property {Long|null} [gas_used] ResponseCheckTx gas_used - * @property {Array.|null} [events] ResponseCheckTx events - * @property {string|null} [codespace] ResponseCheckTx codespace - */ - - /** - * Constructs a new ResponseCheckTx. - * @memberof tendermint.abci - * @classdesc Represents a ResponseCheckTx. - * @implements IResponseCheckTx - * @constructor - * @param {tendermint.abci.IResponseCheckTx=} [properties] Properties to set - */ - function ResponseCheckTx(properties) { - this.events = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseCheckTx code. - * @member {number} code - * @memberof tendermint.abci.ResponseCheckTx - * @instance - */ - ResponseCheckTx.prototype.code = 0; - - /** - * ResponseCheckTx data. - * @member {Uint8Array} data - * @memberof tendermint.abci.ResponseCheckTx - * @instance - */ - ResponseCheckTx.prototype.data = $util.newBuffer([]); - - /** - * ResponseCheckTx log. - * @member {string} log - * @memberof tendermint.abci.ResponseCheckTx - * @instance - */ - ResponseCheckTx.prototype.log = ""; - - /** - * ResponseCheckTx info. - * @member {string} info - * @memberof tendermint.abci.ResponseCheckTx - * @instance - */ - ResponseCheckTx.prototype.info = ""; - - /** - * ResponseCheckTx gas_wanted. - * @member {Long} gas_wanted - * @memberof tendermint.abci.ResponseCheckTx - * @instance - */ - ResponseCheckTx.prototype.gas_wanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ResponseCheckTx gas_used. - * @member {Long} gas_used - * @memberof tendermint.abci.ResponseCheckTx - * @instance - */ - ResponseCheckTx.prototype.gas_used = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ResponseCheckTx events. - * @member {Array.} events - * @memberof tendermint.abci.ResponseCheckTx - * @instance - */ - ResponseCheckTx.prototype.events = $util.emptyArray; - - /** - * ResponseCheckTx codespace. - * @member {string} codespace - * @memberof tendermint.abci.ResponseCheckTx - * @instance - */ - ResponseCheckTx.prototype.codespace = ""; - - /** - * Encodes the specified ResponseCheckTx message. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseCheckTx - * @static - * @param {tendermint.abci.IResponseCheckTx} message ResponseCheckTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseCheckTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - if (message.log != null && Object.hasOwnProperty.call(message, "log")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); - if (message.gas_wanted != null && Object.hasOwnProperty.call(message, "gas_wanted")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gas_wanted); - if (message.gas_used != null && Object.hasOwnProperty.call(message, "gas_used")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gas_used); - if (message.events != null && message.events.length) - for (var i = 0; i < message.events.length; ++i) - $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.codespace); - return writer; - }; - - /** - * Encodes the specified ResponseCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseCheckTx - * @static - * @param {tendermint.abci.IResponseCheckTx} message ResponseCheckTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseCheckTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseCheckTx message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseCheckTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseCheckTx.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseCheckTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - case 5: - message.gas_wanted = reader.int64(); - break; - case 6: - message.gas_used = reader.int64(); - break; - case 7: - if (!(message.events && message.events.length)) - message.events = []; - message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); - break; - case 8: - message.codespace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseCheckTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseCheckTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseCheckTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseCheckTx message. - * @function verify - * @memberof tendermint.abci.ResponseCheckTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseCheckTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.log != null && message.hasOwnProperty("log")) - if (!$util.isString(message.log)) - return "log: string expected"; - if (message.info != null && message.hasOwnProperty("info")) - if (!$util.isString(message.info)) - return "info: string expected"; - if (message.gas_wanted != null && message.hasOwnProperty("gas_wanted")) - if (!$util.isInteger(message.gas_wanted) && !(message.gas_wanted && $util.isInteger(message.gas_wanted.low) && $util.isInteger(message.gas_wanted.high))) - return "gas_wanted: integer|Long expected"; - if (message.gas_used != null && message.hasOwnProperty("gas_used")) - if (!$util.isInteger(message.gas_used) && !(message.gas_used && $util.isInteger(message.gas_used.low) && $util.isInteger(message.gas_used.high))) - return "gas_used: integer|Long expected"; - if (message.events != null && message.hasOwnProperty("events")) { - if (!Array.isArray(message.events)) - return "events: array expected"; - for (var i = 0; i < message.events.length; ++i) { - var error = $root.tendermint.abci.Event.verify(message.events[i]); - if (error) - return "events." + error; - } - } - if (message.codespace != null && message.hasOwnProperty("codespace")) - if (!$util.isString(message.codespace)) - return "codespace: string expected"; - return null; - }; - - /** - * Creates a ResponseCheckTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseCheckTx - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx - */ - ResponseCheckTx.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseCheckTx) - return object; - var message = new $root.tendermint.abci.ResponseCheckTx(); - if (object.code != null) - message.code = object.code >>> 0; - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.log != null) - message.log = String(object.log); - if (object.info != null) - message.info = String(object.info); - if (object.gas_wanted != null) - if ($util.Long) - (message.gas_wanted = $util.Long.fromValue(object.gas_wanted)).unsigned = false; - else if (typeof object.gas_wanted === "string") - message.gas_wanted = parseInt(object.gas_wanted, 10); - else if (typeof object.gas_wanted === "number") - message.gas_wanted = object.gas_wanted; - else if (typeof object.gas_wanted === "object") - message.gas_wanted = new $util.LongBits(object.gas_wanted.low >>> 0, object.gas_wanted.high >>> 0).toNumber(); - if (object.gas_used != null) - if ($util.Long) - (message.gas_used = $util.Long.fromValue(object.gas_used)).unsigned = false; - else if (typeof object.gas_used === "string") - message.gas_used = parseInt(object.gas_used, 10); - else if (typeof object.gas_used === "number") - message.gas_used = object.gas_used; - else if (typeof object.gas_used === "object") - message.gas_used = new $util.LongBits(object.gas_used.low >>> 0, object.gas_used.high >>> 0).toNumber(); - if (object.events) { - if (!Array.isArray(object.events)) - throw TypeError(".tendermint.abci.ResponseCheckTx.events: array expected"); - message.events = []; - for (var i = 0; i < object.events.length; ++i) { - if (typeof object.events[i] !== "object") - throw TypeError(".tendermint.abci.ResponseCheckTx.events: object expected"); - message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); - } - } - if (object.codespace != null) - message.codespace = String(object.codespace); - return message; - }; - - /** - * Creates a plain object from a ResponseCheckTx message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseCheckTx - * @static - * @param {tendermint.abci.ResponseCheckTx} message ResponseCheckTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseCheckTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.events = []; - if (options.defaults) { - object.code = 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.log = ""; - object.info = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.gas_wanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.gas_wanted = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.gas_used = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.gas_used = options.longs === String ? "0" : 0; - object.codespace = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.log != null && message.hasOwnProperty("log")) - object.log = message.log; - if (message.info != null && message.hasOwnProperty("info")) - object.info = message.info; - if (message.gas_wanted != null && message.hasOwnProperty("gas_wanted")) - if (typeof message.gas_wanted === "number") - object.gas_wanted = options.longs === String ? String(message.gas_wanted) : message.gas_wanted; - else - object.gas_wanted = options.longs === String ? $util.Long.prototype.toString.call(message.gas_wanted) : options.longs === Number ? new $util.LongBits(message.gas_wanted.low >>> 0, message.gas_wanted.high >>> 0).toNumber() : message.gas_wanted; - if (message.gas_used != null && message.hasOwnProperty("gas_used")) - if (typeof message.gas_used === "number") - object.gas_used = options.longs === String ? String(message.gas_used) : message.gas_used; - else - object.gas_used = options.longs === String ? $util.Long.prototype.toString.call(message.gas_used) : options.longs === Number ? new $util.LongBits(message.gas_used.low >>> 0, message.gas_used.high >>> 0).toNumber() : message.gas_used; - if (message.events && message.events.length) { - object.events = []; - for (var j = 0; j < message.events.length; ++j) - object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); - } - if (message.codespace != null && message.hasOwnProperty("codespace")) - object.codespace = message.codespace; - return object; - }; - - /** - * Converts this ResponseCheckTx to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseCheckTx - * @instance - * @returns {Object.} JSON object - */ - ResponseCheckTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseCheckTx; - })(); - - abci.ResponseDeliverTx = (function() { - - /** - * Properties of a ResponseDeliverTx. - * @memberof tendermint.abci - * @interface IResponseDeliverTx - * @property {number|null} [code] ResponseDeliverTx code - * @property {Uint8Array|null} [data] ResponseDeliverTx data - * @property {string|null} [log] ResponseDeliverTx log - * @property {string|null} [info] ResponseDeliverTx info - * @property {Long|null} [gas_wanted] ResponseDeliverTx gas_wanted - * @property {Long|null} [gas_used] ResponseDeliverTx gas_used - * @property {Array.|null} [events] ResponseDeliverTx events - * @property {string|null} [codespace] ResponseDeliverTx codespace - */ - - /** - * Constructs a new ResponseDeliverTx. - * @memberof tendermint.abci - * @classdesc Represents a ResponseDeliverTx. - * @implements IResponseDeliverTx - * @constructor - * @param {tendermint.abci.IResponseDeliverTx=} [properties] Properties to set - */ - function ResponseDeliverTx(properties) { - this.events = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseDeliverTx code. - * @member {number} code - * @memberof tendermint.abci.ResponseDeliverTx - * @instance - */ - ResponseDeliverTx.prototype.code = 0; - - /** - * ResponseDeliverTx data. - * @member {Uint8Array} data - * @memberof tendermint.abci.ResponseDeliverTx - * @instance - */ - ResponseDeliverTx.prototype.data = $util.newBuffer([]); - - /** - * ResponseDeliverTx log. - * @member {string} log - * @memberof tendermint.abci.ResponseDeliverTx - * @instance - */ - ResponseDeliverTx.prototype.log = ""; - - /** - * ResponseDeliverTx info. - * @member {string} info - * @memberof tendermint.abci.ResponseDeliverTx - * @instance - */ - ResponseDeliverTx.prototype.info = ""; - - /** - * ResponseDeliverTx gas_wanted. - * @member {Long} gas_wanted - * @memberof tendermint.abci.ResponseDeliverTx - * @instance - */ - ResponseDeliverTx.prototype.gas_wanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ResponseDeliverTx gas_used. - * @member {Long} gas_used - * @memberof tendermint.abci.ResponseDeliverTx - * @instance - */ - ResponseDeliverTx.prototype.gas_used = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ResponseDeliverTx events. - * @member {Array.} events - * @memberof tendermint.abci.ResponseDeliverTx - * @instance - */ - ResponseDeliverTx.prototype.events = $util.emptyArray; - - /** - * ResponseDeliverTx codespace. - * @member {string} codespace - * @memberof tendermint.abci.ResponseDeliverTx - * @instance - */ - ResponseDeliverTx.prototype.codespace = ""; - - /** - * Encodes the specified ResponseDeliverTx message. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseDeliverTx - * @static - * @param {tendermint.abci.IResponseDeliverTx} message ResponseDeliverTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseDeliverTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.code); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - if (message.log != null && Object.hasOwnProperty.call(message, "log")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.log); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.info); - if (message.gas_wanted != null && Object.hasOwnProperty.call(message, "gas_wanted")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gas_wanted); - if (message.gas_used != null && Object.hasOwnProperty.call(message, "gas_used")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gas_used); - if (message.events != null && message.events.length) - for (var i = 0; i < message.events.length; ++i) - $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.codespace != null && Object.hasOwnProperty.call(message, "codespace")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.codespace); - return writer; - }; - - /** - * Encodes the specified ResponseDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseDeliverTx - * @static - * @param {tendermint.abci.IResponseDeliverTx} message ResponseDeliverTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseDeliverTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseDeliverTx message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseDeliverTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseDeliverTx.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseDeliverTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint32(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.log = reader.string(); - break; - case 4: - message.info = reader.string(); - break; - case 5: - message.gas_wanted = reader.int64(); - break; - case 6: - message.gas_used = reader.int64(); - break; - case 7: - if (!(message.events && message.events.length)) - message.events = []; - message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); - break; - case 8: - message.codespace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseDeliverTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseDeliverTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseDeliverTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseDeliverTx message. - * @function verify - * @memberof tendermint.abci.ResponseDeliverTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseDeliverTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.log != null && message.hasOwnProperty("log")) - if (!$util.isString(message.log)) - return "log: string expected"; - if (message.info != null && message.hasOwnProperty("info")) - if (!$util.isString(message.info)) - return "info: string expected"; - if (message.gas_wanted != null && message.hasOwnProperty("gas_wanted")) - if (!$util.isInteger(message.gas_wanted) && !(message.gas_wanted && $util.isInteger(message.gas_wanted.low) && $util.isInteger(message.gas_wanted.high))) - return "gas_wanted: integer|Long expected"; - if (message.gas_used != null && message.hasOwnProperty("gas_used")) - if (!$util.isInteger(message.gas_used) && !(message.gas_used && $util.isInteger(message.gas_used.low) && $util.isInteger(message.gas_used.high))) - return "gas_used: integer|Long expected"; - if (message.events != null && message.hasOwnProperty("events")) { - if (!Array.isArray(message.events)) - return "events: array expected"; - for (var i = 0; i < message.events.length; ++i) { - var error = $root.tendermint.abci.Event.verify(message.events[i]); - if (error) - return "events." + error; - } - } - if (message.codespace != null && message.hasOwnProperty("codespace")) - if (!$util.isString(message.codespace)) - return "codespace: string expected"; - return null; - }; - - /** - * Creates a ResponseDeliverTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseDeliverTx - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx - */ - ResponseDeliverTx.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseDeliverTx) - return object; - var message = new $root.tendermint.abci.ResponseDeliverTx(); - if (object.code != null) - message.code = object.code >>> 0; - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.log != null) - message.log = String(object.log); - if (object.info != null) - message.info = String(object.info); - if (object.gas_wanted != null) - if ($util.Long) - (message.gas_wanted = $util.Long.fromValue(object.gas_wanted)).unsigned = false; - else if (typeof object.gas_wanted === "string") - message.gas_wanted = parseInt(object.gas_wanted, 10); - else if (typeof object.gas_wanted === "number") - message.gas_wanted = object.gas_wanted; - else if (typeof object.gas_wanted === "object") - message.gas_wanted = new $util.LongBits(object.gas_wanted.low >>> 0, object.gas_wanted.high >>> 0).toNumber(); - if (object.gas_used != null) - if ($util.Long) - (message.gas_used = $util.Long.fromValue(object.gas_used)).unsigned = false; - else if (typeof object.gas_used === "string") - message.gas_used = parseInt(object.gas_used, 10); - else if (typeof object.gas_used === "number") - message.gas_used = object.gas_used; - else if (typeof object.gas_used === "object") - message.gas_used = new $util.LongBits(object.gas_used.low >>> 0, object.gas_used.high >>> 0).toNumber(); - if (object.events) { - if (!Array.isArray(object.events)) - throw TypeError(".tendermint.abci.ResponseDeliverTx.events: array expected"); - message.events = []; - for (var i = 0; i < object.events.length; ++i) { - if (typeof object.events[i] !== "object") - throw TypeError(".tendermint.abci.ResponseDeliverTx.events: object expected"); - message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); - } - } - if (object.codespace != null) - message.codespace = String(object.codespace); - return message; - }; - - /** - * Creates a plain object from a ResponseDeliverTx message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseDeliverTx - * @static - * @param {tendermint.abci.ResponseDeliverTx} message ResponseDeliverTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseDeliverTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.events = []; - if (options.defaults) { - object.code = 0; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.log = ""; - object.info = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.gas_wanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.gas_wanted = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.gas_used = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.gas_used = options.longs === String ? "0" : 0; - object.codespace = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.log != null && message.hasOwnProperty("log")) - object.log = message.log; - if (message.info != null && message.hasOwnProperty("info")) - object.info = message.info; - if (message.gas_wanted != null && message.hasOwnProperty("gas_wanted")) - if (typeof message.gas_wanted === "number") - object.gas_wanted = options.longs === String ? String(message.gas_wanted) : message.gas_wanted; - else - object.gas_wanted = options.longs === String ? $util.Long.prototype.toString.call(message.gas_wanted) : options.longs === Number ? new $util.LongBits(message.gas_wanted.low >>> 0, message.gas_wanted.high >>> 0).toNumber() : message.gas_wanted; - if (message.gas_used != null && message.hasOwnProperty("gas_used")) - if (typeof message.gas_used === "number") - object.gas_used = options.longs === String ? String(message.gas_used) : message.gas_used; - else - object.gas_used = options.longs === String ? $util.Long.prototype.toString.call(message.gas_used) : options.longs === Number ? new $util.LongBits(message.gas_used.low >>> 0, message.gas_used.high >>> 0).toNumber() : message.gas_used; - if (message.events && message.events.length) { - object.events = []; - for (var j = 0; j < message.events.length; ++j) - object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); - } - if (message.codespace != null && message.hasOwnProperty("codespace")) - object.codespace = message.codespace; - return object; - }; - - /** - * Converts this ResponseDeliverTx to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseDeliverTx - * @instance - * @returns {Object.} JSON object - */ - ResponseDeliverTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseDeliverTx; - })(); - - abci.ResponseEndBlock = (function() { - - /** - * Properties of a ResponseEndBlock. - * @memberof tendermint.abci - * @interface IResponseEndBlock - * @property {Array.|null} [validator_updates] ResponseEndBlock validator_updates - * @property {tendermint.abci.IConsensusParams|null} [consensus_param_updates] ResponseEndBlock consensus_param_updates - * @property {Array.|null} [events] ResponseEndBlock events - */ - - /** - * Constructs a new ResponseEndBlock. - * @memberof tendermint.abci - * @classdesc Represents a ResponseEndBlock. - * @implements IResponseEndBlock - * @constructor - * @param {tendermint.abci.IResponseEndBlock=} [properties] Properties to set - */ - function ResponseEndBlock(properties) { - this.validator_updates = []; - this.events = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseEndBlock validator_updates. - * @member {Array.} validator_updates - * @memberof tendermint.abci.ResponseEndBlock - * @instance - */ - ResponseEndBlock.prototype.validator_updates = $util.emptyArray; - - /** - * ResponseEndBlock consensus_param_updates. - * @member {tendermint.abci.IConsensusParams|null|undefined} consensus_param_updates - * @memberof tendermint.abci.ResponseEndBlock - * @instance - */ - ResponseEndBlock.prototype.consensus_param_updates = null; - - /** - * ResponseEndBlock events. - * @member {Array.} events - * @memberof tendermint.abci.ResponseEndBlock - * @instance - */ - ResponseEndBlock.prototype.events = $util.emptyArray; - - /** - * Encodes the specified ResponseEndBlock message. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseEndBlock - * @static - * @param {tendermint.abci.IResponseEndBlock} message ResponseEndBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseEndBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.validator_updates != null && message.validator_updates.length) - for (var i = 0; i < message.validator_updates.length; ++i) - $root.tendermint.abci.ValidatorUpdate.encode(message.validator_updates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.consensus_param_updates != null && Object.hasOwnProperty.call(message, "consensus_param_updates")) - $root.tendermint.abci.ConsensusParams.encode(message.consensus_param_updates, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.events != null && message.events.length) - for (var i = 0; i < message.events.length; ++i) - $root.tendermint.abci.Event.encode(message.events[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResponseEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseEndBlock - * @static - * @param {tendermint.abci.IResponseEndBlock} message ResponseEndBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseEndBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseEndBlock message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseEndBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseEndBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseEndBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.validator_updates && message.validator_updates.length)) - message.validator_updates = []; - message.validator_updates.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32())); - break; - case 2: - message.consensus_param_updates = $root.tendermint.abci.ConsensusParams.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.events && message.events.length)) - message.events = []; - message.events.push($root.tendermint.abci.Event.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseEndBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseEndBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseEndBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseEndBlock message. - * @function verify - * @memberof tendermint.abci.ResponseEndBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseEndBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.validator_updates != null && message.hasOwnProperty("validator_updates")) { - if (!Array.isArray(message.validator_updates)) - return "validator_updates: array expected"; - for (var i = 0; i < message.validator_updates.length; ++i) { - var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validator_updates[i]); - if (error) - return "validator_updates." + error; - } - } - if (message.consensus_param_updates != null && message.hasOwnProperty("consensus_param_updates")) { - var error = $root.tendermint.abci.ConsensusParams.verify(message.consensus_param_updates); - if (error) - return "consensus_param_updates." + error; - } - if (message.events != null && message.hasOwnProperty("events")) { - if (!Array.isArray(message.events)) - return "events: array expected"; - for (var i = 0; i < message.events.length; ++i) { - var error = $root.tendermint.abci.Event.verify(message.events[i]); - if (error) - return "events." + error; - } - } - return null; - }; - - /** - * Creates a ResponseEndBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseEndBlock - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock - */ - ResponseEndBlock.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseEndBlock) - return object; - var message = new $root.tendermint.abci.ResponseEndBlock(); - if (object.validator_updates) { - if (!Array.isArray(object.validator_updates)) - throw TypeError(".tendermint.abci.ResponseEndBlock.validator_updates: array expected"); - message.validator_updates = []; - for (var i = 0; i < object.validator_updates.length; ++i) { - if (typeof object.validator_updates[i] !== "object") - throw TypeError(".tendermint.abci.ResponseEndBlock.validator_updates: object expected"); - message.validator_updates[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validator_updates[i]); - } - } - if (object.consensus_param_updates != null) { - if (typeof object.consensus_param_updates !== "object") - throw TypeError(".tendermint.abci.ResponseEndBlock.consensus_param_updates: object expected"); - message.consensus_param_updates = $root.tendermint.abci.ConsensusParams.fromObject(object.consensus_param_updates); - } - if (object.events) { - if (!Array.isArray(object.events)) - throw TypeError(".tendermint.abci.ResponseEndBlock.events: array expected"); - message.events = []; - for (var i = 0; i < object.events.length; ++i) { - if (typeof object.events[i] !== "object") - throw TypeError(".tendermint.abci.ResponseEndBlock.events: object expected"); - message.events[i] = $root.tendermint.abci.Event.fromObject(object.events[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ResponseEndBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseEndBlock - * @static - * @param {tendermint.abci.ResponseEndBlock} message ResponseEndBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseEndBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.validator_updates = []; - object.events = []; - } - if (options.defaults) - object.consensus_param_updates = null; - if (message.validator_updates && message.validator_updates.length) { - object.validator_updates = []; - for (var j = 0; j < message.validator_updates.length; ++j) - object.validator_updates[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validator_updates[j], options); - } - if (message.consensus_param_updates != null && message.hasOwnProperty("consensus_param_updates")) - object.consensus_param_updates = $root.tendermint.abci.ConsensusParams.toObject(message.consensus_param_updates, options); - if (message.events && message.events.length) { - object.events = []; - for (var j = 0; j < message.events.length; ++j) - object.events[j] = $root.tendermint.abci.Event.toObject(message.events[j], options); - } - return object; - }; - - /** - * Converts this ResponseEndBlock to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseEndBlock - * @instance - * @returns {Object.} JSON object - */ - ResponseEndBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseEndBlock; - })(); - - abci.ResponseCommit = (function() { - - /** - * Properties of a ResponseCommit. - * @memberof tendermint.abci - * @interface IResponseCommit - * @property {Uint8Array|null} [data] ResponseCommit data - * @property {Long|null} [retain_height] ResponseCommit retain_height - */ - - /** - * Constructs a new ResponseCommit. - * @memberof tendermint.abci - * @classdesc Represents a ResponseCommit. - * @implements IResponseCommit - * @constructor - * @param {tendermint.abci.IResponseCommit=} [properties] Properties to set - */ - function ResponseCommit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseCommit data. - * @member {Uint8Array} data - * @memberof tendermint.abci.ResponseCommit - * @instance - */ - ResponseCommit.prototype.data = $util.newBuffer([]); - - /** - * ResponseCommit retain_height. - * @member {Long} retain_height - * @memberof tendermint.abci.ResponseCommit - * @instance - */ - ResponseCommit.prototype.retain_height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified ResponseCommit message. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseCommit - * @static - * @param {tendermint.abci.IResponseCommit} message ResponseCommit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseCommit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - if (message.retain_height != null && Object.hasOwnProperty.call(message, "retain_height")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.retain_height); - return writer; - }; - - /** - * Encodes the specified ResponseCommit message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseCommit - * @static - * @param {tendermint.abci.IResponseCommit} message ResponseCommit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseCommit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseCommit message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseCommit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseCommit} ResponseCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseCommit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseCommit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.data = reader.bytes(); - break; - case 3: - message.retain_height = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseCommit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseCommit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseCommit} ResponseCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseCommit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseCommit message. - * @function verify - * @memberof tendermint.abci.ResponseCommit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseCommit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.retain_height != null && message.hasOwnProperty("retain_height")) - if (!$util.isInteger(message.retain_height) && !(message.retain_height && $util.isInteger(message.retain_height.low) && $util.isInteger(message.retain_height.high))) - return "retain_height: integer|Long expected"; - return null; - }; - - /** - * Creates a ResponseCommit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseCommit - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseCommit} ResponseCommit - */ - ResponseCommit.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseCommit) - return object; - var message = new $root.tendermint.abci.ResponseCommit(); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.retain_height != null) - if ($util.Long) - (message.retain_height = $util.Long.fromValue(object.retain_height)).unsigned = false; - else if (typeof object.retain_height === "string") - message.retain_height = parseInt(object.retain_height, 10); - else if (typeof object.retain_height === "number") - message.retain_height = object.retain_height; - else if (typeof object.retain_height === "object") - message.retain_height = new $util.LongBits(object.retain_height.low >>> 0, object.retain_height.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ResponseCommit message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseCommit - * @static - * @param {tendermint.abci.ResponseCommit} message ResponseCommit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseCommit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.retain_height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.retain_height = options.longs === String ? "0" : 0; - } - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.retain_height != null && message.hasOwnProperty("retain_height")) - if (typeof message.retain_height === "number") - object.retain_height = options.longs === String ? String(message.retain_height) : message.retain_height; - else - object.retain_height = options.longs === String ? $util.Long.prototype.toString.call(message.retain_height) : options.longs === Number ? new $util.LongBits(message.retain_height.low >>> 0, message.retain_height.high >>> 0).toNumber() : message.retain_height; - return object; - }; - - /** - * Converts this ResponseCommit to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseCommit - * @instance - * @returns {Object.} JSON object - */ - ResponseCommit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseCommit; - })(); - - abci.ResponseListSnapshots = (function() { - - /** - * Properties of a ResponseListSnapshots. - * @memberof tendermint.abci - * @interface IResponseListSnapshots - * @property {Array.|null} [snapshots] ResponseListSnapshots snapshots - */ - - /** - * Constructs a new ResponseListSnapshots. - * @memberof tendermint.abci - * @classdesc Represents a ResponseListSnapshots. - * @implements IResponseListSnapshots - * @constructor - * @param {tendermint.abci.IResponseListSnapshots=} [properties] Properties to set - */ - function ResponseListSnapshots(properties) { - this.snapshots = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseListSnapshots snapshots. - * @member {Array.} snapshots - * @memberof tendermint.abci.ResponseListSnapshots - * @instance - */ - ResponseListSnapshots.prototype.snapshots = $util.emptyArray; - - /** - * Encodes the specified ResponseListSnapshots message. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseListSnapshots - * @static - * @param {tendermint.abci.IResponseListSnapshots} message ResponseListSnapshots message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseListSnapshots.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshots != null && message.snapshots.length) - for (var i = 0; i < message.snapshots.length; ++i) - $root.tendermint.abci.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResponseListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseListSnapshots - * @static - * @param {tendermint.abci.IResponseListSnapshots} message ResponseListSnapshots message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseListSnapshots.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseListSnapshots message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseListSnapshots - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseListSnapshots.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseListSnapshots(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.snapshots && message.snapshots.length)) - message.snapshots = []; - message.snapshots.push($root.tendermint.abci.Snapshot.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseListSnapshots message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseListSnapshots - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseListSnapshots.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseListSnapshots message. - * @function verify - * @memberof tendermint.abci.ResponseListSnapshots - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseListSnapshots.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshots != null && message.hasOwnProperty("snapshots")) { - if (!Array.isArray(message.snapshots)) - return "snapshots: array expected"; - for (var i = 0; i < message.snapshots.length; ++i) { - var error = $root.tendermint.abci.Snapshot.verify(message.snapshots[i]); - if (error) - return "snapshots." + error; - } - } - return null; - }; - - /** - * Creates a ResponseListSnapshots message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseListSnapshots - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots - */ - ResponseListSnapshots.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseListSnapshots) - return object; - var message = new $root.tendermint.abci.ResponseListSnapshots(); - if (object.snapshots) { - if (!Array.isArray(object.snapshots)) - throw TypeError(".tendermint.abci.ResponseListSnapshots.snapshots: array expected"); - message.snapshots = []; - for (var i = 0; i < object.snapshots.length; ++i) { - if (typeof object.snapshots[i] !== "object") - throw TypeError(".tendermint.abci.ResponseListSnapshots.snapshots: object expected"); - message.snapshots[i] = $root.tendermint.abci.Snapshot.fromObject(object.snapshots[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ResponseListSnapshots message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseListSnapshots - * @static - * @param {tendermint.abci.ResponseListSnapshots} message ResponseListSnapshots - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseListSnapshots.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.snapshots = []; - if (message.snapshots && message.snapshots.length) { - object.snapshots = []; - for (var j = 0; j < message.snapshots.length; ++j) - object.snapshots[j] = $root.tendermint.abci.Snapshot.toObject(message.snapshots[j], options); - } - return object; - }; - - /** - * Converts this ResponseListSnapshots to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseListSnapshots - * @instance - * @returns {Object.} JSON object - */ - ResponseListSnapshots.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseListSnapshots; - })(); - - abci.ResponseOfferSnapshot = (function() { - - /** - * Properties of a ResponseOfferSnapshot. - * @memberof tendermint.abci - * @interface IResponseOfferSnapshot - * @property {tendermint.abci.ResponseOfferSnapshot.Result|null} [result] ResponseOfferSnapshot result - */ - - /** - * Constructs a new ResponseOfferSnapshot. - * @memberof tendermint.abci - * @classdesc Represents a ResponseOfferSnapshot. - * @implements IResponseOfferSnapshot - * @constructor - * @param {tendermint.abci.IResponseOfferSnapshot=} [properties] Properties to set - */ - function ResponseOfferSnapshot(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseOfferSnapshot result. - * @member {tendermint.abci.ResponseOfferSnapshot.Result} result - * @memberof tendermint.abci.ResponseOfferSnapshot - * @instance - */ - ResponseOfferSnapshot.prototype.result = 0; - - /** - * Encodes the specified ResponseOfferSnapshot message. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseOfferSnapshot - * @static - * @param {tendermint.abci.IResponseOfferSnapshot} message ResponseOfferSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseOfferSnapshot.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - return writer; - }; - - /** - * Encodes the specified ResponseOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseOfferSnapshot - * @static - * @param {tendermint.abci.IResponseOfferSnapshot} message ResponseOfferSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseOfferSnapshot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseOfferSnapshot message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseOfferSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseOfferSnapshot.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseOfferSnapshot(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseOfferSnapshot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseOfferSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseOfferSnapshot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseOfferSnapshot message. - * @function verify - * @memberof tendermint.abci.ResponseOfferSnapshot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseOfferSnapshot.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates a ResponseOfferSnapshot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseOfferSnapshot - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot - */ - ResponseOfferSnapshot.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseOfferSnapshot) - return object; - var message = new $root.tendermint.abci.ResponseOfferSnapshot(); - switch (object.result) { - case "UNKNOWN": - case 0: - message.result = 0; - break; - case "ACCEPT": - case 1: - message.result = 1; - break; - case "ABORT": - case 2: - message.result = 2; - break; - case "REJECT": - case 3: - message.result = 3; - break; - case "REJECT_FORMAT": - case 4: - message.result = 4; - break; - case "REJECT_SENDER": - case 5: - message.result = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from a ResponseOfferSnapshot message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseOfferSnapshot - * @static - * @param {tendermint.abci.ResponseOfferSnapshot} message ResponseOfferSnapshot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseOfferSnapshot.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.result = options.enums === String ? "UNKNOWN" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.tendermint.abci.ResponseOfferSnapshot.Result[message.result] : message.result; - return object; - }; - - /** - * Converts this ResponseOfferSnapshot to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseOfferSnapshot - * @instance - * @returns {Object.} JSON object - */ - ResponseOfferSnapshot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Result enum. - * @name tendermint.abci.ResponseOfferSnapshot.Result - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} ACCEPT=1 ACCEPT value - * @property {number} ABORT=2 ABORT value - * @property {number} REJECT=3 REJECT value - * @property {number} REJECT_FORMAT=4 REJECT_FORMAT value - * @property {number} REJECT_SENDER=5 REJECT_SENDER value - */ - ResponseOfferSnapshot.Result = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "ACCEPT"] = 1; - values[valuesById[2] = "ABORT"] = 2; - values[valuesById[3] = "REJECT"] = 3; - values[valuesById[4] = "REJECT_FORMAT"] = 4; - values[valuesById[5] = "REJECT_SENDER"] = 5; - return values; - })(); - - return ResponseOfferSnapshot; - })(); - - abci.ResponseLoadSnapshotChunk = (function() { - - /** - * Properties of a ResponseLoadSnapshotChunk. - * @memberof tendermint.abci - * @interface IResponseLoadSnapshotChunk - * @property {Uint8Array|null} [chunk] ResponseLoadSnapshotChunk chunk - */ - - /** - * Constructs a new ResponseLoadSnapshotChunk. - * @memberof tendermint.abci - * @classdesc Represents a ResponseLoadSnapshotChunk. - * @implements IResponseLoadSnapshotChunk - * @constructor - * @param {tendermint.abci.IResponseLoadSnapshotChunk=} [properties] Properties to set - */ - function ResponseLoadSnapshotChunk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseLoadSnapshotChunk chunk. - * @member {Uint8Array} chunk - * @memberof tendermint.abci.ResponseLoadSnapshotChunk - * @instance - */ - ResponseLoadSnapshotChunk.prototype.chunk = $util.newBuffer([]); - - /** - * Encodes the specified ResponseLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseLoadSnapshotChunk - * @static - * @param {tendermint.abci.IResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseLoadSnapshotChunk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.chunk); - return writer; - }; - - /** - * Encodes the specified ResponseLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseLoadSnapshotChunk - * @static - * @param {tendermint.abci.IResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseLoadSnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseLoadSnapshotChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseLoadSnapshotChunk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseLoadSnapshotChunk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.chunk = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseLoadSnapshotChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseLoadSnapshotChunk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseLoadSnapshotChunk message. - * @function verify - * @memberof tendermint.abci.ResponseLoadSnapshotChunk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseLoadSnapshotChunk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chunk != null && message.hasOwnProperty("chunk")) - if (!(message.chunk && typeof message.chunk.length === "number" || $util.isString(message.chunk))) - return "chunk: buffer expected"; - return null; - }; - - /** - * Creates a ResponseLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseLoadSnapshotChunk - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk - */ - ResponseLoadSnapshotChunk.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseLoadSnapshotChunk) - return object; - var message = new $root.tendermint.abci.ResponseLoadSnapshotChunk(); - if (object.chunk != null) - if (typeof object.chunk === "string") - $util.base64.decode(object.chunk, message.chunk = $util.newBuffer($util.base64.length(object.chunk)), 0); - else if (object.chunk.length) - message.chunk = object.chunk; - return message; - }; - - /** - * Creates a plain object from a ResponseLoadSnapshotChunk message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseLoadSnapshotChunk - * @static - * @param {tendermint.abci.ResponseLoadSnapshotChunk} message ResponseLoadSnapshotChunk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseLoadSnapshotChunk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.chunk = ""; - else { - object.chunk = []; - if (options.bytes !== Array) - object.chunk = $util.newBuffer(object.chunk); - } - if (message.chunk != null && message.hasOwnProperty("chunk")) - object.chunk = options.bytes === String ? $util.base64.encode(message.chunk, 0, message.chunk.length) : options.bytes === Array ? Array.prototype.slice.call(message.chunk) : message.chunk; - return object; - }; - - /** - * Converts this ResponseLoadSnapshotChunk to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseLoadSnapshotChunk - * @instance - * @returns {Object.} JSON object - */ - ResponseLoadSnapshotChunk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ResponseLoadSnapshotChunk; - })(); - - abci.ResponseApplySnapshotChunk = (function() { - - /** - * Properties of a ResponseApplySnapshotChunk. - * @memberof tendermint.abci - * @interface IResponseApplySnapshotChunk - * @property {tendermint.abci.ResponseApplySnapshotChunk.Result|null} [result] ResponseApplySnapshotChunk result - * @property {Array.|null} [refetch_chunks] ResponseApplySnapshotChunk refetch_chunks - * @property {Array.|null} [reject_senders] ResponseApplySnapshotChunk reject_senders - */ - - /** - * Constructs a new ResponseApplySnapshotChunk. - * @memberof tendermint.abci - * @classdesc Represents a ResponseApplySnapshotChunk. - * @implements IResponseApplySnapshotChunk - * @constructor - * @param {tendermint.abci.IResponseApplySnapshotChunk=} [properties] Properties to set - */ - function ResponseApplySnapshotChunk(properties) { - this.refetch_chunks = []; - this.reject_senders = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResponseApplySnapshotChunk result. - * @member {tendermint.abci.ResponseApplySnapshotChunk.Result} result - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @instance - */ - ResponseApplySnapshotChunk.prototype.result = 0; - - /** - * ResponseApplySnapshotChunk refetch_chunks. - * @member {Array.} refetch_chunks - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @instance - */ - ResponseApplySnapshotChunk.prototype.refetch_chunks = $util.emptyArray; - - /** - * ResponseApplySnapshotChunk reject_senders. - * @member {Array.} reject_senders - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @instance - */ - ResponseApplySnapshotChunk.prototype.reject_senders = $util.emptyArray; - - /** - * Encodes the specified ResponseApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @static - * @param {tendermint.abci.IResponseApplySnapshotChunk} message ResponseApplySnapshotChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseApplySnapshotChunk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.result); - if (message.refetch_chunks != null && message.refetch_chunks.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.refetch_chunks.length; ++i) - writer.uint32(message.refetch_chunks[i]); - writer.ldelim(); - } - if (message.reject_senders != null && message.reject_senders.length) - for (var i = 0; i < message.reject_senders.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.reject_senders[i]); - return writer; - }; - - /** - * Encodes the specified ResponseApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @static - * @param {tendermint.abci.IResponseApplySnapshotChunk} message ResponseApplySnapshotChunk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseApplySnapshotChunk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseApplySnapshotChunk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ResponseApplySnapshotChunk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - case 2: - if (!(message.refetch_chunks && message.refetch_chunks.length)) - message.refetch_chunks = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.refetch_chunks.push(reader.uint32()); - } else - message.refetch_chunks.push(reader.uint32()); - break; - case 3: - if (!(message.reject_senders && message.reject_senders.length)) - message.reject_senders = []; - message.reject_senders.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseApplySnapshotChunk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResponseApplySnapshotChunk message. - * @function verify - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseApplySnapshotChunk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.refetch_chunks != null && message.hasOwnProperty("refetch_chunks")) { - if (!Array.isArray(message.refetch_chunks)) - return "refetch_chunks: array expected"; - for (var i = 0; i < message.refetch_chunks.length; ++i) - if (!$util.isInteger(message.refetch_chunks[i])) - return "refetch_chunks: integer[] expected"; - } - if (message.reject_senders != null && message.hasOwnProperty("reject_senders")) { - if (!Array.isArray(message.reject_senders)) - return "reject_senders: array expected"; - for (var i = 0; i < message.reject_senders.length; ++i) - if (!$util.isString(message.reject_senders[i])) - return "reject_senders: string[] expected"; - } - return null; - }; - - /** - * Creates a ResponseApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk - */ - ResponseApplySnapshotChunk.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ResponseApplySnapshotChunk) - return object; - var message = new $root.tendermint.abci.ResponseApplySnapshotChunk(); - switch (object.result) { - case "UNKNOWN": - case 0: - message.result = 0; - break; - case "ACCEPT": - case 1: - message.result = 1; - break; - case "ABORT": - case 2: - message.result = 2; - break; - case "RETRY": - case 3: - message.result = 3; - break; - case "RETRY_SNAPSHOT": - case 4: - message.result = 4; - break; - case "REJECT_SNAPSHOT": - case 5: - message.result = 5; - break; - } - if (object.refetch_chunks) { - if (!Array.isArray(object.refetch_chunks)) - throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.refetch_chunks: array expected"); - message.refetch_chunks = []; - for (var i = 0; i < object.refetch_chunks.length; ++i) - message.refetch_chunks[i] = object.refetch_chunks[i] >>> 0; - } - if (object.reject_senders) { - if (!Array.isArray(object.reject_senders)) - throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.reject_senders: array expected"); - message.reject_senders = []; - for (var i = 0; i < object.reject_senders.length; ++i) - message.reject_senders[i] = String(object.reject_senders[i]); - } - return message; - }; - - /** - * Creates a plain object from a ResponseApplySnapshotChunk message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @static - * @param {tendermint.abci.ResponseApplySnapshotChunk} message ResponseApplySnapshotChunk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseApplySnapshotChunk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.refetch_chunks = []; - object.reject_senders = []; - } - if (options.defaults) - object.result = options.enums === String ? "UNKNOWN" : 0; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.tendermint.abci.ResponseApplySnapshotChunk.Result[message.result] : message.result; - if (message.refetch_chunks && message.refetch_chunks.length) { - object.refetch_chunks = []; - for (var j = 0; j < message.refetch_chunks.length; ++j) - object.refetch_chunks[j] = message.refetch_chunks[j]; - } - if (message.reject_senders && message.reject_senders.length) { - object.reject_senders = []; - for (var j = 0; j < message.reject_senders.length; ++j) - object.reject_senders[j] = message.reject_senders[j]; - } - return object; - }; - - /** - * Converts this ResponseApplySnapshotChunk to JSON. - * @function toJSON - * @memberof tendermint.abci.ResponseApplySnapshotChunk - * @instance - * @returns {Object.} JSON object - */ - ResponseApplySnapshotChunk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Result enum. - * @name tendermint.abci.ResponseApplySnapshotChunk.Result - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} ACCEPT=1 ACCEPT value - * @property {number} ABORT=2 ABORT value - * @property {number} RETRY=3 RETRY value - * @property {number} RETRY_SNAPSHOT=4 RETRY_SNAPSHOT value - * @property {number} REJECT_SNAPSHOT=5 REJECT_SNAPSHOT value - */ - ResponseApplySnapshotChunk.Result = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "ACCEPT"] = 1; - values[valuesById[2] = "ABORT"] = 2; - values[valuesById[3] = "RETRY"] = 3; - values[valuesById[4] = "RETRY_SNAPSHOT"] = 4; - values[valuesById[5] = "REJECT_SNAPSHOT"] = 5; - return values; - })(); - - return ResponseApplySnapshotChunk; - })(); - - abci.ConsensusParams = (function() { - - /** - * Properties of a ConsensusParams. - * @memberof tendermint.abci - * @interface IConsensusParams - * @property {tendermint.abci.IBlockParams|null} [block] ConsensusParams block - * @property {tendermint.types.IEvidenceParams|null} [evidence] ConsensusParams evidence - * @property {tendermint.types.IValidatorParams|null} [validator] ConsensusParams validator - * @property {tendermint.types.IVersionParams|null} [version] ConsensusParams version - */ - - /** - * Constructs a new ConsensusParams. - * @memberof tendermint.abci - * @classdesc Represents a ConsensusParams. - * @implements IConsensusParams - * @constructor - * @param {tendermint.abci.IConsensusParams=} [properties] Properties to set - */ - function ConsensusParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusParams block. - * @member {tendermint.abci.IBlockParams|null|undefined} block - * @memberof tendermint.abci.ConsensusParams - * @instance - */ - ConsensusParams.prototype.block = null; - - /** - * ConsensusParams evidence. - * @member {tendermint.types.IEvidenceParams|null|undefined} evidence - * @memberof tendermint.abci.ConsensusParams - * @instance - */ - ConsensusParams.prototype.evidence = null; - - /** - * ConsensusParams validator. - * @member {tendermint.types.IValidatorParams|null|undefined} validator - * @memberof tendermint.abci.ConsensusParams - * @instance - */ - ConsensusParams.prototype.validator = null; - - /** - * ConsensusParams version. - * @member {tendermint.types.IVersionParams|null|undefined} version - * @memberof tendermint.abci.ConsensusParams - * @instance - */ - ConsensusParams.prototype.version = null; - - /** - * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ConsensusParams - * @static - * @param {tendermint.abci.IConsensusParams} message ConsensusParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - $root.tendermint.abci.BlockParams.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) - $root.tendermint.types.EvidenceParams.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) - $root.tendermint.types.ValidatorParams.encode(message.validator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.tendermint.types.VersionParams.encode(message.version, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ConsensusParams - * @static - * @param {tendermint.abci.IConsensusParams} message ConsensusParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ConsensusParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ConsensusParams} ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ConsensusParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = $root.tendermint.abci.BlockParams.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = $root.tendermint.types.EvidenceParams.decode(reader, reader.uint32()); - break; - case 3: - message.validator = $root.tendermint.types.ValidatorParams.decode(reader, reader.uint32()); - break; - case 4: - message.version = $root.tendermint.types.VersionParams.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ConsensusParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ConsensusParams} ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusParams message. - * @function verify - * @memberof tendermint.abci.ConsensusParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block != null && message.hasOwnProperty("block")) { - var error = $root.tendermint.abci.BlockParams.verify(message.block); - if (error) - return "block." + error; - } - if (message.evidence != null && message.hasOwnProperty("evidence")) { - var error = $root.tendermint.types.EvidenceParams.verify(message.evidence); - if (error) - return "evidence." + error; - } - if (message.validator != null && message.hasOwnProperty("validator")) { - var error = $root.tendermint.types.ValidatorParams.verify(message.validator); - if (error) - return "validator." + error; - } - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.tendermint.types.VersionParams.verify(message.version); - if (error) - return "version." + error; - } - return null; - }; - - /** - * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ConsensusParams - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ConsensusParams} ConsensusParams - */ - ConsensusParams.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ConsensusParams) - return object; - var message = new $root.tendermint.abci.ConsensusParams(); - if (object.block != null) { - if (typeof object.block !== "object") - throw TypeError(".tendermint.abci.ConsensusParams.block: object expected"); - message.block = $root.tendermint.abci.BlockParams.fromObject(object.block); - } - if (object.evidence != null) { - if (typeof object.evidence !== "object") - throw TypeError(".tendermint.abci.ConsensusParams.evidence: object expected"); - message.evidence = $root.tendermint.types.EvidenceParams.fromObject(object.evidence); - } - if (object.validator != null) { - if (typeof object.validator !== "object") - throw TypeError(".tendermint.abci.ConsensusParams.validator: object expected"); - message.validator = $root.tendermint.types.ValidatorParams.fromObject(object.validator); - } - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".tendermint.abci.ConsensusParams.version: object expected"); - message.version = $root.tendermint.types.VersionParams.fromObject(object.version); - } - return message; - }; - - /** - * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ConsensusParams - * @static - * @param {tendermint.abci.ConsensusParams} message ConsensusParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.block = null; - object.evidence = null; - object.validator = null; - object.version = null; - } - if (message.block != null && message.hasOwnProperty("block")) - object.block = $root.tendermint.abci.BlockParams.toObject(message.block, options); - if (message.evidence != null && message.hasOwnProperty("evidence")) - object.evidence = $root.tendermint.types.EvidenceParams.toObject(message.evidence, options); - if (message.validator != null && message.hasOwnProperty("validator")) - object.validator = $root.tendermint.types.ValidatorParams.toObject(message.validator, options); - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.tendermint.types.VersionParams.toObject(message.version, options); - return object; - }; - - /** - * Converts this ConsensusParams to JSON. - * @function toJSON - * @memberof tendermint.abci.ConsensusParams - * @instance - * @returns {Object.} JSON object - */ - ConsensusParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusParams; - })(); - - abci.BlockParams = (function() { - - /** - * Properties of a BlockParams. - * @memberof tendermint.abci - * @interface IBlockParams - * @property {Long|null} [max_bytes] BlockParams max_bytes - * @property {Long|null} [max_gas] BlockParams max_gas - */ - - /** - * Constructs a new BlockParams. - * @memberof tendermint.abci - * @classdesc Represents a BlockParams. - * @implements IBlockParams - * @constructor - * @param {tendermint.abci.IBlockParams=} [properties] Properties to set - */ - function BlockParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockParams max_bytes. - * @member {Long} max_bytes - * @memberof tendermint.abci.BlockParams - * @instance - */ - BlockParams.prototype.max_bytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BlockParams max_gas. - * @member {Long} max_gas - * @memberof tendermint.abci.BlockParams - * @instance - */ - BlockParams.prototype.max_gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.BlockParams - * @static - * @param {tendermint.abci.IBlockParams} message BlockParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.max_bytes != null && Object.hasOwnProperty.call(message, "max_bytes")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.max_bytes); - if (message.max_gas != null && Object.hasOwnProperty.call(message, "max_gas")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.max_gas); - return writer; - }; - - /** - * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.BlockParams - * @static - * @param {tendermint.abci.IBlockParams} message BlockParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockParams message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.BlockParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.BlockParams} BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.BlockParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_bytes = reader.int64(); - break; - case 2: - message.max_gas = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.BlockParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.BlockParams} BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockParams message. - * @function verify - * @memberof tendermint.abci.BlockParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.max_bytes != null && message.hasOwnProperty("max_bytes")) - if (!$util.isInteger(message.max_bytes) && !(message.max_bytes && $util.isInteger(message.max_bytes.low) && $util.isInteger(message.max_bytes.high))) - return "max_bytes: integer|Long expected"; - if (message.max_gas != null && message.hasOwnProperty("max_gas")) - if (!$util.isInteger(message.max_gas) && !(message.max_gas && $util.isInteger(message.max_gas.low) && $util.isInteger(message.max_gas.high))) - return "max_gas: integer|Long expected"; - return null; - }; - - /** - * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.BlockParams - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.BlockParams} BlockParams - */ - BlockParams.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.BlockParams) - return object; - var message = new $root.tendermint.abci.BlockParams(); - if (object.max_bytes != null) - if ($util.Long) - (message.max_bytes = $util.Long.fromValue(object.max_bytes)).unsigned = false; - else if (typeof object.max_bytes === "string") - message.max_bytes = parseInt(object.max_bytes, 10); - else if (typeof object.max_bytes === "number") - message.max_bytes = object.max_bytes; - else if (typeof object.max_bytes === "object") - message.max_bytes = new $util.LongBits(object.max_bytes.low >>> 0, object.max_bytes.high >>> 0).toNumber(); - if (object.max_gas != null) - if ($util.Long) - (message.max_gas = $util.Long.fromValue(object.max_gas)).unsigned = false; - else if (typeof object.max_gas === "string") - message.max_gas = parseInt(object.max_gas, 10); - else if (typeof object.max_gas === "number") - message.max_gas = object.max_gas; - else if (typeof object.max_gas === "object") - message.max_gas = new $util.LongBits(object.max_gas.low >>> 0, object.max_gas.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a BlockParams message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.BlockParams - * @static - * @param {tendermint.abci.BlockParams} message BlockParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.max_bytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_bytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.max_gas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_gas = options.longs === String ? "0" : 0; - } - if (message.max_bytes != null && message.hasOwnProperty("max_bytes")) - if (typeof message.max_bytes === "number") - object.max_bytes = options.longs === String ? String(message.max_bytes) : message.max_bytes; - else - object.max_bytes = options.longs === String ? $util.Long.prototype.toString.call(message.max_bytes) : options.longs === Number ? new $util.LongBits(message.max_bytes.low >>> 0, message.max_bytes.high >>> 0).toNumber() : message.max_bytes; - if (message.max_gas != null && message.hasOwnProperty("max_gas")) - if (typeof message.max_gas === "number") - object.max_gas = options.longs === String ? String(message.max_gas) : message.max_gas; - else - object.max_gas = options.longs === String ? $util.Long.prototype.toString.call(message.max_gas) : options.longs === Number ? new $util.LongBits(message.max_gas.low >>> 0, message.max_gas.high >>> 0).toNumber() : message.max_gas; - return object; - }; - - /** - * Converts this BlockParams to JSON. - * @function toJSON - * @memberof tendermint.abci.BlockParams - * @instance - * @returns {Object.} JSON object - */ - BlockParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockParams; - })(); - - abci.LastCommitInfo = (function() { - - /** - * Properties of a LastCommitInfo. - * @memberof tendermint.abci - * @interface ILastCommitInfo - * @property {number|null} [round] LastCommitInfo round - * @property {Array.|null} [votes] LastCommitInfo votes - */ - - /** - * Constructs a new LastCommitInfo. - * @memberof tendermint.abci - * @classdesc Represents a LastCommitInfo. - * @implements ILastCommitInfo - * @constructor - * @param {tendermint.abci.ILastCommitInfo=} [properties] Properties to set - */ - function LastCommitInfo(properties) { - this.votes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LastCommitInfo round. - * @member {number} round - * @memberof tendermint.abci.LastCommitInfo - * @instance - */ - LastCommitInfo.prototype.round = 0; - - /** - * LastCommitInfo votes. - * @member {Array.} votes - * @memberof tendermint.abci.LastCommitInfo - * @instance - */ - LastCommitInfo.prototype.votes = $util.emptyArray; - - /** - * Encodes the specified LastCommitInfo message. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.LastCommitInfo - * @static - * @param {tendermint.abci.ILastCommitInfo} message LastCommitInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LastCommitInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.round); - if (message.votes != null && message.votes.length) - for (var i = 0; i < message.votes.length; ++i) - $root.tendermint.abci.VoteInfo.encode(message.votes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LastCommitInfo message, length delimited. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.LastCommitInfo - * @static - * @param {tendermint.abci.ILastCommitInfo} message LastCommitInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LastCommitInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LastCommitInfo message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.LastCommitInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LastCommitInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.LastCommitInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.round = reader.int32(); - break; - case 2: - if (!(message.votes && message.votes.length)) - message.votes = []; - message.votes.push($root.tendermint.abci.VoteInfo.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LastCommitInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.LastCommitInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LastCommitInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LastCommitInfo message. - * @function verify - * @memberof tendermint.abci.LastCommitInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LastCommitInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.votes != null && message.hasOwnProperty("votes")) { - if (!Array.isArray(message.votes)) - return "votes: array expected"; - for (var i = 0; i < message.votes.length; ++i) { - var error = $root.tendermint.abci.VoteInfo.verify(message.votes[i]); - if (error) - return "votes." + error; - } - } - return null; - }; - - /** - * Creates a LastCommitInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.LastCommitInfo - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.LastCommitInfo} LastCommitInfo - */ - LastCommitInfo.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.LastCommitInfo) - return object; - var message = new $root.tendermint.abci.LastCommitInfo(); - if (object.round != null) - message.round = object.round | 0; - if (object.votes) { - if (!Array.isArray(object.votes)) - throw TypeError(".tendermint.abci.LastCommitInfo.votes: array expected"); - message.votes = []; - for (var i = 0; i < object.votes.length; ++i) { - if (typeof object.votes[i] !== "object") - throw TypeError(".tendermint.abci.LastCommitInfo.votes: object expected"); - message.votes[i] = $root.tendermint.abci.VoteInfo.fromObject(object.votes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a LastCommitInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.LastCommitInfo - * @static - * @param {tendermint.abci.LastCommitInfo} message LastCommitInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LastCommitInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.votes = []; - if (options.defaults) - object.round = 0; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.votes && message.votes.length) { - object.votes = []; - for (var j = 0; j < message.votes.length; ++j) - object.votes[j] = $root.tendermint.abci.VoteInfo.toObject(message.votes[j], options); - } - return object; - }; - - /** - * Converts this LastCommitInfo to JSON. - * @function toJSON - * @memberof tendermint.abci.LastCommitInfo - * @instance - * @returns {Object.} JSON object - */ - LastCommitInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return LastCommitInfo; - })(); - - abci.Event = (function() { - - /** - * Properties of an Event. - * @memberof tendermint.abci - * @interface IEvent - * @property {string|null} [type] Event type - * @property {Array.|null} [attributes] Event attributes - */ - - /** - * Constructs a new Event. - * @memberof tendermint.abci - * @classdesc Represents an Event. - * @implements IEvent - * @constructor - * @param {tendermint.abci.IEvent=} [properties] Properties to set - */ - function Event(properties) { - this.attributes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Event type. - * @member {string} type - * @memberof tendermint.abci.Event - * @instance - */ - Event.prototype.type = ""; - - /** - * Event attributes. - * @member {Array.} attributes - * @memberof tendermint.abci.Event - * @instance - */ - Event.prototype.attributes = $util.emptyArray; - - /** - * Encodes the specified Event message. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.Event - * @static - * @param {tendermint.abci.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.attributes != null && message.attributes.length) - for (var i = 0; i < message.attributes.length; ++i) - $root.tendermint.abci.EventAttribute.encode(message.attributes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.Event - * @static - * @param {tendermint.abci.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Event message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Event(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - if (!(message.attributes && message.attributes.length)) - message.attributes = []; - message.attributes.push($root.tendermint.abci.EventAttribute.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Event message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Event message. - * @function verify - * @memberof tendermint.abci.Event - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Event.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) - return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.tendermint.abci.EventAttribute.verify(message.attributes[i]); - if (error) - return "attributes." + error; - } - } - return null; - }; - - /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.Event - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.Event} Event - */ - Event.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.Event) - return object; - var message = new $root.tendermint.abci.Event(); - if (object.type != null) - message.type = String(object.type); - if (object.attributes) { - if (!Array.isArray(object.attributes)) - throw TypeError(".tendermint.abci.Event.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object.attributes.length; ++i) { - if (typeof object.attributes[i] !== "object") - throw TypeError(".tendermint.abci.Event.attributes: object expected"); - message.attributes[i] = $root.tendermint.abci.EventAttribute.fromObject(object.attributes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.Event - * @static - * @param {tendermint.abci.Event} message Event - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Event.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attributes = []; - if (options.defaults) - object.type = ""; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.attributes && message.attributes.length) { - object.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) - object.attributes[j] = $root.tendermint.abci.EventAttribute.toObject(message.attributes[j], options); - } - return object; - }; - - /** - * Converts this Event to JSON. - * @function toJSON - * @memberof tendermint.abci.Event - * @instance - * @returns {Object.} JSON object - */ - Event.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Event; - })(); - - abci.EventAttribute = (function() { - - /** - * Properties of an EventAttribute. - * @memberof tendermint.abci - * @interface IEventAttribute - * @property {Uint8Array|null} [key] EventAttribute key - * @property {Uint8Array|null} [value] EventAttribute value - * @property {boolean|null} [index] EventAttribute index - */ - - /** - * Constructs a new EventAttribute. - * @memberof tendermint.abci - * @classdesc Represents an EventAttribute. - * @implements IEventAttribute - * @constructor - * @param {tendermint.abci.IEventAttribute=} [properties] Properties to set - */ - function EventAttribute(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EventAttribute key. - * @member {Uint8Array} key - * @memberof tendermint.abci.EventAttribute - * @instance - */ - EventAttribute.prototype.key = $util.newBuffer([]); - - /** - * EventAttribute value. - * @member {Uint8Array} value - * @memberof tendermint.abci.EventAttribute - * @instance - */ - EventAttribute.prototype.value = $util.newBuffer([]); - - /** - * EventAttribute index. - * @member {boolean} index - * @memberof tendermint.abci.EventAttribute - * @instance - */ - EventAttribute.prototype.index = false; - - /** - * Encodes the specified EventAttribute message. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.EventAttribute - * @static - * @param {tendermint.abci.IEventAttribute} message EventAttribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EventAttribute.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.index); - return writer; - }; - - /** - * Encodes the specified EventAttribute message, length delimited. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.EventAttribute - * @static - * @param {tendermint.abci.IEventAttribute} message EventAttribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EventAttribute.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EventAttribute message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.EventAttribute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.EventAttribute} EventAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EventAttribute.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.EventAttribute(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.bytes(); - break; - case 2: - message.value = reader.bytes(); - break; - case 3: - message.index = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EventAttribute message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.EventAttribute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.EventAttribute} EventAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EventAttribute.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EventAttribute message. - * @function verify - * @memberof tendermint.abci.EventAttribute - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EventAttribute.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (typeof message.index !== "boolean") - return "index: boolean expected"; - return null; - }; - - /** - * Creates an EventAttribute message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.EventAttribute - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.EventAttribute} EventAttribute - */ - EventAttribute.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.EventAttribute) - return object; - var message = new $root.tendermint.abci.EventAttribute(); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - if (object.index != null) - message.index = Boolean(object.index); - return message; - }; - - /** - * Creates a plain object from an EventAttribute message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.EventAttribute - * @static - * @param {tendermint.abci.EventAttribute} message EventAttribute - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EventAttribute.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.key = ""; - else { - object.key = []; - if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); - } - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - object.index = false; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - return object; - }; - - /** - * Converts this EventAttribute to JSON. - * @function toJSON - * @memberof tendermint.abci.EventAttribute - * @instance - * @returns {Object.} JSON object - */ - EventAttribute.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EventAttribute; - })(); - - abci.TxResult = (function() { - - /** - * Properties of a TxResult. - * @memberof tendermint.abci - * @interface ITxResult - * @property {Long|null} [height] TxResult height - * @property {number|null} [index] TxResult index - * @property {Uint8Array|null} [tx] TxResult tx - * @property {tendermint.abci.IResponseDeliverTx|null} [result] TxResult result - */ - - /** - * Constructs a new TxResult. - * @memberof tendermint.abci - * @classdesc Represents a TxResult. - * @implements ITxResult - * @constructor - * @param {tendermint.abci.ITxResult=} [properties] Properties to set - */ - function TxResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TxResult height. - * @member {Long} height - * @memberof tendermint.abci.TxResult - * @instance - */ - TxResult.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TxResult index. - * @member {number} index - * @memberof tendermint.abci.TxResult - * @instance - */ - TxResult.prototype.index = 0; - - /** - * TxResult tx. - * @member {Uint8Array} tx - * @memberof tendermint.abci.TxResult - * @instance - */ - TxResult.prototype.tx = $util.newBuffer([]); - - /** - * TxResult result. - * @member {tendermint.abci.IResponseDeliverTx|null|undefined} result - * @memberof tendermint.abci.TxResult - * @instance - */ - TxResult.prototype.result = null; - - /** - * Encodes the specified TxResult message. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.TxResult - * @static - * @param {tendermint.abci.ITxResult} message TxResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index); - if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.tx); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - $root.tendermint.abci.ResponseDeliverTx.encode(message.result, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TxResult message, length delimited. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.TxResult - * @static - * @param {tendermint.abci.ITxResult} message TxResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TxResult message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.TxResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.TxResult} TxResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.TxResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.int64(); - break; - case 2: - message.index = reader.uint32(); - break; - case 3: - message.tx = reader.bytes(); - break; - case 4: - message.result = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TxResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.TxResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.TxResult} TxResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TxResult message. - * @function verify - * @memberof tendermint.abci.TxResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TxResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.tx != null && message.hasOwnProperty("tx")) - if (!(message.tx && typeof message.tx.length === "number" || $util.isString(message.tx))) - return "tx: buffer expected"; - if (message.result != null && message.hasOwnProperty("result")) { - var error = $root.tendermint.abci.ResponseDeliverTx.verify(message.result); - if (error) - return "result." + error; - } - return null; - }; - - /** - * Creates a TxResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.TxResult - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.TxResult} TxResult - */ - TxResult.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.TxResult) - return object; - var message = new $root.tendermint.abci.TxResult(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.index != null) - message.index = object.index >>> 0; - if (object.tx != null) - if (typeof object.tx === "string") - $util.base64.decode(object.tx, message.tx = $util.newBuffer($util.base64.length(object.tx)), 0); - else if (object.tx.length) - message.tx = object.tx; - if (object.result != null) { - if (typeof object.result !== "object") - throw TypeError(".tendermint.abci.TxResult.result: object expected"); - message.result = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.result); - } - return message; - }; - - /** - * Creates a plain object from a TxResult message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.TxResult - * @static - * @param {tendermint.abci.TxResult} message TxResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TxResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.index = 0; - if (options.bytes === String) - object.tx = ""; - else { - object.tx = []; - if (options.bytes !== Array) - object.tx = $util.newBuffer(object.tx); - } - object.result = null; - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.tx != null && message.hasOwnProperty("tx")) - object.tx = options.bytes === String ? $util.base64.encode(message.tx, 0, message.tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx) : message.tx; - if (message.result != null && message.hasOwnProperty("result")) - object.result = $root.tendermint.abci.ResponseDeliverTx.toObject(message.result, options); - return object; - }; - - /** - * Converts this TxResult to JSON. - * @function toJSON - * @memberof tendermint.abci.TxResult - * @instance - * @returns {Object.} JSON object - */ - TxResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TxResult; - })(); - - abci.Validator = (function() { - - /** - * Properties of a Validator. - * @memberof tendermint.abci - * @interface IValidator - * @property {Uint8Array|null} [address] Validator address - * @property {Long|null} [power] Validator power - */ - - /** - * Constructs a new Validator. - * @memberof tendermint.abci - * @classdesc Represents a Validator. - * @implements IValidator - * @constructor - * @param {tendermint.abci.IValidator=} [properties] Properties to set - */ - function Validator(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Validator address. - * @member {Uint8Array} address - * @memberof tendermint.abci.Validator - * @instance - */ - Validator.prototype.address = $util.newBuffer([]); - - /** - * Validator power. - * @member {Long} power - * @memberof tendermint.abci.Validator - * @instance - */ - Validator.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified Validator message. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.Validator - * @static - * @param {tendermint.abci.IValidator} message Validator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Validator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); - if (message.power != null && Object.hasOwnProperty.call(message, "power")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.power); - return writer; - }; - - /** - * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.Validator - * @static - * @param {tendermint.abci.IValidator} message Validator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Validator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.Validator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.Validator} Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Validator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Validator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.bytes(); - break; - case 3: - message.power = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Validator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.Validator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.Validator} Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Validator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Validator message. - * @function verify - * @memberof tendermint.abci.Validator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Validator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) - return "address: buffer expected"; - if (message.power != null && message.hasOwnProperty("power")) - if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) - return "power: integer|Long expected"; - return null; - }; - - /** - * Creates a Validator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.Validator - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.Validator} Validator - */ - Validator.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.Validator) - return object; - var message = new $root.tendermint.abci.Validator(); - if (object.address != null) - if (typeof object.address === "string") - $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); - else if (object.address.length) - message.address = object.address; - if (object.power != null) - if ($util.Long) - (message.power = $util.Long.fromValue(object.power)).unsigned = false; - else if (typeof object.power === "string") - message.power = parseInt(object.power, 10); - else if (typeof object.power === "number") - message.power = object.power; - else if (typeof object.power === "object") - message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Validator message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.Validator - * @static - * @param {tendermint.abci.Validator} message Validator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Validator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.address = ""; - else { - object.address = []; - if (options.bytes !== Array) - object.address = $util.newBuffer(object.address); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.power = options.longs === String ? "0" : 0; - } - if (message.address != null && message.hasOwnProperty("address")) - object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; - if (message.power != null && message.hasOwnProperty("power")) - if (typeof message.power === "number") - object.power = options.longs === String ? String(message.power) : message.power; - else - object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; - return object; - }; - - /** - * Converts this Validator to JSON. - * @function toJSON - * @memberof tendermint.abci.Validator - * @instance - * @returns {Object.} JSON object - */ - Validator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Validator; - })(); - - abci.ValidatorUpdate = (function() { - - /** - * Properties of a ValidatorUpdate. - * @memberof tendermint.abci - * @interface IValidatorUpdate - * @property {tendermint.crypto.IPublicKey|null} [pub_key] ValidatorUpdate pub_key - * @property {Long|null} [power] ValidatorUpdate power - */ - - /** - * Constructs a new ValidatorUpdate. - * @memberof tendermint.abci - * @classdesc Represents a ValidatorUpdate. - * @implements IValidatorUpdate - * @constructor - * @param {tendermint.abci.IValidatorUpdate=} [properties] Properties to set - */ - function ValidatorUpdate(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidatorUpdate pub_key. - * @member {tendermint.crypto.IPublicKey|null|undefined} pub_key - * @memberof tendermint.abci.ValidatorUpdate - * @instance - */ - ValidatorUpdate.prototype.pub_key = null; - - /** - * ValidatorUpdate power. - * @member {Long} power - * @memberof tendermint.abci.ValidatorUpdate - * @instance - */ - ValidatorUpdate.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified ValidatorUpdate message. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.ValidatorUpdate - * @static - * @param {tendermint.abci.IValidatorUpdate} message ValidatorUpdate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorUpdate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key")) - $root.tendermint.crypto.PublicKey.encode(message.pub_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.power != null && Object.hasOwnProperty.call(message, "power")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.power); - return writer; - }; - - /** - * Encodes the specified ValidatorUpdate message, length delimited. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.ValidatorUpdate - * @static - * @param {tendermint.abci.IValidatorUpdate} message ValidatorUpdate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorUpdate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidatorUpdate message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.ValidatorUpdate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorUpdate.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.ValidatorUpdate(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pub_key = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); - break; - case 2: - message.power = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidatorUpdate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.ValidatorUpdate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorUpdate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidatorUpdate message. - * @function verify - * @memberof tendermint.abci.ValidatorUpdate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidatorUpdate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) { - var error = $root.tendermint.crypto.PublicKey.verify(message.pub_key); - if (error) - return "pub_key." + error; - } - if (message.power != null && message.hasOwnProperty("power")) - if (!$util.isInteger(message.power) && !(message.power && $util.isInteger(message.power.low) && $util.isInteger(message.power.high))) - return "power: integer|Long expected"; - return null; - }; - - /** - * Creates a ValidatorUpdate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.ValidatorUpdate - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate - */ - ValidatorUpdate.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.ValidatorUpdate) - return object; - var message = new $root.tendermint.abci.ValidatorUpdate(); - if (object.pub_key != null) { - if (typeof object.pub_key !== "object") - throw TypeError(".tendermint.abci.ValidatorUpdate.pub_key: object expected"); - message.pub_key = $root.tendermint.crypto.PublicKey.fromObject(object.pub_key); - } - if (object.power != null) - if ($util.Long) - (message.power = $util.Long.fromValue(object.power)).unsigned = false; - else if (typeof object.power === "string") - message.power = parseInt(object.power, 10); - else if (typeof object.power === "number") - message.power = object.power; - else if (typeof object.power === "object") - message.power = new $util.LongBits(object.power.low >>> 0, object.power.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ValidatorUpdate message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.ValidatorUpdate - * @static - * @param {tendermint.abci.ValidatorUpdate} message ValidatorUpdate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidatorUpdate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pub_key = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.power = options.longs === String ? "0" : 0; - } - if (message.pub_key != null && message.hasOwnProperty("pub_key")) - object.pub_key = $root.tendermint.crypto.PublicKey.toObject(message.pub_key, options); - if (message.power != null && message.hasOwnProperty("power")) - if (typeof message.power === "number") - object.power = options.longs === String ? String(message.power) : message.power; - else - object.power = options.longs === String ? $util.Long.prototype.toString.call(message.power) : options.longs === Number ? new $util.LongBits(message.power.low >>> 0, message.power.high >>> 0).toNumber() : message.power; - return object; - }; - - /** - * Converts this ValidatorUpdate to JSON. - * @function toJSON - * @memberof tendermint.abci.ValidatorUpdate - * @instance - * @returns {Object.} JSON object - */ - ValidatorUpdate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValidatorUpdate; - })(); - - abci.VoteInfo = (function() { - - /** - * Properties of a VoteInfo. - * @memberof tendermint.abci - * @interface IVoteInfo - * @property {tendermint.abci.IValidator|null} [validator] VoteInfo validator - * @property {boolean|null} [signed_last_block] VoteInfo signed_last_block - */ - - /** - * Constructs a new VoteInfo. - * @memberof tendermint.abci - * @classdesc Represents a VoteInfo. - * @implements IVoteInfo - * @constructor - * @param {tendermint.abci.IVoteInfo=} [properties] Properties to set - */ - function VoteInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VoteInfo validator. - * @member {tendermint.abci.IValidator|null|undefined} validator - * @memberof tendermint.abci.VoteInfo - * @instance - */ - VoteInfo.prototype.validator = null; - - /** - * VoteInfo signed_last_block. - * @member {boolean} signed_last_block - * @memberof tendermint.abci.VoteInfo - * @instance - */ - VoteInfo.prototype.signed_last_block = false; - - /** - * Encodes the specified VoteInfo message. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.VoteInfo - * @static - * @param {tendermint.abci.IVoteInfo} message VoteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VoteInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) - $root.tendermint.abci.Validator.encode(message.validator, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.signed_last_block != null && Object.hasOwnProperty.call(message, "signed_last_block")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.signed_last_block); - return writer; - }; - - /** - * Encodes the specified VoteInfo message, length delimited. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.VoteInfo - * @static - * @param {tendermint.abci.IVoteInfo} message VoteInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VoteInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VoteInfo message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.VoteInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.VoteInfo} VoteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VoteInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.VoteInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validator = $root.tendermint.abci.Validator.decode(reader, reader.uint32()); - break; - case 2: - message.signed_last_block = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VoteInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.VoteInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.VoteInfo} VoteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VoteInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VoteInfo message. - * @function verify - * @memberof tendermint.abci.VoteInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VoteInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.validator != null && message.hasOwnProperty("validator")) { - var error = $root.tendermint.abci.Validator.verify(message.validator); - if (error) - return "validator." + error; - } - if (message.signed_last_block != null && message.hasOwnProperty("signed_last_block")) - if (typeof message.signed_last_block !== "boolean") - return "signed_last_block: boolean expected"; - return null; - }; - - /** - * Creates a VoteInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.VoteInfo - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.VoteInfo} VoteInfo - */ - VoteInfo.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.VoteInfo) - return object; - var message = new $root.tendermint.abci.VoteInfo(); - if (object.validator != null) { - if (typeof object.validator !== "object") - throw TypeError(".tendermint.abci.VoteInfo.validator: object expected"); - message.validator = $root.tendermint.abci.Validator.fromObject(object.validator); - } - if (object.signed_last_block != null) - message.signed_last_block = Boolean(object.signed_last_block); - return message; - }; - - /** - * Creates a plain object from a VoteInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.VoteInfo - * @static - * @param {tendermint.abci.VoteInfo} message VoteInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VoteInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.validator = null; - object.signed_last_block = false; - } - if (message.validator != null && message.hasOwnProperty("validator")) - object.validator = $root.tendermint.abci.Validator.toObject(message.validator, options); - if (message.signed_last_block != null && message.hasOwnProperty("signed_last_block")) - object.signed_last_block = message.signed_last_block; - return object; - }; - - /** - * Converts this VoteInfo to JSON. - * @function toJSON - * @memberof tendermint.abci.VoteInfo - * @instance - * @returns {Object.} JSON object - */ - VoteInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VoteInfo; - })(); - - /** - * EvidenceType enum. - * @name tendermint.abci.EvidenceType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} DUPLICATE_VOTE=1 DUPLICATE_VOTE value - * @property {number} LIGHT_CLIENT_ATTACK=2 LIGHT_CLIENT_ATTACK value - */ - abci.EvidenceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "DUPLICATE_VOTE"] = 1; - values[valuesById[2] = "LIGHT_CLIENT_ATTACK"] = 2; - return values; - })(); - - abci.Evidence = (function() { - - /** - * Properties of an Evidence. - * @memberof tendermint.abci - * @interface IEvidence - * @property {tendermint.abci.EvidenceType|null} [type] Evidence type - * @property {tendermint.abci.IValidator|null} [validator] Evidence validator - * @property {Long|null} [height] Evidence height - * @property {google.protobuf.ITimestamp|null} [time] Evidence time - * @property {Long|null} [total_voting_power] Evidence total_voting_power - */ - - /** - * Constructs a new Evidence. - * @memberof tendermint.abci - * @classdesc Represents an Evidence. - * @implements IEvidence - * @constructor - * @param {tendermint.abci.IEvidence=} [properties] Properties to set - */ - function Evidence(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Evidence type. - * @member {tendermint.abci.EvidenceType} type - * @memberof tendermint.abci.Evidence - * @instance - */ - Evidence.prototype.type = 0; - - /** - * Evidence validator. - * @member {tendermint.abci.IValidator|null|undefined} validator - * @memberof tendermint.abci.Evidence - * @instance - */ - Evidence.prototype.validator = null; - - /** - * Evidence height. - * @member {Long} height - * @memberof tendermint.abci.Evidence - * @instance - */ - Evidence.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Evidence time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof tendermint.abci.Evidence - * @instance - */ - Evidence.prototype.time = null; - - /** - * Evidence total_voting_power. - * @member {Long} total_voting_power - * @memberof tendermint.abci.Evidence - * @instance - */ - Evidence.prototype.total_voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified Evidence message. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.Evidence - * @static - * @param {tendermint.abci.IEvidence} message Evidence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evidence.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) - $root.tendermint.abci.Validator.encode(message.validator, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.total_voting_power != null && Object.hasOwnProperty.call(message, "total_voting_power")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.total_voting_power); - return writer; - }; - - /** - * Encodes the specified Evidence message, length delimited. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.Evidence - * @static - * @param {tendermint.abci.IEvidence} message Evidence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evidence.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Evidence message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.Evidence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.Evidence} Evidence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evidence.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Evidence(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.validator = $root.tendermint.abci.Validator.decode(reader, reader.uint32()); - break; - case 3: - message.height = reader.int64(); - break; - case 4: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.total_voting_power = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Evidence message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.Evidence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.Evidence} Evidence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evidence.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Evidence message. - * @function verify - * @memberof tendermint.abci.Evidence - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Evidence.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.validator != null && message.hasOwnProperty("validator")) { - var error = $root.tendermint.abci.Validator.verify(message.validator); - if (error) - return "validator." + error; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - if (message.total_voting_power != null && message.hasOwnProperty("total_voting_power")) - if (!$util.isInteger(message.total_voting_power) && !(message.total_voting_power && $util.isInteger(message.total_voting_power.low) && $util.isInteger(message.total_voting_power.high))) - return "total_voting_power: integer|Long expected"; - return null; - }; - - /** - * Creates an Evidence message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.Evidence - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.Evidence} Evidence - */ - Evidence.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.Evidence) - return object; - var message = new $root.tendermint.abci.Evidence(); - switch (object.type) { - case "UNKNOWN": - case 0: - message.type = 0; - break; - case "DUPLICATE_VOTE": - case 1: - message.type = 1; - break; - case "LIGHT_CLIENT_ATTACK": - case 2: - message.type = 2; - break; - } - if (object.validator != null) { - if (typeof object.validator !== "object") - throw TypeError(".tendermint.abci.Evidence.validator: object expected"); - message.validator = $root.tendermint.abci.Validator.fromObject(object.validator); - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".tendermint.abci.Evidence.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.total_voting_power != null) - if ($util.Long) - (message.total_voting_power = $util.Long.fromValue(object.total_voting_power)).unsigned = false; - else if (typeof object.total_voting_power === "string") - message.total_voting_power = parseInt(object.total_voting_power, 10); - else if (typeof object.total_voting_power === "number") - message.total_voting_power = object.total_voting_power; - else if (typeof object.total_voting_power === "object") - message.total_voting_power = new $util.LongBits(object.total_voting_power.low >>> 0, object.total_voting_power.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Evidence message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.Evidence - * @static - * @param {tendermint.abci.Evidence} message Evidence - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Evidence.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "UNKNOWN" : 0; - object.validator = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.time = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.total_voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total_voting_power = options.longs === String ? "0" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.tendermint.abci.EvidenceType[message.type] : message.type; - if (message.validator != null && message.hasOwnProperty("validator")) - object.validator = $root.tendermint.abci.Validator.toObject(message.validator, options); - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (message.total_voting_power != null && message.hasOwnProperty("total_voting_power")) - if (typeof message.total_voting_power === "number") - object.total_voting_power = options.longs === String ? String(message.total_voting_power) : message.total_voting_power; - else - object.total_voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.total_voting_power) : options.longs === Number ? new $util.LongBits(message.total_voting_power.low >>> 0, message.total_voting_power.high >>> 0).toNumber() : message.total_voting_power; - return object; - }; - - /** - * Converts this Evidence to JSON. - * @function toJSON - * @memberof tendermint.abci.Evidence - * @instance - * @returns {Object.} JSON object - */ - Evidence.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Evidence; - })(); - - abci.Snapshot = (function() { - - /** - * Properties of a Snapshot. - * @memberof tendermint.abci - * @interface ISnapshot - * @property {Long|null} [height] Snapshot height - * @property {number|null} [format] Snapshot format - * @property {number|null} [chunks] Snapshot chunks - * @property {Uint8Array|null} [hash] Snapshot hash - * @property {Uint8Array|null} [metadata] Snapshot metadata - */ - - /** - * Constructs a new Snapshot. - * @memberof tendermint.abci - * @classdesc Represents a Snapshot. - * @implements ISnapshot - * @constructor - * @param {tendermint.abci.ISnapshot=} [properties] Properties to set - */ - function Snapshot(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Snapshot height. - * @member {Long} height - * @memberof tendermint.abci.Snapshot - * @instance - */ - Snapshot.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Snapshot format. - * @member {number} format - * @memberof tendermint.abci.Snapshot - * @instance - */ - Snapshot.prototype.format = 0; - - /** - * Snapshot chunks. - * @member {number} chunks - * @memberof tendermint.abci.Snapshot - * @instance - */ - Snapshot.prototype.chunks = 0; - - /** - * Snapshot hash. - * @member {Uint8Array} hash - * @memberof tendermint.abci.Snapshot - * @instance - */ - Snapshot.prototype.hash = $util.newBuffer([]); - - /** - * Snapshot metadata. - * @member {Uint8Array} metadata - * @memberof tendermint.abci.Snapshot - * @instance - */ - Snapshot.prototype.metadata = $util.newBuffer([]); - - /** - * Encodes the specified Snapshot message. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. - * @function encode - * @memberof tendermint.abci.Snapshot - * @static - * @param {tendermint.abci.ISnapshot} message Snapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Snapshot.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.format); - if (message.chunks != null && Object.hasOwnProperty.call(message, "chunks")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.chunks); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.metadata); - return writer; - }; - - /** - * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.abci.Snapshot - * @static - * @param {tendermint.abci.ISnapshot} message Snapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Snapshot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Snapshot message from the specified reader or buffer. - * @function decode - * @memberof tendermint.abci.Snapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.abci.Snapshot} Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Snapshot.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.abci.Snapshot(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.uint64(); - break; - case 2: - message.format = reader.uint32(); - break; - case 3: - message.chunks = reader.uint32(); - break; - case 4: - message.hash = reader.bytes(); - break; - case 5: - message.metadata = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Snapshot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.abci.Snapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.abci.Snapshot} Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Snapshot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Snapshot message. - * @function verify - * @memberof tendermint.abci.Snapshot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Snapshot.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.format != null && message.hasOwnProperty("format")) - if (!$util.isInteger(message.format)) - return "format: integer expected"; - if (message.chunks != null && message.hasOwnProperty("chunks")) - if (!$util.isInteger(message.chunks)) - return "chunks: integer expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) - if (!(message.metadata && typeof message.metadata.length === "number" || $util.isString(message.metadata))) - return "metadata: buffer expected"; - return null; - }; - - /** - * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.abci.Snapshot - * @static - * @param {Object.} object Plain object - * @returns {tendermint.abci.Snapshot} Snapshot - */ - Snapshot.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.abci.Snapshot) - return object; - var message = new $root.tendermint.abci.Snapshot(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = true; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); - if (object.format != null) - message.format = object.format >>> 0; - if (object.chunks != null) - message.chunks = object.chunks >>> 0; - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - if (object.metadata != null) - if (typeof object.metadata === "string") - $util.base64.decode(object.metadata, message.metadata = $util.newBuffer($util.base64.length(object.metadata)), 0); - else if (object.metadata.length) - message.metadata = object.metadata; - return message; - }; - - /** - * Creates a plain object from a Snapshot message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.abci.Snapshot - * @static - * @param {tendermint.abci.Snapshot} message Snapshot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Snapshot.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.format = 0; - object.chunks = 0; - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - if (options.bytes === String) - object.metadata = ""; - else { - object.metadata = []; - if (options.bytes !== Array) - object.metadata = $util.newBuffer(object.metadata); - } - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height; - if (message.format != null && message.hasOwnProperty("format")) - object.format = message.format; - if (message.chunks != null && message.hasOwnProperty("chunks")) - object.chunks = message.chunks; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = options.bytes === String ? $util.base64.encode(message.metadata, 0, message.metadata.length) : options.bytes === Array ? Array.prototype.slice.call(message.metadata) : message.metadata; - return object; - }; - - /** - * Converts this Snapshot to JSON. - * @function toJSON - * @memberof tendermint.abci.Snapshot - * @instance - * @returns {Object.} JSON object - */ - Snapshot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Snapshot; - })(); - - abci.ABCIApplication = (function() { - - /** - * Constructs a new ABCIApplication service. - * @memberof tendermint.abci - * @classdesc Represents a ABCIApplication - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function ABCIApplication(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ABCIApplication.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ABCIApplication; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#echo}. - * @memberof tendermint.abci.ABCIApplication - * @typedef EchoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseEcho} [response] ResponseEcho - */ - - /** - * Calls Echo. - * @function echo - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestEcho} request RequestEcho message or plain object - * @param {tendermint.abci.ABCIApplication.EchoCallback} callback Node-style callback called with the error, if any, and ResponseEcho - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.echo = function echo(request, callback) { - return this.rpcCall(echo, $root.tendermint.abci.RequestEcho, $root.tendermint.abci.ResponseEcho, request, callback); - }, "name", { value: "Echo" }); - - /** - * Calls Echo. - * @function echo - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestEcho} request RequestEcho message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#flush}. - * @memberof tendermint.abci.ABCIApplication - * @typedef FlushCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseFlush} [response] ResponseFlush - */ - - /** - * Calls Flush. - * @function flush - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestFlush} request RequestFlush message or plain object - * @param {tendermint.abci.ABCIApplication.FlushCallback} callback Node-style callback called with the error, if any, and ResponseFlush - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.flush = function flush(request, callback) { - return this.rpcCall(flush, $root.tendermint.abci.RequestFlush, $root.tendermint.abci.ResponseFlush, request, callback); - }, "name", { value: "Flush" }); - - /** - * Calls Flush. - * @function flush - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestFlush} request RequestFlush message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#info}. - * @memberof tendermint.abci.ABCIApplication - * @typedef InfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseInfo} [response] ResponseInfo - */ - - /** - * Calls Info. - * @function info - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestInfo} request RequestInfo message or plain object - * @param {tendermint.abci.ABCIApplication.InfoCallback} callback Node-style callback called with the error, if any, and ResponseInfo - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.info = function info(request, callback) { - return this.rpcCall(info, $root.tendermint.abci.RequestInfo, $root.tendermint.abci.ResponseInfo, request, callback); - }, "name", { value: "Info" }); - - /** - * Calls Info. - * @function info - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestInfo} request RequestInfo message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#setOption}. - * @memberof tendermint.abci.ABCIApplication - * @typedef SetOptionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseSetOption} [response] ResponseSetOption - */ - - /** - * Calls SetOption. - * @function setOption - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestSetOption} request RequestSetOption message or plain object - * @param {tendermint.abci.ABCIApplication.SetOptionCallback} callback Node-style callback called with the error, if any, and ResponseSetOption - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.setOption = function setOption(request, callback) { - return this.rpcCall(setOption, $root.tendermint.abci.RequestSetOption, $root.tendermint.abci.ResponseSetOption, request, callback); - }, "name", { value: "SetOption" }); - - /** - * Calls SetOption. - * @function setOption - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestSetOption} request RequestSetOption message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#deliverTx}. - * @memberof tendermint.abci.ABCIApplication - * @typedef DeliverTxCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseDeliverTx} [response] ResponseDeliverTx - */ - - /** - * Calls DeliverTx. - * @function deliverTx - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestDeliverTx} request RequestDeliverTx message or plain object - * @param {tendermint.abci.ABCIApplication.DeliverTxCallback} callback Node-style callback called with the error, if any, and ResponseDeliverTx - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.deliverTx = function deliverTx(request, callback) { - return this.rpcCall(deliverTx, $root.tendermint.abci.RequestDeliverTx, $root.tendermint.abci.ResponseDeliverTx, request, callback); - }, "name", { value: "DeliverTx" }); - - /** - * Calls DeliverTx. - * @function deliverTx - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestDeliverTx} request RequestDeliverTx message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#checkTx}. - * @memberof tendermint.abci.ABCIApplication - * @typedef CheckTxCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseCheckTx} [response] ResponseCheckTx - */ - - /** - * Calls CheckTx. - * @function checkTx - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestCheckTx} request RequestCheckTx message or plain object - * @param {tendermint.abci.ABCIApplication.CheckTxCallback} callback Node-style callback called with the error, if any, and ResponseCheckTx - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.checkTx = function checkTx(request, callback) { - return this.rpcCall(checkTx, $root.tendermint.abci.RequestCheckTx, $root.tendermint.abci.ResponseCheckTx, request, callback); - }, "name", { value: "CheckTx" }); - - /** - * Calls CheckTx. - * @function checkTx - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestCheckTx} request RequestCheckTx message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#query}. - * @memberof tendermint.abci.ABCIApplication - * @typedef QueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseQuery} [response] ResponseQuery - */ - - /** - * Calls Query. - * @function query - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestQuery} request RequestQuery message or plain object - * @param {tendermint.abci.ABCIApplication.QueryCallback} callback Node-style callback called with the error, if any, and ResponseQuery - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.query = function query(request, callback) { - return this.rpcCall(query, $root.tendermint.abci.RequestQuery, $root.tendermint.abci.ResponseQuery, request, callback); - }, "name", { value: "Query" }); - - /** - * Calls Query. - * @function query - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestQuery} request RequestQuery message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#commit}. - * @memberof tendermint.abci.ABCIApplication - * @typedef CommitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseCommit} [response] ResponseCommit - */ - - /** - * Calls Commit. - * @function commit - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestCommit} request RequestCommit message or plain object - * @param {tendermint.abci.ABCIApplication.CommitCallback} callback Node-style callback called with the error, if any, and ResponseCommit - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.commit = function commit(request, callback) { - return this.rpcCall(commit, $root.tendermint.abci.RequestCommit, $root.tendermint.abci.ResponseCommit, request, callback); - }, "name", { value: "Commit" }); - - /** - * Calls Commit. - * @function commit - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestCommit} request RequestCommit message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#initChain}. - * @memberof tendermint.abci.ABCIApplication - * @typedef InitChainCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseInitChain} [response] ResponseInitChain - */ - - /** - * Calls InitChain. - * @function initChain - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestInitChain} request RequestInitChain message or plain object - * @param {tendermint.abci.ABCIApplication.InitChainCallback} callback Node-style callback called with the error, if any, and ResponseInitChain - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.initChain = function initChain(request, callback) { - return this.rpcCall(initChain, $root.tendermint.abci.RequestInitChain, $root.tendermint.abci.ResponseInitChain, request, callback); - }, "name", { value: "InitChain" }); - - /** - * Calls InitChain. - * @function initChain - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestInitChain} request RequestInitChain message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#beginBlock}. - * @memberof tendermint.abci.ABCIApplication - * @typedef BeginBlockCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseBeginBlock} [response] ResponseBeginBlock - */ - - /** - * Calls BeginBlock. - * @function beginBlock - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestBeginBlock} request RequestBeginBlock message or plain object - * @param {tendermint.abci.ABCIApplication.BeginBlockCallback} callback Node-style callback called with the error, if any, and ResponseBeginBlock - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.beginBlock = function beginBlock(request, callback) { - return this.rpcCall(beginBlock, $root.tendermint.abci.RequestBeginBlock, $root.tendermint.abci.ResponseBeginBlock, request, callback); - }, "name", { value: "BeginBlock" }); - - /** - * Calls BeginBlock. - * @function beginBlock - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestBeginBlock} request RequestBeginBlock message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#endBlock}. - * @memberof tendermint.abci.ABCIApplication - * @typedef EndBlockCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseEndBlock} [response] ResponseEndBlock - */ - - /** - * Calls EndBlock. - * @function endBlock - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestEndBlock} request RequestEndBlock message or plain object - * @param {tendermint.abci.ABCIApplication.EndBlockCallback} callback Node-style callback called with the error, if any, and ResponseEndBlock - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.endBlock = function endBlock(request, callback) { - return this.rpcCall(endBlock, $root.tendermint.abci.RequestEndBlock, $root.tendermint.abci.ResponseEndBlock, request, callback); - }, "name", { value: "EndBlock" }); - - /** - * Calls EndBlock. - * @function endBlock - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestEndBlock} request RequestEndBlock message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#listSnapshots}. - * @memberof tendermint.abci.ABCIApplication - * @typedef ListSnapshotsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseListSnapshots} [response] ResponseListSnapshots - */ - - /** - * Calls ListSnapshots. - * @function listSnapshots - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestListSnapshots} request RequestListSnapshots message or plain object - * @param {tendermint.abci.ABCIApplication.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ResponseListSnapshots - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.listSnapshots = function listSnapshots(request, callback) { - return this.rpcCall(listSnapshots, $root.tendermint.abci.RequestListSnapshots, $root.tendermint.abci.ResponseListSnapshots, request, callback); - }, "name", { value: "ListSnapshots" }); - - /** - * Calls ListSnapshots. - * @function listSnapshots - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestListSnapshots} request RequestListSnapshots message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#offerSnapshot}. - * @memberof tendermint.abci.ABCIApplication - * @typedef OfferSnapshotCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseOfferSnapshot} [response] ResponseOfferSnapshot - */ - - /** - * Calls OfferSnapshot. - * @function offerSnapshot - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestOfferSnapshot} request RequestOfferSnapshot message or plain object - * @param {tendermint.abci.ABCIApplication.OfferSnapshotCallback} callback Node-style callback called with the error, if any, and ResponseOfferSnapshot - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.offerSnapshot = function offerSnapshot(request, callback) { - return this.rpcCall(offerSnapshot, $root.tendermint.abci.RequestOfferSnapshot, $root.tendermint.abci.ResponseOfferSnapshot, request, callback); - }, "name", { value: "OfferSnapshot" }); - - /** - * Calls OfferSnapshot. - * @function offerSnapshot - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestOfferSnapshot} request RequestOfferSnapshot message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#loadSnapshotChunk}. - * @memberof tendermint.abci.ABCIApplication - * @typedef LoadSnapshotChunkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseLoadSnapshotChunk} [response] ResponseLoadSnapshotChunk - */ - - /** - * Calls LoadSnapshotChunk. - * @function loadSnapshotChunk - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestLoadSnapshotChunk} request RequestLoadSnapshotChunk message or plain object - * @param {tendermint.abci.ABCIApplication.LoadSnapshotChunkCallback} callback Node-style callback called with the error, if any, and ResponseLoadSnapshotChunk - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.loadSnapshotChunk = function loadSnapshotChunk(request, callback) { - return this.rpcCall(loadSnapshotChunk, $root.tendermint.abci.RequestLoadSnapshotChunk, $root.tendermint.abci.ResponseLoadSnapshotChunk, request, callback); - }, "name", { value: "LoadSnapshotChunk" }); - - /** - * Calls LoadSnapshotChunk. - * @function loadSnapshotChunk - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestLoadSnapshotChunk} request RequestLoadSnapshotChunk message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#applySnapshotChunk}. - * @memberof tendermint.abci.ABCIApplication - * @typedef ApplySnapshotChunkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {tendermint.abci.ResponseApplySnapshotChunk} [response] ResponseApplySnapshotChunk - */ - - /** - * Calls ApplySnapshotChunk. - * @function applySnapshotChunk - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestApplySnapshotChunk} request RequestApplySnapshotChunk message or plain object - * @param {tendermint.abci.ABCIApplication.ApplySnapshotChunkCallback} callback Node-style callback called with the error, if any, and ResponseApplySnapshotChunk - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ABCIApplication.prototype.applySnapshotChunk = function applySnapshotChunk(request, callback) { - return this.rpcCall(applySnapshotChunk, $root.tendermint.abci.RequestApplySnapshotChunk, $root.tendermint.abci.ResponseApplySnapshotChunk, request, callback); - }, "name", { value: "ApplySnapshotChunk" }); - - /** - * Calls ApplySnapshotChunk. - * @function applySnapshotChunk - * @memberof tendermint.abci.ABCIApplication - * @instance - * @param {tendermint.abci.IRequestApplySnapshotChunk} request RequestApplySnapshotChunk message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ABCIApplication; - })(); - - return abci; - })(); - - tendermint.types = (function() { - - /** - * Namespace types. - * @memberof tendermint - * @namespace - */ - var types = {}; - - /** - * BlockIDFlag enum. - * @name tendermint.types.BlockIDFlag - * @enum {number} - * @property {number} BLOCK_ID_FLAG_UNKNOWN=0 BLOCK_ID_FLAG_UNKNOWN value - * @property {number} BLOCK_ID_FLAG_ABSENT=1 BLOCK_ID_FLAG_ABSENT value - * @property {number} BLOCK_ID_FLAG_COMMIT=2 BLOCK_ID_FLAG_COMMIT value - * @property {number} BLOCK_ID_FLAG_NIL=3 BLOCK_ID_FLAG_NIL value - */ - types.BlockIDFlag = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BLOCK_ID_FLAG_UNKNOWN"] = 0; - values[valuesById[1] = "BLOCK_ID_FLAG_ABSENT"] = 1; - values[valuesById[2] = "BLOCK_ID_FLAG_COMMIT"] = 2; - values[valuesById[3] = "BLOCK_ID_FLAG_NIL"] = 3; - return values; - })(); - - /** - * SignedMsgType enum. - * @name tendermint.types.SignedMsgType - * @enum {number} - * @property {number} SIGNED_MSG_TYPE_UNKNOWN=0 SIGNED_MSG_TYPE_UNKNOWN value - * @property {number} SIGNED_MSG_TYPE_PREVOTE=1 SIGNED_MSG_TYPE_PREVOTE value - * @property {number} SIGNED_MSG_TYPE_PRECOMMIT=2 SIGNED_MSG_TYPE_PRECOMMIT value - * @property {number} SIGNED_MSG_TYPE_PROPOSAL=32 SIGNED_MSG_TYPE_PROPOSAL value - */ - types.SignedMsgType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SIGNED_MSG_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "SIGNED_MSG_TYPE_PREVOTE"] = 1; - values[valuesById[2] = "SIGNED_MSG_TYPE_PRECOMMIT"] = 2; - values[valuesById[32] = "SIGNED_MSG_TYPE_PROPOSAL"] = 32; - return values; - })(); - - types.PartSetHeader = (function() { - - /** - * Properties of a PartSetHeader. - * @memberof tendermint.types - * @interface IPartSetHeader - * @property {number|null} [total] PartSetHeader total - * @property {Uint8Array|null} [hash] PartSetHeader hash - */ - - /** - * Constructs a new PartSetHeader. - * @memberof tendermint.types - * @classdesc Represents a PartSetHeader. - * @implements IPartSetHeader - * @constructor - * @param {tendermint.types.IPartSetHeader=} [properties] Properties to set - */ - function PartSetHeader(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartSetHeader total. - * @member {number} total - * @memberof tendermint.types.PartSetHeader - * @instance - */ - PartSetHeader.prototype.total = 0; - - /** - * PartSetHeader hash. - * @member {Uint8Array} hash - * @memberof tendermint.types.PartSetHeader - * @instance - */ - PartSetHeader.prototype.hash = $util.newBuffer([]); - - /** - * Encodes the specified PartSetHeader message. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @function encode - * @memberof tendermint.types.PartSetHeader - * @static - * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartSetHeader.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.total != null && Object.hasOwnProperty.call(message, "total")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.total); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hash); - return writer; - }; - - /** - * Encodes the specified PartSetHeader message, length delimited. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.PartSetHeader - * @static - * @param {tendermint.types.IPartSetHeader} message PartSetHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PartSetHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.PartSetHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.PartSetHeader} PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartSetHeader.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.PartSetHeader(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.total = reader.uint32(); - break; - case 2: - message.hash = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.PartSetHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.PartSetHeader} PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PartSetHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PartSetHeader message. - * @function verify - * @memberof tendermint.types.PartSetHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PartSetHeader.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.total != null && message.hasOwnProperty("total")) - if (!$util.isInteger(message.total)) - return "total: integer expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - return null; - }; - - /** - * Creates a PartSetHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.PartSetHeader - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.PartSetHeader} PartSetHeader - */ - PartSetHeader.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.PartSetHeader) - return object; - var message = new $root.tendermint.types.PartSetHeader(); - if (object.total != null) - message.total = object.total >>> 0; - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - return message; - }; - - /** - * Creates a plain object from a PartSetHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.PartSetHeader - * @static - * @param {tendermint.types.PartSetHeader} message PartSetHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PartSetHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.total = 0; - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - } - if (message.total != null && message.hasOwnProperty("total")) - object.total = message.total; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - return object; - }; - - /** - * Converts this PartSetHeader to JSON. - * @function toJSON - * @memberof tendermint.types.PartSetHeader - * @instance - * @returns {Object.} JSON object - */ - PartSetHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PartSetHeader; - })(); - - types.Part = (function() { - - /** - * Properties of a Part. - * @memberof tendermint.types - * @interface IPart - * @property {number|null} [index] Part index - * @property {Uint8Array|null} [bytes] Part bytes - * @property {tendermint.crypto.IProof|null} [proof] Part proof - */ - - /** - * Constructs a new Part. - * @memberof tendermint.types - * @classdesc Represents a Part. - * @implements IPart - * @constructor - * @param {tendermint.types.IPart=} [properties] Properties to set - */ - function Part(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Part index. - * @member {number} index - * @memberof tendermint.types.Part - * @instance - */ - Part.prototype.index = 0; - - /** - * Part bytes. - * @member {Uint8Array} bytes - * @memberof tendermint.types.Part - * @instance - */ - Part.prototype.bytes = $util.newBuffer([]); - - /** - * Part proof. - * @member {tendermint.crypto.IProof|null|undefined} proof - * @memberof tendermint.types.Part - * @instance - */ - Part.prototype.proof = null; - - /** - * Encodes the specified Part message. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Part - * @static - * @param {tendermint.types.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.index); - if (message.bytes != null && Object.hasOwnProperty.call(message, "bytes")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bytes); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Part - * @static - * @param {tendermint.types.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Part message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Part(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.index = reader.uint32(); - break; - case 2: - message.bytes = reader.bytes(); - break; - case 3: - message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Part message. - * @function verify - * @memberof tendermint.types.Part - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Part.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.bytes != null && message.hasOwnProperty("bytes")) - if (!(message.bytes && typeof message.bytes.length === "number" || $util.isString(message.bytes))) - return "bytes: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - var error = $root.tendermint.crypto.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - return null; - }; - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Part - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Part} Part - */ - Part.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Part) - return object; - var message = new $root.tendermint.types.Part(); - if (object.index != null) - message.index = object.index >>> 0; - if (object.bytes != null) - if (typeof object.bytes === "string") - $util.base64.decode(object.bytes, message.bytes = $util.newBuffer($util.base64.length(object.bytes)), 0); - else if (object.bytes.length) - message.bytes = object.bytes; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".tendermint.types.Part.proof: object expected"); - message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); - } - return message; - }; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Part - * @static - * @param {tendermint.types.Part} message Part - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Part.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.index = 0; - if (options.bytes === String) - object.bytes = ""; - else { - object.bytes = []; - if (options.bytes !== Array) - object.bytes = $util.newBuffer(object.bytes); - } - object.proof = null; - } - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.bytes != null && message.hasOwnProperty("bytes")) - object.bytes = options.bytes === String ? $util.base64.encode(message.bytes, 0, message.bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytes) : message.bytes; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); - return object; - }; - - /** - * Converts this Part to JSON. - * @function toJSON - * @memberof tendermint.types.Part - * @instance - * @returns {Object.} JSON object - */ - Part.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Part; - })(); - - types.BlockID = (function() { - - /** - * Properties of a BlockID. - * @memberof tendermint.types - * @interface IBlockID - * @property {Uint8Array|null} [hash] BlockID hash - * @property {tendermint.types.IPartSetHeader|null} [part_set_header] BlockID part_set_header - */ - - /** - * Constructs a new BlockID. - * @memberof tendermint.types - * @classdesc Represents a BlockID. - * @implements IBlockID - * @constructor - * @param {tendermint.types.IBlockID=} [properties] Properties to set - */ - function BlockID(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockID hash. - * @member {Uint8Array} hash - * @memberof tendermint.types.BlockID - * @instance - */ - BlockID.prototype.hash = $util.newBuffer([]); - - /** - * BlockID part_set_header. - * @member {tendermint.types.IPartSetHeader|null|undefined} part_set_header - * @memberof tendermint.types.BlockID - * @instance - */ - BlockID.prototype.part_set_header = null; - - /** - * Encodes the specified BlockID message. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @function encode - * @memberof tendermint.types.BlockID - * @static - * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockID.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash); - if (message.part_set_header != null && Object.hasOwnProperty.call(message, "part_set_header")) - $root.tendermint.types.PartSetHeader.encode(message.part_set_header, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BlockID message, length delimited. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.BlockID - * @static - * @param {tendermint.types.IBlockID} message BlockID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockID.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockID message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.BlockID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.BlockID} BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockID.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockID(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.hash = reader.bytes(); - break; - case 2: - message.part_set_header = $root.tendermint.types.PartSetHeader.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockID message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.BlockID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.BlockID} BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockID.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockID message. - * @function verify - * @memberof tendermint.types.BlockID - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockID.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash))) - return "hash: buffer expected"; - if (message.part_set_header != null && message.hasOwnProperty("part_set_header")) { - var error = $root.tendermint.types.PartSetHeader.verify(message.part_set_header); - if (error) - return "part_set_header." + error; - } - return null; - }; - - /** - * Creates a BlockID message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.BlockID - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.BlockID} BlockID - */ - BlockID.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.BlockID) - return object; - var message = new $root.tendermint.types.BlockID(); - if (object.hash != null) - if (typeof object.hash === "string") - $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0); - else if (object.hash.length) - message.hash = object.hash; - if (object.part_set_header != null) { - if (typeof object.part_set_header !== "object") - throw TypeError(".tendermint.types.BlockID.part_set_header: object expected"); - message.part_set_header = $root.tendermint.types.PartSetHeader.fromObject(object.part_set_header); - } - return message; - }; - - /** - * Creates a plain object from a BlockID message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.BlockID - * @static - * @param {tendermint.types.BlockID} message BlockID - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockID.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.hash = ""; - else { - object.hash = []; - if (options.bytes !== Array) - object.hash = $util.newBuffer(object.hash); - } - object.part_set_header = null; - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash; - if (message.part_set_header != null && message.hasOwnProperty("part_set_header")) - object.part_set_header = $root.tendermint.types.PartSetHeader.toObject(message.part_set_header, options); - return object; - }; - - /** - * Converts this BlockID to JSON. - * @function toJSON - * @memberof tendermint.types.BlockID - * @instance - * @returns {Object.} JSON object - */ - BlockID.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockID; - })(); - - types.Header = (function() { - - /** - * Properties of a Header. - * @memberof tendermint.types - * @interface IHeader - * @property {tendermint.version.IConsensus|null} [version] Header version - * @property {string|null} [chain_id] Header chain_id - * @property {Long|null} [height] Header height - * @property {google.protobuf.ITimestamp|null} [time] Header time - * @property {tendermint.types.IBlockID|null} [last_block_id] Header last_block_id - * @property {Uint8Array|null} [last_commit_hash] Header last_commit_hash - * @property {Uint8Array|null} [data_hash] Header data_hash - * @property {Uint8Array|null} [validators_hash] Header validators_hash - * @property {Uint8Array|null} [next_validators_hash] Header next_validators_hash - * @property {Uint8Array|null} [consensus_hash] Header consensus_hash - * @property {Uint8Array|null} [app_hash] Header app_hash - * @property {Uint8Array|null} [last_results_hash] Header last_results_hash - * @property {Uint8Array|null} [evidence_hash] Header evidence_hash - * @property {Uint8Array|null} [proposer_address] Header proposer_address - */ - - /** - * Constructs a new Header. - * @memberof tendermint.types - * @classdesc Represents a Header. - * @implements IHeader - * @constructor - * @param {tendermint.types.IHeader=} [properties] Properties to set - */ - function Header(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Header version. - * @member {tendermint.version.IConsensus|null|undefined} version - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.version = null; - - /** - * Header chain_id. - * @member {string} chain_id - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.chain_id = ""; - - /** - * Header height. - * @member {Long} height - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Header time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.time = null; - - /** - * Header last_block_id. - * @member {tendermint.types.IBlockID|null|undefined} last_block_id - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.last_block_id = null; - - /** - * Header last_commit_hash. - * @member {Uint8Array} last_commit_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.last_commit_hash = $util.newBuffer([]); - - /** - * Header data_hash. - * @member {Uint8Array} data_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.data_hash = $util.newBuffer([]); - - /** - * Header validators_hash. - * @member {Uint8Array} validators_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.validators_hash = $util.newBuffer([]); - - /** - * Header next_validators_hash. - * @member {Uint8Array} next_validators_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.next_validators_hash = $util.newBuffer([]); - - /** - * Header consensus_hash. - * @member {Uint8Array} consensus_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.consensus_hash = $util.newBuffer([]); - - /** - * Header app_hash. - * @member {Uint8Array} app_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.app_hash = $util.newBuffer([]); - - /** - * Header last_results_hash. - * @member {Uint8Array} last_results_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.last_results_hash = $util.newBuffer([]); - - /** - * Header evidence_hash. - * @member {Uint8Array} evidence_hash - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.evidence_hash = $util.newBuffer([]); - - /** - * Header proposer_address. - * @member {Uint8Array} proposer_address - * @memberof tendermint.types.Header - * @instance - */ - Header.prototype.proposer_address = $util.newBuffer([]); - - /** - * Encodes the specified Header message. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Header - * @static - * @param {tendermint.types.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.tendermint.version.Consensus.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.chain_id != null && Object.hasOwnProperty.call(message, "chain_id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain_id); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.height); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.last_block_id != null && Object.hasOwnProperty.call(message, "last_block_id")) - $root.tendermint.types.BlockID.encode(message.last_block_id, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.last_commit_hash != null && Object.hasOwnProperty.call(message, "last_commit_hash")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.last_commit_hash); - if (message.data_hash != null && Object.hasOwnProperty.call(message, "data_hash")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.data_hash); - if (message.validators_hash != null && Object.hasOwnProperty.call(message, "validators_hash")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.validators_hash); - if (message.next_validators_hash != null && Object.hasOwnProperty.call(message, "next_validators_hash")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.next_validators_hash); - if (message.consensus_hash != null && Object.hasOwnProperty.call(message, "consensus_hash")) - writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.consensus_hash); - if (message.app_hash != null && Object.hasOwnProperty.call(message, "app_hash")) - writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.app_hash); - if (message.last_results_hash != null && Object.hasOwnProperty.call(message, "last_results_hash")) - writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.last_results_hash); - if (message.evidence_hash != null && Object.hasOwnProperty.call(message, "evidence_hash")) - writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.evidence_hash); - if (message.proposer_address != null && Object.hasOwnProperty.call(message, "proposer_address")) - writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.proposer_address); - return writer; - }; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Header - * @static - * @param {tendermint.types.IHeader} message Header message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Header.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Header message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Header(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = $root.tendermint.version.Consensus.decode(reader, reader.uint32()); - break; - case 2: - message.chain_id = reader.string(); - break; - case 3: - message.height = reader.int64(); - break; - case 4: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.last_block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.last_commit_hash = reader.bytes(); - break; - case 7: - message.data_hash = reader.bytes(); - break; - case 8: - message.validators_hash = reader.bytes(); - break; - case 9: - message.next_validators_hash = reader.bytes(); - break; - case 10: - message.consensus_hash = reader.bytes(); - break; - case 11: - message.app_hash = reader.bytes(); - break; - case 12: - message.last_results_hash = reader.bytes(); - break; - case 13: - message.evidence_hash = reader.bytes(); - break; - case 14: - message.proposer_address = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Header - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Header} Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Header.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Header message. - * @function verify - * @memberof tendermint.types.Header - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Header.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.tendermint.version.Consensus.verify(message.version); - if (error) - return "version." + error; - } - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - if (!$util.isString(message.chain_id)) - return "chain_id: string expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - if (message.last_block_id != null && message.hasOwnProperty("last_block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.last_block_id); - if (error) - return "last_block_id." + error; - } - if (message.last_commit_hash != null && message.hasOwnProperty("last_commit_hash")) - if (!(message.last_commit_hash && typeof message.last_commit_hash.length === "number" || $util.isString(message.last_commit_hash))) - return "last_commit_hash: buffer expected"; - if (message.data_hash != null && message.hasOwnProperty("data_hash")) - if (!(message.data_hash && typeof message.data_hash.length === "number" || $util.isString(message.data_hash))) - return "data_hash: buffer expected"; - if (message.validators_hash != null && message.hasOwnProperty("validators_hash")) - if (!(message.validators_hash && typeof message.validators_hash.length === "number" || $util.isString(message.validators_hash))) - return "validators_hash: buffer expected"; - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - if (!(message.next_validators_hash && typeof message.next_validators_hash.length === "number" || $util.isString(message.next_validators_hash))) - return "next_validators_hash: buffer expected"; - if (message.consensus_hash != null && message.hasOwnProperty("consensus_hash")) - if (!(message.consensus_hash && typeof message.consensus_hash.length === "number" || $util.isString(message.consensus_hash))) - return "consensus_hash: buffer expected"; - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - if (!(message.app_hash && typeof message.app_hash.length === "number" || $util.isString(message.app_hash))) - return "app_hash: buffer expected"; - if (message.last_results_hash != null && message.hasOwnProperty("last_results_hash")) - if (!(message.last_results_hash && typeof message.last_results_hash.length === "number" || $util.isString(message.last_results_hash))) - return "last_results_hash: buffer expected"; - if (message.evidence_hash != null && message.hasOwnProperty("evidence_hash")) - if (!(message.evidence_hash && typeof message.evidence_hash.length === "number" || $util.isString(message.evidence_hash))) - return "evidence_hash: buffer expected"; - if (message.proposer_address != null && message.hasOwnProperty("proposer_address")) - if (!(message.proposer_address && typeof message.proposer_address.length === "number" || $util.isString(message.proposer_address))) - return "proposer_address: buffer expected"; - return null; - }; - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Header - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Header} Header - */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Header) - return object; - var message = new $root.tendermint.types.Header(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".tendermint.types.Header.version: object expected"); - message.version = $root.tendermint.version.Consensus.fromObject(object.version); - } - if (object.chain_id != null) - message.chain_id = String(object.chain_id); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".tendermint.types.Header.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.last_block_id != null) { - if (typeof object.last_block_id !== "object") - throw TypeError(".tendermint.types.Header.last_block_id: object expected"); - message.last_block_id = $root.tendermint.types.BlockID.fromObject(object.last_block_id); - } - if (object.last_commit_hash != null) - if (typeof object.last_commit_hash === "string") - $util.base64.decode(object.last_commit_hash, message.last_commit_hash = $util.newBuffer($util.base64.length(object.last_commit_hash)), 0); - else if (object.last_commit_hash.length) - message.last_commit_hash = object.last_commit_hash; - if (object.data_hash != null) - if (typeof object.data_hash === "string") - $util.base64.decode(object.data_hash, message.data_hash = $util.newBuffer($util.base64.length(object.data_hash)), 0); - else if (object.data_hash.length) - message.data_hash = object.data_hash; - if (object.validators_hash != null) - if (typeof object.validators_hash === "string") - $util.base64.decode(object.validators_hash, message.validators_hash = $util.newBuffer($util.base64.length(object.validators_hash)), 0); - else if (object.validators_hash.length) - message.validators_hash = object.validators_hash; - if (object.next_validators_hash != null) - if (typeof object.next_validators_hash === "string") - $util.base64.decode(object.next_validators_hash, message.next_validators_hash = $util.newBuffer($util.base64.length(object.next_validators_hash)), 0); - else if (object.next_validators_hash.length) - message.next_validators_hash = object.next_validators_hash; - if (object.consensus_hash != null) - if (typeof object.consensus_hash === "string") - $util.base64.decode(object.consensus_hash, message.consensus_hash = $util.newBuffer($util.base64.length(object.consensus_hash)), 0); - else if (object.consensus_hash.length) - message.consensus_hash = object.consensus_hash; - if (object.app_hash != null) - if (typeof object.app_hash === "string") - $util.base64.decode(object.app_hash, message.app_hash = $util.newBuffer($util.base64.length(object.app_hash)), 0); - else if (object.app_hash.length) - message.app_hash = object.app_hash; - if (object.last_results_hash != null) - if (typeof object.last_results_hash === "string") - $util.base64.decode(object.last_results_hash, message.last_results_hash = $util.newBuffer($util.base64.length(object.last_results_hash)), 0); - else if (object.last_results_hash.length) - message.last_results_hash = object.last_results_hash; - if (object.evidence_hash != null) - if (typeof object.evidence_hash === "string") - $util.base64.decode(object.evidence_hash, message.evidence_hash = $util.newBuffer($util.base64.length(object.evidence_hash)), 0); - else if (object.evidence_hash.length) - message.evidence_hash = object.evidence_hash; - if (object.proposer_address != null) - if (typeof object.proposer_address === "string") - $util.base64.decode(object.proposer_address, message.proposer_address = $util.newBuffer($util.base64.length(object.proposer_address)), 0); - else if (object.proposer_address.length) - message.proposer_address = object.proposer_address; - return message; - }; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Header - * @static - * @param {tendermint.types.Header} message Header - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Header.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = null; - object.chain_id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.time = null; - object.last_block_id = null; - if (options.bytes === String) - object.last_commit_hash = ""; - else { - object.last_commit_hash = []; - if (options.bytes !== Array) - object.last_commit_hash = $util.newBuffer(object.last_commit_hash); - } - if (options.bytes === String) - object.data_hash = ""; - else { - object.data_hash = []; - if (options.bytes !== Array) - object.data_hash = $util.newBuffer(object.data_hash); - } - if (options.bytes === String) - object.validators_hash = ""; - else { - object.validators_hash = []; - if (options.bytes !== Array) - object.validators_hash = $util.newBuffer(object.validators_hash); - } - if (options.bytes === String) - object.next_validators_hash = ""; - else { - object.next_validators_hash = []; - if (options.bytes !== Array) - object.next_validators_hash = $util.newBuffer(object.next_validators_hash); - } - if (options.bytes === String) - object.consensus_hash = ""; - else { - object.consensus_hash = []; - if (options.bytes !== Array) - object.consensus_hash = $util.newBuffer(object.consensus_hash); - } - if (options.bytes === String) - object.app_hash = ""; - else { - object.app_hash = []; - if (options.bytes !== Array) - object.app_hash = $util.newBuffer(object.app_hash); - } - if (options.bytes === String) - object.last_results_hash = ""; - else { - object.last_results_hash = []; - if (options.bytes !== Array) - object.last_results_hash = $util.newBuffer(object.last_results_hash); - } - if (options.bytes === String) - object.evidence_hash = ""; - else { - object.evidence_hash = []; - if (options.bytes !== Array) - object.evidence_hash = $util.newBuffer(object.evidence_hash); - } - if (options.bytes === String) - object.proposer_address = ""; - else { - object.proposer_address = []; - if (options.bytes !== Array) - object.proposer_address = $util.newBuffer(object.proposer_address); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.tendermint.version.Consensus.toObject(message.version, options); - if (message.chain_id != null && message.hasOwnProperty("chain_id")) - object.chain_id = message.chain_id; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (message.last_block_id != null && message.hasOwnProperty("last_block_id")) - object.last_block_id = $root.tendermint.types.BlockID.toObject(message.last_block_id, options); - if (message.last_commit_hash != null && message.hasOwnProperty("last_commit_hash")) - object.last_commit_hash = options.bytes === String ? $util.base64.encode(message.last_commit_hash, 0, message.last_commit_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_commit_hash) : message.last_commit_hash; - if (message.data_hash != null && message.hasOwnProperty("data_hash")) - object.data_hash = options.bytes === String ? $util.base64.encode(message.data_hash, 0, message.data_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.data_hash) : message.data_hash; - if (message.validators_hash != null && message.hasOwnProperty("validators_hash")) - object.validators_hash = options.bytes === String ? $util.base64.encode(message.validators_hash, 0, message.validators_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.validators_hash) : message.validators_hash; - if (message.next_validators_hash != null && message.hasOwnProperty("next_validators_hash")) - object.next_validators_hash = options.bytes === String ? $util.base64.encode(message.next_validators_hash, 0, message.next_validators_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.next_validators_hash) : message.next_validators_hash; - if (message.consensus_hash != null && message.hasOwnProperty("consensus_hash")) - object.consensus_hash = options.bytes === String ? $util.base64.encode(message.consensus_hash, 0, message.consensus_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.consensus_hash) : message.consensus_hash; - if (message.app_hash != null && message.hasOwnProperty("app_hash")) - object.app_hash = options.bytes === String ? $util.base64.encode(message.app_hash, 0, message.app_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.app_hash) : message.app_hash; - if (message.last_results_hash != null && message.hasOwnProperty("last_results_hash")) - object.last_results_hash = options.bytes === String ? $util.base64.encode(message.last_results_hash, 0, message.last_results_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_results_hash) : message.last_results_hash; - if (message.evidence_hash != null && message.hasOwnProperty("evidence_hash")) - object.evidence_hash = options.bytes === String ? $util.base64.encode(message.evidence_hash, 0, message.evidence_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.evidence_hash) : message.evidence_hash; - if (message.proposer_address != null && message.hasOwnProperty("proposer_address")) - object.proposer_address = options.bytes === String ? $util.base64.encode(message.proposer_address, 0, message.proposer_address.length) : options.bytes === Array ? Array.prototype.slice.call(message.proposer_address) : message.proposer_address; - return object; - }; - - /** - * Converts this Header to JSON. - * @function toJSON - * @memberof tendermint.types.Header - * @instance - * @returns {Object.} JSON object - */ - Header.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Header; - })(); - - types.Data = (function() { - - /** - * Properties of a Data. - * @memberof tendermint.types - * @interface IData - * @property {Array.|null} [txs] Data txs - */ - - /** - * Constructs a new Data. - * @memberof tendermint.types - * @classdesc Represents a Data. - * @implements IData - * @constructor - * @param {tendermint.types.IData=} [properties] Properties to set - */ - function Data(properties) { - this.txs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Data txs. - * @member {Array.} txs - * @memberof tendermint.types.Data - * @instance - */ - Data.prototype.txs = $util.emptyArray; - - /** - * Encodes the specified Data message. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Data - * @static - * @param {tendermint.types.IData} message Data message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Data.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.txs != null && message.txs.length) - for (var i = 0; i < message.txs.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txs[i]); - return writer; - }; - - /** - * Encodes the specified Data message, length delimited. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Data - * @static - * @param {tendermint.types.IData} message Data message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Data.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Data message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Data - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Data} Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Data.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Data(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.txs && message.txs.length)) - message.txs = []; - message.txs.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Data message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Data - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Data} Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Data.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Data message. - * @function verify - * @memberof tendermint.types.Data - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Data.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.txs != null && message.hasOwnProperty("txs")) { - if (!Array.isArray(message.txs)) - return "txs: array expected"; - for (var i = 0; i < message.txs.length; ++i) - if (!(message.txs[i] && typeof message.txs[i].length === "number" || $util.isString(message.txs[i]))) - return "txs: buffer[] expected"; - } - return null; - }; - - /** - * Creates a Data message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Data - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Data} Data - */ - Data.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Data) - return object; - var message = new $root.tendermint.types.Data(); - if (object.txs) { - if (!Array.isArray(object.txs)) - throw TypeError(".tendermint.types.Data.txs: array expected"); - message.txs = []; - for (var i = 0; i < object.txs.length; ++i) - if (typeof object.txs[i] === "string") - $util.base64.decode(object.txs[i], message.txs[i] = $util.newBuffer($util.base64.length(object.txs[i])), 0); - else if (object.txs[i].length) - message.txs[i] = object.txs[i]; - } - return message; - }; - - /** - * Creates a plain object from a Data message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Data - * @static - * @param {tendermint.types.Data} message Data - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Data.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.txs = []; - if (message.txs && message.txs.length) { - object.txs = []; - for (var j = 0; j < message.txs.length; ++j) - object.txs[j] = options.bytes === String ? $util.base64.encode(message.txs[j], 0, message.txs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.txs[j]) : message.txs[j]; - } - return object; - }; - - /** - * Converts this Data to JSON. - * @function toJSON - * @memberof tendermint.types.Data - * @instance - * @returns {Object.} JSON object - */ - Data.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Data; - })(); - - types.Vote = (function() { - - /** - * Properties of a Vote. - * @memberof tendermint.types - * @interface IVote - * @property {tendermint.types.SignedMsgType|null} [type] Vote type - * @property {Long|null} [height] Vote height - * @property {number|null} [round] Vote round - * @property {tendermint.types.IBlockID|null} [block_id] Vote block_id - * @property {google.protobuf.ITimestamp|null} [timestamp] Vote timestamp - * @property {Uint8Array|null} [validator_address] Vote validator_address - * @property {number|null} [validator_index] Vote validator_index - * @property {Uint8Array|null} [signature] Vote signature - */ - - /** - * Constructs a new Vote. - * @memberof tendermint.types - * @classdesc Represents a Vote. - * @implements IVote - * @constructor - * @param {tendermint.types.IVote=} [properties] Properties to set - */ - function Vote(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Vote type. - * @member {tendermint.types.SignedMsgType} type - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.type = 0; - - /** - * Vote height. - * @member {Long} height - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Vote round. - * @member {number} round - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.round = 0; - - /** - * Vote block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.block_id = null; - - /** - * Vote timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.timestamp = null; - - /** - * Vote validator_address. - * @member {Uint8Array} validator_address - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.validator_address = $util.newBuffer([]); - - /** - * Vote validator_index. - * @member {number} validator_index - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.validator_index = 0; - - /** - * Vote signature. - * @member {Uint8Array} signature - * @memberof tendermint.types.Vote - * @instance - */ - Vote.prototype.signature = $util.newBuffer([]); - - /** - * Encodes the specified Vote message. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Vote - * @static - * @param {tendermint.types.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.validator_address != null && Object.hasOwnProperty.call(message, "validator_address")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.validator_address); - if (message.validator_index != null && Object.hasOwnProperty.call(message, "validator_index")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.validator_index); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.signature); - return writer; - }; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Vote - * @static - * @param {tendermint.types.IVote} message Vote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Vote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Vote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.height = reader.int64(); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 5: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.validator_address = reader.bytes(); - break; - case 7: - message.validator_index = reader.int32(); - break; - case 8: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Vote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Vote} Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Vote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Vote message. - * @function verify - * @memberof tendermint.types.Vote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Vote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 32: - break; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - if (!(message.validator_address && typeof message.validator_address.length === "number" || $util.isString(message.validator_address))) - return "validator_address: buffer expected"; - if (message.validator_index != null && message.hasOwnProperty("validator_index")) - if (!$util.isInteger(message.validator_index)) - return "validator_index: integer expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Vote - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Vote} Vote - */ - Vote.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Vote) - return object; - var message = new $root.tendermint.types.Vote(); - switch (object.type) { - case "SIGNED_MSG_TYPE_UNKNOWN": - case 0: - message.type = 0; - break; - case "SIGNED_MSG_TYPE_PREVOTE": - case 1: - message.type = 1; - break; - case "SIGNED_MSG_TYPE_PRECOMMIT": - case 2: - message.type = 2; - break; - case "SIGNED_MSG_TYPE_PROPOSAL": - case 32: - message.type = 32; - break; - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.round != null) - message.round = object.round | 0; - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.Vote.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".tendermint.types.Vote.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.validator_address != null) - if (typeof object.validator_address === "string") - $util.base64.decode(object.validator_address, message.validator_address = $util.newBuffer($util.base64.length(object.validator_address)), 0); - else if (object.validator_address.length) - message.validator_address = object.validator_address; - if (object.validator_index != null) - message.validator_index = object.validator_index | 0; - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Vote - * @static - * @param {tendermint.types.Vote} message Vote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Vote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.round = 0; - object.block_id = null; - object.timestamp = null; - if (options.bytes === String) - object.validator_address = ""; - else { - object.validator_address = []; - if (options.bytes !== Array) - object.validator_address = $util.newBuffer(object.validator_address); - } - object.validator_index = 0; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - object.validator_address = options.bytes === String ? $util.base64.encode(message.validator_address, 0, message.validator_address.length) : options.bytes === Array ? Array.prototype.slice.call(message.validator_address) : message.validator_address; - if (message.validator_index != null && message.hasOwnProperty("validator_index")) - object.validator_index = message.validator_index; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; - - /** - * Converts this Vote to JSON. - * @function toJSON - * @memberof tendermint.types.Vote - * @instance - * @returns {Object.} JSON object - */ - Vote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Vote; - })(); - - types.Commit = (function() { - - /** - * Properties of a Commit. - * @memberof tendermint.types - * @interface ICommit - * @property {Long|null} [height] Commit height - * @property {number|null} [round] Commit round - * @property {tendermint.types.IBlockID|null} [block_id] Commit block_id - * @property {Array.|null} [signatures] Commit signatures - */ - - /** - * Constructs a new Commit. - * @memberof tendermint.types - * @classdesc Represents a Commit. - * @implements ICommit - * @constructor - * @param {tendermint.types.ICommit=} [properties] Properties to set - */ - function Commit(properties) { - this.signatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Commit height. - * @member {Long} height - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Commit round. - * @member {number} round - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.round = 0; - - /** - * Commit block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.block_id = null; - - /** - * Commit signatures. - * @member {Array.} signatures - * @memberof tendermint.types.Commit - * @instance - */ - Commit.prototype.signatures = $util.emptyArray; - - /** - * Encodes the specified Commit message. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Commit - * @static - * @param {tendermint.types.ICommit} message Commit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Commit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.round); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signatures != null && message.signatures.length) - for (var i = 0; i < message.signatures.length; ++i) - $root.tendermint.types.CommitSig.encode(message.signatures[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Commit message, length delimited. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Commit - * @static - * @param {tendermint.types.ICommit} message Commit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Commit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Commit message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Commit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Commit} Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Commit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Commit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.int64(); - break; - case 2: - message.round = reader.int32(); - break; - case 3: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.signatures && message.signatures.length)) - message.signatures = []; - message.signatures.push($root.tendermint.types.CommitSig.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Commit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Commit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Commit} Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Commit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Commit message. - * @function verify - * @memberof tendermint.types.Commit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Commit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.signatures != null && message.hasOwnProperty("signatures")) { - if (!Array.isArray(message.signatures)) - return "signatures: array expected"; - for (var i = 0; i < message.signatures.length; ++i) { - var error = $root.tendermint.types.CommitSig.verify(message.signatures[i]); - if (error) - return "signatures." + error; - } - } - return null; - }; - - /** - * Creates a Commit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Commit - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Commit} Commit - */ - Commit.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Commit) - return object; - var message = new $root.tendermint.types.Commit(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.round != null) - message.round = object.round | 0; - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.Commit.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.signatures) { - if (!Array.isArray(object.signatures)) - throw TypeError(".tendermint.types.Commit.signatures: array expected"); - message.signatures = []; - for (var i = 0; i < object.signatures.length; ++i) { - if (typeof object.signatures[i] !== "object") - throw TypeError(".tendermint.types.Commit.signatures: object expected"); - message.signatures[i] = $root.tendermint.types.CommitSig.fromObject(object.signatures[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Commit message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Commit - * @static - * @param {tendermint.types.Commit} message Commit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Commit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.signatures = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.round = 0; - object.block_id = null; - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.signatures && message.signatures.length) { - object.signatures = []; - for (var j = 0; j < message.signatures.length; ++j) - object.signatures[j] = $root.tendermint.types.CommitSig.toObject(message.signatures[j], options); - } - return object; - }; - - /** - * Converts this Commit to JSON. - * @function toJSON - * @memberof tendermint.types.Commit - * @instance - * @returns {Object.} JSON object - */ - Commit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Commit; - })(); - - types.CommitSig = (function() { - - /** - * Properties of a CommitSig. - * @memberof tendermint.types - * @interface ICommitSig - * @property {tendermint.types.BlockIDFlag|null} [block_id_flag] CommitSig block_id_flag - * @property {Uint8Array|null} [validator_address] CommitSig validator_address - * @property {google.protobuf.ITimestamp|null} [timestamp] CommitSig timestamp - * @property {Uint8Array|null} [signature] CommitSig signature - */ - - /** - * Constructs a new CommitSig. - * @memberof tendermint.types - * @classdesc Represents a CommitSig. - * @implements ICommitSig - * @constructor - * @param {tendermint.types.ICommitSig=} [properties] Properties to set - */ - function CommitSig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommitSig block_id_flag. - * @member {tendermint.types.BlockIDFlag} block_id_flag - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.block_id_flag = 0; - - /** - * CommitSig validator_address. - * @member {Uint8Array} validator_address - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.validator_address = $util.newBuffer([]); - - /** - * CommitSig timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.timestamp = null; - - /** - * CommitSig signature. - * @member {Uint8Array} signature - * @memberof tendermint.types.CommitSig - * @instance - */ - CommitSig.prototype.signature = $util.newBuffer([]); - - /** - * Encodes the specified CommitSig message. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @function encode - * @memberof tendermint.types.CommitSig - * @static - * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitSig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block_id_flag != null && Object.hasOwnProperty.call(message, "block_id_flag")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.block_id_flag); - if (message.validator_address != null && Object.hasOwnProperty.call(message, "validator_address")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.validator_address); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.signature); - return writer; - }; - - /** - * Encodes the specified CommitSig message, length delimited. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.CommitSig - * @static - * @param {tendermint.types.ICommitSig} message CommitSig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommitSig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommitSig message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.CommitSig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.CommitSig} CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitSig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.CommitSig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id_flag = reader.int32(); - break; - case 2: - message.validator_address = reader.bytes(); - break; - case 3: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommitSig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.CommitSig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.CommitSig} CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommitSig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommitSig message. - * @function verify - * @memberof tendermint.types.CommitSig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommitSig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block_id_flag != null && message.hasOwnProperty("block_id_flag")) - switch (message.block_id_flag) { - default: - return "block_id_flag: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - if (!(message.validator_address && typeof message.validator_address.length === "number" || $util.isString(message.validator_address))) - return "validator_address: buffer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; - - /** - * Creates a CommitSig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.CommitSig - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.CommitSig} CommitSig - */ - CommitSig.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.CommitSig) - return object; - var message = new $root.tendermint.types.CommitSig(); - switch (object.block_id_flag) { - case "BLOCK_ID_FLAG_UNKNOWN": - case 0: - message.block_id_flag = 0; - break; - case "BLOCK_ID_FLAG_ABSENT": - case 1: - message.block_id_flag = 1; - break; - case "BLOCK_ID_FLAG_COMMIT": - case 2: - message.block_id_flag = 2; - break; - case "BLOCK_ID_FLAG_NIL": - case 3: - message.block_id_flag = 3; - break; - } - if (object.validator_address != null) - if (typeof object.validator_address === "string") - $util.base64.decode(object.validator_address, message.validator_address = $util.newBuffer($util.base64.length(object.validator_address)), 0); - else if (object.validator_address.length) - message.validator_address = object.validator_address; - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".tendermint.types.CommitSig.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; - - /** - * Creates a plain object from a CommitSig message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.CommitSig - * @static - * @param {tendermint.types.CommitSig} message CommitSig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommitSig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.block_id_flag = options.enums === String ? "BLOCK_ID_FLAG_UNKNOWN" : 0; - if (options.bytes === String) - object.validator_address = ""; - else { - object.validator_address = []; - if (options.bytes !== Array) - object.validator_address = $util.newBuffer(object.validator_address); - } - object.timestamp = null; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - } - if (message.block_id_flag != null && message.hasOwnProperty("block_id_flag")) - object.block_id_flag = options.enums === String ? $root.tendermint.types.BlockIDFlag[message.block_id_flag] : message.block_id_flag; - if (message.validator_address != null && message.hasOwnProperty("validator_address")) - object.validator_address = options.bytes === String ? $util.base64.encode(message.validator_address, 0, message.validator_address.length) : options.bytes === Array ? Array.prototype.slice.call(message.validator_address) : message.validator_address; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; - - /** - * Converts this CommitSig to JSON. - * @function toJSON - * @memberof tendermint.types.CommitSig - * @instance - * @returns {Object.} JSON object - */ - CommitSig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CommitSig; - })(); - - types.Proposal = (function() { - - /** - * Properties of a Proposal. - * @memberof tendermint.types - * @interface IProposal - * @property {tendermint.types.SignedMsgType|null} [type] Proposal type - * @property {Long|null} [height] Proposal height - * @property {number|null} [round] Proposal round - * @property {number|null} [pol_round] Proposal pol_round - * @property {tendermint.types.IBlockID|null} [block_id] Proposal block_id - * @property {google.protobuf.ITimestamp|null} [timestamp] Proposal timestamp - * @property {Uint8Array|null} [signature] Proposal signature - */ - - /** - * Constructs a new Proposal. - * @memberof tendermint.types - * @classdesc Represents a Proposal. - * @implements IProposal - * @constructor - * @param {tendermint.types.IProposal=} [properties] Properties to set - */ - function Proposal(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Proposal type. - * @member {tendermint.types.SignedMsgType} type - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.type = 0; - - /** - * Proposal height. - * @member {Long} height - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Proposal round. - * @member {number} round - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.round = 0; - - /** - * Proposal pol_round. - * @member {number} pol_round - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.pol_round = 0; - - /** - * Proposal block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.block_id = null; - - /** - * Proposal timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.timestamp = null; - - /** - * Proposal signature. - * @member {Uint8Array} signature - * @memberof tendermint.types.Proposal - * @instance - */ - Proposal.prototype.signature = $util.newBuffer([]); - - /** - * Encodes the specified Proposal message. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Proposal - * @static - * @param {tendermint.types.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.height); - if (message.round != null && Object.hasOwnProperty.call(message, "round")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.round); - if (message.pol_round != null && Object.hasOwnProperty.call(message, "pol_round")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pol_round); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.signature); - return writer; - }; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Proposal - * @static - * @param {tendermint.types.IProposal} message Proposal message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Proposal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Proposal(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.int32(); - break; - case 2: - message.height = reader.int64(); - break; - case 3: - message.round = reader.int32(); - break; - case 4: - message.pol_round = reader.int32(); - break; - case 5: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 6: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Proposal - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Proposal} Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Proposal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Proposal message. - * @function verify - * @memberof tendermint.types.Proposal - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Proposal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 32: - break; - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.round != null && message.hasOwnProperty("round")) - if (!$util.isInteger(message.round)) - return "round: integer expected"; - if (message.pol_round != null && message.hasOwnProperty("pol_round")) - if (!$util.isInteger(message.pol_round)) - return "pol_round: integer expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - return null; - }; - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Proposal - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Proposal} Proposal - */ - Proposal.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Proposal) - return object; - var message = new $root.tendermint.types.Proposal(); - switch (object.type) { - case "SIGNED_MSG_TYPE_UNKNOWN": - case 0: - message.type = 0; - break; - case "SIGNED_MSG_TYPE_PREVOTE": - case 1: - message.type = 1; - break; - case "SIGNED_MSG_TYPE_PRECOMMIT": - case 2: - message.type = 2; - break; - case "SIGNED_MSG_TYPE_PROPOSAL": - case 32: - message.type = 32; - break; - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.round != null) - message.round = object.round | 0; - if (object.pol_round != null) - message.pol_round = object.pol_round | 0; - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.Proposal.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".tendermint.types.Proposal.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - return message; - }; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Proposal - * @static - * @param {tendermint.types.Proposal} message Proposal - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Proposal.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "SIGNED_MSG_TYPE_UNKNOWN" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.round = 0; - object.pol_round = 0; - object.block_id = null; - object.timestamp = null; - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.tendermint.types.SignedMsgType[message.type] : message.type; - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.round != null && message.hasOwnProperty("round")) - object.round = message.round; - if (message.pol_round != null && message.hasOwnProperty("pol_round")) - object.pol_round = message.pol_round; - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - return object; - }; - - /** - * Converts this Proposal to JSON. - * @function toJSON - * @memberof tendermint.types.Proposal - * @instance - * @returns {Object.} JSON object - */ - Proposal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Proposal; - })(); - - types.SignedHeader = (function() { - - /** - * Properties of a SignedHeader. - * @memberof tendermint.types - * @interface ISignedHeader - * @property {tendermint.types.IHeader|null} [header] SignedHeader header - * @property {tendermint.types.ICommit|null} [commit] SignedHeader commit - */ - - /** - * Constructs a new SignedHeader. - * @memberof tendermint.types - * @classdesc Represents a SignedHeader. - * @implements ISignedHeader - * @constructor - * @param {tendermint.types.ISignedHeader=} [properties] Properties to set - */ - function SignedHeader(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SignedHeader header. - * @member {tendermint.types.IHeader|null|undefined} header - * @memberof tendermint.types.SignedHeader - * @instance - */ - SignedHeader.prototype.header = null; - - /** - * SignedHeader commit. - * @member {tendermint.types.ICommit|null|undefined} commit - * @memberof tendermint.types.SignedHeader - * @instance - */ - SignedHeader.prototype.commit = null; - - /** - * Encodes the specified SignedHeader message. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @function encode - * @memberof tendermint.types.SignedHeader - * @static - * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedHeader.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.commit != null && Object.hasOwnProperty.call(message, "commit")) - $root.tendermint.types.Commit.encode(message.commit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SignedHeader message, length delimited. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.SignedHeader - * @static - * @param {tendermint.types.ISignedHeader} message SignedHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SignedHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SignedHeader message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.SignedHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.SignedHeader} SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedHeader.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SignedHeader(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); - break; - case 2: - message.commit = $root.tendermint.types.Commit.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SignedHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.SignedHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.SignedHeader} SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SignedHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SignedHeader message. - * @function verify - * @memberof tendermint.types.SignedHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SignedHeader.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.header != null && message.hasOwnProperty("header")) { - var error = $root.tendermint.types.Header.verify(message.header); - if (error) - return "header." + error; - } - if (message.commit != null && message.hasOwnProperty("commit")) { - var error = $root.tendermint.types.Commit.verify(message.commit); - if (error) - return "commit." + error; - } - return null; - }; - - /** - * Creates a SignedHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.SignedHeader - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.SignedHeader} SignedHeader - */ - SignedHeader.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.SignedHeader) - return object; - var message = new $root.tendermint.types.SignedHeader(); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".tendermint.types.SignedHeader.header: object expected"); - message.header = $root.tendermint.types.Header.fromObject(object.header); - } - if (object.commit != null) { - if (typeof object.commit !== "object") - throw TypeError(".tendermint.types.SignedHeader.commit: object expected"); - message.commit = $root.tendermint.types.Commit.fromObject(object.commit); - } - return message; - }; - - /** - * Creates a plain object from a SignedHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.SignedHeader - * @static - * @param {tendermint.types.SignedHeader} message SignedHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SignedHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.header = null; - object.commit = null; - } - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.tendermint.types.Header.toObject(message.header, options); - if (message.commit != null && message.hasOwnProperty("commit")) - object.commit = $root.tendermint.types.Commit.toObject(message.commit, options); - return object; - }; - - /** - * Converts this SignedHeader to JSON. - * @function toJSON - * @memberof tendermint.types.SignedHeader - * @instance - * @returns {Object.} JSON object - */ - SignedHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SignedHeader; - })(); - - types.LightBlock = (function() { - - /** - * Properties of a LightBlock. - * @memberof tendermint.types - * @interface ILightBlock - * @property {tendermint.types.ISignedHeader|null} [signed_header] LightBlock signed_header - * @property {tendermint.types.IValidatorSet|null} [validator_set] LightBlock validator_set - */ - - /** - * Constructs a new LightBlock. - * @memberof tendermint.types - * @classdesc Represents a LightBlock. - * @implements ILightBlock - * @constructor - * @param {tendermint.types.ILightBlock=} [properties] Properties to set - */ - function LightBlock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LightBlock signed_header. - * @member {tendermint.types.ISignedHeader|null|undefined} signed_header - * @memberof tendermint.types.LightBlock - * @instance - */ - LightBlock.prototype.signed_header = null; - - /** - * LightBlock validator_set. - * @member {tendermint.types.IValidatorSet|null|undefined} validator_set - * @memberof tendermint.types.LightBlock - * @instance - */ - LightBlock.prototype.validator_set = null; - - /** - * Encodes the specified LightBlock message. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @function encode - * @memberof tendermint.types.LightBlock - * @static - * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LightBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.signed_header != null && Object.hasOwnProperty.call(message, "signed_header")) - $root.tendermint.types.SignedHeader.encode(message.signed_header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.validator_set != null && Object.hasOwnProperty.call(message, "validator_set")) - $root.tendermint.types.ValidatorSet.encode(message.validator_set, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LightBlock message, length delimited. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.LightBlock - * @static - * @param {tendermint.types.ILightBlock} message LightBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LightBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LightBlock message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.LightBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.LightBlock} LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LightBlock.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.LightBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.signed_header = $root.tendermint.types.SignedHeader.decode(reader, reader.uint32()); - break; - case 2: - message.validator_set = $root.tendermint.types.ValidatorSet.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LightBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.LightBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.LightBlock} LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LightBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LightBlock message. - * @function verify - * @memberof tendermint.types.LightBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LightBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.signed_header != null && message.hasOwnProperty("signed_header")) { - var error = $root.tendermint.types.SignedHeader.verify(message.signed_header); - if (error) - return "signed_header." + error; - } - if (message.validator_set != null && message.hasOwnProperty("validator_set")) { - var error = $root.tendermint.types.ValidatorSet.verify(message.validator_set); - if (error) - return "validator_set." + error; - } - return null; - }; - - /** - * Creates a LightBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.LightBlock - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.LightBlock} LightBlock - */ - LightBlock.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.LightBlock) - return object; - var message = new $root.tendermint.types.LightBlock(); - if (object.signed_header != null) { - if (typeof object.signed_header !== "object") - throw TypeError(".tendermint.types.LightBlock.signed_header: object expected"); - message.signed_header = $root.tendermint.types.SignedHeader.fromObject(object.signed_header); - } - if (object.validator_set != null) { - if (typeof object.validator_set !== "object") - throw TypeError(".tendermint.types.LightBlock.validator_set: object expected"); - message.validator_set = $root.tendermint.types.ValidatorSet.fromObject(object.validator_set); - } - return message; - }; - - /** - * Creates a plain object from a LightBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.LightBlock - * @static - * @param {tendermint.types.LightBlock} message LightBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LightBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.signed_header = null; - object.validator_set = null; - } - if (message.signed_header != null && message.hasOwnProperty("signed_header")) - object.signed_header = $root.tendermint.types.SignedHeader.toObject(message.signed_header, options); - if (message.validator_set != null && message.hasOwnProperty("validator_set")) - object.validator_set = $root.tendermint.types.ValidatorSet.toObject(message.validator_set, options); - return object; - }; - - /** - * Converts this LightBlock to JSON. - * @function toJSON - * @memberof tendermint.types.LightBlock - * @instance - * @returns {Object.} JSON object - */ - LightBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return LightBlock; - })(); - - types.BlockMeta = (function() { - - /** - * Properties of a BlockMeta. - * @memberof tendermint.types - * @interface IBlockMeta - * @property {tendermint.types.IBlockID|null} [block_id] BlockMeta block_id - * @property {Long|null} [block_size] BlockMeta block_size - * @property {tendermint.types.IHeader|null} [header] BlockMeta header - * @property {Long|null} [num_txs] BlockMeta num_txs - */ - - /** - * Constructs a new BlockMeta. - * @memberof tendermint.types - * @classdesc Represents a BlockMeta. - * @implements IBlockMeta - * @constructor - * @param {tendermint.types.IBlockMeta=} [properties] Properties to set - */ - function BlockMeta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockMeta block_id. - * @member {tendermint.types.IBlockID|null|undefined} block_id - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.block_id = null; - - /** - * BlockMeta block_size. - * @member {Long} block_size - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.block_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BlockMeta header. - * @member {tendermint.types.IHeader|null|undefined} header - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.header = null; - - /** - * BlockMeta num_txs. - * @member {Long} num_txs - * @memberof tendermint.types.BlockMeta - * @instance - */ - BlockMeta.prototype.num_txs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified BlockMeta message. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @function encode - * @memberof tendermint.types.BlockMeta - * @static - * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockMeta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block_id != null && Object.hasOwnProperty.call(message, "block_id")) - $root.tendermint.types.BlockID.encode(message.block_id, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.block_size != null && Object.hasOwnProperty.call(message, "block_size")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.block_size); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.tendermint.types.Header.encode(message.header, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.num_txs != null && Object.hasOwnProperty.call(message, "num_txs")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.num_txs); - return writer; - }; - - /** - * Encodes the specified BlockMeta message, length delimited. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.BlockMeta - * @static - * @param {tendermint.types.IBlockMeta} message BlockMeta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockMeta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockMeta message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.BlockMeta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.BlockMeta} BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockMeta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockMeta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_id = $root.tendermint.types.BlockID.decode(reader, reader.uint32()); - break; - case 2: - message.block_size = reader.int64(); - break; - case 3: - message.header = $root.tendermint.types.Header.decode(reader, reader.uint32()); - break; - case 4: - message.num_txs = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockMeta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.BlockMeta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.BlockMeta} BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockMeta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockMeta message. - * @function verify - * @memberof tendermint.types.BlockMeta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockMeta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block_id != null && message.hasOwnProperty("block_id")) { - var error = $root.tendermint.types.BlockID.verify(message.block_id); - if (error) - return "block_id." + error; - } - if (message.block_size != null && message.hasOwnProperty("block_size")) - if (!$util.isInteger(message.block_size) && !(message.block_size && $util.isInteger(message.block_size.low) && $util.isInteger(message.block_size.high))) - return "block_size: integer|Long expected"; - if (message.header != null && message.hasOwnProperty("header")) { - var error = $root.tendermint.types.Header.verify(message.header); - if (error) - return "header." + error; - } - if (message.num_txs != null && message.hasOwnProperty("num_txs")) - if (!$util.isInteger(message.num_txs) && !(message.num_txs && $util.isInteger(message.num_txs.low) && $util.isInteger(message.num_txs.high))) - return "num_txs: integer|Long expected"; - return null; - }; - - /** - * Creates a BlockMeta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.BlockMeta - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.BlockMeta} BlockMeta - */ - BlockMeta.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.BlockMeta) - return object; - var message = new $root.tendermint.types.BlockMeta(); - if (object.block_id != null) { - if (typeof object.block_id !== "object") - throw TypeError(".tendermint.types.BlockMeta.block_id: object expected"); - message.block_id = $root.tendermint.types.BlockID.fromObject(object.block_id); - } - if (object.block_size != null) - if ($util.Long) - (message.block_size = $util.Long.fromValue(object.block_size)).unsigned = false; - else if (typeof object.block_size === "string") - message.block_size = parseInt(object.block_size, 10); - else if (typeof object.block_size === "number") - message.block_size = object.block_size; - else if (typeof object.block_size === "object") - message.block_size = new $util.LongBits(object.block_size.low >>> 0, object.block_size.high >>> 0).toNumber(); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".tendermint.types.BlockMeta.header: object expected"); - message.header = $root.tendermint.types.Header.fromObject(object.header); - } - if (object.num_txs != null) - if ($util.Long) - (message.num_txs = $util.Long.fromValue(object.num_txs)).unsigned = false; - else if (typeof object.num_txs === "string") - message.num_txs = parseInt(object.num_txs, 10); - else if (typeof object.num_txs === "number") - message.num_txs = object.num_txs; - else if (typeof object.num_txs === "object") - message.num_txs = new $util.LongBits(object.num_txs.low >>> 0, object.num_txs.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a BlockMeta message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.BlockMeta - * @static - * @param {tendermint.types.BlockMeta} message BlockMeta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockMeta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.block_id = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.block_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block_size = options.longs === String ? "0" : 0; - object.header = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.num_txs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.num_txs = options.longs === String ? "0" : 0; - } - if (message.block_id != null && message.hasOwnProperty("block_id")) - object.block_id = $root.tendermint.types.BlockID.toObject(message.block_id, options); - if (message.block_size != null && message.hasOwnProperty("block_size")) - if (typeof message.block_size === "number") - object.block_size = options.longs === String ? String(message.block_size) : message.block_size; - else - object.block_size = options.longs === String ? $util.Long.prototype.toString.call(message.block_size) : options.longs === Number ? new $util.LongBits(message.block_size.low >>> 0, message.block_size.high >>> 0).toNumber() : message.block_size; - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.tendermint.types.Header.toObject(message.header, options); - if (message.num_txs != null && message.hasOwnProperty("num_txs")) - if (typeof message.num_txs === "number") - object.num_txs = options.longs === String ? String(message.num_txs) : message.num_txs; - else - object.num_txs = options.longs === String ? $util.Long.prototype.toString.call(message.num_txs) : options.longs === Number ? new $util.LongBits(message.num_txs.low >>> 0, message.num_txs.high >>> 0).toNumber() : message.num_txs; - return object; - }; - - /** - * Converts this BlockMeta to JSON. - * @function toJSON - * @memberof tendermint.types.BlockMeta - * @instance - * @returns {Object.} JSON object - */ - BlockMeta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockMeta; - })(); - - types.TxProof = (function() { - - /** - * Properties of a TxProof. - * @memberof tendermint.types - * @interface ITxProof - * @property {Uint8Array|null} [root_hash] TxProof root_hash - * @property {Uint8Array|null} [data] TxProof data - * @property {tendermint.crypto.IProof|null} [proof] TxProof proof - */ - - /** - * Constructs a new TxProof. - * @memberof tendermint.types - * @classdesc Represents a TxProof. - * @implements ITxProof - * @constructor - * @param {tendermint.types.ITxProof=} [properties] Properties to set - */ - function TxProof(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TxProof root_hash. - * @member {Uint8Array} root_hash - * @memberof tendermint.types.TxProof - * @instance - */ - TxProof.prototype.root_hash = $util.newBuffer([]); - - /** - * TxProof data. - * @member {Uint8Array} data - * @memberof tendermint.types.TxProof - * @instance - */ - TxProof.prototype.data = $util.newBuffer([]); - - /** - * TxProof proof. - * @member {tendermint.crypto.IProof|null|undefined} proof - * @memberof tendermint.types.TxProof - * @instance - */ - TxProof.prototype.proof = null; - - /** - * Encodes the specified TxProof message. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @function encode - * @memberof tendermint.types.TxProof - * @static - * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxProof.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.root_hash != null && Object.hasOwnProperty.call(message, "root_hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.root_hash); - if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.tendermint.crypto.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TxProof message, length delimited. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.TxProof - * @static - * @param {tendermint.types.ITxProof} message TxProof message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TxProof.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TxProof message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.TxProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.TxProof} TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxProof.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.TxProof(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.root_hash = reader.bytes(); - break; - case 2: - message.data = reader.bytes(); - break; - case 3: - message.proof = $root.tendermint.crypto.Proof.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TxProof message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.TxProof - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.TxProof} TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TxProof.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TxProof message. - * @function verify - * @memberof tendermint.types.TxProof - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TxProof.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.root_hash != null && message.hasOwnProperty("root_hash")) - if (!(message.root_hash && typeof message.root_hash.length === "number" || $util.isString(message.root_hash))) - return "root_hash: buffer expected"; - if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - if (message.proof != null && message.hasOwnProperty("proof")) { - var error = $root.tendermint.crypto.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - return null; - }; - - /** - * Creates a TxProof message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.TxProof - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.TxProof} TxProof - */ - TxProof.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.TxProof) - return object; - var message = new $root.tendermint.types.TxProof(); - if (object.root_hash != null) - if (typeof object.root_hash === "string") - $util.base64.decode(object.root_hash, message.root_hash = $util.newBuffer($util.base64.length(object.root_hash)), 0); - else if (object.root_hash.length) - message.root_hash = object.root_hash; - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length) - message.data = object.data; - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".tendermint.types.TxProof.proof: object expected"); - message.proof = $root.tendermint.crypto.Proof.fromObject(object.proof); - } - return message; - }; - - /** - * Creates a plain object from a TxProof message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.TxProof - * @static - * @param {tendermint.types.TxProof} message TxProof - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TxProof.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.root_hash = ""; - else { - object.root_hash = []; - if (options.bytes !== Array) - object.root_hash = $util.newBuffer(object.root_hash); - } - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } - object.proof = null; - } - if (message.root_hash != null && message.hasOwnProperty("root_hash")) - object.root_hash = options.bytes === String ? $util.base64.encode(message.root_hash, 0, message.root_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.root_hash) : message.root_hash; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.tendermint.crypto.Proof.toObject(message.proof, options); - return object; - }; - - /** - * Converts this TxProof to JSON. - * @function toJSON - * @memberof tendermint.types.TxProof - * @instance - * @returns {Object.} JSON object - */ - TxProof.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return TxProof; - })(); - - types.ValidatorSet = (function() { - - /** - * Properties of a ValidatorSet. - * @memberof tendermint.types - * @interface IValidatorSet - * @property {Array.|null} [validators] ValidatorSet validators - * @property {tendermint.types.IValidator|null} [proposer] ValidatorSet proposer - * @property {Long|null} [total_voting_power] ValidatorSet total_voting_power - */ - - /** - * Constructs a new ValidatorSet. - * @memberof tendermint.types - * @classdesc Represents a ValidatorSet. - * @implements IValidatorSet - * @constructor - * @param {tendermint.types.IValidatorSet=} [properties] Properties to set - */ - function ValidatorSet(properties) { - this.validators = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidatorSet validators. - * @member {Array.} validators - * @memberof tendermint.types.ValidatorSet - * @instance - */ - ValidatorSet.prototype.validators = $util.emptyArray; - - /** - * ValidatorSet proposer. - * @member {tendermint.types.IValidator|null|undefined} proposer - * @memberof tendermint.types.ValidatorSet - * @instance - */ - ValidatorSet.prototype.proposer = null; - - /** - * ValidatorSet total_voting_power. - * @member {Long} total_voting_power - * @memberof tendermint.types.ValidatorSet - * @instance - */ - ValidatorSet.prototype.total_voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified ValidatorSet message. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @function encode - * @memberof tendermint.types.ValidatorSet - * @static - * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.validators != null && message.validators.length) - for (var i = 0; i < message.validators.length; ++i) - $root.tendermint.types.Validator.encode(message.validators[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer")) - $root.tendermint.types.Validator.encode(message.proposer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.total_voting_power != null && Object.hasOwnProperty.call(message, "total_voting_power")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.total_voting_power); - return writer; - }; - - /** - * Encodes the specified ValidatorSet message, length delimited. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.ValidatorSet - * @static - * @param {tendermint.types.IValidatorSet} message ValidatorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.ValidatorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.ValidatorSet} ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.validators && message.validators.length)) - message.validators = []; - message.validators.push($root.tendermint.types.Validator.decode(reader, reader.uint32())); - break; - case 2: - message.proposer = $root.tendermint.types.Validator.decode(reader, reader.uint32()); - break; - case 3: - message.total_voting_power = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.ValidatorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.ValidatorSet} ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidatorSet message. - * @function verify - * @memberof tendermint.types.ValidatorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidatorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.validators != null && message.hasOwnProperty("validators")) { - if (!Array.isArray(message.validators)) - return "validators: array expected"; - for (var i = 0; i < message.validators.length; ++i) { - var error = $root.tendermint.types.Validator.verify(message.validators[i]); - if (error) - return "validators." + error; - } - } - if (message.proposer != null && message.hasOwnProperty("proposer")) { - var error = $root.tendermint.types.Validator.verify(message.proposer); - if (error) - return "proposer." + error; - } - if (message.total_voting_power != null && message.hasOwnProperty("total_voting_power")) - if (!$util.isInteger(message.total_voting_power) && !(message.total_voting_power && $util.isInteger(message.total_voting_power.low) && $util.isInteger(message.total_voting_power.high))) - return "total_voting_power: integer|Long expected"; - return null; - }; - - /** - * Creates a ValidatorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.ValidatorSet - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.ValidatorSet} ValidatorSet - */ - ValidatorSet.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.ValidatorSet) - return object; - var message = new $root.tendermint.types.ValidatorSet(); - if (object.validators) { - if (!Array.isArray(object.validators)) - throw TypeError(".tendermint.types.ValidatorSet.validators: array expected"); - message.validators = []; - for (var i = 0; i < object.validators.length; ++i) { - if (typeof object.validators[i] !== "object") - throw TypeError(".tendermint.types.ValidatorSet.validators: object expected"); - message.validators[i] = $root.tendermint.types.Validator.fromObject(object.validators[i]); - } - } - if (object.proposer != null) { - if (typeof object.proposer !== "object") - throw TypeError(".tendermint.types.ValidatorSet.proposer: object expected"); - message.proposer = $root.tendermint.types.Validator.fromObject(object.proposer); - } - if (object.total_voting_power != null) - if ($util.Long) - (message.total_voting_power = $util.Long.fromValue(object.total_voting_power)).unsigned = false; - else if (typeof object.total_voting_power === "string") - message.total_voting_power = parseInt(object.total_voting_power, 10); - else if (typeof object.total_voting_power === "number") - message.total_voting_power = object.total_voting_power; - else if (typeof object.total_voting_power === "object") - message.total_voting_power = new $util.LongBits(object.total_voting_power.low >>> 0, object.total_voting_power.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ValidatorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.ValidatorSet - * @static - * @param {tendermint.types.ValidatorSet} message ValidatorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidatorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.validators = []; - if (options.defaults) { - object.proposer = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.total_voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.total_voting_power = options.longs === String ? "0" : 0; - } - if (message.validators && message.validators.length) { - object.validators = []; - for (var j = 0; j < message.validators.length; ++j) - object.validators[j] = $root.tendermint.types.Validator.toObject(message.validators[j], options); - } - if (message.proposer != null && message.hasOwnProperty("proposer")) - object.proposer = $root.tendermint.types.Validator.toObject(message.proposer, options); - if (message.total_voting_power != null && message.hasOwnProperty("total_voting_power")) - if (typeof message.total_voting_power === "number") - object.total_voting_power = options.longs === String ? String(message.total_voting_power) : message.total_voting_power; - else - object.total_voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.total_voting_power) : options.longs === Number ? new $util.LongBits(message.total_voting_power.low >>> 0, message.total_voting_power.high >>> 0).toNumber() : message.total_voting_power; - return object; - }; - - /** - * Converts this ValidatorSet to JSON. - * @function toJSON - * @memberof tendermint.types.ValidatorSet - * @instance - * @returns {Object.} JSON object - */ - ValidatorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValidatorSet; - })(); - - types.Validator = (function() { - - /** - * Properties of a Validator. - * @memberof tendermint.types - * @interface IValidator - * @property {Uint8Array|null} [address] Validator address - * @property {tendermint.crypto.IPublicKey|null} [pub_key] Validator pub_key - * @property {Long|null} [voting_power] Validator voting_power - * @property {Long|null} [proposer_priority] Validator proposer_priority - */ - - /** - * Constructs a new Validator. - * @memberof tendermint.types - * @classdesc Represents a Validator. - * @implements IValidator - * @constructor - * @param {tendermint.types.IValidator=} [properties] Properties to set - */ - function Validator(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Validator address. - * @member {Uint8Array} address - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.address = $util.newBuffer([]); - - /** - * Validator pub_key. - * @member {tendermint.crypto.IPublicKey|null|undefined} pub_key - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.pub_key = null; - - /** - * Validator voting_power. - * @member {Long} voting_power - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Validator proposer_priority. - * @member {Long} proposer_priority - * @memberof tendermint.types.Validator - * @instance - */ - Validator.prototype.proposer_priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified Validator message. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @function encode - * @memberof tendermint.types.Validator - * @static - * @param {tendermint.types.IValidator} message Validator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Validator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.address); - if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key")) - $root.tendermint.crypto.PublicKey.encode(message.pub_key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.voting_power != null && Object.hasOwnProperty.call(message, "voting_power")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.voting_power); - if (message.proposer_priority != null && Object.hasOwnProperty.call(message, "proposer_priority")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.proposer_priority); - return writer; - }; - - /** - * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.Validator - * @static - * @param {tendermint.types.IValidator} message Validator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Validator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.Validator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.Validator} Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Validator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.Validator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.bytes(); - break; - case 2: - message.pub_key = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); - break; - case 3: - message.voting_power = reader.int64(); - break; - case 4: - message.proposer_priority = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Validator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.Validator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.Validator} Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Validator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Validator message. - * @function verify - * @memberof tendermint.types.Validator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Validator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!(message.address && typeof message.address.length === "number" || $util.isString(message.address))) - return "address: buffer expected"; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) { - var error = $root.tendermint.crypto.PublicKey.verify(message.pub_key); - if (error) - return "pub_key." + error; - } - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (!$util.isInteger(message.voting_power) && !(message.voting_power && $util.isInteger(message.voting_power.low) && $util.isInteger(message.voting_power.high))) - return "voting_power: integer|Long expected"; - if (message.proposer_priority != null && message.hasOwnProperty("proposer_priority")) - if (!$util.isInteger(message.proposer_priority) && !(message.proposer_priority && $util.isInteger(message.proposer_priority.low) && $util.isInteger(message.proposer_priority.high))) - return "proposer_priority: integer|Long expected"; - return null; - }; - - /** - * Creates a Validator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.Validator - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.Validator} Validator - */ - Validator.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.Validator) - return object; - var message = new $root.tendermint.types.Validator(); - if (object.address != null) - if (typeof object.address === "string") - $util.base64.decode(object.address, message.address = $util.newBuffer($util.base64.length(object.address)), 0); - else if (object.address.length) - message.address = object.address; - if (object.pub_key != null) { - if (typeof object.pub_key !== "object") - throw TypeError(".tendermint.types.Validator.pub_key: object expected"); - message.pub_key = $root.tendermint.crypto.PublicKey.fromObject(object.pub_key); - } - if (object.voting_power != null) - if ($util.Long) - (message.voting_power = $util.Long.fromValue(object.voting_power)).unsigned = false; - else if (typeof object.voting_power === "string") - message.voting_power = parseInt(object.voting_power, 10); - else if (typeof object.voting_power === "number") - message.voting_power = object.voting_power; - else if (typeof object.voting_power === "object") - message.voting_power = new $util.LongBits(object.voting_power.low >>> 0, object.voting_power.high >>> 0).toNumber(); - if (object.proposer_priority != null) - if ($util.Long) - (message.proposer_priority = $util.Long.fromValue(object.proposer_priority)).unsigned = false; - else if (typeof object.proposer_priority === "string") - message.proposer_priority = parseInt(object.proposer_priority, 10); - else if (typeof object.proposer_priority === "number") - message.proposer_priority = object.proposer_priority; - else if (typeof object.proposer_priority === "object") - message.proposer_priority = new $util.LongBits(object.proposer_priority.low >>> 0, object.proposer_priority.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Validator message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.Validator - * @static - * @param {tendermint.types.Validator} message Validator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Validator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.address = ""; - else { - object.address = []; - if (options.bytes !== Array) - object.address = $util.newBuffer(object.address); - } - object.pub_key = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.voting_power = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.proposer_priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.proposer_priority = options.longs === String ? "0" : 0; - } - if (message.address != null && message.hasOwnProperty("address")) - object.address = options.bytes === String ? $util.base64.encode(message.address, 0, message.address.length) : options.bytes === Array ? Array.prototype.slice.call(message.address) : message.address; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) - object.pub_key = $root.tendermint.crypto.PublicKey.toObject(message.pub_key, options); - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (typeof message.voting_power === "number") - object.voting_power = options.longs === String ? String(message.voting_power) : message.voting_power; - else - object.voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.voting_power) : options.longs === Number ? new $util.LongBits(message.voting_power.low >>> 0, message.voting_power.high >>> 0).toNumber() : message.voting_power; - if (message.proposer_priority != null && message.hasOwnProperty("proposer_priority")) - if (typeof message.proposer_priority === "number") - object.proposer_priority = options.longs === String ? String(message.proposer_priority) : message.proposer_priority; - else - object.proposer_priority = options.longs === String ? $util.Long.prototype.toString.call(message.proposer_priority) : options.longs === Number ? new $util.LongBits(message.proposer_priority.low >>> 0, message.proposer_priority.high >>> 0).toNumber() : message.proposer_priority; - return object; - }; - - /** - * Converts this Validator to JSON. - * @function toJSON - * @memberof tendermint.types.Validator - * @instance - * @returns {Object.} JSON object - */ - Validator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Validator; - })(); - - types.SimpleValidator = (function() { - - /** - * Properties of a SimpleValidator. - * @memberof tendermint.types - * @interface ISimpleValidator - * @property {tendermint.crypto.IPublicKey|null} [pub_key] SimpleValidator pub_key - * @property {Long|null} [voting_power] SimpleValidator voting_power - */ - - /** - * Constructs a new SimpleValidator. - * @memberof tendermint.types - * @classdesc Represents a SimpleValidator. - * @implements ISimpleValidator - * @constructor - * @param {tendermint.types.ISimpleValidator=} [properties] Properties to set - */ - function SimpleValidator(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SimpleValidator pub_key. - * @member {tendermint.crypto.IPublicKey|null|undefined} pub_key - * @memberof tendermint.types.SimpleValidator - * @instance - */ - SimpleValidator.prototype.pub_key = null; - - /** - * SimpleValidator voting_power. - * @member {Long} voting_power - * @memberof tendermint.types.SimpleValidator - * @instance - */ - SimpleValidator.prototype.voting_power = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified SimpleValidator message. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @function encode - * @memberof tendermint.types.SimpleValidator - * @static - * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleValidator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key")) - $root.tendermint.crypto.PublicKey.encode(message.pub_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.voting_power != null && Object.hasOwnProperty.call(message, "voting_power")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.voting_power); - return writer; - }; - - /** - * Encodes the specified SimpleValidator message, length delimited. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.SimpleValidator - * @static - * @param {tendermint.types.ISimpleValidator} message SimpleValidator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleValidator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.SimpleValidator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.SimpleValidator} SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleValidator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.SimpleValidator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.pub_key = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32()); - break; - case 2: - message.voting_power = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.SimpleValidator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.SimpleValidator} SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleValidator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SimpleValidator message. - * @function verify - * @memberof tendermint.types.SimpleValidator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimpleValidator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pub_key != null && message.hasOwnProperty("pub_key")) { - var error = $root.tendermint.crypto.PublicKey.verify(message.pub_key); - if (error) - return "pub_key." + error; - } - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (!$util.isInteger(message.voting_power) && !(message.voting_power && $util.isInteger(message.voting_power.low) && $util.isInteger(message.voting_power.high))) - return "voting_power: integer|Long expected"; - return null; - }; - - /** - * Creates a SimpleValidator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.SimpleValidator - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.SimpleValidator} SimpleValidator - */ - SimpleValidator.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.SimpleValidator) - return object; - var message = new $root.tendermint.types.SimpleValidator(); - if (object.pub_key != null) { - if (typeof object.pub_key !== "object") - throw TypeError(".tendermint.types.SimpleValidator.pub_key: object expected"); - message.pub_key = $root.tendermint.crypto.PublicKey.fromObject(object.pub_key); - } - if (object.voting_power != null) - if ($util.Long) - (message.voting_power = $util.Long.fromValue(object.voting_power)).unsigned = false; - else if (typeof object.voting_power === "string") - message.voting_power = parseInt(object.voting_power, 10); - else if (typeof object.voting_power === "number") - message.voting_power = object.voting_power; - else if (typeof object.voting_power === "object") - message.voting_power = new $util.LongBits(object.voting_power.low >>> 0, object.voting_power.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a SimpleValidator message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.SimpleValidator - * @static - * @param {tendermint.types.SimpleValidator} message SimpleValidator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimpleValidator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pub_key = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.voting_power = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.voting_power = options.longs === String ? "0" : 0; - } - if (message.pub_key != null && message.hasOwnProperty("pub_key")) - object.pub_key = $root.tendermint.crypto.PublicKey.toObject(message.pub_key, options); - if (message.voting_power != null && message.hasOwnProperty("voting_power")) - if (typeof message.voting_power === "number") - object.voting_power = options.longs === String ? String(message.voting_power) : message.voting_power; - else - object.voting_power = options.longs === String ? $util.Long.prototype.toString.call(message.voting_power) : options.longs === Number ? new $util.LongBits(message.voting_power.low >>> 0, message.voting_power.high >>> 0).toNumber() : message.voting_power; - return object; - }; - - /** - * Converts this SimpleValidator to JSON. - * @function toJSON - * @memberof tendermint.types.SimpleValidator - * @instance - * @returns {Object.} JSON object - */ - SimpleValidator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SimpleValidator; - })(); - - types.ConsensusParams = (function() { - - /** - * Properties of a ConsensusParams. - * @memberof tendermint.types - * @interface IConsensusParams - * @property {tendermint.types.IBlockParams|null} [block] ConsensusParams block - * @property {tendermint.types.IEvidenceParams|null} [evidence] ConsensusParams evidence - * @property {tendermint.types.IValidatorParams|null} [validator] ConsensusParams validator - * @property {tendermint.types.IVersionParams|null} [version] ConsensusParams version - */ - - /** - * Constructs a new ConsensusParams. - * @memberof tendermint.types - * @classdesc Represents a ConsensusParams. - * @implements IConsensusParams - * @constructor - * @param {tendermint.types.IConsensusParams=} [properties] Properties to set - */ - function ConsensusParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsensusParams block. - * @member {tendermint.types.IBlockParams|null|undefined} block - * @memberof tendermint.types.ConsensusParams - * @instance - */ - ConsensusParams.prototype.block = null; - - /** - * ConsensusParams evidence. - * @member {tendermint.types.IEvidenceParams|null|undefined} evidence - * @memberof tendermint.types.ConsensusParams - * @instance - */ - ConsensusParams.prototype.evidence = null; - - /** - * ConsensusParams validator. - * @member {tendermint.types.IValidatorParams|null|undefined} validator - * @memberof tendermint.types.ConsensusParams - * @instance - */ - ConsensusParams.prototype.validator = null; - - /** - * ConsensusParams version. - * @member {tendermint.types.IVersionParams|null|undefined} version - * @memberof tendermint.types.ConsensusParams - * @instance - */ - ConsensusParams.prototype.version = null; - - /** - * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. - * @function encode - * @memberof tendermint.types.ConsensusParams - * @static - * @param {tendermint.types.IConsensusParams} message ConsensusParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - $root.tendermint.types.BlockParams.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) - $root.tendermint.types.EvidenceParams.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validator != null && Object.hasOwnProperty.call(message, "validator")) - $root.tendermint.types.ValidatorParams.encode(message.validator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.tendermint.types.VersionParams.encode(message.version, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.ConsensusParams - * @static - * @param {tendermint.types.IConsensusParams} message ConsensusParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsensusParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.ConsensusParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.ConsensusParams} ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ConsensusParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = $root.tendermint.types.BlockParams.decode(reader, reader.uint32()); - break; - case 2: - message.evidence = $root.tendermint.types.EvidenceParams.decode(reader, reader.uint32()); - break; - case 3: - message.validator = $root.tendermint.types.ValidatorParams.decode(reader, reader.uint32()); - break; - case 4: - message.version = $root.tendermint.types.VersionParams.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.ConsensusParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.ConsensusParams} ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsensusParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsensusParams message. - * @function verify - * @memberof tendermint.types.ConsensusParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsensusParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block != null && message.hasOwnProperty("block")) { - var error = $root.tendermint.types.BlockParams.verify(message.block); - if (error) - return "block." + error; - } - if (message.evidence != null && message.hasOwnProperty("evidence")) { - var error = $root.tendermint.types.EvidenceParams.verify(message.evidence); - if (error) - return "evidence." + error; - } - if (message.validator != null && message.hasOwnProperty("validator")) { - var error = $root.tendermint.types.ValidatorParams.verify(message.validator); - if (error) - return "validator." + error; - } - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.tendermint.types.VersionParams.verify(message.version); - if (error) - return "version." + error; - } - return null; - }; - - /** - * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.ConsensusParams - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.ConsensusParams} ConsensusParams - */ - ConsensusParams.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.ConsensusParams) - return object; - var message = new $root.tendermint.types.ConsensusParams(); - if (object.block != null) { - if (typeof object.block !== "object") - throw TypeError(".tendermint.types.ConsensusParams.block: object expected"); - message.block = $root.tendermint.types.BlockParams.fromObject(object.block); - } - if (object.evidence != null) { - if (typeof object.evidence !== "object") - throw TypeError(".tendermint.types.ConsensusParams.evidence: object expected"); - message.evidence = $root.tendermint.types.EvidenceParams.fromObject(object.evidence); - } - if (object.validator != null) { - if (typeof object.validator !== "object") - throw TypeError(".tendermint.types.ConsensusParams.validator: object expected"); - message.validator = $root.tendermint.types.ValidatorParams.fromObject(object.validator); - } - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".tendermint.types.ConsensusParams.version: object expected"); - message.version = $root.tendermint.types.VersionParams.fromObject(object.version); - } - return message; - }; - - /** - * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.ConsensusParams - * @static - * @param {tendermint.types.ConsensusParams} message ConsensusParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsensusParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.block = null; - object.evidence = null; - object.validator = null; - object.version = null; - } - if (message.block != null && message.hasOwnProperty("block")) - object.block = $root.tendermint.types.BlockParams.toObject(message.block, options); - if (message.evidence != null && message.hasOwnProperty("evidence")) - object.evidence = $root.tendermint.types.EvidenceParams.toObject(message.evidence, options); - if (message.validator != null && message.hasOwnProperty("validator")) - object.validator = $root.tendermint.types.ValidatorParams.toObject(message.validator, options); - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.tendermint.types.VersionParams.toObject(message.version, options); - return object; - }; - - /** - * Converts this ConsensusParams to JSON. - * @function toJSON - * @memberof tendermint.types.ConsensusParams - * @instance - * @returns {Object.} JSON object - */ - ConsensusParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ConsensusParams; - })(); - - types.BlockParams = (function() { - - /** - * Properties of a BlockParams. - * @memberof tendermint.types - * @interface IBlockParams - * @property {Long|null} [max_bytes] BlockParams max_bytes - * @property {Long|null} [max_gas] BlockParams max_gas - * @property {Long|null} [time_iota_ms] BlockParams time_iota_ms - */ - - /** - * Constructs a new BlockParams. - * @memberof tendermint.types - * @classdesc Represents a BlockParams. - * @implements IBlockParams - * @constructor - * @param {tendermint.types.IBlockParams=} [properties] Properties to set - */ - function BlockParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlockParams max_bytes. - * @member {Long} max_bytes - * @memberof tendermint.types.BlockParams - * @instance - */ - BlockParams.prototype.max_bytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BlockParams max_gas. - * @member {Long} max_gas - * @memberof tendermint.types.BlockParams - * @instance - */ - BlockParams.prototype.max_gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BlockParams time_iota_ms. - * @member {Long} time_iota_ms - * @memberof tendermint.types.BlockParams - * @instance - */ - BlockParams.prototype.time_iota_ms = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. - * @function encode - * @memberof tendermint.types.BlockParams - * @static - * @param {tendermint.types.IBlockParams} message BlockParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.max_bytes != null && Object.hasOwnProperty.call(message, "max_bytes")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.max_bytes); - if (message.max_gas != null && Object.hasOwnProperty.call(message, "max_gas")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.max_gas); - if (message.time_iota_ms != null && Object.hasOwnProperty.call(message, "time_iota_ms")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.time_iota_ms); - return writer; - }; - - /** - * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.BlockParams - * @static - * @param {tendermint.types.IBlockParams} message BlockParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlockParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlockParams message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.BlockParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.BlockParams} BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.BlockParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_bytes = reader.int64(); - break; - case 2: - message.max_gas = reader.int64(); - break; - case 3: - message.time_iota_ms = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlockParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.BlockParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.BlockParams} BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlockParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlockParams message. - * @function verify - * @memberof tendermint.types.BlockParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlockParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.max_bytes != null && message.hasOwnProperty("max_bytes")) - if (!$util.isInteger(message.max_bytes) && !(message.max_bytes && $util.isInteger(message.max_bytes.low) && $util.isInteger(message.max_bytes.high))) - return "max_bytes: integer|Long expected"; - if (message.max_gas != null && message.hasOwnProperty("max_gas")) - if (!$util.isInteger(message.max_gas) && !(message.max_gas && $util.isInteger(message.max_gas.low) && $util.isInteger(message.max_gas.high))) - return "max_gas: integer|Long expected"; - if (message.time_iota_ms != null && message.hasOwnProperty("time_iota_ms")) - if (!$util.isInteger(message.time_iota_ms) && !(message.time_iota_ms && $util.isInteger(message.time_iota_ms.low) && $util.isInteger(message.time_iota_ms.high))) - return "time_iota_ms: integer|Long expected"; - return null; - }; - - /** - * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.BlockParams - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.BlockParams} BlockParams - */ - BlockParams.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.BlockParams) - return object; - var message = new $root.tendermint.types.BlockParams(); - if (object.max_bytes != null) - if ($util.Long) - (message.max_bytes = $util.Long.fromValue(object.max_bytes)).unsigned = false; - else if (typeof object.max_bytes === "string") - message.max_bytes = parseInt(object.max_bytes, 10); - else if (typeof object.max_bytes === "number") - message.max_bytes = object.max_bytes; - else if (typeof object.max_bytes === "object") - message.max_bytes = new $util.LongBits(object.max_bytes.low >>> 0, object.max_bytes.high >>> 0).toNumber(); - if (object.max_gas != null) - if ($util.Long) - (message.max_gas = $util.Long.fromValue(object.max_gas)).unsigned = false; - else if (typeof object.max_gas === "string") - message.max_gas = parseInt(object.max_gas, 10); - else if (typeof object.max_gas === "number") - message.max_gas = object.max_gas; - else if (typeof object.max_gas === "object") - message.max_gas = new $util.LongBits(object.max_gas.low >>> 0, object.max_gas.high >>> 0).toNumber(); - if (object.time_iota_ms != null) - if ($util.Long) - (message.time_iota_ms = $util.Long.fromValue(object.time_iota_ms)).unsigned = false; - else if (typeof object.time_iota_ms === "string") - message.time_iota_ms = parseInt(object.time_iota_ms, 10); - else if (typeof object.time_iota_ms === "number") - message.time_iota_ms = object.time_iota_ms; - else if (typeof object.time_iota_ms === "object") - message.time_iota_ms = new $util.LongBits(object.time_iota_ms.low >>> 0, object.time_iota_ms.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a BlockParams message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.BlockParams - * @static - * @param {tendermint.types.BlockParams} message BlockParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlockParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.max_bytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_bytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.max_gas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_gas = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.time_iota_ms = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.time_iota_ms = options.longs === String ? "0" : 0; - } - if (message.max_bytes != null && message.hasOwnProperty("max_bytes")) - if (typeof message.max_bytes === "number") - object.max_bytes = options.longs === String ? String(message.max_bytes) : message.max_bytes; - else - object.max_bytes = options.longs === String ? $util.Long.prototype.toString.call(message.max_bytes) : options.longs === Number ? new $util.LongBits(message.max_bytes.low >>> 0, message.max_bytes.high >>> 0).toNumber() : message.max_bytes; - if (message.max_gas != null && message.hasOwnProperty("max_gas")) - if (typeof message.max_gas === "number") - object.max_gas = options.longs === String ? String(message.max_gas) : message.max_gas; - else - object.max_gas = options.longs === String ? $util.Long.prototype.toString.call(message.max_gas) : options.longs === Number ? new $util.LongBits(message.max_gas.low >>> 0, message.max_gas.high >>> 0).toNumber() : message.max_gas; - if (message.time_iota_ms != null && message.hasOwnProperty("time_iota_ms")) - if (typeof message.time_iota_ms === "number") - object.time_iota_ms = options.longs === String ? String(message.time_iota_ms) : message.time_iota_ms; - else - object.time_iota_ms = options.longs === String ? $util.Long.prototype.toString.call(message.time_iota_ms) : options.longs === Number ? new $util.LongBits(message.time_iota_ms.low >>> 0, message.time_iota_ms.high >>> 0).toNumber() : message.time_iota_ms; - return object; - }; - - /** - * Converts this BlockParams to JSON. - * @function toJSON - * @memberof tendermint.types.BlockParams - * @instance - * @returns {Object.} JSON object - */ - BlockParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BlockParams; - })(); - - types.EvidenceParams = (function() { - - /** - * Properties of an EvidenceParams. - * @memberof tendermint.types - * @interface IEvidenceParams - * @property {Long|null} [max_age_num_blocks] EvidenceParams max_age_num_blocks - * @property {google.protobuf.IDuration|null} [max_age_duration] EvidenceParams max_age_duration - * @property {Long|null} [max_bytes] EvidenceParams max_bytes - */ - - /** - * Constructs a new EvidenceParams. - * @memberof tendermint.types - * @classdesc Represents an EvidenceParams. - * @implements IEvidenceParams - * @constructor - * @param {tendermint.types.IEvidenceParams=} [properties] Properties to set - */ - function EvidenceParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvidenceParams max_age_num_blocks. - * @member {Long} max_age_num_blocks - * @memberof tendermint.types.EvidenceParams - * @instance - */ - EvidenceParams.prototype.max_age_num_blocks = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * EvidenceParams max_age_duration. - * @member {google.protobuf.IDuration|null|undefined} max_age_duration - * @memberof tendermint.types.EvidenceParams - * @instance - */ - EvidenceParams.prototype.max_age_duration = null; - - /** - * EvidenceParams max_bytes. - * @member {Long} max_bytes - * @memberof tendermint.types.EvidenceParams - * @instance - */ - EvidenceParams.prototype.max_bytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified EvidenceParams message. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. - * @function encode - * @memberof tendermint.types.EvidenceParams - * @static - * @param {tendermint.types.IEvidenceParams} message EvidenceParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvidenceParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.max_age_num_blocks != null && Object.hasOwnProperty.call(message, "max_age_num_blocks")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.max_age_num_blocks); - if (message.max_age_duration != null && Object.hasOwnProperty.call(message, "max_age_duration")) - $root.google.protobuf.Duration.encode(message.max_age_duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.max_bytes != null && Object.hasOwnProperty.call(message, "max_bytes")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.max_bytes); - return writer; - }; - - /** - * Encodes the specified EvidenceParams message, length delimited. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.EvidenceParams - * @static - * @param {tendermint.types.IEvidenceParams} message EvidenceParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvidenceParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvidenceParams message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.EvidenceParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.EvidenceParams} EvidenceParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvidenceParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.EvidenceParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.max_age_num_blocks = reader.int64(); - break; - case 2: - message.max_age_duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 3: - message.max_bytes = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvidenceParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.EvidenceParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.EvidenceParams} EvidenceParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvidenceParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvidenceParams message. - * @function verify - * @memberof tendermint.types.EvidenceParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvidenceParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.max_age_num_blocks != null && message.hasOwnProperty("max_age_num_blocks")) - if (!$util.isInteger(message.max_age_num_blocks) && !(message.max_age_num_blocks && $util.isInteger(message.max_age_num_blocks.low) && $util.isInteger(message.max_age_num_blocks.high))) - return "max_age_num_blocks: integer|Long expected"; - if (message.max_age_duration != null && message.hasOwnProperty("max_age_duration")) { - var error = $root.google.protobuf.Duration.verify(message.max_age_duration); - if (error) - return "max_age_duration." + error; - } - if (message.max_bytes != null && message.hasOwnProperty("max_bytes")) - if (!$util.isInteger(message.max_bytes) && !(message.max_bytes && $util.isInteger(message.max_bytes.low) && $util.isInteger(message.max_bytes.high))) - return "max_bytes: integer|Long expected"; - return null; - }; - - /** - * Creates an EvidenceParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.EvidenceParams - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.EvidenceParams} EvidenceParams - */ - EvidenceParams.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.EvidenceParams) - return object; - var message = new $root.tendermint.types.EvidenceParams(); - if (object.max_age_num_blocks != null) - if ($util.Long) - (message.max_age_num_blocks = $util.Long.fromValue(object.max_age_num_blocks)).unsigned = false; - else if (typeof object.max_age_num_blocks === "string") - message.max_age_num_blocks = parseInt(object.max_age_num_blocks, 10); - else if (typeof object.max_age_num_blocks === "number") - message.max_age_num_blocks = object.max_age_num_blocks; - else if (typeof object.max_age_num_blocks === "object") - message.max_age_num_blocks = new $util.LongBits(object.max_age_num_blocks.low >>> 0, object.max_age_num_blocks.high >>> 0).toNumber(); - if (object.max_age_duration != null) { - if (typeof object.max_age_duration !== "object") - throw TypeError(".tendermint.types.EvidenceParams.max_age_duration: object expected"); - message.max_age_duration = $root.google.protobuf.Duration.fromObject(object.max_age_duration); - } - if (object.max_bytes != null) - if ($util.Long) - (message.max_bytes = $util.Long.fromValue(object.max_bytes)).unsigned = false; - else if (typeof object.max_bytes === "string") - message.max_bytes = parseInt(object.max_bytes, 10); - else if (typeof object.max_bytes === "number") - message.max_bytes = object.max_bytes; - else if (typeof object.max_bytes === "object") - message.max_bytes = new $util.LongBits(object.max_bytes.low >>> 0, object.max_bytes.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an EvidenceParams message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.EvidenceParams - * @static - * @param {tendermint.types.EvidenceParams} message EvidenceParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvidenceParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.max_age_num_blocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_age_num_blocks = options.longs === String ? "0" : 0; - object.max_age_duration = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.max_bytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_bytes = options.longs === String ? "0" : 0; - } - if (message.max_age_num_blocks != null && message.hasOwnProperty("max_age_num_blocks")) - if (typeof message.max_age_num_blocks === "number") - object.max_age_num_blocks = options.longs === String ? String(message.max_age_num_blocks) : message.max_age_num_blocks; - else - object.max_age_num_blocks = options.longs === String ? $util.Long.prototype.toString.call(message.max_age_num_blocks) : options.longs === Number ? new $util.LongBits(message.max_age_num_blocks.low >>> 0, message.max_age_num_blocks.high >>> 0).toNumber() : message.max_age_num_blocks; - if (message.max_age_duration != null && message.hasOwnProperty("max_age_duration")) - object.max_age_duration = $root.google.protobuf.Duration.toObject(message.max_age_duration, options); - if (message.max_bytes != null && message.hasOwnProperty("max_bytes")) - if (typeof message.max_bytes === "number") - object.max_bytes = options.longs === String ? String(message.max_bytes) : message.max_bytes; - else - object.max_bytes = options.longs === String ? $util.Long.prototype.toString.call(message.max_bytes) : options.longs === Number ? new $util.LongBits(message.max_bytes.low >>> 0, message.max_bytes.high >>> 0).toNumber() : message.max_bytes; - return object; - }; - - /** - * Converts this EvidenceParams to JSON. - * @function toJSON - * @memberof tendermint.types.EvidenceParams - * @instance - * @returns {Object.} JSON object - */ - EvidenceParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EvidenceParams; - })(); - - types.ValidatorParams = (function() { - - /** - * Properties of a ValidatorParams. - * @memberof tendermint.types - * @interface IValidatorParams - * @property {Array.|null} [pub_key_types] ValidatorParams pub_key_types - */ - - /** - * Constructs a new ValidatorParams. - * @memberof tendermint.types - * @classdesc Represents a ValidatorParams. - * @implements IValidatorParams - * @constructor - * @param {tendermint.types.IValidatorParams=} [properties] Properties to set - */ - function ValidatorParams(properties) { - this.pub_key_types = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidatorParams pub_key_types. - * @member {Array.} pub_key_types - * @memberof tendermint.types.ValidatorParams - * @instance - */ - ValidatorParams.prototype.pub_key_types = $util.emptyArray; - - /** - * Encodes the specified ValidatorParams message. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. - * @function encode - * @memberof tendermint.types.ValidatorParams - * @static - * @param {tendermint.types.IValidatorParams} message ValidatorParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pub_key_types != null && message.pub_key_types.length) - for (var i = 0; i < message.pub_key_types.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pub_key_types[i]); - return writer; - }; - - /** - * Encodes the specified ValidatorParams message, length delimited. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.ValidatorParams - * @static - * @param {tendermint.types.IValidatorParams} message ValidatorParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidatorParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValidatorParams message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.ValidatorParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.ValidatorParams} ValidatorParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.ValidatorParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.pub_key_types && message.pub_key_types.length)) - message.pub_key_types = []; - message.pub_key_types.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValidatorParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.ValidatorParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.ValidatorParams} ValidatorParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidatorParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValidatorParams message. - * @function verify - * @memberof tendermint.types.ValidatorParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidatorParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pub_key_types != null && message.hasOwnProperty("pub_key_types")) { - if (!Array.isArray(message.pub_key_types)) - return "pub_key_types: array expected"; - for (var i = 0; i < message.pub_key_types.length; ++i) - if (!$util.isString(message.pub_key_types[i])) - return "pub_key_types: string[] expected"; - } - return null; - }; - - /** - * Creates a ValidatorParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.ValidatorParams - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.ValidatorParams} ValidatorParams - */ - ValidatorParams.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.ValidatorParams) - return object; - var message = new $root.tendermint.types.ValidatorParams(); - if (object.pub_key_types) { - if (!Array.isArray(object.pub_key_types)) - throw TypeError(".tendermint.types.ValidatorParams.pub_key_types: array expected"); - message.pub_key_types = []; - for (var i = 0; i < object.pub_key_types.length; ++i) - message.pub_key_types[i] = String(object.pub_key_types[i]); - } - return message; - }; - - /** - * Creates a plain object from a ValidatorParams message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.ValidatorParams - * @static - * @param {tendermint.types.ValidatorParams} message ValidatorParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidatorParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pub_key_types = []; - if (message.pub_key_types && message.pub_key_types.length) { - object.pub_key_types = []; - for (var j = 0; j < message.pub_key_types.length; ++j) - object.pub_key_types[j] = message.pub_key_types[j]; - } - return object; - }; - - /** - * Converts this ValidatorParams to JSON. - * @function toJSON - * @memberof tendermint.types.ValidatorParams - * @instance - * @returns {Object.} JSON object - */ - ValidatorParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ValidatorParams; - })(); - - types.VersionParams = (function() { - - /** - * Properties of a VersionParams. - * @memberof tendermint.types - * @interface IVersionParams - * @property {Long|null} [app_version] VersionParams app_version - */ - - /** - * Constructs a new VersionParams. - * @memberof tendermint.types - * @classdesc Represents a VersionParams. - * @implements IVersionParams - * @constructor - * @param {tendermint.types.IVersionParams=} [properties] Properties to set - */ - function VersionParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VersionParams app_version. - * @member {Long} app_version - * @memberof tendermint.types.VersionParams - * @instance - */ - VersionParams.prototype.app_version = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified VersionParams message. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. - * @function encode - * @memberof tendermint.types.VersionParams - * @static - * @param {tendermint.types.IVersionParams} message VersionParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.app_version != null && Object.hasOwnProperty.call(message, "app_version")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.app_version); - return writer; - }; - - /** - * Encodes the specified VersionParams message, length delimited. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.VersionParams - * @static - * @param {tendermint.types.IVersionParams} message VersionParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VersionParams message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.VersionParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.VersionParams} VersionParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.VersionParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.app_version = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VersionParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.VersionParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.VersionParams} VersionParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VersionParams message. - * @function verify - * @memberof tendermint.types.VersionParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VersionParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.app_version != null && message.hasOwnProperty("app_version")) - if (!$util.isInteger(message.app_version) && !(message.app_version && $util.isInteger(message.app_version.low) && $util.isInteger(message.app_version.high))) - return "app_version: integer|Long expected"; - return null; - }; - - /** - * Creates a VersionParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.VersionParams - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.VersionParams} VersionParams - */ - VersionParams.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.VersionParams) - return object; - var message = new $root.tendermint.types.VersionParams(); - if (object.app_version != null) - if ($util.Long) - (message.app_version = $util.Long.fromValue(object.app_version)).unsigned = true; - else if (typeof object.app_version === "string") - message.app_version = parseInt(object.app_version, 10); - else if (typeof object.app_version === "number") - message.app_version = object.app_version; - else if (typeof object.app_version === "object") - message.app_version = new $util.LongBits(object.app_version.low >>> 0, object.app_version.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a VersionParams message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.VersionParams - * @static - * @param {tendermint.types.VersionParams} message VersionParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VersionParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.app_version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.app_version = options.longs === String ? "0" : 0; - if (message.app_version != null && message.hasOwnProperty("app_version")) - if (typeof message.app_version === "number") - object.app_version = options.longs === String ? String(message.app_version) : message.app_version; - else - object.app_version = options.longs === String ? $util.Long.prototype.toString.call(message.app_version) : options.longs === Number ? new $util.LongBits(message.app_version.low >>> 0, message.app_version.high >>> 0).toNumber(true) : message.app_version; - return object; - }; - - /** - * Converts this VersionParams to JSON. - * @function toJSON - * @memberof tendermint.types.VersionParams - * @instance - * @returns {Object.} JSON object - */ - VersionParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return VersionParams; - })(); - - types.HashedParams = (function() { - - /** - * Properties of a HashedParams. - * @memberof tendermint.types - * @interface IHashedParams - * @property {Long|null} [block_max_bytes] HashedParams block_max_bytes - * @property {Long|null} [block_max_gas] HashedParams block_max_gas - */ - - /** - * Constructs a new HashedParams. - * @memberof tendermint.types - * @classdesc Represents a HashedParams. - * @implements IHashedParams - * @constructor - * @param {tendermint.types.IHashedParams=} [properties] Properties to set - */ - function HashedParams(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HashedParams block_max_bytes. - * @member {Long} block_max_bytes - * @memberof tendermint.types.HashedParams - * @instance - */ - HashedParams.prototype.block_max_bytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * HashedParams block_max_gas. - * @member {Long} block_max_gas - * @memberof tendermint.types.HashedParams - * @instance - */ - HashedParams.prototype.block_max_gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Encodes the specified HashedParams message. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. - * @function encode - * @memberof tendermint.types.HashedParams - * @static - * @param {tendermint.types.IHashedParams} message HashedParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HashedParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block_max_bytes != null && Object.hasOwnProperty.call(message, "block_max_bytes")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.block_max_bytes); - if (message.block_max_gas != null && Object.hasOwnProperty.call(message, "block_max_gas")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.block_max_gas); - return writer; - }; - - /** - * Encodes the specified HashedParams message, length delimited. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.types.HashedParams - * @static - * @param {tendermint.types.IHashedParams} message HashedParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HashedParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HashedParams message from the specified reader or buffer. - * @function decode - * @memberof tendermint.types.HashedParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.types.HashedParams} HashedParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HashedParams.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.types.HashedParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block_max_bytes = reader.int64(); - break; - case 2: - message.block_max_gas = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HashedParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.types.HashedParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.types.HashedParams} HashedParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HashedParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HashedParams message. - * @function verify - * @memberof tendermint.types.HashedParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HashedParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block_max_bytes != null && message.hasOwnProperty("block_max_bytes")) - if (!$util.isInteger(message.block_max_bytes) && !(message.block_max_bytes && $util.isInteger(message.block_max_bytes.low) && $util.isInteger(message.block_max_bytes.high))) - return "block_max_bytes: integer|Long expected"; - if (message.block_max_gas != null && message.hasOwnProperty("block_max_gas")) - if (!$util.isInteger(message.block_max_gas) && !(message.block_max_gas && $util.isInteger(message.block_max_gas.low) && $util.isInteger(message.block_max_gas.high))) - return "block_max_gas: integer|Long expected"; - return null; - }; - - /** - * Creates a HashedParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.types.HashedParams - * @static - * @param {Object.} object Plain object - * @returns {tendermint.types.HashedParams} HashedParams - */ - HashedParams.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.types.HashedParams) - return object; - var message = new $root.tendermint.types.HashedParams(); - if (object.block_max_bytes != null) - if ($util.Long) - (message.block_max_bytes = $util.Long.fromValue(object.block_max_bytes)).unsigned = false; - else if (typeof object.block_max_bytes === "string") - message.block_max_bytes = parseInt(object.block_max_bytes, 10); - else if (typeof object.block_max_bytes === "number") - message.block_max_bytes = object.block_max_bytes; - else if (typeof object.block_max_bytes === "object") - message.block_max_bytes = new $util.LongBits(object.block_max_bytes.low >>> 0, object.block_max_bytes.high >>> 0).toNumber(); - if (object.block_max_gas != null) - if ($util.Long) - (message.block_max_gas = $util.Long.fromValue(object.block_max_gas)).unsigned = false; - else if (typeof object.block_max_gas === "string") - message.block_max_gas = parseInt(object.block_max_gas, 10); - else if (typeof object.block_max_gas === "number") - message.block_max_gas = object.block_max_gas; - else if (typeof object.block_max_gas === "object") - message.block_max_gas = new $util.LongBits(object.block_max_gas.low >>> 0, object.block_max_gas.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a HashedParams message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.types.HashedParams - * @static - * @param {tendermint.types.HashedParams} message HashedParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HashedParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.block_max_bytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block_max_bytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.block_max_gas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block_max_gas = options.longs === String ? "0" : 0; - } - if (message.block_max_bytes != null && message.hasOwnProperty("block_max_bytes")) - if (typeof message.block_max_bytes === "number") - object.block_max_bytes = options.longs === String ? String(message.block_max_bytes) : message.block_max_bytes; - else - object.block_max_bytes = options.longs === String ? $util.Long.prototype.toString.call(message.block_max_bytes) : options.longs === Number ? new $util.LongBits(message.block_max_bytes.low >>> 0, message.block_max_bytes.high >>> 0).toNumber() : message.block_max_bytes; - if (message.block_max_gas != null && message.hasOwnProperty("block_max_gas")) - if (typeof message.block_max_gas === "number") - object.block_max_gas = options.longs === String ? String(message.block_max_gas) : message.block_max_gas; - else - object.block_max_gas = options.longs === String ? $util.Long.prototype.toString.call(message.block_max_gas) : options.longs === Number ? new $util.LongBits(message.block_max_gas.low >>> 0, message.block_max_gas.high >>> 0).toNumber() : message.block_max_gas; - return object; - }; - - /** - * Converts this HashedParams to JSON. - * @function toJSON - * @memberof tendermint.types.HashedParams - * @instance - * @returns {Object.} JSON object - */ - HashedParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HashedParams; - })(); - - return types; - })(); - - tendermint.version = (function() { - - /** - * Namespace version. - * @memberof tendermint - * @namespace - */ - var version = {}; - - version.App = (function() { - - /** - * Properties of an App. - * @memberof tendermint.version - * @interface IApp - * @property {Long|null} [protocol] App protocol - * @property {string|null} [software] App software - */ - - /** - * Constructs a new App. - * @memberof tendermint.version - * @classdesc Represents an App. - * @implements IApp - * @constructor - * @param {tendermint.version.IApp=} [properties] Properties to set - */ - function App(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * App protocol. - * @member {Long} protocol - * @memberof tendermint.version.App - * @instance - */ - App.prototype.protocol = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * App software. - * @member {string} software - * @memberof tendermint.version.App - * @instance - */ - App.prototype.software = ""; - - /** - * Encodes the specified App message. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @function encode - * @memberof tendermint.version.App - * @static - * @param {tendermint.version.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.protocol); - if (message.software != null && Object.hasOwnProperty.call(message, "software")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.software); - return writer; - }; - - /** - * Encodes the specified App message, length delimited. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.version.App - * @static - * @param {tendermint.version.IApp} message App message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - App.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an App message from the specified reader or buffer. - * @function decode - * @memberof tendermint.version.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.version.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.App(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.protocol = reader.uint64(); - break; - case 2: - message.software = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an App message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.version.App - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.version.App} App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - App.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an App message. - * @function verify - * @memberof tendermint.version.App - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - App.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.protocol != null && message.hasOwnProperty("protocol")) - if (!$util.isInteger(message.protocol) && !(message.protocol && $util.isInteger(message.protocol.low) && $util.isInteger(message.protocol.high))) - return "protocol: integer|Long expected"; - if (message.software != null && message.hasOwnProperty("software")) - if (!$util.isString(message.software)) - return "software: string expected"; - return null; - }; - - /** - * Creates an App message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.version.App - * @static - * @param {Object.} object Plain object - * @returns {tendermint.version.App} App - */ - App.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.version.App) - return object; - var message = new $root.tendermint.version.App(); - if (object.protocol != null) - if ($util.Long) - (message.protocol = $util.Long.fromValue(object.protocol)).unsigned = true; - else if (typeof object.protocol === "string") - message.protocol = parseInt(object.protocol, 10); - else if (typeof object.protocol === "number") - message.protocol = object.protocol; - else if (typeof object.protocol === "object") - message.protocol = new $util.LongBits(object.protocol.low >>> 0, object.protocol.high >>> 0).toNumber(true); - if (object.software != null) - message.software = String(object.software); - return message; - }; - - /** - * Creates a plain object from an App message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.version.App - * @static - * @param {tendermint.version.App} message App - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - App.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.protocol = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.protocol = options.longs === String ? "0" : 0; - object.software = ""; - } - if (message.protocol != null && message.hasOwnProperty("protocol")) - if (typeof message.protocol === "number") - object.protocol = options.longs === String ? String(message.protocol) : message.protocol; - else - object.protocol = options.longs === String ? $util.Long.prototype.toString.call(message.protocol) : options.longs === Number ? new $util.LongBits(message.protocol.low >>> 0, message.protocol.high >>> 0).toNumber(true) : message.protocol; - if (message.software != null && message.hasOwnProperty("software")) - object.software = message.software; - return object; - }; - - /** - * Converts this App to JSON. - * @function toJSON - * @memberof tendermint.version.App - * @instance - * @returns {Object.} JSON object - */ - App.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return App; - })(); - - version.Consensus = (function() { - - /** - * Properties of a Consensus. - * @memberof tendermint.version - * @interface IConsensus - * @property {Long|null} [block] Consensus block - * @property {Long|null} [app] Consensus app - */ - - /** - * Constructs a new Consensus. - * @memberof tendermint.version - * @classdesc Represents a Consensus. - * @implements IConsensus - * @constructor - * @param {tendermint.version.IConsensus=} [properties] Properties to set - */ - function Consensus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Consensus block. - * @member {Long} block - * @memberof tendermint.version.Consensus - * @instance - */ - Consensus.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Consensus app. - * @member {Long} app - * @memberof tendermint.version.Consensus - * @instance - */ - Consensus.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Encodes the specified Consensus message. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @function encode - * @memberof tendermint.version.Consensus - * @static - * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Consensus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.block); - if (message.app != null && Object.hasOwnProperty.call(message, "app")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.app); - return writer; - }; - - /** - * Encodes the specified Consensus message, length delimited. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @function encodeDelimited - * @memberof tendermint.version.Consensus - * @static - * @param {tendermint.version.IConsensus} message Consensus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Consensus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Consensus message from the specified reader or buffer. - * @function decode - * @memberof tendermint.version.Consensus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {tendermint.version.Consensus} Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Consensus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.tendermint.version.Consensus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.block = reader.uint64(); - break; - case 2: - message.app = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Consensus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof tendermint.version.Consensus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {tendermint.version.Consensus} Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Consensus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Consensus message. - * @function verify - * @memberof tendermint.version.Consensus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Consensus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.block != null && message.hasOwnProperty("block")) - if (!$util.isInteger(message.block) && !(message.block && $util.isInteger(message.block.low) && $util.isInteger(message.block.high))) - return "block: integer|Long expected"; - if (message.app != null && message.hasOwnProperty("app")) - if (!$util.isInteger(message.app) && !(message.app && $util.isInteger(message.app.low) && $util.isInteger(message.app.high))) - return "app: integer|Long expected"; - return null; - }; - - /** - * Creates a Consensus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof tendermint.version.Consensus - * @static - * @param {Object.} object Plain object - * @returns {tendermint.version.Consensus} Consensus - */ - Consensus.fromObject = function fromObject(object) { - if (object instanceof $root.tendermint.version.Consensus) - return object; - var message = new $root.tendermint.version.Consensus(); - if (object.block != null) - if ($util.Long) - (message.block = $util.Long.fromValue(object.block)).unsigned = true; - else if (typeof object.block === "string") - message.block = parseInt(object.block, 10); - else if (typeof object.block === "number") - message.block = object.block; - else if (typeof object.block === "object") - message.block = new $util.LongBits(object.block.low >>> 0, object.block.high >>> 0).toNumber(true); - if (object.app != null) - if ($util.Long) - (message.app = $util.Long.fromValue(object.app)).unsigned = true; - else if (typeof object.app === "string") - message.app = parseInt(object.app, 10); - else if (typeof object.app === "number") - message.app = object.app; - else if (typeof object.app === "object") - message.app = new $util.LongBits(object.app.low >>> 0, object.app.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a Consensus message. Also converts values to other types if specified. - * @function toObject - * @memberof tendermint.version.Consensus - * @static - * @param {tendermint.version.Consensus} message Consensus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Consensus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.block = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.block = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.app = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.app = options.longs === String ? "0" : 0; - } - if (message.block != null && message.hasOwnProperty("block")) - if (typeof message.block === "number") - object.block = options.longs === String ? String(message.block) : message.block; - else - object.block = options.longs === String ? $util.Long.prototype.toString.call(message.block) : options.longs === Number ? new $util.LongBits(message.block.low >>> 0, message.block.high >>> 0).toNumber(true) : message.block; - if (message.app != null && message.hasOwnProperty("app")) - if (typeof message.app === "number") - object.app = options.longs === String ? String(message.app) : message.app; - else - object.app = options.longs === String ? $util.Long.prototype.toString.call(message.app) : options.longs === Number ? new $util.LongBits(message.app.low >>> 0, message.app.high >>> 0).toNumber(true) : message.app; - return object; - }; - - /** - * Converts this Consensus to JSON. - * @function toJSON - * @memberof tendermint.version.Consensus - * @instance - * @returns {Object.} JSON object - */ - Consensus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Consensus; - })(); - - return version; - })(); - - return tendermint; - })(); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorSet; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [public_dependency] FileDescriptorProto public_dependency - * @property {Array.|null} [weak_dependency] FileDescriptorProto weak_dependency - * @property {Array.|null} [message_type] FileDescriptorProto message_type - * @property {Array.|null} [enum_type] FileDescriptorProto enum_type - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [source_code_info] FileDescriptorProto source_code_info - * @property {string|null} [syntax] FileDescriptorProto syntax - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.public_dependency = []; - this.weak_dependency = []; - this.message_type = []; - this.enum_type = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto public_dependency. - * @member {Array.} public_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.public_dependency = $util.emptyArray; - - /** - * FileDescriptorProto weak_dependency. - * @member {Array.} weak_dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weak_dependency = $util.emptyArray; - - /** - * FileDescriptorProto message_type. - * @member {Array.} message_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.message_type = $util.emptyArray; - - /** - * FileDescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto source_code_info. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} source_code_info - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.source_code_info = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.message_type != null && message.message_type.length) - for (var i = 0; i < message.message_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.message_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (var i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.source_code_info != null && Object.hasOwnProperty.call(message, "source_code_info")) - $root.google.protobuf.SourceCodeInfo.encode(message.source_code_info, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.public_dependency != null && message.public_dependency.length) - for (var i = 0; i < message.public_dependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.public_dependency[i]); - if (message.weak_dependency != null && message.weak_dependency.length) - for (var i = 0; i < message.weak_dependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weak_dependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.public_dependency && message.public_dependency.length)) - message.public_dependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.public_dependency.push(reader.int32()); - } else - message.public_dependency.push(reader.int32()); - break; - case 11: - if (!(message.weak_dependency && message.weak_dependency.length)) - message.weak_dependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weak_dependency.push(reader.int32()); - } else - message.weak_dependency.push(reader.int32()); - break; - case 4: - if (!(message.message_type && message.message_type.length)) - message.message_type = []; - message.message_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.source_code_info = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.public_dependency != null && message.hasOwnProperty("public_dependency")) { - if (!Array.isArray(message.public_dependency)) - return "public_dependency: array expected"; - for (var i = 0; i < message.public_dependency.length; ++i) - if (!$util.isInteger(message.public_dependency[i])) - return "public_dependency: integer[] expected"; - } - if (message.weak_dependency != null && message.hasOwnProperty("weak_dependency")) { - if (!Array.isArray(message.weak_dependency)) - return "weak_dependency: array expected"; - for (var i = 0; i < message.weak_dependency.length; ++i) - if (!$util.isInteger(message.weak_dependency[i])) - return "weak_dependency: integer[] expected"; - } - if (message.message_type != null && message.hasOwnProperty("message_type")) { - if (!Array.isArray(message.message_type)) - return "message_type: array expected"; - for (var i = 0; i < message.message_type.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.message_type[i]); - if (error) - return "message_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (var i = 0; i < message.enum_type.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.source_code_info); - if (error) - return "source_code_info." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.public_dependency) { - if (!Array.isArray(object.public_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.public_dependency: array expected"); - message.public_dependency = []; - for (var i = 0; i < object.public_dependency.length; ++i) - message.public_dependency[i] = object.public_dependency[i] | 0; - } - if (object.weak_dependency) { - if (!Array.isArray(object.weak_dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weak_dependency: array expected"); - message.weak_dependency = []; - for (var i = 0; i < object.weak_dependency.length; ++i) - message.weak_dependency[i] = object.weak_dependency[i] | 0; - } - if (object.message_type) { - if (!Array.isArray(object.message_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: array expected"); - message.message_type = []; - for (var i = 0; i < object.message_type.length; ++i) { - if (typeof object.message_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.message_type: object expected"); - message.message_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.message_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (var i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.source_code_info != null) { - if (typeof object.source_code_info !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.source_code_info: object expected"); - message.source_code_info = $root.google.protobuf.SourceCodeInfo.fromObject(object.source_code_info); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.message_type = []; - object.enum_type = []; - object.service = []; - object.extension = []; - object.public_dependency = []; - object.weak_dependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.source_code_info = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.message_type && message.message_type.length) { - object.message_type = []; - for (var j = 0; j < message.message_type.length; ++j) - object.message_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.message_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (var j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.source_code_info != null && message.hasOwnProperty("source_code_info")) - object.source_code_info = $root.google.protobuf.SourceCodeInfo.toObject(message.source_code_info, options); - if (message.public_dependency && message.public_dependency.length) { - object.public_dependency = []; - for (var j = 0; j < message.public_dependency.length; ++j) - object.public_dependency[j] = message.public_dependency[j]; - } - if (message.weak_dependency && message.weak_dependency.length) { - object.weak_dependency = []; - for (var j = 0; j < message.weak_dependency.length; ++j) - object.weak_dependency[j] = message.weak_dependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nested_type] DescriptorProto nested_type - * @property {Array.|null} [enum_type] DescriptorProto enum_type - * @property {Array.|null} [extension_range] DescriptorProto extension_range - * @property {Array.|null} [oneof_decl] DescriptorProto oneof_decl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reserved_range] DescriptorProto reserved_range - * @property {Array.|null} [reserved_name] DescriptorProto reserved_name - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nested_type = []; - this.enum_type = []; - this.extension_range = []; - this.oneof_decl = []; - this.reserved_range = []; - this.reserved_name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nested_type. - * @member {Array.} nested_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nested_type = $util.emptyArray; - - /** - * DescriptorProto enum_type. - * @member {Array.} enum_type - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enum_type = $util.emptyArray; - - /** - * DescriptorProto extension_range. - * @member {Array.} extension_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension_range = $util.emptyArray; - - /** - * DescriptorProto oneof_decl. - * @member {Array.} oneof_decl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneof_decl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reserved_range. - * @member {Array.} reserved_range - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_range = $util.emptyArray; - - /** - * DescriptorProto reserved_name. - * @member {Array.} reserved_name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reserved_name = $util.emptyArray; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nested_type != null && message.nested_type.length) - for (var i = 0; i < message.nested_type.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nested_type[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enum_type != null && message.enum_type.length) - for (var i = 0; i < message.enum_type.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enum_type[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extension_range != null && message.extension_range.length) - for (var i = 0; i < message.extension_range.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extension_range[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneof_decl != null && message.oneof_decl.length) - for (var i = 0; i < message.oneof_decl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneof_decl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reserved_range != null && message.reserved_range.length) - for (var i = 0; i < message.reserved_range.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reserved_range[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reserved_name != null && message.reserved_name.length) - for (var i = 0; i < message.reserved_name.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reserved_name[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nested_type && message.nested_type.length)) - message.nested_type = []; - message.nested_type.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enum_type && message.enum_type.length)) - message.enum_type = []; - message.enum_type.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extension_range && message.extension_range.length)) - message.extension_range = []; - message.extension_range.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneof_decl && message.oneof_decl.length)) - message.oneof_decl = []; - message.oneof_decl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reserved_range && message.reserved_range.length)) - message.reserved_range = []; - message.reserved_range.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reserved_name && message.reserved_name.length)) - message.reserved_name = []; - message.reserved_name.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nested_type != null && message.hasOwnProperty("nested_type")) { - if (!Array.isArray(message.nested_type)) - return "nested_type: array expected"; - for (var i = 0; i < message.nested_type.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nested_type[i]); - if (error) - return "nested_type." + error; - } - } - if (message.enum_type != null && message.hasOwnProperty("enum_type")) { - if (!Array.isArray(message.enum_type)) - return "enum_type: array expected"; - for (var i = 0; i < message.enum_type.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enum_type[i]); - if (error) - return "enum_type." + error; - } - } - if (message.extension_range != null && message.hasOwnProperty("extension_range")) { - if (!Array.isArray(message.extension_range)) - return "extension_range: array expected"; - for (var i = 0; i < message.extension_range.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extension_range[i]); - if (error) - return "extension_range." + error; - } - } - if (message.oneof_decl != null && message.hasOwnProperty("oneof_decl")) { - if (!Array.isArray(message.oneof_decl)) - return "oneof_decl: array expected"; - for (var i = 0; i < message.oneof_decl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneof_decl[i]); - if (error) - return "oneof_decl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reserved_range != null && message.hasOwnProperty("reserved_range")) { - if (!Array.isArray(message.reserved_range)) - return "reserved_range: array expected"; - for (var i = 0; i < message.reserved_range.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reserved_range[i]); - if (error) - return "reserved_range." + error; - } - } - if (message.reserved_name != null && message.hasOwnProperty("reserved_name")) { - if (!Array.isArray(message.reserved_name)) - return "reserved_name: array expected"; - for (var i = 0; i < message.reserved_name.length; ++i) - if (!$util.isString(message.reserved_name[i])) - return "reserved_name: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nested_type) { - if (!Array.isArray(object.nested_type)) - throw TypeError(".google.protobuf.DescriptorProto.nested_type: array expected"); - message.nested_type = []; - for (var i = 0; i < object.nested_type.length; ++i) { - if (typeof object.nested_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nested_type: object expected"); - message.nested_type[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nested_type[i]); - } - } - if (object.enum_type) { - if (!Array.isArray(object.enum_type)) - throw TypeError(".google.protobuf.DescriptorProto.enum_type: array expected"); - message.enum_type = []; - for (var i = 0; i < object.enum_type.length; ++i) { - if (typeof object.enum_type[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enum_type: object expected"); - message.enum_type[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enum_type[i]); - } - } - if (object.extension_range) { - if (!Array.isArray(object.extension_range)) - throw TypeError(".google.protobuf.DescriptorProto.extension_range: array expected"); - message.extension_range = []; - for (var i = 0; i < object.extension_range.length; ++i) { - if (typeof object.extension_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension_range: object expected"); - message.extension_range[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extension_range[i]); - } - } - if (object.oneof_decl) { - if (!Array.isArray(object.oneof_decl)) - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: array expected"); - message.oneof_decl = []; - for (var i = 0; i < object.oneof_decl.length; ++i) { - if (typeof object.oneof_decl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneof_decl: object expected"); - message.oneof_decl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneof_decl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reserved_range) { - if (!Array.isArray(object.reserved_range)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: array expected"); - message.reserved_range = []; - for (var i = 0; i < object.reserved_range.length; ++i) { - if (typeof object.reserved_range[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reserved_range: object expected"); - message.reserved_range[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reserved_range[i]); - } - } - if (object.reserved_name) { - if (!Array.isArray(object.reserved_name)) - throw TypeError(".google.protobuf.DescriptorProto.reserved_name: array expected"); - message.reserved_name = []; - for (var i = 0; i < object.reserved_name.length; ++i) - message.reserved_name[i] = String(object.reserved_name[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nested_type = []; - object.enum_type = []; - object.extension_range = []; - object.extension = []; - object.oneof_decl = []; - object.reserved_range = []; - object.reserved_name = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nested_type && message.nested_type.length) { - object.nested_type = []; - for (var j = 0; j < message.nested_type.length; ++j) - object.nested_type[j] = $root.google.protobuf.DescriptorProto.toObject(message.nested_type[j], options); - } - if (message.enum_type && message.enum_type.length) { - object.enum_type = []; - for (var j = 0; j < message.enum_type.length; ++j) - object.enum_type[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enum_type[j], options); - } - if (message.extension_range && message.extension_range.length) { - object.extension_range = []; - for (var j = 0; j < message.extension_range.length; ++j) - object.extension_range[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extension_range[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneof_decl && message.oneof_decl.length) { - object.oneof_decl = []; - for (var j = 0; j < message.oneof_decl.length; ++j) - object.oneof_decl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneof_decl[j], options); - } - if (message.reserved_range && message.reserved_range.length) { - object.reserved_range = []; - for (var j = 0; j < message.reserved_range.length; ++j) - object.reserved_range[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reserved_range[j], options); - } - if (message.reserved_name && message.reserved_name.length) { - object.reserved_name = []; - for (var j = 0; j < message.reserved_name.length; ++j) - object.reserved_name[j] = message.reserved_name[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [type_name] FieldDescriptorProto type_name - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [default_value] FieldDescriptorProto default_value - * @property {number|null} [oneof_index] FieldDescriptorProto oneof_index - * @property {string|null} [json_name] FieldDescriptorProto json_name - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto type_name. - * @member {string} type_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type_name = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto default_value. - * @member {string} default_value - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.default_value = ""; - - /** - * FieldDescriptorProto oneof_index. - * @member {number} oneof_index - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneof_index = 0; - - /** - * FieldDescriptorProto json_name. - * @member {string} json_name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.json_name = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.type_name != null && Object.hasOwnProperty.call(message, "type_name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.type_name); - if (message.default_value != null && Object.hasOwnProperty.call(message, "default_value")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.default_value); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneof_index != null && Object.hasOwnProperty.call(message, "oneof_index")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneof_index); - if (message.json_name != null && Object.hasOwnProperty.call(message, "json_name")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.json_name); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.type_name = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.default_value = reader.string(); - break; - case 9: - message.oneof_index = reader.int32(); - break; - case 10: - message.json_name = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.type_name != null && message.hasOwnProperty("type_name")) - if (!$util.isString(message.type_name)) - return "type_name: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.default_value != null && message.hasOwnProperty("default_value")) - if (!$util.isString(message.default_value)) - return "default_value: string expected"; - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - if (!$util.isInteger(message.oneof_index)) - return "oneof_index: integer expected"; - if (message.json_name != null && message.hasOwnProperty("json_name")) - if (!$util.isString(message.json_name)) - return "json_name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.type_name != null) - message.type_name = String(object.type_name); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.default_value != null) - message.default_value = String(object.default_value); - if (object.oneof_index != null) - message.oneof_index = object.oneof_index | 0; - if (object.json_name != null) - message.json_name = String(object.json_name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.type_name = ""; - object.default_value = ""; - object.options = null; - object.oneof_index = 0; - object.json_name = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.type_name != null && message.hasOwnProperty("type_name")) - object.type_name = message.type_name; - if (message.default_value != null && message.hasOwnProperty("default_value")) - object.default_value = message.default_value; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneof_index != null && message.hasOwnProperty("oneof_index")) - object.oneof_index = message.oneof_index; - if (message.json_name != null && message.hasOwnProperty("json_name")) - object.json_name = message.json_name; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.value = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [input_type] MethodDescriptorProto input_type - * @property {string|null} [output_type] MethodDescriptorProto output_type - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [client_streaming] MethodDescriptorProto client_streaming - * @property {boolean|null} [server_streaming] MethodDescriptorProto server_streaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto input_type. - * @member {string} input_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.input_type = ""; - - /** - * MethodDescriptorProto output_type. - * @member {string} output_type - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.output_type = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto client_streaming. - * @member {boolean} client_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.client_streaming = false; - - /** - * MethodDescriptorProto server_streaming. - * @member {boolean} server_streaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.server_streaming = false; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.input_type != null && Object.hasOwnProperty.call(message, "input_type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.input_type); - if (message.output_type != null && Object.hasOwnProperty.call(message, "output_type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.output_type); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.client_streaming != null && Object.hasOwnProperty.call(message, "client_streaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.client_streaming); - if (message.server_streaming != null && Object.hasOwnProperty.call(message, "server_streaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.server_streaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.input_type = reader.string(); - break; - case 3: - message.output_type = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.client_streaming = reader.bool(); - break; - case 6: - message.server_streaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.input_type != null && message.hasOwnProperty("input_type")) - if (!$util.isString(message.input_type)) - return "input_type: string expected"; - if (message.output_type != null && message.hasOwnProperty("output_type")) - if (!$util.isString(message.output_type)) - return "output_type: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - if (typeof message.client_streaming !== "boolean") - return "client_streaming: boolean expected"; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - if (typeof message.server_streaming !== "boolean") - return "server_streaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.input_type != null) - message.input_type = String(object.input_type); - if (object.output_type != null) - message.output_type = String(object.output_type); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.client_streaming != null) - message.client_streaming = Boolean(object.client_streaming); - if (object.server_streaming != null) - message.server_streaming = Boolean(object.server_streaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.input_type = ""; - object.output_type = ""; - object.options = null; - object.client_streaming = false; - object.server_streaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.input_type != null && message.hasOwnProperty("input_type")) - object.input_type = message.input_type; - if (message.output_type != null && message.hasOwnProperty("output_type")) - object.output_type = message.output_type; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.client_streaming != null && message.hasOwnProperty("client_streaming")) - object.client_streaming = message.client_streaming; - if (message.server_streaming != null && message.hasOwnProperty("server_streaming")) - object.server_streaming = message.server_streaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [java_package] FileOptions java_package - * @property {string|null} [java_outer_classname] FileOptions java_outer_classname - * @property {boolean|null} [java_multiple_files] FileOptions java_multiple_files - * @property {boolean|null} [java_generate_equals_and_hash] FileOptions java_generate_equals_and_hash - * @property {boolean|null} [java_string_check_utf8] FileOptions java_string_check_utf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimize_for] FileOptions optimize_for - * @property {string|null} [go_package] FileOptions go_package - * @property {boolean|null} [cc_generic_services] FileOptions cc_generic_services - * @property {boolean|null} [java_generic_services] FileOptions java_generic_services - * @property {boolean|null} [py_generic_services] FileOptions py_generic_services - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [cc_enable_arenas] FileOptions cc_enable_arenas - * @property {string|null} [objc_class_prefix] FileOptions objc_class_prefix - * @property {string|null} [csharp_namespace] FileOptions csharp_namespace - * @property {Array.|null} [uninterpreted_option] FileOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters_all"] FileOptions .gogoproto.goproto_getters_all - * @property {boolean|null} [".gogoproto.goproto_enum_prefix_all"] FileOptions .gogoproto.goproto_enum_prefix_all - * @property {boolean|null} [".gogoproto.goproto_stringer_all"] FileOptions .gogoproto.goproto_stringer_all - * @property {boolean|null} [".gogoproto.verbose_equal_all"] FileOptions .gogoproto.verbose_equal_all - * @property {boolean|null} [".gogoproto.face_all"] FileOptions .gogoproto.face_all - * @property {boolean|null} [".gogoproto.gostring_all"] FileOptions .gogoproto.gostring_all - * @property {boolean|null} [".gogoproto.populate_all"] FileOptions .gogoproto.populate_all - * @property {boolean|null} [".gogoproto.stringer_all"] FileOptions .gogoproto.stringer_all - * @property {boolean|null} [".gogoproto.onlyone_all"] FileOptions .gogoproto.onlyone_all - * @property {boolean|null} [".gogoproto.equal_all"] FileOptions .gogoproto.equal_all - * @property {boolean|null} [".gogoproto.description_all"] FileOptions .gogoproto.description_all - * @property {boolean|null} [".gogoproto.testgen_all"] FileOptions .gogoproto.testgen_all - * @property {boolean|null} [".gogoproto.benchgen_all"] FileOptions .gogoproto.benchgen_all - * @property {boolean|null} [".gogoproto.marshaler_all"] FileOptions .gogoproto.marshaler_all - * @property {boolean|null} [".gogoproto.unmarshaler_all"] FileOptions .gogoproto.unmarshaler_all - * @property {boolean|null} [".gogoproto.stable_marshaler_all"] FileOptions .gogoproto.stable_marshaler_all - * @property {boolean|null} [".gogoproto.sizer_all"] FileOptions .gogoproto.sizer_all - * @property {boolean|null} [".gogoproto.goproto_enum_stringer_all"] FileOptions .gogoproto.goproto_enum_stringer_all - * @property {boolean|null} [".gogoproto.enum_stringer_all"] FileOptions .gogoproto.enum_stringer_all - * @property {boolean|null} [".gogoproto.unsafe_marshaler_all"] FileOptions .gogoproto.unsafe_marshaler_all - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler_all"] FileOptions .gogoproto.unsafe_unmarshaler_all - * @property {boolean|null} [".gogoproto.goproto_extensions_map_all"] FileOptions .gogoproto.goproto_extensions_map_all - * @property {boolean|null} [".gogoproto.goproto_unrecognized_all"] FileOptions .gogoproto.goproto_unrecognized_all - * @property {boolean|null} [".gogoproto.gogoproto_import"] FileOptions .gogoproto.gogoproto_import - * @property {boolean|null} [".gogoproto.protosizer_all"] FileOptions .gogoproto.protosizer_all - * @property {boolean|null} [".gogoproto.compare_all"] FileOptions .gogoproto.compare_all - * @property {boolean|null} [".gogoproto.typedecl_all"] FileOptions .gogoproto.typedecl_all - * @property {boolean|null} [".gogoproto.enumdecl_all"] FileOptions .gogoproto.enumdecl_all - * @property {boolean|null} [".gogoproto.goproto_registration"] FileOptions .gogoproto.goproto_registration - * @property {boolean|null} [".gogoproto.messagename_all"] FileOptions .gogoproto.messagename_all - * @property {boolean|null} [".gogoproto.goproto_sizecache_all"] FileOptions .gogoproto.goproto_sizecache_all - * @property {boolean|null} [".gogoproto.goproto_unkeyed_all"] FileOptions .gogoproto.goproto_unkeyed_all - * @property {Array.|null} [".cosmos_proto.declare_interface"] FileOptions .cosmos_proto.declare_interface - * @property {Array.|null} [".cosmos_proto.declare_scalar"] FileOptions .cosmos_proto.declare_scalar - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpreted_option = []; - this[".cosmos_proto.declare_interface"] = []; - this[".cosmos_proto.declare_scalar"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions java_package. - * @member {string} java_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_package = ""; - - /** - * FileOptions java_outer_classname. - * @member {string} java_outer_classname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_outer_classname = ""; - - /** - * FileOptions java_multiple_files. - * @member {boolean} java_multiple_files - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_multiple_files = false; - - /** - * FileOptions java_generate_equals_and_hash. - * @member {boolean} java_generate_equals_and_hash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generate_equals_and_hash = false; - - /** - * FileOptions java_string_check_utf8. - * @member {boolean} java_string_check_utf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_string_check_utf8 = false; - - /** - * FileOptions optimize_for. - * @member {google.protobuf.FileOptions.OptimizeMode} optimize_for - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimize_for = 1; - - /** - * FileOptions go_package. - * @member {string} go_package - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.go_package = ""; - - /** - * FileOptions cc_generic_services. - * @member {boolean} cc_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_generic_services = false; - - /** - * FileOptions java_generic_services. - * @member {boolean} java_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.java_generic_services = false; - - /** - * FileOptions py_generic_services. - * @member {boolean} py_generic_services - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.py_generic_services = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions cc_enable_arenas. - * @member {boolean} cc_enable_arenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.cc_enable_arenas = false; - - /** - * FileOptions objc_class_prefix. - * @member {string} objc_class_prefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objc_class_prefix = ""; - - /** - * FileOptions csharp_namespace. - * @member {string} csharp_namespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharp_namespace = ""; - - /** - * FileOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FileOptions .gogoproto.goproto_getters_all. - * @member {boolean} .gogoproto.goproto_getters_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_getters_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_prefix_all. - * @member {boolean} .gogoproto.goproto_enum_prefix_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_prefix_all"] = false; - - /** - * FileOptions .gogoproto.goproto_stringer_all. - * @member {boolean} .gogoproto.goproto_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_stringer_all"] = false; - - /** - * FileOptions .gogoproto.verbose_equal_all. - * @member {boolean} .gogoproto.verbose_equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.verbose_equal_all"] = false; - - /** - * FileOptions .gogoproto.face_all. - * @member {boolean} .gogoproto.face_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.face_all"] = false; - - /** - * FileOptions .gogoproto.gostring_all. - * @member {boolean} .gogoproto.gostring_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gostring_all"] = false; - - /** - * FileOptions .gogoproto.populate_all. - * @member {boolean} .gogoproto.populate_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.populate_all"] = false; - - /** - * FileOptions .gogoproto.stringer_all. - * @member {boolean} .gogoproto.stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stringer_all"] = false; - - /** - * FileOptions .gogoproto.onlyone_all. - * @member {boolean} .gogoproto.onlyone_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.onlyone_all"] = false; - - /** - * FileOptions .gogoproto.equal_all. - * @member {boolean} .gogoproto.equal_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.equal_all"] = false; - - /** - * FileOptions .gogoproto.description_all. - * @member {boolean} .gogoproto.description_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.description_all"] = false; - - /** - * FileOptions .gogoproto.testgen_all. - * @member {boolean} .gogoproto.testgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.testgen_all"] = false; - - /** - * FileOptions .gogoproto.benchgen_all. - * @member {boolean} .gogoproto.benchgen_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.benchgen_all"] = false; - - /** - * FileOptions .gogoproto.marshaler_all. - * @member {boolean} .gogoproto.marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unmarshaler_all. - * @member {boolean} .gogoproto.unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.stable_marshaler_all. - * @member {boolean} .gogoproto.stable_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stable_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.sizer_all. - * @member {boolean} .gogoproto.sizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.sizer_all"] = false; - - /** - * FileOptions .gogoproto.goproto_enum_stringer_all. - * @member {boolean} .gogoproto.goproto_enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.enum_stringer_all. - * @member {boolean} .gogoproto.enum_stringer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enum_stringer_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_marshaler_all. - * @member {boolean} .gogoproto.unsafe_marshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_marshaler_all"] = false; - - /** - * FileOptions .gogoproto.unsafe_unmarshaler_all. - * @member {boolean} .gogoproto.unsafe_unmarshaler_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafe_unmarshaler_all"] = false; - - /** - * FileOptions .gogoproto.goproto_extensions_map_all. - * @member {boolean} .gogoproto.goproto_extensions_map_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_extensions_map_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unrecognized_all. - * @member {boolean} .gogoproto.goproto_unrecognized_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unrecognized_all"] = false; - - /** - * FileOptions .gogoproto.gogoproto_import. - * @member {boolean} .gogoproto.gogoproto_import - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gogoproto_import"] = false; - - /** - * FileOptions .gogoproto.protosizer_all. - * @member {boolean} .gogoproto.protosizer_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.protosizer_all"] = false; - - /** - * FileOptions .gogoproto.compare_all. - * @member {boolean} .gogoproto.compare_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.compare_all"] = false; - - /** - * FileOptions .gogoproto.typedecl_all. - * @member {boolean} .gogoproto.typedecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.typedecl_all"] = false; - - /** - * FileOptions .gogoproto.enumdecl_all. - * @member {boolean} .gogoproto.enumdecl_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enumdecl_all"] = false; - - /** - * FileOptions .gogoproto.goproto_registration. - * @member {boolean} .gogoproto.goproto_registration - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_registration"] = false; - - /** - * FileOptions .gogoproto.messagename_all. - * @member {boolean} .gogoproto.messagename_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.messagename_all"] = false; - - /** - * FileOptions .gogoproto.goproto_sizecache_all. - * @member {boolean} .gogoproto.goproto_sizecache_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_sizecache_all"] = false; - - /** - * FileOptions .gogoproto.goproto_unkeyed_all. - * @member {boolean} .gogoproto.goproto_unkeyed_all - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goproto_unkeyed_all"] = false; - - /** - * FileOptions .cosmos_proto.declare_interface. - * @member {Array.} .cosmos_proto.declare_interface - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".cosmos_proto.declare_interface"] = $util.emptyArray; - - /** - * FileOptions .cosmos_proto.declare_scalar. - * @member {Array.} .cosmos_proto.declare_scalar - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".cosmos_proto.declare_scalar"] = $util.emptyArray; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.java_package != null && Object.hasOwnProperty.call(message, "java_package")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.java_package); - if (message.java_outer_classname != null && Object.hasOwnProperty.call(message, "java_outer_classname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.java_outer_classname); - if (message.optimize_for != null && Object.hasOwnProperty.call(message, "optimize_for")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimize_for); - if (message.java_multiple_files != null && Object.hasOwnProperty.call(message, "java_multiple_files")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.java_multiple_files); - if (message.go_package != null && Object.hasOwnProperty.call(message, "go_package")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.go_package); - if (message.cc_generic_services != null && Object.hasOwnProperty.call(message, "cc_generic_services")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.cc_generic_services); - if (message.java_generic_services != null && Object.hasOwnProperty.call(message, "java_generic_services")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.java_generic_services); - if (message.py_generic_services != null && Object.hasOwnProperty.call(message, "py_generic_services")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.py_generic_services); - if (message.java_generate_equals_and_hash != null && Object.hasOwnProperty.call(message, "java_generate_equals_and_hash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.java_generate_equals_and_hash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.java_string_check_utf8 != null && Object.hasOwnProperty.call(message, "java_string_check_utf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.java_string_check_utf8); - if (message.cc_enable_arenas != null && Object.hasOwnProperty.call(message, "cc_enable_arenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.cc_enable_arenas); - if (message.objc_class_prefix != null && Object.hasOwnProperty.call(message, "objc_class_prefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objc_class_prefix); - if (message.csharp_namespace != null && Object.hasOwnProperty.call(message, "csharp_namespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharp_namespace); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters_all")) - writer.uint32(/* id 63001, wireType 0 =*/504008).bool(message[".gogoproto.goproto_getters_all"]); - if (message[".gogoproto.goproto_enum_prefix_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix_all")) - writer.uint32(/* id 63002, wireType 0 =*/504016).bool(message[".gogoproto.goproto_enum_prefix_all"]); - if (message[".gogoproto.goproto_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer_all")) - writer.uint32(/* id 63003, wireType 0 =*/504024).bool(message[".gogoproto.goproto_stringer_all"]); - if (message[".gogoproto.verbose_equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal_all")) - writer.uint32(/* id 63004, wireType 0 =*/504032).bool(message[".gogoproto.verbose_equal_all"]); - if (message[".gogoproto.face_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face_all")) - writer.uint32(/* id 63005, wireType 0 =*/504040).bool(message[".gogoproto.face_all"]); - if (message[".gogoproto.gostring_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring_all")) - writer.uint32(/* id 63006, wireType 0 =*/504048).bool(message[".gogoproto.gostring_all"]); - if (message[".gogoproto.populate_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate_all")) - writer.uint32(/* id 63007, wireType 0 =*/504056).bool(message[".gogoproto.populate_all"]); - if (message[".gogoproto.stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer_all")) - writer.uint32(/* id 63008, wireType 0 =*/504064).bool(message[".gogoproto.stringer_all"]); - if (message[".gogoproto.onlyone_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone_all")) - writer.uint32(/* id 63009, wireType 0 =*/504072).bool(message[".gogoproto.onlyone_all"]); - if (message[".gogoproto.equal_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal_all")) - writer.uint32(/* id 63013, wireType 0 =*/504104).bool(message[".gogoproto.equal_all"]); - if (message[".gogoproto.description_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description_all")) - writer.uint32(/* id 63014, wireType 0 =*/504112).bool(message[".gogoproto.description_all"]); - if (message[".gogoproto.testgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen_all")) - writer.uint32(/* id 63015, wireType 0 =*/504120).bool(message[".gogoproto.testgen_all"]); - if (message[".gogoproto.benchgen_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen_all")) - writer.uint32(/* id 63016, wireType 0 =*/504128).bool(message[".gogoproto.benchgen_all"]); - if (message[".gogoproto.marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler_all")) - writer.uint32(/* id 63017, wireType 0 =*/504136).bool(message[".gogoproto.marshaler_all"]); - if (message[".gogoproto.unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler_all")) - writer.uint32(/* id 63018, wireType 0 =*/504144).bool(message[".gogoproto.unmarshaler_all"]); - if (message[".gogoproto.stable_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler_all")) - writer.uint32(/* id 63019, wireType 0 =*/504152).bool(message[".gogoproto.stable_marshaler_all"]); - if (message[".gogoproto.sizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer_all")) - writer.uint32(/* id 63020, wireType 0 =*/504160).bool(message[".gogoproto.sizer_all"]); - if (message[".gogoproto.goproto_enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer_all")) - writer.uint32(/* id 63021, wireType 0 =*/504168).bool(message[".gogoproto.goproto_enum_stringer_all"]); - if (message[".gogoproto.enum_stringer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer_all")) - writer.uint32(/* id 63022, wireType 0 =*/504176).bool(message[".gogoproto.enum_stringer_all"]); - if (message[".gogoproto.unsafe_marshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler_all")) - writer.uint32(/* id 63023, wireType 0 =*/504184).bool(message[".gogoproto.unsafe_marshaler_all"]); - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler_all")) - writer.uint32(/* id 63024, wireType 0 =*/504192).bool(message[".gogoproto.unsafe_unmarshaler_all"]); - if (message[".gogoproto.goproto_extensions_map_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map_all")) - writer.uint32(/* id 63025, wireType 0 =*/504200).bool(message[".gogoproto.goproto_extensions_map_all"]); - if (message[".gogoproto.goproto_unrecognized_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized_all")) - writer.uint32(/* id 63026, wireType 0 =*/504208).bool(message[".gogoproto.goproto_unrecognized_all"]); - if (message[".gogoproto.gogoproto_import"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gogoproto_import")) - writer.uint32(/* id 63027, wireType 0 =*/504216).bool(message[".gogoproto.gogoproto_import"]); - if (message[".gogoproto.protosizer_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer_all")) - writer.uint32(/* id 63028, wireType 0 =*/504224).bool(message[".gogoproto.protosizer_all"]); - if (message[".gogoproto.compare_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare_all")) - writer.uint32(/* id 63029, wireType 0 =*/504232).bool(message[".gogoproto.compare_all"]); - if (message[".gogoproto.typedecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl_all")) - writer.uint32(/* id 63030, wireType 0 =*/504240).bool(message[".gogoproto.typedecl_all"]); - if (message[".gogoproto.enumdecl_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl_all")) - writer.uint32(/* id 63031, wireType 0 =*/504248).bool(message[".gogoproto.enumdecl_all"]); - if (message[".gogoproto.goproto_registration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_registration")) - writer.uint32(/* id 63032, wireType 0 =*/504256).bool(message[".gogoproto.goproto_registration"]); - if (message[".gogoproto.messagename_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename_all")) - writer.uint32(/* id 63033, wireType 0 =*/504264).bool(message[".gogoproto.messagename_all"]); - if (message[".gogoproto.goproto_sizecache_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache_all")) - writer.uint32(/* id 63034, wireType 0 =*/504272).bool(message[".gogoproto.goproto_sizecache_all"]); - if (message[".gogoproto.goproto_unkeyed_all"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed_all")) - writer.uint32(/* id 63035, wireType 0 =*/504280).bool(message[".gogoproto.goproto_unkeyed_all"]); - if (message[".cosmos_proto.declare_interface"] != null && message[".cosmos_proto.declare_interface"].length) - for (var i = 0; i < message[".cosmos_proto.declare_interface"].length; ++i) - $root.cosmos_proto.InterfaceDescriptor.encode(message[".cosmos_proto.declare_interface"][i], writer.uint32(/* id 793021, wireType 2 =*/6344170).fork()).ldelim(); - if (message[".cosmos_proto.declare_scalar"] != null && message[".cosmos_proto.declare_scalar"].length) - for (var i = 0; i < message[".cosmos_proto.declare_scalar"].length; ++i) - $root.cosmos_proto.ScalarDescriptor.encode(message[".cosmos_proto.declare_scalar"][i], writer.uint32(/* id 793022, wireType 2 =*/6344178).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.java_package = reader.string(); - break; - case 8: - message.java_outer_classname = reader.string(); - break; - case 10: - message.java_multiple_files = reader.bool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.bool(); - break; - case 27: - message.java_string_check_utf8 = reader.bool(); - break; - case 9: - message.optimize_for = reader.int32(); - break; - case 11: - message.go_package = reader.string(); - break; - case 16: - message.cc_generic_services = reader.bool(); - break; - case 17: - message.java_generic_services = reader.bool(); - break; - case 18: - message.py_generic_services = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.cc_enable_arenas = reader.bool(); - break; - case 36: - message.objc_class_prefix = reader.string(); - break; - case 37: - message.csharp_namespace = reader.string(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 63001: - message[".gogoproto.goproto_getters_all"] = reader.bool(); - break; - case 63002: - message[".gogoproto.goproto_enum_prefix_all"] = reader.bool(); - break; - case 63003: - message[".gogoproto.goproto_stringer_all"] = reader.bool(); - break; - case 63004: - message[".gogoproto.verbose_equal_all"] = reader.bool(); - break; - case 63005: - message[".gogoproto.face_all"] = reader.bool(); - break; - case 63006: - message[".gogoproto.gostring_all"] = reader.bool(); - break; - case 63007: - message[".gogoproto.populate_all"] = reader.bool(); - break; - case 63008: - message[".gogoproto.stringer_all"] = reader.bool(); - break; - case 63009: - message[".gogoproto.onlyone_all"] = reader.bool(); - break; - case 63013: - message[".gogoproto.equal_all"] = reader.bool(); - break; - case 63014: - message[".gogoproto.description_all"] = reader.bool(); - break; - case 63015: - message[".gogoproto.testgen_all"] = reader.bool(); - break; - case 63016: - message[".gogoproto.benchgen_all"] = reader.bool(); - break; - case 63017: - message[".gogoproto.marshaler_all"] = reader.bool(); - break; - case 63018: - message[".gogoproto.unmarshaler_all"] = reader.bool(); - break; - case 63019: - message[".gogoproto.stable_marshaler_all"] = reader.bool(); - break; - case 63020: - message[".gogoproto.sizer_all"] = reader.bool(); - break; - case 63021: - message[".gogoproto.goproto_enum_stringer_all"] = reader.bool(); - break; - case 63022: - message[".gogoproto.enum_stringer_all"] = reader.bool(); - break; - case 63023: - message[".gogoproto.unsafe_marshaler_all"] = reader.bool(); - break; - case 63024: - message[".gogoproto.unsafe_unmarshaler_all"] = reader.bool(); - break; - case 63025: - message[".gogoproto.goproto_extensions_map_all"] = reader.bool(); - break; - case 63026: - message[".gogoproto.goproto_unrecognized_all"] = reader.bool(); - break; - case 63027: - message[".gogoproto.gogoproto_import"] = reader.bool(); - break; - case 63028: - message[".gogoproto.protosizer_all"] = reader.bool(); - break; - case 63029: - message[".gogoproto.compare_all"] = reader.bool(); - break; - case 63030: - message[".gogoproto.typedecl_all"] = reader.bool(); - break; - case 63031: - message[".gogoproto.enumdecl_all"] = reader.bool(); - break; - case 63032: - message[".gogoproto.goproto_registration"] = reader.bool(); - break; - case 63033: - message[".gogoproto.messagename_all"] = reader.bool(); - break; - case 63034: - message[".gogoproto.goproto_sizecache_all"] = reader.bool(); - break; - case 63035: - message[".gogoproto.goproto_unkeyed_all"] = reader.bool(); - break; - case 793021: - if (!(message[".cosmos_proto.declare_interface"] && message[".cosmos_proto.declare_interface"].length)) - message[".cosmos_proto.declare_interface"] = []; - message[".cosmos_proto.declare_interface"].push($root.cosmos_proto.InterfaceDescriptor.decode(reader, reader.uint32())); - break; - case 793022: - if (!(message[".cosmos_proto.declare_scalar"] && message[".cosmos_proto.declare_scalar"].length)) - message[".cosmos_proto.declare_scalar"] = []; - message[".cosmos_proto.declare_scalar"].push($root.cosmos_proto.ScalarDescriptor.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.java_package != null && message.hasOwnProperty("java_package")) - if (!$util.isString(message.java_package)) - return "java_package: string expected"; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - if (!$util.isString(message.java_outer_classname)) - return "java_outer_classname: string expected"; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - if (typeof message.java_multiple_files !== "boolean") - return "java_multiple_files: boolean expected"; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - if (typeof message.java_generate_equals_and_hash !== "boolean") - return "java_generate_equals_and_hash: boolean expected"; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - if (typeof message.java_string_check_utf8 !== "boolean") - return "java_string_check_utf8: boolean expected"; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - switch (message.optimize_for) { - default: - return "optimize_for: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.go_package != null && message.hasOwnProperty("go_package")) - if (!$util.isString(message.go_package)) - return "go_package: string expected"; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - if (typeof message.cc_generic_services !== "boolean") - return "cc_generic_services: boolean expected"; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - if (typeof message.java_generic_services !== "boolean") - return "java_generic_services: boolean expected"; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - if (typeof message.py_generic_services !== "boolean") - return "py_generic_services: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - if (typeof message.cc_enable_arenas !== "boolean") - return "cc_enable_arenas: boolean expected"; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - if (!$util.isString(message.objc_class_prefix)) - return "objc_class_prefix: string expected"; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - if (!$util.isString(message.csharp_namespace)) - return "csharp_namespace: string expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - if (typeof message[".gogoproto.goproto_getters_all"] !== "boolean") - return ".gogoproto.goproto_getters_all: boolean expected"; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - if (typeof message[".gogoproto.goproto_enum_prefix_all"] !== "boolean") - return ".gogoproto.goproto_enum_prefix_all: boolean expected"; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - if (typeof message[".gogoproto.goproto_stringer_all"] !== "boolean") - return ".gogoproto.goproto_stringer_all: boolean expected"; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - if (typeof message[".gogoproto.verbose_equal_all"] !== "boolean") - return ".gogoproto.verbose_equal_all: boolean expected"; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - if (typeof message[".gogoproto.face_all"] !== "boolean") - return ".gogoproto.face_all: boolean expected"; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - if (typeof message[".gogoproto.gostring_all"] !== "boolean") - return ".gogoproto.gostring_all: boolean expected"; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - if (typeof message[".gogoproto.populate_all"] !== "boolean") - return ".gogoproto.populate_all: boolean expected"; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - if (typeof message[".gogoproto.stringer_all"] !== "boolean") - return ".gogoproto.stringer_all: boolean expected"; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - if (typeof message[".gogoproto.onlyone_all"] !== "boolean") - return ".gogoproto.onlyone_all: boolean expected"; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - if (typeof message[".gogoproto.equal_all"] !== "boolean") - return ".gogoproto.equal_all: boolean expected"; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - if (typeof message[".gogoproto.description_all"] !== "boolean") - return ".gogoproto.description_all: boolean expected"; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - if (typeof message[".gogoproto.testgen_all"] !== "boolean") - return ".gogoproto.testgen_all: boolean expected"; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - if (typeof message[".gogoproto.benchgen_all"] !== "boolean") - return ".gogoproto.benchgen_all: boolean expected"; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - if (typeof message[".gogoproto.marshaler_all"] !== "boolean") - return ".gogoproto.marshaler_all: boolean expected"; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - if (typeof message[".gogoproto.unmarshaler_all"] !== "boolean") - return ".gogoproto.unmarshaler_all: boolean expected"; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - if (typeof message[".gogoproto.stable_marshaler_all"] !== "boolean") - return ".gogoproto.stable_marshaler_all: boolean expected"; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - if (typeof message[".gogoproto.sizer_all"] !== "boolean") - return ".gogoproto.sizer_all: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - if (typeof message[".gogoproto.goproto_enum_stringer_all"] !== "boolean") - return ".gogoproto.goproto_enum_stringer_all: boolean expected"; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - if (typeof message[".gogoproto.enum_stringer_all"] !== "boolean") - return ".gogoproto.enum_stringer_all: boolean expected"; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - if (typeof message[".gogoproto.unsafe_marshaler_all"] !== "boolean") - return ".gogoproto.unsafe_marshaler_all: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - if (typeof message[".gogoproto.unsafe_unmarshaler_all"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler_all: boolean expected"; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - if (typeof message[".gogoproto.goproto_extensions_map_all"] !== "boolean") - return ".gogoproto.goproto_extensions_map_all: boolean expected"; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - if (typeof message[".gogoproto.goproto_unrecognized_all"] !== "boolean") - return ".gogoproto.goproto_unrecognized_all: boolean expected"; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - if (typeof message[".gogoproto.gogoproto_import"] !== "boolean") - return ".gogoproto.gogoproto_import: boolean expected"; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - if (typeof message[".gogoproto.protosizer_all"] !== "boolean") - return ".gogoproto.protosizer_all: boolean expected"; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - if (typeof message[".gogoproto.compare_all"] !== "boolean") - return ".gogoproto.compare_all: boolean expected"; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - if (typeof message[".gogoproto.typedecl_all"] !== "boolean") - return ".gogoproto.typedecl_all: boolean expected"; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - if (typeof message[".gogoproto.enumdecl_all"] !== "boolean") - return ".gogoproto.enumdecl_all: boolean expected"; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - if (typeof message[".gogoproto.goproto_registration"] !== "boolean") - return ".gogoproto.goproto_registration: boolean expected"; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - if (typeof message[".gogoproto.messagename_all"] !== "boolean") - return ".gogoproto.messagename_all: boolean expected"; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - if (typeof message[".gogoproto.goproto_sizecache_all"] !== "boolean") - return ".gogoproto.goproto_sizecache_all: boolean expected"; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - if (typeof message[".gogoproto.goproto_unkeyed_all"] !== "boolean") - return ".gogoproto.goproto_unkeyed_all: boolean expected"; - if (message[".cosmos_proto.declare_interface"] != null && message.hasOwnProperty(".cosmos_proto.declare_interface")) { - if (!Array.isArray(message[".cosmos_proto.declare_interface"])) - return ".cosmos_proto.declare_interface: array expected"; - for (var i = 0; i < message[".cosmos_proto.declare_interface"].length; ++i) { - var error = $root.cosmos_proto.InterfaceDescriptor.verify(message[".cosmos_proto.declare_interface"][i]); - if (error) - return ".cosmos_proto.declare_interface." + error; - } - } - if (message[".cosmos_proto.declare_scalar"] != null && message.hasOwnProperty(".cosmos_proto.declare_scalar")) { - if (!Array.isArray(message[".cosmos_proto.declare_scalar"])) - return ".cosmos_proto.declare_scalar: array expected"; - for (var i = 0; i < message[".cosmos_proto.declare_scalar"].length; ++i) { - var error = $root.cosmos_proto.ScalarDescriptor.verify(message[".cosmos_proto.declare_scalar"][i]); - if (error) - return ".cosmos_proto.declare_scalar." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.java_package != null) - message.java_package = String(object.java_package); - if (object.java_outer_classname != null) - message.java_outer_classname = String(object.java_outer_classname); - if (object.java_multiple_files != null) - message.java_multiple_files = Boolean(object.java_multiple_files); - if (object.java_generate_equals_and_hash != null) - message.java_generate_equals_and_hash = Boolean(object.java_generate_equals_and_hash); - if (object.java_string_check_utf8 != null) - message.java_string_check_utf8 = Boolean(object.java_string_check_utf8); - switch (object.optimize_for) { - case "SPEED": - case 1: - message.optimize_for = 1; - break; - case "CODE_SIZE": - case 2: - message.optimize_for = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimize_for = 3; - break; - } - if (object.go_package != null) - message.go_package = String(object.go_package); - if (object.cc_generic_services != null) - message.cc_generic_services = Boolean(object.cc_generic_services); - if (object.java_generic_services != null) - message.java_generic_services = Boolean(object.java_generic_services); - if (object.py_generic_services != null) - message.py_generic_services = Boolean(object.py_generic_services); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.cc_enable_arenas != null) - message.cc_enable_arenas = Boolean(object.cc_enable_arenas); - if (object.objc_class_prefix != null) - message.objc_class_prefix = String(object.objc_class_prefix); - if (object.csharp_namespace != null) - message.csharp_namespace = String(object.csharp_namespace); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters_all"] != null) - message[".gogoproto.goproto_getters_all"] = Boolean(object[".gogoproto.goproto_getters_all"]); - if (object[".gogoproto.goproto_enum_prefix_all"] != null) - message[".gogoproto.goproto_enum_prefix_all"] = Boolean(object[".gogoproto.goproto_enum_prefix_all"]); - if (object[".gogoproto.goproto_stringer_all"] != null) - message[".gogoproto.goproto_stringer_all"] = Boolean(object[".gogoproto.goproto_stringer_all"]); - if (object[".gogoproto.verbose_equal_all"] != null) - message[".gogoproto.verbose_equal_all"] = Boolean(object[".gogoproto.verbose_equal_all"]); - if (object[".gogoproto.face_all"] != null) - message[".gogoproto.face_all"] = Boolean(object[".gogoproto.face_all"]); - if (object[".gogoproto.gostring_all"] != null) - message[".gogoproto.gostring_all"] = Boolean(object[".gogoproto.gostring_all"]); - if (object[".gogoproto.populate_all"] != null) - message[".gogoproto.populate_all"] = Boolean(object[".gogoproto.populate_all"]); - if (object[".gogoproto.stringer_all"] != null) - message[".gogoproto.stringer_all"] = Boolean(object[".gogoproto.stringer_all"]); - if (object[".gogoproto.onlyone_all"] != null) - message[".gogoproto.onlyone_all"] = Boolean(object[".gogoproto.onlyone_all"]); - if (object[".gogoproto.equal_all"] != null) - message[".gogoproto.equal_all"] = Boolean(object[".gogoproto.equal_all"]); - if (object[".gogoproto.description_all"] != null) - message[".gogoproto.description_all"] = Boolean(object[".gogoproto.description_all"]); - if (object[".gogoproto.testgen_all"] != null) - message[".gogoproto.testgen_all"] = Boolean(object[".gogoproto.testgen_all"]); - if (object[".gogoproto.benchgen_all"] != null) - message[".gogoproto.benchgen_all"] = Boolean(object[".gogoproto.benchgen_all"]); - if (object[".gogoproto.marshaler_all"] != null) - message[".gogoproto.marshaler_all"] = Boolean(object[".gogoproto.marshaler_all"]); - if (object[".gogoproto.unmarshaler_all"] != null) - message[".gogoproto.unmarshaler_all"] = Boolean(object[".gogoproto.unmarshaler_all"]); - if (object[".gogoproto.stable_marshaler_all"] != null) - message[".gogoproto.stable_marshaler_all"] = Boolean(object[".gogoproto.stable_marshaler_all"]); - if (object[".gogoproto.sizer_all"] != null) - message[".gogoproto.sizer_all"] = Boolean(object[".gogoproto.sizer_all"]); - if (object[".gogoproto.goproto_enum_stringer_all"] != null) - message[".gogoproto.goproto_enum_stringer_all"] = Boolean(object[".gogoproto.goproto_enum_stringer_all"]); - if (object[".gogoproto.enum_stringer_all"] != null) - message[".gogoproto.enum_stringer_all"] = Boolean(object[".gogoproto.enum_stringer_all"]); - if (object[".gogoproto.unsafe_marshaler_all"] != null) - message[".gogoproto.unsafe_marshaler_all"] = Boolean(object[".gogoproto.unsafe_marshaler_all"]); - if (object[".gogoproto.unsafe_unmarshaler_all"] != null) - message[".gogoproto.unsafe_unmarshaler_all"] = Boolean(object[".gogoproto.unsafe_unmarshaler_all"]); - if (object[".gogoproto.goproto_extensions_map_all"] != null) - message[".gogoproto.goproto_extensions_map_all"] = Boolean(object[".gogoproto.goproto_extensions_map_all"]); - if (object[".gogoproto.goproto_unrecognized_all"] != null) - message[".gogoproto.goproto_unrecognized_all"] = Boolean(object[".gogoproto.goproto_unrecognized_all"]); - if (object[".gogoproto.gogoproto_import"] != null) - message[".gogoproto.gogoproto_import"] = Boolean(object[".gogoproto.gogoproto_import"]); - if (object[".gogoproto.protosizer_all"] != null) - message[".gogoproto.protosizer_all"] = Boolean(object[".gogoproto.protosizer_all"]); - if (object[".gogoproto.compare_all"] != null) - message[".gogoproto.compare_all"] = Boolean(object[".gogoproto.compare_all"]); - if (object[".gogoproto.typedecl_all"] != null) - message[".gogoproto.typedecl_all"] = Boolean(object[".gogoproto.typedecl_all"]); - if (object[".gogoproto.enumdecl_all"] != null) - message[".gogoproto.enumdecl_all"] = Boolean(object[".gogoproto.enumdecl_all"]); - if (object[".gogoproto.goproto_registration"] != null) - message[".gogoproto.goproto_registration"] = Boolean(object[".gogoproto.goproto_registration"]); - if (object[".gogoproto.messagename_all"] != null) - message[".gogoproto.messagename_all"] = Boolean(object[".gogoproto.messagename_all"]); - if (object[".gogoproto.goproto_sizecache_all"] != null) - message[".gogoproto.goproto_sizecache_all"] = Boolean(object[".gogoproto.goproto_sizecache_all"]); - if (object[".gogoproto.goproto_unkeyed_all"] != null) - message[".gogoproto.goproto_unkeyed_all"] = Boolean(object[".gogoproto.goproto_unkeyed_all"]); - if (object[".cosmos_proto.declare_interface"]) { - if (!Array.isArray(object[".cosmos_proto.declare_interface"])) - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_interface: array expected"); - message[".cosmos_proto.declare_interface"] = []; - for (var i = 0; i < object[".cosmos_proto.declare_interface"].length; ++i) { - if (typeof object[".cosmos_proto.declare_interface"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_interface: object expected"); - message[".cosmos_proto.declare_interface"][i] = $root.cosmos_proto.InterfaceDescriptor.fromObject(object[".cosmos_proto.declare_interface"][i]); - } - } - if (object[".cosmos_proto.declare_scalar"]) { - if (!Array.isArray(object[".cosmos_proto.declare_scalar"])) - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_scalar: array expected"); - message[".cosmos_proto.declare_scalar"] = []; - for (var i = 0; i < object[".cosmos_proto.declare_scalar"].length; ++i) { - if (typeof object[".cosmos_proto.declare_scalar"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..cosmos_proto.declare_scalar: object expected"); - message[".cosmos_proto.declare_scalar"][i] = $root.cosmos_proto.ScalarDescriptor.fromObject(object[".cosmos_proto.declare_scalar"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpreted_option = []; - object[".cosmos_proto.declare_interface"] = []; - object[".cosmos_proto.declare_scalar"] = []; - } - if (options.defaults) { - object.java_package = ""; - object.java_outer_classname = ""; - object.optimize_for = options.enums === String ? "SPEED" : 1; - object.java_multiple_files = false; - object.go_package = ""; - object.cc_generic_services = false; - object.java_generic_services = false; - object.py_generic_services = false; - object.java_generate_equals_and_hash = false; - object.deprecated = false; - object.java_string_check_utf8 = false; - object.cc_enable_arenas = false; - object.objc_class_prefix = ""; - object.csharp_namespace = ""; - object[".gogoproto.goproto_getters_all"] = false; - object[".gogoproto.goproto_enum_prefix_all"] = false; - object[".gogoproto.goproto_stringer_all"] = false; - object[".gogoproto.verbose_equal_all"] = false; - object[".gogoproto.face_all"] = false; - object[".gogoproto.gostring_all"] = false; - object[".gogoproto.populate_all"] = false; - object[".gogoproto.stringer_all"] = false; - object[".gogoproto.onlyone_all"] = false; - object[".gogoproto.equal_all"] = false; - object[".gogoproto.description_all"] = false; - object[".gogoproto.testgen_all"] = false; - object[".gogoproto.benchgen_all"] = false; - object[".gogoproto.marshaler_all"] = false; - object[".gogoproto.unmarshaler_all"] = false; - object[".gogoproto.stable_marshaler_all"] = false; - object[".gogoproto.sizer_all"] = false; - object[".gogoproto.goproto_enum_stringer_all"] = false; - object[".gogoproto.enum_stringer_all"] = false; - object[".gogoproto.unsafe_marshaler_all"] = false; - object[".gogoproto.unsafe_unmarshaler_all"] = false; - object[".gogoproto.goproto_extensions_map_all"] = false; - object[".gogoproto.goproto_unrecognized_all"] = false; - object[".gogoproto.gogoproto_import"] = false; - object[".gogoproto.protosizer_all"] = false; - object[".gogoproto.compare_all"] = false; - object[".gogoproto.typedecl_all"] = false; - object[".gogoproto.enumdecl_all"] = false; - object[".gogoproto.goproto_registration"] = false; - object[".gogoproto.messagename_all"] = false; - object[".gogoproto.goproto_sizecache_all"] = false; - object[".gogoproto.goproto_unkeyed_all"] = false; - } - if (message.java_package != null && message.hasOwnProperty("java_package")) - object.java_package = message.java_package; - if (message.java_outer_classname != null && message.hasOwnProperty("java_outer_classname")) - object.java_outer_classname = message.java_outer_classname; - if (message.optimize_for != null && message.hasOwnProperty("optimize_for")) - object.optimize_for = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimize_for] : message.optimize_for; - if (message.java_multiple_files != null && message.hasOwnProperty("java_multiple_files")) - object.java_multiple_files = message.java_multiple_files; - if (message.go_package != null && message.hasOwnProperty("go_package")) - object.go_package = message.go_package; - if (message.cc_generic_services != null && message.hasOwnProperty("cc_generic_services")) - object.cc_generic_services = message.cc_generic_services; - if (message.java_generic_services != null && message.hasOwnProperty("java_generic_services")) - object.java_generic_services = message.java_generic_services; - if (message.py_generic_services != null && message.hasOwnProperty("py_generic_services")) - object.py_generic_services = message.py_generic_services; - if (message.java_generate_equals_and_hash != null && message.hasOwnProperty("java_generate_equals_and_hash")) - object.java_generate_equals_and_hash = message.java_generate_equals_and_hash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.java_string_check_utf8 != null && message.hasOwnProperty("java_string_check_utf8")) - object.java_string_check_utf8 = message.java_string_check_utf8; - if (message.cc_enable_arenas != null && message.hasOwnProperty("cc_enable_arenas")) - object.cc_enable_arenas = message.cc_enable_arenas; - if (message.objc_class_prefix != null && message.hasOwnProperty("objc_class_prefix")) - object.objc_class_prefix = message.objc_class_prefix; - if (message.csharp_namespace != null && message.hasOwnProperty("csharp_namespace")) - object.csharp_namespace = message.csharp_namespace; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters_all"] != null && message.hasOwnProperty(".gogoproto.goproto_getters_all")) - object[".gogoproto.goproto_getters_all"] = message[".gogoproto.goproto_getters_all"]; - if (message[".gogoproto.goproto_enum_prefix_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix_all")) - object[".gogoproto.goproto_enum_prefix_all"] = message[".gogoproto.goproto_enum_prefix_all"]; - if (message[".gogoproto.goproto_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer_all")) - object[".gogoproto.goproto_stringer_all"] = message[".gogoproto.goproto_stringer_all"]; - if (message[".gogoproto.verbose_equal_all"] != null && message.hasOwnProperty(".gogoproto.verbose_equal_all")) - object[".gogoproto.verbose_equal_all"] = message[".gogoproto.verbose_equal_all"]; - if (message[".gogoproto.face_all"] != null && message.hasOwnProperty(".gogoproto.face_all")) - object[".gogoproto.face_all"] = message[".gogoproto.face_all"]; - if (message[".gogoproto.gostring_all"] != null && message.hasOwnProperty(".gogoproto.gostring_all")) - object[".gogoproto.gostring_all"] = message[".gogoproto.gostring_all"]; - if (message[".gogoproto.populate_all"] != null && message.hasOwnProperty(".gogoproto.populate_all")) - object[".gogoproto.populate_all"] = message[".gogoproto.populate_all"]; - if (message[".gogoproto.stringer_all"] != null && message.hasOwnProperty(".gogoproto.stringer_all")) - object[".gogoproto.stringer_all"] = message[".gogoproto.stringer_all"]; - if (message[".gogoproto.onlyone_all"] != null && message.hasOwnProperty(".gogoproto.onlyone_all")) - object[".gogoproto.onlyone_all"] = message[".gogoproto.onlyone_all"]; - if (message[".gogoproto.equal_all"] != null && message.hasOwnProperty(".gogoproto.equal_all")) - object[".gogoproto.equal_all"] = message[".gogoproto.equal_all"]; - if (message[".gogoproto.description_all"] != null && message.hasOwnProperty(".gogoproto.description_all")) - object[".gogoproto.description_all"] = message[".gogoproto.description_all"]; - if (message[".gogoproto.testgen_all"] != null && message.hasOwnProperty(".gogoproto.testgen_all")) - object[".gogoproto.testgen_all"] = message[".gogoproto.testgen_all"]; - if (message[".gogoproto.benchgen_all"] != null && message.hasOwnProperty(".gogoproto.benchgen_all")) - object[".gogoproto.benchgen_all"] = message[".gogoproto.benchgen_all"]; - if (message[".gogoproto.marshaler_all"] != null && message.hasOwnProperty(".gogoproto.marshaler_all")) - object[".gogoproto.marshaler_all"] = message[".gogoproto.marshaler_all"]; - if (message[".gogoproto.unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unmarshaler_all")) - object[".gogoproto.unmarshaler_all"] = message[".gogoproto.unmarshaler_all"]; - if (message[".gogoproto.stable_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler_all")) - object[".gogoproto.stable_marshaler_all"] = message[".gogoproto.stable_marshaler_all"]; - if (message[".gogoproto.sizer_all"] != null && message.hasOwnProperty(".gogoproto.sizer_all")) - object[".gogoproto.sizer_all"] = message[".gogoproto.sizer_all"]; - if (message[".gogoproto.goproto_enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer_all")) - object[".gogoproto.goproto_enum_stringer_all"] = message[".gogoproto.goproto_enum_stringer_all"]; - if (message[".gogoproto.enum_stringer_all"] != null && message.hasOwnProperty(".gogoproto.enum_stringer_all")) - object[".gogoproto.enum_stringer_all"] = message[".gogoproto.enum_stringer_all"]; - if (message[".gogoproto.unsafe_marshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler_all")) - object[".gogoproto.unsafe_marshaler_all"] = message[".gogoproto.unsafe_marshaler_all"]; - if (message[".gogoproto.unsafe_unmarshaler_all"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler_all")) - object[".gogoproto.unsafe_unmarshaler_all"] = message[".gogoproto.unsafe_unmarshaler_all"]; - if (message[".gogoproto.goproto_extensions_map_all"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map_all")) - object[".gogoproto.goproto_extensions_map_all"] = message[".gogoproto.goproto_extensions_map_all"]; - if (message[".gogoproto.goproto_unrecognized_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized_all")) - object[".gogoproto.goproto_unrecognized_all"] = message[".gogoproto.goproto_unrecognized_all"]; - if (message[".gogoproto.gogoproto_import"] != null && message.hasOwnProperty(".gogoproto.gogoproto_import")) - object[".gogoproto.gogoproto_import"] = message[".gogoproto.gogoproto_import"]; - if (message[".gogoproto.protosizer_all"] != null && message.hasOwnProperty(".gogoproto.protosizer_all")) - object[".gogoproto.protosizer_all"] = message[".gogoproto.protosizer_all"]; - if (message[".gogoproto.compare_all"] != null && message.hasOwnProperty(".gogoproto.compare_all")) - object[".gogoproto.compare_all"] = message[".gogoproto.compare_all"]; - if (message[".gogoproto.typedecl_all"] != null && message.hasOwnProperty(".gogoproto.typedecl_all")) - object[".gogoproto.typedecl_all"] = message[".gogoproto.typedecl_all"]; - if (message[".gogoproto.enumdecl_all"] != null && message.hasOwnProperty(".gogoproto.enumdecl_all")) - object[".gogoproto.enumdecl_all"] = message[".gogoproto.enumdecl_all"]; - if (message[".gogoproto.goproto_registration"] != null && message.hasOwnProperty(".gogoproto.goproto_registration")) - object[".gogoproto.goproto_registration"] = message[".gogoproto.goproto_registration"]; - if (message[".gogoproto.messagename_all"] != null && message.hasOwnProperty(".gogoproto.messagename_all")) - object[".gogoproto.messagename_all"] = message[".gogoproto.messagename_all"]; - if (message[".gogoproto.goproto_sizecache_all"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache_all")) - object[".gogoproto.goproto_sizecache_all"] = message[".gogoproto.goproto_sizecache_all"]; - if (message[".gogoproto.goproto_unkeyed_all"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed_all")) - object[".gogoproto.goproto_unkeyed_all"] = message[".gogoproto.goproto_unkeyed_all"]; - if (message[".cosmos_proto.declare_interface"] && message[".cosmos_proto.declare_interface"].length) { - object[".cosmos_proto.declare_interface"] = []; - for (var j = 0; j < message[".cosmos_proto.declare_interface"].length; ++j) - object[".cosmos_proto.declare_interface"][j] = $root.cosmos_proto.InterfaceDescriptor.toObject(message[".cosmos_proto.declare_interface"][j], options); - } - if (message[".cosmos_proto.declare_scalar"] && message[".cosmos_proto.declare_scalar"].length) { - object[".cosmos_proto.declare_scalar"] = []; - for (var j = 0; j < message[".cosmos_proto.declare_scalar"].length; ++j) - object[".cosmos_proto.declare_scalar"][j] = $root.cosmos_proto.ScalarDescriptor.toObject(message[".cosmos_proto.declare_scalar"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [message_set_wire_format] MessageOptions message_set_wire_format - * @property {boolean|null} [no_standard_descriptor_accessor] MessageOptions no_standard_descriptor_accessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [map_entry] MessageOptions map_entry - * @property {Array.|null} [uninterpreted_option] MessageOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_getters"] MessageOptions .gogoproto.goproto_getters - * @property {boolean|null} [".gogoproto.goproto_stringer"] MessageOptions .gogoproto.goproto_stringer - * @property {boolean|null} [".gogoproto.verbose_equal"] MessageOptions .gogoproto.verbose_equal - * @property {boolean|null} [".gogoproto.face"] MessageOptions .gogoproto.face - * @property {boolean|null} [".gogoproto.gostring"] MessageOptions .gogoproto.gostring - * @property {boolean|null} [".gogoproto.populate"] MessageOptions .gogoproto.populate - * @property {boolean|null} [".gogoproto.stringer"] MessageOptions .gogoproto.stringer - * @property {boolean|null} [".gogoproto.onlyone"] MessageOptions .gogoproto.onlyone - * @property {boolean|null} [".gogoproto.equal"] MessageOptions .gogoproto.equal - * @property {boolean|null} [".gogoproto.description"] MessageOptions .gogoproto.description - * @property {boolean|null} [".gogoproto.testgen"] MessageOptions .gogoproto.testgen - * @property {boolean|null} [".gogoproto.benchgen"] MessageOptions .gogoproto.benchgen - * @property {boolean|null} [".gogoproto.marshaler"] MessageOptions .gogoproto.marshaler - * @property {boolean|null} [".gogoproto.unmarshaler"] MessageOptions .gogoproto.unmarshaler - * @property {boolean|null} [".gogoproto.stable_marshaler"] MessageOptions .gogoproto.stable_marshaler - * @property {boolean|null} [".gogoproto.sizer"] MessageOptions .gogoproto.sizer - * @property {boolean|null} [".gogoproto.unsafe_marshaler"] MessageOptions .gogoproto.unsafe_marshaler - * @property {boolean|null} [".gogoproto.unsafe_unmarshaler"] MessageOptions .gogoproto.unsafe_unmarshaler - * @property {boolean|null} [".gogoproto.goproto_extensions_map"] MessageOptions .gogoproto.goproto_extensions_map - * @property {boolean|null} [".gogoproto.goproto_unrecognized"] MessageOptions .gogoproto.goproto_unrecognized - * @property {boolean|null} [".gogoproto.protosizer"] MessageOptions .gogoproto.protosizer - * @property {boolean|null} [".gogoproto.compare"] MessageOptions .gogoproto.compare - * @property {boolean|null} [".gogoproto.typedecl"] MessageOptions .gogoproto.typedecl - * @property {boolean|null} [".gogoproto.messagename"] MessageOptions .gogoproto.messagename - * @property {boolean|null} [".gogoproto.goproto_sizecache"] MessageOptions .gogoproto.goproto_sizecache - * @property {boolean|null} [".gogoproto.goproto_unkeyed"] MessageOptions .gogoproto.goproto_unkeyed - * @property {Array.|null} [".cosmos_proto.implements_interface"] MessageOptions .cosmos_proto.implements_interface - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpreted_option = []; - this[".cosmos_proto.implements_interface"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions message_set_wire_format. - * @member {boolean} message_set_wire_format - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.message_set_wire_format = false; - - /** - * MessageOptions no_standard_descriptor_accessor. - * @member {boolean} no_standard_descriptor_accessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.no_standard_descriptor_accessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions map_entry. - * @member {boolean} map_entry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.map_entry = false; - - /** - * MessageOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MessageOptions .gogoproto.goproto_getters. - * @member {boolean} .gogoproto.goproto_getters - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_getters"] = false; - - /** - * MessageOptions .gogoproto.goproto_stringer. - * @member {boolean} .gogoproto.goproto_stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_stringer"] = false; - - /** - * MessageOptions .gogoproto.verbose_equal. - * @member {boolean} .gogoproto.verbose_equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.verbose_equal"] = false; - - /** - * MessageOptions .gogoproto.face. - * @member {boolean} .gogoproto.face - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.face"] = false; - - /** - * MessageOptions .gogoproto.gostring. - * @member {boolean} .gogoproto.gostring - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.gostring"] = false; - - /** - * MessageOptions .gogoproto.populate. - * @member {boolean} .gogoproto.populate - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.populate"] = false; - - /** - * MessageOptions .gogoproto.stringer. - * @member {boolean} .gogoproto.stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stringer"] = false; - - /** - * MessageOptions .gogoproto.onlyone. - * @member {boolean} .gogoproto.onlyone - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.onlyone"] = false; - - /** - * MessageOptions .gogoproto.equal. - * @member {boolean} .gogoproto.equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.equal"] = false; - - /** - * MessageOptions .gogoproto.description. - * @member {boolean} .gogoproto.description - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.description"] = false; - - /** - * MessageOptions .gogoproto.testgen. - * @member {boolean} .gogoproto.testgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.testgen"] = false; - - /** - * MessageOptions .gogoproto.benchgen. - * @member {boolean} .gogoproto.benchgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.benchgen"] = false; - - /** - * MessageOptions .gogoproto.marshaler. - * @member {boolean} .gogoproto.marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.marshaler"] = false; - - /** - * MessageOptions .gogoproto.unmarshaler. - * @member {boolean} .gogoproto.unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.stable_marshaler. - * @member {boolean} .gogoproto.stable_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stable_marshaler"] = false; - - /** - * MessageOptions .gogoproto.sizer. - * @member {boolean} .gogoproto.sizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.sizer"] = false; - - /** - * MessageOptions .gogoproto.unsafe_marshaler. - * @member {boolean} .gogoproto.unsafe_marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_marshaler"] = false; - - /** - * MessageOptions .gogoproto.unsafe_unmarshaler. - * @member {boolean} .gogoproto.unsafe_unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafe_unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.goproto_extensions_map. - * @member {boolean} .gogoproto.goproto_extensions_map - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_extensions_map"] = false; - - /** - * MessageOptions .gogoproto.goproto_unrecognized. - * @member {boolean} .gogoproto.goproto_unrecognized - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unrecognized"] = false; - - /** - * MessageOptions .gogoproto.protosizer. - * @member {boolean} .gogoproto.protosizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.protosizer"] = false; - - /** - * MessageOptions .gogoproto.compare. - * @member {boolean} .gogoproto.compare - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.compare"] = false; - - /** - * MessageOptions .gogoproto.typedecl. - * @member {boolean} .gogoproto.typedecl - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.typedecl"] = false; - - /** - * MessageOptions .gogoproto.messagename. - * @member {boolean} .gogoproto.messagename - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.messagename"] = false; - - /** - * MessageOptions .gogoproto.goproto_sizecache. - * @member {boolean} .gogoproto.goproto_sizecache - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_sizecache"] = false; - - /** - * MessageOptions .gogoproto.goproto_unkeyed. - * @member {boolean} .gogoproto.goproto_unkeyed - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goproto_unkeyed"] = false; - - /** - * MessageOptions .cosmos_proto.implements_interface. - * @member {Array.} .cosmos_proto.implements_interface - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".cosmos_proto.implements_interface"] = $util.emptyArray; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message_set_wire_format != null && Object.hasOwnProperty.call(message, "message_set_wire_format")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.message_set_wire_format); - if (message.no_standard_descriptor_accessor != null && Object.hasOwnProperty.call(message, "no_standard_descriptor_accessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.no_standard_descriptor_accessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.map_entry != null && Object.hasOwnProperty.call(message, "map_entry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.map_entry); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_getters"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_getters")) - writer.uint32(/* id 64001, wireType 0 =*/512008).bool(message[".gogoproto.goproto_getters"]); - if (message[".gogoproto.goproto_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_stringer")) - writer.uint32(/* id 64003, wireType 0 =*/512024).bool(message[".gogoproto.goproto_stringer"]); - if (message[".gogoproto.verbose_equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verbose_equal")) - writer.uint32(/* id 64004, wireType 0 =*/512032).bool(message[".gogoproto.verbose_equal"]); - if (message[".gogoproto.face"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face")) - writer.uint32(/* id 64005, wireType 0 =*/512040).bool(message[".gogoproto.face"]); - if (message[".gogoproto.gostring"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring")) - writer.uint32(/* id 64006, wireType 0 =*/512048).bool(message[".gogoproto.gostring"]); - if (message[".gogoproto.populate"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate")) - writer.uint32(/* id 64007, wireType 0 =*/512056).bool(message[".gogoproto.populate"]); - if (message[".gogoproto.onlyone"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone")) - writer.uint32(/* id 64009, wireType 0 =*/512072).bool(message[".gogoproto.onlyone"]); - if (message[".gogoproto.equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal")) - writer.uint32(/* id 64013, wireType 0 =*/512104).bool(message[".gogoproto.equal"]); - if (message[".gogoproto.description"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description")) - writer.uint32(/* id 64014, wireType 0 =*/512112).bool(message[".gogoproto.description"]); - if (message[".gogoproto.testgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen")) - writer.uint32(/* id 64015, wireType 0 =*/512120).bool(message[".gogoproto.testgen"]); - if (message[".gogoproto.benchgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen")) - writer.uint32(/* id 64016, wireType 0 =*/512128).bool(message[".gogoproto.benchgen"]); - if (message[".gogoproto.marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler")) - writer.uint32(/* id 64017, wireType 0 =*/512136).bool(message[".gogoproto.marshaler"]); - if (message[".gogoproto.unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler")) - writer.uint32(/* id 64018, wireType 0 =*/512144).bool(message[".gogoproto.unmarshaler"]); - if (message[".gogoproto.stable_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stable_marshaler")) - writer.uint32(/* id 64019, wireType 0 =*/512152).bool(message[".gogoproto.stable_marshaler"]); - if (message[".gogoproto.sizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer")) - writer.uint32(/* id 64020, wireType 0 =*/512160).bool(message[".gogoproto.sizer"]); - if (message[".gogoproto.unsafe_marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_marshaler")) - writer.uint32(/* id 64023, wireType 0 =*/512184).bool(message[".gogoproto.unsafe_marshaler"]); - if (message[".gogoproto.unsafe_unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafe_unmarshaler")) - writer.uint32(/* id 64024, wireType 0 =*/512192).bool(message[".gogoproto.unsafe_unmarshaler"]); - if (message[".gogoproto.goproto_extensions_map"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_extensions_map")) - writer.uint32(/* id 64025, wireType 0 =*/512200).bool(message[".gogoproto.goproto_extensions_map"]); - if (message[".gogoproto.goproto_unrecognized"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unrecognized")) - writer.uint32(/* id 64026, wireType 0 =*/512208).bool(message[".gogoproto.goproto_unrecognized"]); - if (message[".gogoproto.protosizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer")) - writer.uint32(/* id 64028, wireType 0 =*/512224).bool(message[".gogoproto.protosizer"]); - if (message[".gogoproto.compare"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare")) - writer.uint32(/* id 64029, wireType 0 =*/512232).bool(message[".gogoproto.compare"]); - if (message[".gogoproto.typedecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl")) - writer.uint32(/* id 64030, wireType 0 =*/512240).bool(message[".gogoproto.typedecl"]); - if (message[".gogoproto.messagename"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename")) - writer.uint32(/* id 64033, wireType 0 =*/512264).bool(message[".gogoproto.messagename"]); - if (message[".gogoproto.goproto_sizecache"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_sizecache")) - writer.uint32(/* id 64034, wireType 0 =*/512272).bool(message[".gogoproto.goproto_sizecache"]); - if (message[".gogoproto.goproto_unkeyed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_unkeyed")) - writer.uint32(/* id 64035, wireType 0 =*/512280).bool(message[".gogoproto.goproto_unkeyed"]); - if (message[".gogoproto.stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer")) - writer.uint32(/* id 67008, wireType 0 =*/536064).bool(message[".gogoproto.stringer"]); - if (message[".cosmos_proto.implements_interface"] != null && message[".cosmos_proto.implements_interface"].length) - for (var i = 0; i < message[".cosmos_proto.implements_interface"].length; ++i) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.implements_interface"][i]); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.message_set_wire_format = reader.bool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.map_entry = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 64001: - message[".gogoproto.goproto_getters"] = reader.bool(); - break; - case 64003: - message[".gogoproto.goproto_stringer"] = reader.bool(); - break; - case 64004: - message[".gogoproto.verbose_equal"] = reader.bool(); - break; - case 64005: - message[".gogoproto.face"] = reader.bool(); - break; - case 64006: - message[".gogoproto.gostring"] = reader.bool(); - break; - case 64007: - message[".gogoproto.populate"] = reader.bool(); - break; - case 67008: - message[".gogoproto.stringer"] = reader.bool(); - break; - case 64009: - message[".gogoproto.onlyone"] = reader.bool(); - break; - case 64013: - message[".gogoproto.equal"] = reader.bool(); - break; - case 64014: - message[".gogoproto.description"] = reader.bool(); - break; - case 64015: - message[".gogoproto.testgen"] = reader.bool(); - break; - case 64016: - message[".gogoproto.benchgen"] = reader.bool(); - break; - case 64017: - message[".gogoproto.marshaler"] = reader.bool(); - break; - case 64018: - message[".gogoproto.unmarshaler"] = reader.bool(); - break; - case 64019: - message[".gogoproto.stable_marshaler"] = reader.bool(); - break; - case 64020: - message[".gogoproto.sizer"] = reader.bool(); - break; - case 64023: - message[".gogoproto.unsafe_marshaler"] = reader.bool(); - break; - case 64024: - message[".gogoproto.unsafe_unmarshaler"] = reader.bool(); - break; - case 64025: - message[".gogoproto.goproto_extensions_map"] = reader.bool(); - break; - case 64026: - message[".gogoproto.goproto_unrecognized"] = reader.bool(); - break; - case 64028: - message[".gogoproto.protosizer"] = reader.bool(); - break; - case 64029: - message[".gogoproto.compare"] = reader.bool(); - break; - case 64030: - message[".gogoproto.typedecl"] = reader.bool(); - break; - case 64033: - message[".gogoproto.messagename"] = reader.bool(); - break; - case 64034: - message[".gogoproto.goproto_sizecache"] = reader.bool(); - break; - case 64035: - message[".gogoproto.goproto_unkeyed"] = reader.bool(); - break; - case 93001: - if (!(message[".cosmos_proto.implements_interface"] && message[".cosmos_proto.implements_interface"].length)) - message[".cosmos_proto.implements_interface"] = []; - message[".cosmos_proto.implements_interface"].push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - if (typeof message.message_set_wire_format !== "boolean") - return "message_set_wire_format: boolean expected"; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - if (typeof message.no_standard_descriptor_accessor !== "boolean") - return "no_standard_descriptor_accessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - if (typeof message.map_entry !== "boolean") - return "map_entry: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - if (typeof message[".gogoproto.goproto_getters"] !== "boolean") - return ".gogoproto.goproto_getters: boolean expected"; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - if (typeof message[".gogoproto.goproto_stringer"] !== "boolean") - return ".gogoproto.goproto_stringer: boolean expected"; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - if (typeof message[".gogoproto.verbose_equal"] !== "boolean") - return ".gogoproto.verbose_equal: boolean expected"; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - if (typeof message[".gogoproto.face"] !== "boolean") - return ".gogoproto.face: boolean expected"; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - if (typeof message[".gogoproto.gostring"] !== "boolean") - return ".gogoproto.gostring: boolean expected"; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - if (typeof message[".gogoproto.populate"] !== "boolean") - return ".gogoproto.populate: boolean expected"; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - if (typeof message[".gogoproto.stringer"] !== "boolean") - return ".gogoproto.stringer: boolean expected"; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - if (typeof message[".gogoproto.onlyone"] !== "boolean") - return ".gogoproto.onlyone: boolean expected"; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - if (typeof message[".gogoproto.equal"] !== "boolean") - return ".gogoproto.equal: boolean expected"; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - if (typeof message[".gogoproto.description"] !== "boolean") - return ".gogoproto.description: boolean expected"; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - if (typeof message[".gogoproto.testgen"] !== "boolean") - return ".gogoproto.testgen: boolean expected"; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - if (typeof message[".gogoproto.benchgen"] !== "boolean") - return ".gogoproto.benchgen: boolean expected"; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - if (typeof message[".gogoproto.marshaler"] !== "boolean") - return ".gogoproto.marshaler: boolean expected"; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - if (typeof message[".gogoproto.unmarshaler"] !== "boolean") - return ".gogoproto.unmarshaler: boolean expected"; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - if (typeof message[".gogoproto.stable_marshaler"] !== "boolean") - return ".gogoproto.stable_marshaler: boolean expected"; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - if (typeof message[".gogoproto.sizer"] !== "boolean") - return ".gogoproto.sizer: boolean expected"; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - if (typeof message[".gogoproto.unsafe_marshaler"] !== "boolean") - return ".gogoproto.unsafe_marshaler: boolean expected"; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - if (typeof message[".gogoproto.unsafe_unmarshaler"] !== "boolean") - return ".gogoproto.unsafe_unmarshaler: boolean expected"; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - if (typeof message[".gogoproto.goproto_extensions_map"] !== "boolean") - return ".gogoproto.goproto_extensions_map: boolean expected"; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - if (typeof message[".gogoproto.goproto_unrecognized"] !== "boolean") - return ".gogoproto.goproto_unrecognized: boolean expected"; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - if (typeof message[".gogoproto.protosizer"] !== "boolean") - return ".gogoproto.protosizer: boolean expected"; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - if (typeof message[".gogoproto.compare"] !== "boolean") - return ".gogoproto.compare: boolean expected"; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - if (typeof message[".gogoproto.typedecl"] !== "boolean") - return ".gogoproto.typedecl: boolean expected"; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - if (typeof message[".gogoproto.messagename"] !== "boolean") - return ".gogoproto.messagename: boolean expected"; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - if (typeof message[".gogoproto.goproto_sizecache"] !== "boolean") - return ".gogoproto.goproto_sizecache: boolean expected"; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - if (typeof message[".gogoproto.goproto_unkeyed"] !== "boolean") - return ".gogoproto.goproto_unkeyed: boolean expected"; - if (message[".cosmos_proto.implements_interface"] != null && message.hasOwnProperty(".cosmos_proto.implements_interface")) { - if (!Array.isArray(message[".cosmos_proto.implements_interface"])) - return ".cosmos_proto.implements_interface: array expected"; - for (var i = 0; i < message[".cosmos_proto.implements_interface"].length; ++i) - if (!$util.isString(message[".cosmos_proto.implements_interface"][i])) - return ".cosmos_proto.implements_interface: string[] expected"; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.message_set_wire_format != null) - message.message_set_wire_format = Boolean(object.message_set_wire_format); - if (object.no_standard_descriptor_accessor != null) - message.no_standard_descriptor_accessor = Boolean(object.no_standard_descriptor_accessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.map_entry != null) - message.map_entry = Boolean(object.map_entry); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_getters"] != null) - message[".gogoproto.goproto_getters"] = Boolean(object[".gogoproto.goproto_getters"]); - if (object[".gogoproto.goproto_stringer"] != null) - message[".gogoproto.goproto_stringer"] = Boolean(object[".gogoproto.goproto_stringer"]); - if (object[".gogoproto.verbose_equal"] != null) - message[".gogoproto.verbose_equal"] = Boolean(object[".gogoproto.verbose_equal"]); - if (object[".gogoproto.face"] != null) - message[".gogoproto.face"] = Boolean(object[".gogoproto.face"]); - if (object[".gogoproto.gostring"] != null) - message[".gogoproto.gostring"] = Boolean(object[".gogoproto.gostring"]); - if (object[".gogoproto.populate"] != null) - message[".gogoproto.populate"] = Boolean(object[".gogoproto.populate"]); - if (object[".gogoproto.stringer"] != null) - message[".gogoproto.stringer"] = Boolean(object[".gogoproto.stringer"]); - if (object[".gogoproto.onlyone"] != null) - message[".gogoproto.onlyone"] = Boolean(object[".gogoproto.onlyone"]); - if (object[".gogoproto.equal"] != null) - message[".gogoproto.equal"] = Boolean(object[".gogoproto.equal"]); - if (object[".gogoproto.description"] != null) - message[".gogoproto.description"] = Boolean(object[".gogoproto.description"]); - if (object[".gogoproto.testgen"] != null) - message[".gogoproto.testgen"] = Boolean(object[".gogoproto.testgen"]); - if (object[".gogoproto.benchgen"] != null) - message[".gogoproto.benchgen"] = Boolean(object[".gogoproto.benchgen"]); - if (object[".gogoproto.marshaler"] != null) - message[".gogoproto.marshaler"] = Boolean(object[".gogoproto.marshaler"]); - if (object[".gogoproto.unmarshaler"] != null) - message[".gogoproto.unmarshaler"] = Boolean(object[".gogoproto.unmarshaler"]); - if (object[".gogoproto.stable_marshaler"] != null) - message[".gogoproto.stable_marshaler"] = Boolean(object[".gogoproto.stable_marshaler"]); - if (object[".gogoproto.sizer"] != null) - message[".gogoproto.sizer"] = Boolean(object[".gogoproto.sizer"]); - if (object[".gogoproto.unsafe_marshaler"] != null) - message[".gogoproto.unsafe_marshaler"] = Boolean(object[".gogoproto.unsafe_marshaler"]); - if (object[".gogoproto.unsafe_unmarshaler"] != null) - message[".gogoproto.unsafe_unmarshaler"] = Boolean(object[".gogoproto.unsafe_unmarshaler"]); - if (object[".gogoproto.goproto_extensions_map"] != null) - message[".gogoproto.goproto_extensions_map"] = Boolean(object[".gogoproto.goproto_extensions_map"]); - if (object[".gogoproto.goproto_unrecognized"] != null) - message[".gogoproto.goproto_unrecognized"] = Boolean(object[".gogoproto.goproto_unrecognized"]); - if (object[".gogoproto.protosizer"] != null) - message[".gogoproto.protosizer"] = Boolean(object[".gogoproto.protosizer"]); - if (object[".gogoproto.compare"] != null) - message[".gogoproto.compare"] = Boolean(object[".gogoproto.compare"]); - if (object[".gogoproto.typedecl"] != null) - message[".gogoproto.typedecl"] = Boolean(object[".gogoproto.typedecl"]); - if (object[".gogoproto.messagename"] != null) - message[".gogoproto.messagename"] = Boolean(object[".gogoproto.messagename"]); - if (object[".gogoproto.goproto_sizecache"] != null) - message[".gogoproto.goproto_sizecache"] = Boolean(object[".gogoproto.goproto_sizecache"]); - if (object[".gogoproto.goproto_unkeyed"] != null) - message[".gogoproto.goproto_unkeyed"] = Boolean(object[".gogoproto.goproto_unkeyed"]); - if (object[".cosmos_proto.implements_interface"]) { - if (!Array.isArray(object[".cosmos_proto.implements_interface"])) - throw TypeError(".google.protobuf.MessageOptions..cosmos_proto.implements_interface: array expected"); - message[".cosmos_proto.implements_interface"] = []; - for (var i = 0; i < object[".cosmos_proto.implements_interface"].length; ++i) - message[".cosmos_proto.implements_interface"][i] = String(object[".cosmos_proto.implements_interface"][i]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpreted_option = []; - object[".cosmos_proto.implements_interface"] = []; - } - if (options.defaults) { - object.message_set_wire_format = false; - object.no_standard_descriptor_accessor = false; - object.deprecated = false; - object.map_entry = false; - object[".gogoproto.goproto_getters"] = false; - object[".gogoproto.goproto_stringer"] = false; - object[".gogoproto.verbose_equal"] = false; - object[".gogoproto.face"] = false; - object[".gogoproto.gostring"] = false; - object[".gogoproto.populate"] = false; - object[".gogoproto.onlyone"] = false; - object[".gogoproto.equal"] = false; - object[".gogoproto.description"] = false; - object[".gogoproto.testgen"] = false; - object[".gogoproto.benchgen"] = false; - object[".gogoproto.marshaler"] = false; - object[".gogoproto.unmarshaler"] = false; - object[".gogoproto.stable_marshaler"] = false; - object[".gogoproto.sizer"] = false; - object[".gogoproto.unsafe_marshaler"] = false; - object[".gogoproto.unsafe_unmarshaler"] = false; - object[".gogoproto.goproto_extensions_map"] = false; - object[".gogoproto.goproto_unrecognized"] = false; - object[".gogoproto.protosizer"] = false; - object[".gogoproto.compare"] = false; - object[".gogoproto.typedecl"] = false; - object[".gogoproto.messagename"] = false; - object[".gogoproto.goproto_sizecache"] = false; - object[".gogoproto.goproto_unkeyed"] = false; - object[".gogoproto.stringer"] = false; - } - if (message.message_set_wire_format != null && message.hasOwnProperty("message_set_wire_format")) - object.message_set_wire_format = message.message_set_wire_format; - if (message.no_standard_descriptor_accessor != null && message.hasOwnProperty("no_standard_descriptor_accessor")) - object.no_standard_descriptor_accessor = message.no_standard_descriptor_accessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.map_entry != null && message.hasOwnProperty("map_entry")) - object.map_entry = message.map_entry; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_getters"] != null && message.hasOwnProperty(".gogoproto.goproto_getters")) - object[".gogoproto.goproto_getters"] = message[".gogoproto.goproto_getters"]; - if (message[".gogoproto.goproto_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_stringer")) - object[".gogoproto.goproto_stringer"] = message[".gogoproto.goproto_stringer"]; - if (message[".gogoproto.verbose_equal"] != null && message.hasOwnProperty(".gogoproto.verbose_equal")) - object[".gogoproto.verbose_equal"] = message[".gogoproto.verbose_equal"]; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - object[".gogoproto.face"] = message[".gogoproto.face"]; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - object[".gogoproto.gostring"] = message[".gogoproto.gostring"]; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - object[".gogoproto.populate"] = message[".gogoproto.populate"]; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - object[".gogoproto.onlyone"] = message[".gogoproto.onlyone"]; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - object[".gogoproto.equal"] = message[".gogoproto.equal"]; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - object[".gogoproto.description"] = message[".gogoproto.description"]; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - object[".gogoproto.testgen"] = message[".gogoproto.testgen"]; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - object[".gogoproto.benchgen"] = message[".gogoproto.benchgen"]; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - object[".gogoproto.marshaler"] = message[".gogoproto.marshaler"]; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - object[".gogoproto.unmarshaler"] = message[".gogoproto.unmarshaler"]; - if (message[".gogoproto.stable_marshaler"] != null && message.hasOwnProperty(".gogoproto.stable_marshaler")) - object[".gogoproto.stable_marshaler"] = message[".gogoproto.stable_marshaler"]; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - object[".gogoproto.sizer"] = message[".gogoproto.sizer"]; - if (message[".gogoproto.unsafe_marshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_marshaler")) - object[".gogoproto.unsafe_marshaler"] = message[".gogoproto.unsafe_marshaler"]; - if (message[".gogoproto.unsafe_unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafe_unmarshaler")) - object[".gogoproto.unsafe_unmarshaler"] = message[".gogoproto.unsafe_unmarshaler"]; - if (message[".gogoproto.goproto_extensions_map"] != null && message.hasOwnProperty(".gogoproto.goproto_extensions_map")) - object[".gogoproto.goproto_extensions_map"] = message[".gogoproto.goproto_extensions_map"]; - if (message[".gogoproto.goproto_unrecognized"] != null && message.hasOwnProperty(".gogoproto.goproto_unrecognized")) - object[".gogoproto.goproto_unrecognized"] = message[".gogoproto.goproto_unrecognized"]; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - object[".gogoproto.protosizer"] = message[".gogoproto.protosizer"]; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - object[".gogoproto.compare"] = message[".gogoproto.compare"]; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - object[".gogoproto.typedecl"] = message[".gogoproto.typedecl"]; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - object[".gogoproto.messagename"] = message[".gogoproto.messagename"]; - if (message[".gogoproto.goproto_sizecache"] != null && message.hasOwnProperty(".gogoproto.goproto_sizecache")) - object[".gogoproto.goproto_sizecache"] = message[".gogoproto.goproto_sizecache"]; - if (message[".gogoproto.goproto_unkeyed"] != null && message.hasOwnProperty(".gogoproto.goproto_unkeyed")) - object[".gogoproto.goproto_unkeyed"] = message[".gogoproto.goproto_unkeyed"]; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - object[".gogoproto.stringer"] = message[".gogoproto.stringer"]; - if (message[".cosmos_proto.implements_interface"] && message[".cosmos_proto.implements_interface"].length) { - object[".cosmos_proto.implements_interface"] = []; - for (var j = 0; j < message[".cosmos_proto.implements_interface"].length; ++j) - object[".cosmos_proto.implements_interface"][j] = message[".cosmos_proto.implements_interface"][j]; - } - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpreted_option] FieldOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.nullable"] FieldOptions .gogoproto.nullable - * @property {boolean|null} [".gogoproto.embed"] FieldOptions .gogoproto.embed - * @property {string|null} [".gogoproto.customtype"] FieldOptions .gogoproto.customtype - * @property {string|null} [".gogoproto.customname"] FieldOptions .gogoproto.customname - * @property {string|null} [".gogoproto.jsontag"] FieldOptions .gogoproto.jsontag - * @property {string|null} [".gogoproto.moretags"] FieldOptions .gogoproto.moretags - * @property {string|null} [".gogoproto.casttype"] FieldOptions .gogoproto.casttype - * @property {string|null} [".gogoproto.castkey"] FieldOptions .gogoproto.castkey - * @property {string|null} [".gogoproto.castvalue"] FieldOptions .gogoproto.castvalue - * @property {boolean|null} [".gogoproto.stdtime"] FieldOptions .gogoproto.stdtime - * @property {boolean|null} [".gogoproto.stdduration"] FieldOptions .gogoproto.stdduration - * @property {boolean|null} [".gogoproto.wktpointer"] FieldOptions .gogoproto.wktpointer - * @property {string|null} [".gogoproto.castrepeated"] FieldOptions .gogoproto.castrepeated - * @property {string|null} [".cosmos_proto.accepts_interface"] FieldOptions .cosmos_proto.accepts_interface - * @property {string|null} [".cosmos_proto.scalar"] FieldOptions .cosmos_proto.scalar - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * FieldOptions .gogoproto.nullable. - * @member {boolean} .gogoproto.nullable - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.nullable"] = false; - - /** - * FieldOptions .gogoproto.embed. - * @member {boolean} .gogoproto.embed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.embed"] = false; - - /** - * FieldOptions .gogoproto.customtype. - * @member {string} .gogoproto.customtype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customtype"] = ""; - - /** - * FieldOptions .gogoproto.customname. - * @member {string} .gogoproto.customname - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customname"] = ""; - - /** - * FieldOptions .gogoproto.jsontag. - * @member {string} .gogoproto.jsontag - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.jsontag"] = ""; - - /** - * FieldOptions .gogoproto.moretags. - * @member {string} .gogoproto.moretags - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.moretags"] = ""; - - /** - * FieldOptions .gogoproto.casttype. - * @member {string} .gogoproto.casttype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.casttype"] = ""; - - /** - * FieldOptions .gogoproto.castkey. - * @member {string} .gogoproto.castkey - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castkey"] = ""; - - /** - * FieldOptions .gogoproto.castvalue. - * @member {string} .gogoproto.castvalue - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castvalue"] = ""; - - /** - * FieldOptions .gogoproto.stdtime. - * @member {boolean} .gogoproto.stdtime - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdtime"] = false; - - /** - * FieldOptions .gogoproto.stdduration. - * @member {boolean} .gogoproto.stdduration - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdduration"] = false; - - /** - * FieldOptions .gogoproto.wktpointer. - * @member {boolean} .gogoproto.wktpointer - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.wktpointer"] = false; - - /** - * FieldOptions .gogoproto.castrepeated. - * @member {string} .gogoproto.castrepeated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castrepeated"] = ""; - - /** - * FieldOptions .cosmos_proto.accepts_interface. - * @member {string} .cosmos_proto.accepts_interface - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".cosmos_proto.accepts_interface"] = ""; - - /** - * FieldOptions .cosmos_proto.scalar. - * @member {string} .cosmos_proto.scalar - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".cosmos_proto.scalar"] = ""; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.nullable"] != null && Object.hasOwnProperty.call(message, ".gogoproto.nullable")) - writer.uint32(/* id 65001, wireType 0 =*/520008).bool(message[".gogoproto.nullable"]); - if (message[".gogoproto.embed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.embed")) - writer.uint32(/* id 65002, wireType 0 =*/520016).bool(message[".gogoproto.embed"]); - if (message[".gogoproto.customtype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customtype")) - writer.uint32(/* id 65003, wireType 2 =*/520026).string(message[".gogoproto.customtype"]); - if (message[".gogoproto.customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customname")) - writer.uint32(/* id 65004, wireType 2 =*/520034).string(message[".gogoproto.customname"]); - if (message[".gogoproto.jsontag"] != null && Object.hasOwnProperty.call(message, ".gogoproto.jsontag")) - writer.uint32(/* id 65005, wireType 2 =*/520042).string(message[".gogoproto.jsontag"]); - if (message[".gogoproto.moretags"] != null && Object.hasOwnProperty.call(message, ".gogoproto.moretags")) - writer.uint32(/* id 65006, wireType 2 =*/520050).string(message[".gogoproto.moretags"]); - if (message[".gogoproto.casttype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.casttype")) - writer.uint32(/* id 65007, wireType 2 =*/520058).string(message[".gogoproto.casttype"]); - if (message[".gogoproto.castkey"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castkey")) - writer.uint32(/* id 65008, wireType 2 =*/520066).string(message[".gogoproto.castkey"]); - if (message[".gogoproto.castvalue"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castvalue")) - writer.uint32(/* id 65009, wireType 2 =*/520074).string(message[".gogoproto.castvalue"]); - if (message[".gogoproto.stdtime"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdtime")) - writer.uint32(/* id 65010, wireType 0 =*/520080).bool(message[".gogoproto.stdtime"]); - if (message[".gogoproto.stdduration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdduration")) - writer.uint32(/* id 65011, wireType 0 =*/520088).bool(message[".gogoproto.stdduration"]); - if (message[".gogoproto.wktpointer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.wktpointer")) - writer.uint32(/* id 65012, wireType 0 =*/520096).bool(message[".gogoproto.wktpointer"]); - if (message[".gogoproto.castrepeated"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castrepeated")) - writer.uint32(/* id 65013, wireType 2 =*/520106).string(message[".gogoproto.castrepeated"]); - if (message[".cosmos_proto.accepts_interface"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.accepts_interface")) - writer.uint32(/* id 93001, wireType 2 =*/744010).string(message[".cosmos_proto.accepts_interface"]); - if (message[".cosmos_proto.scalar"] != null && Object.hasOwnProperty.call(message, ".cosmos_proto.scalar")) - writer.uint32(/* id 93002, wireType 2 =*/744018).string(message[".cosmos_proto.scalar"]); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 65001: - message[".gogoproto.nullable"] = reader.bool(); - break; - case 65002: - message[".gogoproto.embed"] = reader.bool(); - break; - case 65003: - message[".gogoproto.customtype"] = reader.string(); - break; - case 65004: - message[".gogoproto.customname"] = reader.string(); - break; - case 65005: - message[".gogoproto.jsontag"] = reader.string(); - break; - case 65006: - message[".gogoproto.moretags"] = reader.string(); - break; - case 65007: - message[".gogoproto.casttype"] = reader.string(); - break; - case 65008: - message[".gogoproto.castkey"] = reader.string(); - break; - case 65009: - message[".gogoproto.castvalue"] = reader.string(); - break; - case 65010: - message[".gogoproto.stdtime"] = reader.bool(); - break; - case 65011: - message[".gogoproto.stdduration"] = reader.bool(); - break; - case 65012: - message[".gogoproto.wktpointer"] = reader.bool(); - break; - case 65013: - message[".gogoproto.castrepeated"] = reader.string(); - break; - case 93001: - message[".cosmos_proto.accepts_interface"] = reader.string(); - break; - case 93002: - message[".cosmos_proto.scalar"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - if (typeof message[".gogoproto.nullable"] !== "boolean") - return ".gogoproto.nullable: boolean expected"; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - if (typeof message[".gogoproto.embed"] !== "boolean") - return ".gogoproto.embed: boolean expected"; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - if (!$util.isString(message[".gogoproto.customtype"])) - return ".gogoproto.customtype: string expected"; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - if (!$util.isString(message[".gogoproto.customname"])) - return ".gogoproto.customname: string expected"; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - if (!$util.isString(message[".gogoproto.jsontag"])) - return ".gogoproto.jsontag: string expected"; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - if (!$util.isString(message[".gogoproto.moretags"])) - return ".gogoproto.moretags: string expected"; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - if (!$util.isString(message[".gogoproto.casttype"])) - return ".gogoproto.casttype: string expected"; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - if (!$util.isString(message[".gogoproto.castkey"])) - return ".gogoproto.castkey: string expected"; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - if (!$util.isString(message[".gogoproto.castvalue"])) - return ".gogoproto.castvalue: string expected"; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - if (typeof message[".gogoproto.stdtime"] !== "boolean") - return ".gogoproto.stdtime: boolean expected"; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - if (typeof message[".gogoproto.stdduration"] !== "boolean") - return ".gogoproto.stdduration: boolean expected"; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - if (typeof message[".gogoproto.wktpointer"] !== "boolean") - return ".gogoproto.wktpointer: boolean expected"; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - if (!$util.isString(message[".gogoproto.castrepeated"])) - return ".gogoproto.castrepeated: string expected"; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - if (!$util.isString(message[".cosmos_proto.accepts_interface"])) - return ".cosmos_proto.accepts_interface: string expected"; - if (message[".cosmos_proto.scalar"] != null && message.hasOwnProperty(".cosmos_proto.scalar")) - if (!$util.isString(message[".cosmos_proto.scalar"])) - return ".cosmos_proto.scalar: string expected"; - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.nullable"] != null) - message[".gogoproto.nullable"] = Boolean(object[".gogoproto.nullable"]); - if (object[".gogoproto.embed"] != null) - message[".gogoproto.embed"] = Boolean(object[".gogoproto.embed"]); - if (object[".gogoproto.customtype"] != null) - message[".gogoproto.customtype"] = String(object[".gogoproto.customtype"]); - if (object[".gogoproto.customname"] != null) - message[".gogoproto.customname"] = String(object[".gogoproto.customname"]); - if (object[".gogoproto.jsontag"] != null) - message[".gogoproto.jsontag"] = String(object[".gogoproto.jsontag"]); - if (object[".gogoproto.moretags"] != null) - message[".gogoproto.moretags"] = String(object[".gogoproto.moretags"]); - if (object[".gogoproto.casttype"] != null) - message[".gogoproto.casttype"] = String(object[".gogoproto.casttype"]); - if (object[".gogoproto.castkey"] != null) - message[".gogoproto.castkey"] = String(object[".gogoproto.castkey"]); - if (object[".gogoproto.castvalue"] != null) - message[".gogoproto.castvalue"] = String(object[".gogoproto.castvalue"]); - if (object[".gogoproto.stdtime"] != null) - message[".gogoproto.stdtime"] = Boolean(object[".gogoproto.stdtime"]); - if (object[".gogoproto.stdduration"] != null) - message[".gogoproto.stdduration"] = Boolean(object[".gogoproto.stdduration"]); - if (object[".gogoproto.wktpointer"] != null) - message[".gogoproto.wktpointer"] = Boolean(object[".gogoproto.wktpointer"]); - if (object[".gogoproto.castrepeated"] != null) - message[".gogoproto.castrepeated"] = String(object[".gogoproto.castrepeated"]); - if (object[".cosmos_proto.accepts_interface"] != null) - message[".cosmos_proto.accepts_interface"] = String(object[".cosmos_proto.accepts_interface"]); - if (object[".cosmos_proto.scalar"] != null) - message[".cosmos_proto.scalar"] = String(object[".cosmos_proto.scalar"]); - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object[".gogoproto.nullable"] = false; - object[".gogoproto.embed"] = false; - object[".gogoproto.customtype"] = ""; - object[".gogoproto.customname"] = ""; - object[".gogoproto.jsontag"] = ""; - object[".gogoproto.moretags"] = ""; - object[".gogoproto.casttype"] = ""; - object[".gogoproto.castkey"] = ""; - object[".gogoproto.castvalue"] = ""; - object[".gogoproto.stdtime"] = false; - object[".gogoproto.stdduration"] = false; - object[".gogoproto.wktpointer"] = false; - object[".gogoproto.castrepeated"] = ""; - object[".cosmos_proto.accepts_interface"] = ""; - object[".cosmos_proto.scalar"] = ""; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - object[".gogoproto.nullable"] = message[".gogoproto.nullable"]; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - object[".gogoproto.embed"] = message[".gogoproto.embed"]; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - object[".gogoproto.customtype"] = message[".gogoproto.customtype"]; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - object[".gogoproto.customname"] = message[".gogoproto.customname"]; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - object[".gogoproto.jsontag"] = message[".gogoproto.jsontag"]; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - object[".gogoproto.moretags"] = message[".gogoproto.moretags"]; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - object[".gogoproto.casttype"] = message[".gogoproto.casttype"]; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - object[".gogoproto.castkey"] = message[".gogoproto.castkey"]; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - object[".gogoproto.castvalue"] = message[".gogoproto.castvalue"]; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - object[".gogoproto.stdtime"] = message[".gogoproto.stdtime"]; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - object[".gogoproto.stdduration"] = message[".gogoproto.stdduration"]; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - object[".gogoproto.wktpointer"] = message[".gogoproto.wktpointer"]; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - object[".gogoproto.castrepeated"] = message[".gogoproto.castrepeated"]; - if (message[".cosmos_proto.accepts_interface"] != null && message.hasOwnProperty(".cosmos_proto.accepts_interface")) - object[".cosmos_proto.accepts_interface"] = message[".cosmos_proto.accepts_interface"]; - if (message[".cosmos_proto.scalar"] != null && message.hasOwnProperty(".cosmos_proto.scalar")) - object[".cosmos_proto.scalar"] = message[".cosmos_proto.scalar"]; - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpreted_option] OneofOptions uninterpreted_option - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allow_alias] EnumOptions allow_alias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumOptions uninterpreted_option - * @property {boolean|null} [".gogoproto.goproto_enum_prefix"] EnumOptions .gogoproto.goproto_enum_prefix - * @property {boolean|null} [".gogoproto.goproto_enum_stringer"] EnumOptions .gogoproto.goproto_enum_stringer - * @property {boolean|null} [".gogoproto.enum_stringer"] EnumOptions .gogoproto.enum_stringer - * @property {string|null} [".gogoproto.enum_customname"] EnumOptions .gogoproto.enum_customname - * @property {boolean|null} [".gogoproto.enumdecl"] EnumOptions .gogoproto.enumdecl - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allow_alias. - * @member {boolean} allow_alias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allow_alias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumOptions .gogoproto.goproto_enum_prefix. - * @member {boolean} .gogoproto.goproto_enum_prefix - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_prefix"] = false; - - /** - * EnumOptions .gogoproto.goproto_enum_stringer. - * @member {boolean} .gogoproto.goproto_enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goproto_enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_stringer. - * @member {boolean} .gogoproto.enum_stringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_stringer"] = false; - - /** - * EnumOptions .gogoproto.enum_customname. - * @member {string} .gogoproto.enum_customname - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enum_customname"] = ""; - - /** - * EnumOptions .gogoproto.enumdecl. - * @member {boolean} .gogoproto.enumdecl - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enumdecl"] = false; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allow_alias != null && Object.hasOwnProperty.call(message, "allow_alias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allow_alias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goproto_enum_prefix"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_prefix")) - writer.uint32(/* id 62001, wireType 0 =*/496008).bool(message[".gogoproto.goproto_enum_prefix"]); - if (message[".gogoproto.goproto_enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goproto_enum_stringer")) - writer.uint32(/* id 62021, wireType 0 =*/496168).bool(message[".gogoproto.goproto_enum_stringer"]); - if (message[".gogoproto.enum_stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_stringer")) - writer.uint32(/* id 62022, wireType 0 =*/496176).bool(message[".gogoproto.enum_stringer"]); - if (message[".gogoproto.enum_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enum_customname")) - writer.uint32(/* id 62023, wireType 2 =*/496186).string(message[".gogoproto.enum_customname"]); - if (message[".gogoproto.enumdecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl")) - writer.uint32(/* id 62024, wireType 0 =*/496192).bool(message[".gogoproto.enumdecl"]); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allow_alias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 62001: - message[".gogoproto.goproto_enum_prefix"] = reader.bool(); - break; - case 62021: - message[".gogoproto.goproto_enum_stringer"] = reader.bool(); - break; - case 62022: - message[".gogoproto.enum_stringer"] = reader.bool(); - break; - case 62023: - message[".gogoproto.enum_customname"] = reader.string(); - break; - case 62024: - message[".gogoproto.enumdecl"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - if (typeof message.allow_alias !== "boolean") - return "allow_alias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - if (typeof message[".gogoproto.goproto_enum_prefix"] !== "boolean") - return ".gogoproto.goproto_enum_prefix: boolean expected"; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - if (typeof message[".gogoproto.goproto_enum_stringer"] !== "boolean") - return ".gogoproto.goproto_enum_stringer: boolean expected"; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - if (typeof message[".gogoproto.enum_stringer"] !== "boolean") - return ".gogoproto.enum_stringer: boolean expected"; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - if (!$util.isString(message[".gogoproto.enum_customname"])) - return ".gogoproto.enum_customname: string expected"; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - if (typeof message[".gogoproto.enumdecl"] !== "boolean") - return ".gogoproto.enumdecl: boolean expected"; - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allow_alias != null) - message.allow_alias = Boolean(object.allow_alias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.goproto_enum_prefix"] != null) - message[".gogoproto.goproto_enum_prefix"] = Boolean(object[".gogoproto.goproto_enum_prefix"]); - if (object[".gogoproto.goproto_enum_stringer"] != null) - message[".gogoproto.goproto_enum_stringer"] = Boolean(object[".gogoproto.goproto_enum_stringer"]); - if (object[".gogoproto.enum_stringer"] != null) - message[".gogoproto.enum_stringer"] = Boolean(object[".gogoproto.enum_stringer"]); - if (object[".gogoproto.enum_customname"] != null) - message[".gogoproto.enum_customname"] = String(object[".gogoproto.enum_customname"]); - if (object[".gogoproto.enumdecl"] != null) - message[".gogoproto.enumdecl"] = Boolean(object[".gogoproto.enumdecl"]); - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.allow_alias = false; - object.deprecated = false; - object[".gogoproto.goproto_enum_prefix"] = false; - object[".gogoproto.goproto_enum_stringer"] = false; - object[".gogoproto.enum_stringer"] = false; - object[".gogoproto.enum_customname"] = ""; - object[".gogoproto.enumdecl"] = false; - } - if (message.allow_alias != null && message.hasOwnProperty("allow_alias")) - object.allow_alias = message.allow_alias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.goproto_enum_prefix"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_prefix")) - object[".gogoproto.goproto_enum_prefix"] = message[".gogoproto.goproto_enum_prefix"]; - if (message[".gogoproto.goproto_enum_stringer"] != null && message.hasOwnProperty(".gogoproto.goproto_enum_stringer")) - object[".gogoproto.goproto_enum_stringer"] = message[".gogoproto.goproto_enum_stringer"]; - if (message[".gogoproto.enum_stringer"] != null && message.hasOwnProperty(".gogoproto.enum_stringer")) - object[".gogoproto.enum_stringer"] = message[".gogoproto.enum_stringer"]; - if (message[".gogoproto.enum_customname"] != null && message.hasOwnProperty(".gogoproto.enum_customname")) - object[".gogoproto.enum_customname"] = message[".gogoproto.enum_customname"]; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - object[".gogoproto.enumdecl"] = message[".gogoproto.enumdecl"]; - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpreted_option] EnumValueOptions uninterpreted_option - * @property {string|null} [".gogoproto.enumvalue_customname"] EnumValueOptions .gogoproto.enumvalue_customname - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * EnumValueOptions .gogoproto.enumvalue_customname. - * @member {string} .gogoproto.enumvalue_customname - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype[".gogoproto.enumvalue_customname"] = ""; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.enumvalue_customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumvalue_customname")) - writer.uint32(/* id 66001, wireType 2 =*/528010).string(message[".gogoproto.enumvalue_customname"]); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 66001: - message[".gogoproto.enumvalue_customname"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - if (!$util.isString(message[".gogoproto.enumvalue_customname"])) - return ".gogoproto.enumvalue_customname: string expected"; - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".gogoproto.enumvalue_customname"] != null) - message[".gogoproto.enumvalue_customname"] = String(object[".gogoproto.enumvalue_customname"]); - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".gogoproto.enumvalue_customname"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".gogoproto.enumvalue_customname"] != null && message.hasOwnProperty(".gogoproto.enumvalue_customname")) - object[".gogoproto.enumvalue_customname"] = message[".gogoproto.enumvalue_customname"]; - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpreted_option] ServiceOptions uninterpreted_option - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {Array.|null} [uninterpreted_option] MethodOptions uninterpreted_option - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpreted_option = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions uninterpreted_option. - * @member {Array.} uninterpreted_option - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpreted_option = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpreted_option != null && message.uninterpreted_option.length) - for (var i = 0; i < message.uninterpreted_option.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpreted_option[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpreted_option && message.uninterpreted_option.length)) - message.uninterpreted_option = []; - message.uninterpreted_option.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpreted_option != null && message.hasOwnProperty("uninterpreted_option")) { - if (!Array.isArray(message.uninterpreted_option)) - return "uninterpreted_option: array expected"; - for (var i = 0; i < message.uninterpreted_option.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpreted_option[i]); - if (error) - return "uninterpreted_option." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpreted_option) { - if (!Array.isArray(object.uninterpreted_option)) - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: array expected"); - message.uninterpreted_option = []; - for (var i = 0; i < object.uninterpreted_option.length; ++i) { - if (typeof object.uninterpreted_option[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpreted_option: object expected"); - message.uninterpreted_option[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpreted_option[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpreted_option = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpreted_option && message.uninterpreted_option.length) { - object.uninterpreted_option = []; - for (var j = 0; j < message.uninterpreted_option.length; ++j) - object.uninterpreted_option[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpreted_option[j], options); - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifier_value] UninterpretedOption identifier_value - * @property {Long|null} [positive_int_value] UninterpretedOption positive_int_value - * @property {Long|null} [negative_int_value] UninterpretedOption negative_int_value - * @property {number|null} [double_value] UninterpretedOption double_value - * @property {Uint8Array|null} [string_value] UninterpretedOption string_value - * @property {string|null} [aggregate_value] UninterpretedOption aggregate_value - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifier_value. - * @member {string} identifier_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifier_value = ""; - - /** - * UninterpretedOption positive_int_value. - * @member {Long} positive_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positive_int_value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negative_int_value. - * @member {Long} negative_int_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negative_int_value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption double_value. - * @member {number} double_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.double_value = 0; - - /** - * UninterpretedOption string_value. - * @member {Uint8Array} string_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.string_value = $util.newBuffer([]); - - /** - * UninterpretedOption aggregate_value. - * @member {string} aggregate_value - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregate_value = ""; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifier_value != null && Object.hasOwnProperty.call(message, "identifier_value")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifier_value); - if (message.positive_int_value != null && Object.hasOwnProperty.call(message, "positive_int_value")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positive_int_value); - if (message.negative_int_value != null && Object.hasOwnProperty.call(message, "negative_int_value")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negative_int_value); - if (message.double_value != null && Object.hasOwnProperty.call(message, "double_value")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.double_value); - if (message.string_value != null && Object.hasOwnProperty.call(message, "string_value")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.string_value); - if (message.aggregate_value != null && Object.hasOwnProperty.call(message, "aggregate_value")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregate_value); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifier_value = reader.string(); - break; - case 4: - message.positive_int_value = reader.uint64(); - break; - case 5: - message.negative_int_value = reader.int64(); - break; - case 6: - message.double_value = reader.double(); - break; - case 7: - message.string_value = reader.bytes(); - break; - case 8: - message.aggregate_value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - if (!$util.isString(message.identifier_value)) - return "identifier_value: string expected"; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (!$util.isInteger(message.positive_int_value) && !(message.positive_int_value && $util.isInteger(message.positive_int_value.low) && $util.isInteger(message.positive_int_value.high))) - return "positive_int_value: integer|Long expected"; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (!$util.isInteger(message.negative_int_value) && !(message.negative_int_value && $util.isInteger(message.negative_int_value.low) && $util.isInteger(message.negative_int_value.high))) - return "negative_int_value: integer|Long expected"; - if (message.double_value != null && message.hasOwnProperty("double_value")) - if (typeof message.double_value !== "number") - return "double_value: number expected"; - if (message.string_value != null && message.hasOwnProperty("string_value")) - if (!(message.string_value && typeof message.string_value.length === "number" || $util.isString(message.string_value))) - return "string_value: buffer expected"; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - if (!$util.isString(message.aggregate_value)) - return "aggregate_value: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifier_value != null) - message.identifier_value = String(object.identifier_value); - if (object.positive_int_value != null) - if ($util.Long) - (message.positive_int_value = $util.Long.fromValue(object.positive_int_value)).unsigned = true; - else if (typeof object.positive_int_value === "string") - message.positive_int_value = parseInt(object.positive_int_value, 10); - else if (typeof object.positive_int_value === "number") - message.positive_int_value = object.positive_int_value; - else if (typeof object.positive_int_value === "object") - message.positive_int_value = new $util.LongBits(object.positive_int_value.low >>> 0, object.positive_int_value.high >>> 0).toNumber(true); - if (object.negative_int_value != null) - if ($util.Long) - (message.negative_int_value = $util.Long.fromValue(object.negative_int_value)).unsigned = false; - else if (typeof object.negative_int_value === "string") - message.negative_int_value = parseInt(object.negative_int_value, 10); - else if (typeof object.negative_int_value === "number") - message.negative_int_value = object.negative_int_value; - else if (typeof object.negative_int_value === "object") - message.negative_int_value = new $util.LongBits(object.negative_int_value.low >>> 0, object.negative_int_value.high >>> 0).toNumber(); - if (object.double_value != null) - message.double_value = Number(object.double_value); - if (object.string_value != null) - if (typeof object.string_value === "string") - $util.base64.decode(object.string_value, message.string_value = $util.newBuffer($util.base64.length(object.string_value)), 0); - else if (object.string_value.length) - message.string_value = object.string_value; - if (object.aggregate_value != null) - message.aggregate_value = String(object.aggregate_value); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifier_value = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positive_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positive_int_value = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negative_int_value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negative_int_value = options.longs === String ? "0" : 0; - object.double_value = 0; - if (options.bytes === String) - object.string_value = ""; - else { - object.string_value = []; - if (options.bytes !== Array) - object.string_value = $util.newBuffer(object.string_value); - } - object.aggregate_value = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifier_value != null && message.hasOwnProperty("identifier_value")) - object.identifier_value = message.identifier_value; - if (message.positive_int_value != null && message.hasOwnProperty("positive_int_value")) - if (typeof message.positive_int_value === "number") - object.positive_int_value = options.longs === String ? String(message.positive_int_value) : message.positive_int_value; - else - object.positive_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.positive_int_value) : options.longs === Number ? new $util.LongBits(message.positive_int_value.low >>> 0, message.positive_int_value.high >>> 0).toNumber(true) : message.positive_int_value; - if (message.negative_int_value != null && message.hasOwnProperty("negative_int_value")) - if (typeof message.negative_int_value === "number") - object.negative_int_value = options.longs === String ? String(message.negative_int_value) : message.negative_int_value; - else - object.negative_int_value = options.longs === String ? $util.Long.prototype.toString.call(message.negative_int_value) : options.longs === Number ? new $util.LongBits(message.negative_int_value.low >>> 0, message.negative_int_value.high >>> 0).toNumber() : message.negative_int_value; - if (message.double_value != null && message.hasOwnProperty("double_value")) - object.double_value = options.json && !isFinite(message.double_value) ? String(message.double_value) : message.double_value; - if (message.string_value != null && message.hasOwnProperty("string_value")) - object.string_value = options.bytes === String ? $util.base64.encode(message.string_value, 0, message.string_value.length) : options.bytes === Array ? Array.prototype.slice.call(message.string_value) : message.string_value; - if (message.aggregate_value != null && message.hasOwnProperty("aggregate_value")) - object.aggregate_value = message.aggregate_value; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} name_part NamePart name_part - * @property {boolean} is_extension NamePart is_extension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart name_part. - * @member {string} name_part - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.name_part = ""; - - /** - * NamePart is_extension. - * @member {boolean} is_extension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.is_extension = false; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name_part); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_extension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name_part = reader.string(); - break; - case 2: - message.is_extension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("name_part")) - throw $util.ProtocolError("missing required 'name_part'", { instance: message }); - if (!message.hasOwnProperty("is_extension")) - throw $util.ProtocolError("missing required 'is_extension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.name_part)) - return "name_part: string expected"; - if (typeof message.is_extension !== "boolean") - return "is_extension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.name_part != null) - message.name_part = String(object.name_part); - if (object.is_extension != null) - message.is_extension = Boolean(object.is_extension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name_part = ""; - object.is_extension = false; - } - if (message.name_part != null && message.hasOwnProperty("name_part")) - object.name_part = message.name_part; - if (message.is_extension != null && message.hasOwnProperty("is_extension")) - object.is_extension = message.is_extension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leading_comments] Location leading_comments - * @property {string|null} [trailing_comments] Location trailing_comments - * @property {Array.|null} [leading_detached_comments] Location leading_detached_comments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leading_detached_comments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leading_comments. - * @member {string} leading_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_comments = ""; - - /** - * Location trailing_comments. - * @member {string} trailing_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailing_comments = ""; - - /** - * Location leading_detached_comments. - * @member {Array.} leading_detached_comments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leading_detached_comments = $util.emptyArray; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leading_comments != null && Object.hasOwnProperty.call(message, "leading_comments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leading_comments); - if (message.trailing_comments != null && Object.hasOwnProperty.call(message, "trailing_comments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailing_comments); - if (message.leading_detached_comments != null && message.leading_detached_comments.length) - for (var i = 0; i < message.leading_detached_comments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leading_detached_comments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leading_comments = reader.string(); - break; - case 4: - message.trailing_comments = reader.string(); - break; - case 6: - if (!(message.leading_detached_comments && message.leading_detached_comments.length)) - message.leading_detached_comments = []; - message.leading_detached_comments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - if (!$util.isString(message.leading_comments)) - return "leading_comments: string expected"; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - if (!$util.isString(message.trailing_comments)) - return "trailing_comments: string expected"; - if (message.leading_detached_comments != null && message.hasOwnProperty("leading_detached_comments")) { - if (!Array.isArray(message.leading_detached_comments)) - return "leading_detached_comments: array expected"; - for (var i = 0; i < message.leading_detached_comments.length; ++i) - if (!$util.isString(message.leading_detached_comments[i])) - return "leading_detached_comments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leading_comments != null) - message.leading_comments = String(object.leading_comments); - if (object.trailing_comments != null) - message.trailing_comments = String(object.trailing_comments); - if (object.leading_detached_comments) { - if (!Array.isArray(object.leading_detached_comments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leading_detached_comments: array expected"); - message.leading_detached_comments = []; - for (var i = 0; i < object.leading_detached_comments.length; ++i) - message.leading_detached_comments[i] = String(object.leading_detached_comments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leading_detached_comments = []; - } - if (options.defaults) { - object.leading_comments = ""; - object.trailing_comments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leading_comments != null && message.hasOwnProperty("leading_comments")) - object.leading_comments = message.leading_comments; - if (message.trailing_comments != null && message.hasOwnProperty("trailing_comments")) - object.trailing_comments = message.trailing_comments; - if (message.leading_detached_comments && message.leading_detached_comments.length) { - object.leading_detached_comments = []; - for (var j = 0; j < message.leading_detached_comments.length; ++j) - object.leading_detached_comments[j] = message.leading_detached_comments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [source_file] Annotation source_file - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation source_file. - * @member {string} source_file - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.source_file = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.source_file != null && Object.hasOwnProperty.call(message, "source_file")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.source_file); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.source_file = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - if (!$util.isString(message.source_file)) - return "source_file: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.source_file != null) - message.source_file = String(object.source_file); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.source_file = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.source_file != null && message.hasOwnProperty("source_file")) - object.source_file = message.source_file; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Any; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Timestamp; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Duration; - })(); - - return protobuf; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fully_decode_reserved_expansion] Http fully_decode_reserved_expansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fully_decode_reserved_expansion. - * @member {boolean} fully_decode_reserved_expansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fully_decode_reserved_expansion = false; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fully_decode_reserved_expansion != null && Object.hasOwnProperty.call(message, "fully_decode_reserved_expansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fully_decode_reserved_expansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fully_decode_reserved_expansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - if (typeof message.fully_decode_reserved_expansion !== "boolean") - return "fully_decode_reserved_expansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fully_decode_reserved_expansion != null) - message.fully_decode_reserved_expansion = Boolean(object.fully_decode_reserved_expansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fully_decode_reserved_expansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fully_decode_reserved_expansion != null && message.hasOwnProperty("fully_decode_reserved_expansion")) - object.fully_decode_reserved_expansion = message.fully_decode_reserved_expansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [response_body] HttpRule response_body - * @property {Array.|null} [additional_bindings] HttpRule additional_bindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additional_bindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule response_body. - * @member {string} response_body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.response_body = ""; - - /** - * HttpRule additional_bindings. - * @member {Array.} additional_bindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additional_bindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additional_bindings != null && message.additional_bindings.length) - for (var i = 0; i < message.additional_bindings.length; ++i) - $root.google.api.HttpRule.encode(message.additional_bindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.response_body != null && Object.hasOwnProperty.call(message, "response_body")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.response_body); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.response_body = reader.string(); - break; - case 11: - if (!(message.additional_bindings && message.additional_bindings.length)) - message.additional_bindings = []; - message.additional_bindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.response_body != null && message.hasOwnProperty("response_body")) - if (!$util.isString(message.response_body)) - return "response_body: string expected"; - if (message.additional_bindings != null && message.hasOwnProperty("additional_bindings")) { - if (!Array.isArray(message.additional_bindings)) - return "additional_bindings: array expected"; - for (var i = 0; i < message.additional_bindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additional_bindings[i]); - if (error) - return "additional_bindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.response_body != null) - message.response_body = String(object.response_body); - if (object.additional_bindings) { - if (!Array.isArray(object.additional_bindings)) - throw TypeError(".google.api.HttpRule.additional_bindings: array expected"); - message.additional_bindings = []; - for (var i = 0; i < object.additional_bindings.length; ++i) { - if (typeof object.additional_bindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additional_bindings: object expected"); - message.additional_bindings[i] = $root.google.api.HttpRule.fromObject(object.additional_bindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additional_bindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.response_body = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additional_bindings && message.additional_bindings.length) { - object.additional_bindings = []; - for (var j = 0; j < message.additional_bindings.length; ++j) - object.additional_bindings[j] = $root.google.api.HttpRule.toObject(message.additional_bindings[j], options); - } - if (message.response_body != null && message.hasOwnProperty("response_body")) - object.response_body = message.response_body; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CustomHttpPattern; - })(); - - return api; - })(); - - return google; - })(); - - $root.osmosis = (function() { - - /** - * Namespace osmosis. - * @exports osmosis - * @namespace - */ - var osmosis = {}; - - osmosis.tokenfactory = (function() { - - /** - * Namespace tokenfactory. - * @memberof osmosis - * @namespace - */ - var tokenfactory = {}; - - tokenfactory.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof osmosis.tokenfactory - * @namespace - */ - var v1beta1 = {}; - - v1beta1.GenesisState = (function() { - - /** - * Properties of a GenesisState. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IGenesisState - * @property {osmosis.tokenfactory.v1beta1.IParams|null} [params] GenesisState params - * @property {Array.|null} [factory_denoms] GenesisState factory_denoms - */ - - /** - * Constructs a new GenesisState. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a GenesisState. - * @implements IGenesisState - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IGenesisState=} [properties] Properties to set - */ - function GenesisState(properties) { - this.factory_denoms = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisState params. - * @member {osmosis.tokenfactory.v1beta1.IParams|null|undefined} params - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @instance - */ - GenesisState.prototype.params = null; - - /** - * GenesisState factory_denoms. - * @member {Array.} factory_denoms - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @instance - */ - GenesisState.prototype.factory_denoms = $util.emptyArray; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.GenesisState.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @static - * @param {osmosis.tokenfactory.v1beta1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.osmosis.tokenfactory.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.factory_denoms != null && message.factory_denoms.length) - for (var i = 0; i < message.factory_denoms.length; ++i) - $root.osmosis.tokenfactory.v1beta1.GenesisDenom.encode(message.factory_denoms[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.GenesisState.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @static - * @param {osmosis.tokenfactory.v1beta1.IGenesisState} message GenesisState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.GenesisState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.osmosis.tokenfactory.v1beta1.Params.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.factory_denoms && message.factory_denoms.length)) - message.factory_denoms = []; - message.factory_denoms.push($root.osmosis.tokenfactory.v1beta1.GenesisDenom.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.GenesisState} GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisState message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.osmosis.tokenfactory.v1beta1.Params.verify(message.params); - if (error) - return "params." + error; - } - if (message.factory_denoms != null && message.hasOwnProperty("factory_denoms")) { - if (!Array.isArray(message.factory_denoms)) - return "factory_denoms: array expected"; - for (var i = 0; i < message.factory_denoms.length; ++i) { - var error = $root.osmosis.tokenfactory.v1beta1.GenesisDenom.verify(message.factory_denoms[i]); - if (error) - return "factory_denoms." + error; - } - } - return null; - }; - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.GenesisState} GenesisState - */ - GenesisState.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.GenesisState) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.GenesisState(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".osmosis.tokenfactory.v1beta1.GenesisState.params: object expected"); - message.params = $root.osmosis.tokenfactory.v1beta1.Params.fromObject(object.params); - } - if (object.factory_denoms) { - if (!Array.isArray(object.factory_denoms)) - throw TypeError(".osmosis.tokenfactory.v1beta1.GenesisState.factory_denoms: array expected"); - message.factory_denoms = []; - for (var i = 0; i < object.factory_denoms.length; ++i) { - if (typeof object.factory_denoms[i] !== "object") - throw TypeError(".osmosis.tokenfactory.v1beta1.GenesisState.factory_denoms: object expected"); - message.factory_denoms[i] = $root.osmosis.tokenfactory.v1beta1.GenesisDenom.fromObject(object.factory_denoms[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @static - * @param {osmosis.tokenfactory.v1beta1.GenesisState} message GenesisState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.factory_denoms = []; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.osmosis.tokenfactory.v1beta1.Params.toObject(message.params, options); - if (message.factory_denoms && message.factory_denoms.length) { - object.factory_denoms = []; - for (var j = 0; j < message.factory_denoms.length; ++j) - object.factory_denoms[j] = $root.osmosis.tokenfactory.v1beta1.GenesisDenom.toObject(message.factory_denoms[j], options); - } - return object; - }; - - /** - * Converts this GenesisState to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.GenesisState - * @instance - * @returns {Object.} JSON object - */ - GenesisState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisState; - })(); - - v1beta1.GenesisDenom = (function() { - - /** - * Properties of a GenesisDenom. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IGenesisDenom - * @property {string|null} [denom] GenesisDenom denom - * @property {osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata|null} [authority_metadata] GenesisDenom authority_metadata - */ - - /** - * Constructs a new GenesisDenom. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a GenesisDenom. - * @implements IGenesisDenom - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IGenesisDenom=} [properties] Properties to set - */ - function GenesisDenom(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenesisDenom denom. - * @member {string} denom - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @instance - */ - GenesisDenom.prototype.denom = ""; - - /** - * GenesisDenom authority_metadata. - * @member {osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata|null|undefined} authority_metadata - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @instance - */ - GenesisDenom.prototype.authority_metadata = null; - - /** - * Encodes the specified GenesisDenom message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.GenesisDenom.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @static - * @param {osmosis.tokenfactory.v1beta1.IGenesisDenom} message GenesisDenom message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisDenom.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.authority_metadata != null && Object.hasOwnProperty.call(message, "authority_metadata")) - $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.encode(message.authority_metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenesisDenom message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.GenesisDenom.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @static - * @param {osmosis.tokenfactory.v1beta1.IGenesisDenom} message GenesisDenom message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenesisDenom.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenesisDenom message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.GenesisDenom} GenesisDenom - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisDenom.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.GenesisDenom(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.authority_metadata = $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenesisDenom message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.GenesisDenom} GenesisDenom - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenesisDenom.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenesisDenom message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenesisDenom.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.authority_metadata != null && message.hasOwnProperty("authority_metadata")) { - var error = $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.verify(message.authority_metadata); - if (error) - return "authority_metadata." + error; - } - return null; - }; - - /** - * Creates a GenesisDenom message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.GenesisDenom} GenesisDenom - */ - GenesisDenom.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.GenesisDenom) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.GenesisDenom(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.authority_metadata != null) { - if (typeof object.authority_metadata !== "object") - throw TypeError(".osmosis.tokenfactory.v1beta1.GenesisDenom.authority_metadata: object expected"); - message.authority_metadata = $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.fromObject(object.authority_metadata); - } - return message; - }; - - /** - * Creates a plain object from a GenesisDenom message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @static - * @param {osmosis.tokenfactory.v1beta1.GenesisDenom} message GenesisDenom - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenesisDenom.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.authority_metadata = null; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.authority_metadata != null && message.hasOwnProperty("authority_metadata")) - object.authority_metadata = $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.toObject(message.authority_metadata, options); - return object; - }; - - /** - * Converts this GenesisDenom to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.GenesisDenom - * @instance - * @returns {Object.} JSON object - */ - GenesisDenom.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GenesisDenom; - })(); - - v1beta1.DenomAuthorityMetadata = (function() { - - /** - * Properties of a DenomAuthorityMetadata. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IDenomAuthorityMetadata - * @property {string|null} [Admin] DenomAuthorityMetadata Admin - */ - - /** - * Constructs a new DenomAuthorityMetadata. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a DenomAuthorityMetadata. - * @implements IDenomAuthorityMetadata - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata=} [properties] Properties to set - */ - function DenomAuthorityMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DenomAuthorityMetadata Admin. - * @member {string} Admin - * @memberof osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata - * @instance - */ - DenomAuthorityMetadata.prototype.Admin = ""; - - /** - * Encodes the specified DenomAuthorityMetadata message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata - * @static - * @param {osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata} message DenomAuthorityMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenomAuthorityMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.Admin != null && Object.hasOwnProperty.call(message, "Admin")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.Admin); - return writer; - }; - - /** - * Encodes the specified DenomAuthorityMetadata message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata - * @static - * @param {osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata} message DenomAuthorityMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DenomAuthorityMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DenomAuthorityMetadata message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata} DenomAuthorityMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenomAuthorityMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.Admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DenomAuthorityMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata} DenomAuthorityMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DenomAuthorityMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DenomAuthorityMetadata message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DenomAuthorityMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.Admin != null && message.hasOwnProperty("Admin")) - if (!$util.isString(message.Admin)) - return "Admin: string expected"; - return null; - }; - - /** - * Creates a DenomAuthorityMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata} DenomAuthorityMetadata - */ - DenomAuthorityMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata(); - if (object.Admin != null) - message.Admin = String(object.Admin); - return message; - }; - - /** - * Creates a plain object from a DenomAuthorityMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata - * @static - * @param {osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata} message DenomAuthorityMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DenomAuthorityMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.Admin = ""; - if (message.Admin != null && message.hasOwnProperty("Admin")) - object.Admin = message.Admin; - return object; - }; - - /** - * Converts this DenomAuthorityMetadata to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata - * @instance - * @returns {Object.} JSON object - */ - DenomAuthorityMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DenomAuthorityMetadata; - })(); - - v1beta1.Params = (function() { - - /** - * Properties of a Params. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IParams - * @property {Array.|null} [denom_creation_fee] Params denom_creation_fee - * @property {string|null} [fee_collector_address] Params fee_collector_address - */ - - /** - * Constructs a new Params. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a Params. - * @implements IParams - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IParams=} [properties] Properties to set - */ - function Params(properties) { - this.denom_creation_fee = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Params denom_creation_fee. - * @member {Array.} denom_creation_fee - * @memberof osmosis.tokenfactory.v1beta1.Params - * @instance - */ - Params.prototype.denom_creation_fee = $util.emptyArray; - - /** - * Params fee_collector_address. - * @member {string} fee_collector_address - * @memberof osmosis.tokenfactory.v1beta1.Params - * @instance - */ - Params.prototype.fee_collector_address = ""; - - /** - * Encodes the specified Params message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.Params.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.Params - * @static - * @param {osmosis.tokenfactory.v1beta1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom_creation_fee != null && message.denom_creation_fee.length) - for (var i = 0; i < message.denom_creation_fee.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.denom_creation_fee[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fee_collector_address != null && Object.hasOwnProperty.call(message, "fee_collector_address")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fee_collector_address); - return writer; - }; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.Params.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.Params - * @static - * @param {osmosis.tokenfactory.v1beta1.IParams} message Params message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Params.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Params message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.Params(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.denom_creation_fee && message.denom_creation_fee.length)) - message.denom_creation_fee = []; - message.denom_creation_fee.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - case 2: - message.fee_collector_address = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.Params - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.Params} Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Params.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Params message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.Params - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Params.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom_creation_fee != null && message.hasOwnProperty("denom_creation_fee")) { - if (!Array.isArray(message.denom_creation_fee)) - return "denom_creation_fee: array expected"; - for (var i = 0; i < message.denom_creation_fee.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.denom_creation_fee[i]); - if (error) - return "denom_creation_fee." + error; - } - } - if (message.fee_collector_address != null && message.hasOwnProperty("fee_collector_address")) - if (!$util.isString(message.fee_collector_address)) - return "fee_collector_address: string expected"; - return null; - }; - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.Params - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.Params} Params - */ - Params.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.Params) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.Params(); - if (object.denom_creation_fee) { - if (!Array.isArray(object.denom_creation_fee)) - throw TypeError(".osmosis.tokenfactory.v1beta1.Params.denom_creation_fee: array expected"); - message.denom_creation_fee = []; - for (var i = 0; i < object.denom_creation_fee.length; ++i) { - if (typeof object.denom_creation_fee[i] !== "object") - throw TypeError(".osmosis.tokenfactory.v1beta1.Params.denom_creation_fee: object expected"); - message.denom_creation_fee[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.denom_creation_fee[i]); - } - } - if (object.fee_collector_address != null) - message.fee_collector_address = String(object.fee_collector_address); - return message; - }; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.Params - * @static - * @param {osmosis.tokenfactory.v1beta1.Params} message Params - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Params.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.denom_creation_fee = []; - if (options.defaults) - object.fee_collector_address = ""; - if (message.denom_creation_fee && message.denom_creation_fee.length) { - object.denom_creation_fee = []; - for (var j = 0; j < message.denom_creation_fee.length; ++j) - object.denom_creation_fee[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.denom_creation_fee[j], options); - } - if (message.fee_collector_address != null && message.hasOwnProperty("fee_collector_address")) - object.fee_collector_address = message.fee_collector_address; - return object; - }; - - /** - * Converts this Params to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.Params - * @instance - * @returns {Object.} JSON object - */ - Params.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Params; - })(); - - v1beta1.Msg = (function() { - - /** - * Constructs a new Msg service. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a Msg - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Msg(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg; - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Msg#createDenom}. - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @typedef CreateDenomCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse} [response] MsgCreateDenomResponse - */ - - /** - * Calls CreateDenom. - * @function createDenom - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @instance - * @param {osmosis.tokenfactory.v1beta1.IMsgCreateDenom} request MsgCreateDenom message or plain object - * @param {osmosis.tokenfactory.v1beta1.Msg.CreateDenomCallback} callback Node-style callback called with the error, if any, and MsgCreateDenomResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.createDenom = function createDenom(request, callback) { - return this.rpcCall(createDenom, $root.osmosis.tokenfactory.v1beta1.MsgCreateDenom, $root.osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse, request, callback); - }, "name", { value: "CreateDenom" }); - - /** - * Calls CreateDenom. - * @function createDenom - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @instance - * @param {osmosis.tokenfactory.v1beta1.IMsgCreateDenom} request MsgCreateDenom message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Msg#mint}. - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @typedef MintCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {osmosis.tokenfactory.v1beta1.MsgMintResponse} [response] MsgMintResponse - */ - - /** - * Calls Mint. - * @function mint - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @instance - * @param {osmosis.tokenfactory.v1beta1.IMsgMint} request MsgMint message or plain object - * @param {osmosis.tokenfactory.v1beta1.Msg.MintCallback} callback Node-style callback called with the error, if any, and MsgMintResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.mint = function mint(request, callback) { - return this.rpcCall(mint, $root.osmosis.tokenfactory.v1beta1.MsgMint, $root.osmosis.tokenfactory.v1beta1.MsgMintResponse, request, callback); - }, "name", { value: "Mint" }); - - /** - * Calls Mint. - * @function mint - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @instance - * @param {osmosis.tokenfactory.v1beta1.IMsgMint} request MsgMint message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Msg#burn}. - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @typedef BurnCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {osmosis.tokenfactory.v1beta1.MsgBurnResponse} [response] MsgBurnResponse - */ - - /** - * Calls Burn. - * @function burn - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @instance - * @param {osmosis.tokenfactory.v1beta1.IMsgBurn} request MsgBurn message or plain object - * @param {osmosis.tokenfactory.v1beta1.Msg.BurnCallback} callback Node-style callback called with the error, if any, and MsgBurnResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.burn = function burn(request, callback) { - return this.rpcCall(burn, $root.osmosis.tokenfactory.v1beta1.MsgBurn, $root.osmosis.tokenfactory.v1beta1.MsgBurnResponse, request, callback); - }, "name", { value: "Burn" }); - - /** - * Calls Burn. - * @function burn - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @instance - * @param {osmosis.tokenfactory.v1beta1.IMsgBurn} request MsgBurn message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Msg#changeAdmin}. - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @typedef ChangeAdminCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse} [response] MsgChangeAdminResponse - */ - - /** - * Calls ChangeAdmin. - * @function changeAdmin - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @instance - * @param {osmosis.tokenfactory.v1beta1.IMsgChangeAdmin} request MsgChangeAdmin message or plain object - * @param {osmosis.tokenfactory.v1beta1.Msg.ChangeAdminCallback} callback Node-style callback called with the error, if any, and MsgChangeAdminResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Msg.prototype.changeAdmin = function changeAdmin(request, callback) { - return this.rpcCall(changeAdmin, $root.osmosis.tokenfactory.v1beta1.MsgChangeAdmin, $root.osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse, request, callback); - }, "name", { value: "ChangeAdmin" }); - - /** - * Calls ChangeAdmin. - * @function changeAdmin - * @memberof osmosis.tokenfactory.v1beta1.Msg - * @instance - * @param {osmosis.tokenfactory.v1beta1.IMsgChangeAdmin} request MsgChangeAdmin message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Msg; - })(); - - v1beta1.MsgCreateDenom = (function() { - - /** - * Properties of a MsgCreateDenom. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IMsgCreateDenom - * @property {string|null} [sender] MsgCreateDenom sender - * @property {string|null} [subdenom] MsgCreateDenom subdenom - */ - - /** - * Constructs a new MsgCreateDenom. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a MsgCreateDenom. - * @implements IMsgCreateDenom - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IMsgCreateDenom=} [properties] Properties to set - */ - function MsgCreateDenom(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgCreateDenom sender. - * @member {string} sender - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @instance - */ - MsgCreateDenom.prototype.sender = ""; - - /** - * MsgCreateDenom subdenom. - * @member {string} subdenom - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @instance - */ - MsgCreateDenom.prototype.subdenom = ""; - - /** - * Encodes the specified MsgCreateDenom message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgCreateDenom.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgCreateDenom} message MsgCreateDenom message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateDenom.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender); - if (message.subdenom != null && Object.hasOwnProperty.call(message, "subdenom")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subdenom); - return writer; - }; - - /** - * Encodes the specified MsgCreateDenom message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgCreateDenom.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgCreateDenom} message MsgCreateDenom message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateDenom.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgCreateDenom message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.MsgCreateDenom} MsgCreateDenom - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateDenom.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.MsgCreateDenom(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.subdenom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgCreateDenom message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.MsgCreateDenom} MsgCreateDenom - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateDenom.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgCreateDenom message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgCreateDenom.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.subdenom != null && message.hasOwnProperty("subdenom")) - if (!$util.isString(message.subdenom)) - return "subdenom: string expected"; - return null; - }; - - /** - * Creates a MsgCreateDenom message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.MsgCreateDenom} MsgCreateDenom - */ - MsgCreateDenom.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.MsgCreateDenom) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.MsgCreateDenom(); - if (object.sender != null) - message.sender = String(object.sender); - if (object.subdenom != null) - message.subdenom = String(object.subdenom); - return message; - }; - - /** - * Creates a plain object from a MsgCreateDenom message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @static - * @param {osmosis.tokenfactory.v1beta1.MsgCreateDenom} message MsgCreateDenom - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgCreateDenom.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sender = ""; - object.subdenom = ""; - } - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.subdenom != null && message.hasOwnProperty("subdenom")) - object.subdenom = message.subdenom; - return object; - }; - - /** - * Converts this MsgCreateDenom to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenom - * @instance - * @returns {Object.} JSON object - */ - MsgCreateDenom.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgCreateDenom; - })(); - - v1beta1.MsgCreateDenomResponse = (function() { - - /** - * Properties of a MsgCreateDenomResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IMsgCreateDenomResponse - * @property {string|null} [new_token_denom] MsgCreateDenomResponse new_token_denom - */ - - /** - * Constructs a new MsgCreateDenomResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a MsgCreateDenomResponse. - * @implements IMsgCreateDenomResponse - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IMsgCreateDenomResponse=} [properties] Properties to set - */ - function MsgCreateDenomResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgCreateDenomResponse new_token_denom. - * @member {string} new_token_denom - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse - * @instance - */ - MsgCreateDenomResponse.prototype.new_token_denom = ""; - - /** - * Encodes the specified MsgCreateDenomResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgCreateDenomResponse} message MsgCreateDenomResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateDenomResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.new_token_denom != null && Object.hasOwnProperty.call(message, "new_token_denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.new_token_denom); - return writer; - }; - - /** - * Encodes the specified MsgCreateDenomResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgCreateDenomResponse} message MsgCreateDenomResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgCreateDenomResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgCreateDenomResponse message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse} MsgCreateDenomResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateDenomResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.new_token_denom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgCreateDenomResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse} MsgCreateDenomResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgCreateDenomResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgCreateDenomResponse message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgCreateDenomResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.new_token_denom != null && message.hasOwnProperty("new_token_denom")) - if (!$util.isString(message.new_token_denom)) - return "new_token_denom: string expected"; - return null; - }; - - /** - * Creates a MsgCreateDenomResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse} MsgCreateDenomResponse - */ - MsgCreateDenomResponse.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse(); - if (object.new_token_denom != null) - message.new_token_denom = String(object.new_token_denom); - return message; - }; - - /** - * Creates a plain object from a MsgCreateDenomResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse} message MsgCreateDenomResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgCreateDenomResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.new_token_denom = ""; - if (message.new_token_denom != null && message.hasOwnProperty("new_token_denom")) - object.new_token_denom = message.new_token_denom; - return object; - }; - - /** - * Converts this MsgCreateDenomResponse to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse - * @instance - * @returns {Object.} JSON object - */ - MsgCreateDenomResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgCreateDenomResponse; - })(); - - v1beta1.MsgMint = (function() { - - /** - * Properties of a MsgMint. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IMsgMint - * @property {string|null} [sender] MsgMint sender - * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgMint amount - */ - - /** - * Constructs a new MsgMint. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a MsgMint. - * @implements IMsgMint - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IMsgMint=} [properties] Properties to set - */ - function MsgMint(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgMint sender. - * @member {string} sender - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @instance - */ - MsgMint.prototype.sender = ""; - - /** - * MsgMint amount. - * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @instance - */ - MsgMint.prototype.amount = null; - - /** - * Encodes the specified MsgMint message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgMint.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgMint} message MsgMint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgMint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MsgMint message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgMint.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgMint} message MsgMint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgMint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgMint message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.MsgMint} MsgMint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgMint.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.MsgMint(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgMint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.MsgMint} MsgMint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgMint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgMint message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgMint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); - if (error) - return "amount." + error; - } - return null; - }; - - /** - * Creates a MsgMint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.MsgMint} MsgMint - */ - MsgMint.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.MsgMint) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.MsgMint(); - if (object.sender != null) - message.sender = String(object.sender); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".osmosis.tokenfactory.v1beta1.MsgMint.amount: object expected"); - message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); - } - return message; - }; - - /** - * Creates a plain object from a MsgMint message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @static - * @param {osmosis.tokenfactory.v1beta1.MsgMint} message MsgMint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgMint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sender = ""; - object.amount = null; - } - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); - return object; - }; - - /** - * Converts this MsgMint to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.MsgMint - * @instance - * @returns {Object.} JSON object - */ - MsgMint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgMint; - })(); - - v1beta1.MsgMintResponse = (function() { - - /** - * Properties of a MsgMintResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IMsgMintResponse - */ - - /** - * Constructs a new MsgMintResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a MsgMintResponse. - * @implements IMsgMintResponse - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IMsgMintResponse=} [properties] Properties to set - */ - function MsgMintResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgMintResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgMintResponse.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.MsgMintResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgMintResponse} message MsgMintResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgMintResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgMintResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgMintResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgMintResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgMintResponse} message MsgMintResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgMintResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgMintResponse message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.MsgMintResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.MsgMintResponse} MsgMintResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgMintResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.MsgMintResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgMintResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgMintResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.MsgMintResponse} MsgMintResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgMintResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgMintResponse message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.MsgMintResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgMintResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgMintResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.MsgMintResponse - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.MsgMintResponse} MsgMintResponse - */ - MsgMintResponse.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.MsgMintResponse) - return object; - return new $root.osmosis.tokenfactory.v1beta1.MsgMintResponse(); - }; - - /** - * Creates a plain object from a MsgMintResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.MsgMintResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.MsgMintResponse} message MsgMintResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgMintResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgMintResponse to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.MsgMintResponse - * @instance - * @returns {Object.} JSON object - */ - MsgMintResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgMintResponse; - })(); - - v1beta1.MsgBurn = (function() { - - /** - * Properties of a MsgBurn. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IMsgBurn - * @property {string|null} [sender] MsgBurn sender - * @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgBurn amount - */ - - /** - * Constructs a new MsgBurn. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a MsgBurn. - * @implements IMsgBurn - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IMsgBurn=} [properties] Properties to set - */ - function MsgBurn(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgBurn sender. - * @member {string} sender - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @instance - */ - MsgBurn.prototype.sender = ""; - - /** - * MsgBurn amount. - * @member {cosmos.base.v1beta1.ICoin|null|undefined} amount - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @instance - */ - MsgBurn.prototype.amount = null; - - /** - * Encodes the specified MsgBurn message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgBurn.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgBurn} message MsgBurn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgBurn.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - $root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MsgBurn message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgBurn.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgBurn} message MsgBurn message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgBurn.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgBurn message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.MsgBurn} MsgBurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgBurn.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.MsgBurn(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgBurn message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.MsgBurn} MsgBurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgBurn.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgBurn message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgBurn.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount); - if (error) - return "amount." + error; - } - return null; - }; - - /** - * Creates a MsgBurn message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.MsgBurn} MsgBurn - */ - MsgBurn.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.MsgBurn) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.MsgBurn(); - if (object.sender != null) - message.sender = String(object.sender); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".osmosis.tokenfactory.v1beta1.MsgBurn.amount: object expected"); - message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount); - } - return message; - }; - - /** - * Creates a plain object from a MsgBurn message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @static - * @param {osmosis.tokenfactory.v1beta1.MsgBurn} message MsgBurn - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgBurn.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sender = ""; - object.amount = null; - } - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options); - return object; - }; - - /** - * Converts this MsgBurn to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.MsgBurn - * @instance - * @returns {Object.} JSON object - */ - MsgBurn.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgBurn; - })(); - - v1beta1.MsgBurnResponse = (function() { - - /** - * Properties of a MsgBurnResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IMsgBurnResponse - */ - - /** - * Constructs a new MsgBurnResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a MsgBurnResponse. - * @implements IMsgBurnResponse - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IMsgBurnResponse=} [properties] Properties to set - */ - function MsgBurnResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgBurnResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgBurnResponse.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.MsgBurnResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgBurnResponse} message MsgBurnResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgBurnResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgBurnResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgBurnResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgBurnResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgBurnResponse} message MsgBurnResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgBurnResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgBurnResponse message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.MsgBurnResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.MsgBurnResponse} MsgBurnResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgBurnResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.MsgBurnResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgBurnResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgBurnResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.MsgBurnResponse} MsgBurnResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgBurnResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgBurnResponse message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.MsgBurnResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgBurnResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgBurnResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.MsgBurnResponse - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.MsgBurnResponse} MsgBurnResponse - */ - MsgBurnResponse.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.MsgBurnResponse) - return object; - return new $root.osmosis.tokenfactory.v1beta1.MsgBurnResponse(); - }; - - /** - * Creates a plain object from a MsgBurnResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.MsgBurnResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.MsgBurnResponse} message MsgBurnResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgBurnResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgBurnResponse to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.MsgBurnResponse - * @instance - * @returns {Object.} JSON object - */ - MsgBurnResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgBurnResponse; - })(); - - v1beta1.MsgChangeAdmin = (function() { - - /** - * Properties of a MsgChangeAdmin. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IMsgChangeAdmin - * @property {string|null} [sender] MsgChangeAdmin sender - * @property {string|null} [denom] MsgChangeAdmin denom - * @property {string|null} [newAdmin] MsgChangeAdmin newAdmin - */ - - /** - * Constructs a new MsgChangeAdmin. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a MsgChangeAdmin. - * @implements IMsgChangeAdmin - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IMsgChangeAdmin=} [properties] Properties to set - */ - function MsgChangeAdmin(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MsgChangeAdmin sender. - * @member {string} sender - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @instance - */ - MsgChangeAdmin.prototype.sender = ""; - - /** - * MsgChangeAdmin denom. - * @member {string} denom - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @instance - */ - MsgChangeAdmin.prototype.denom = ""; - - /** - * MsgChangeAdmin newAdmin. - * @member {string} newAdmin - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @instance - */ - MsgChangeAdmin.prototype.newAdmin = ""; - - /** - * Encodes the specified MsgChangeAdmin message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgChangeAdmin.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgChangeAdmin} message MsgChangeAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChangeAdmin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.denom); - if (message.newAdmin != null && Object.hasOwnProperty.call(message, "newAdmin")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.newAdmin); - return writer; - }; - - /** - * Encodes the specified MsgChangeAdmin message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgChangeAdmin.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgChangeAdmin} message MsgChangeAdmin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChangeAdmin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChangeAdmin message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.MsgChangeAdmin} MsgChangeAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChangeAdmin.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.MsgChangeAdmin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.denom = reader.string(); - break; - case 3: - message.newAdmin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChangeAdmin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.MsgChangeAdmin} MsgChangeAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChangeAdmin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChangeAdmin message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChangeAdmin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sender != null && message.hasOwnProperty("sender")) - if (!$util.isString(message.sender)) - return "sender: string expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.newAdmin != null && message.hasOwnProperty("newAdmin")) - if (!$util.isString(message.newAdmin)) - return "newAdmin: string expected"; - return null; - }; - - /** - * Creates a MsgChangeAdmin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.MsgChangeAdmin} MsgChangeAdmin - */ - MsgChangeAdmin.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.MsgChangeAdmin) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.MsgChangeAdmin(); - if (object.sender != null) - message.sender = String(object.sender); - if (object.denom != null) - message.denom = String(object.denom); - if (object.newAdmin != null) - message.newAdmin = String(object.newAdmin); - return message; - }; - - /** - * Creates a plain object from a MsgChangeAdmin message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @static - * @param {osmosis.tokenfactory.v1beta1.MsgChangeAdmin} message MsgChangeAdmin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChangeAdmin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sender = ""; - object.denom = ""; - object.newAdmin = ""; - } - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = message.sender; - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.newAdmin != null && message.hasOwnProperty("newAdmin")) - object.newAdmin = message.newAdmin; - return object; - }; - - /** - * Converts this MsgChangeAdmin to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdmin - * @instance - * @returns {Object.} JSON object - */ - MsgChangeAdmin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChangeAdmin; - })(); - - v1beta1.MsgChangeAdminResponse = (function() { - - /** - * Properties of a MsgChangeAdminResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IMsgChangeAdminResponse - */ - - /** - * Constructs a new MsgChangeAdminResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a MsgChangeAdminResponse. - * @implements IMsgChangeAdminResponse - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IMsgChangeAdminResponse=} [properties] Properties to set - */ - function MsgChangeAdminResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified MsgChangeAdminResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgChangeAdminResponse} message MsgChangeAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChangeAdminResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified MsgChangeAdminResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IMsgChangeAdminResponse} message MsgChangeAdminResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgChangeAdminResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgChangeAdminResponse message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse} MsgChangeAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChangeAdminResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgChangeAdminResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse} MsgChangeAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgChangeAdminResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgChangeAdminResponse message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgChangeAdminResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a MsgChangeAdminResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse} MsgChangeAdminResponse - */ - MsgChangeAdminResponse.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse) - return object; - return new $root.osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse(); - }; - - /** - * Creates a plain object from a MsgChangeAdminResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse} message MsgChangeAdminResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgChangeAdminResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this MsgChangeAdminResponse to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse - * @instance - * @returns {Object.} JSON object - */ - MsgChangeAdminResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgChangeAdminResponse; - })(); - - v1beta1.Query = (function() { - - /** - * Constructs a new Query service. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a Query - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Query(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Query.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Query; - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Query#params}. - * @memberof osmosis.tokenfactory.v1beta1.Query - * @typedef ParamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {osmosis.tokenfactory.v1beta1.QueryParamsResponse} [response] QueryParamsResponse - */ - - /** - * Calls Params. - * @function params - * @memberof osmosis.tokenfactory.v1beta1.Query - * @instance - * @param {osmosis.tokenfactory.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @param {osmosis.tokenfactory.v1beta1.Query.ParamsCallback} callback Node-style callback called with the error, if any, and QueryParamsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.params = function params(request, callback) { - return this.rpcCall(params, $root.osmosis.tokenfactory.v1beta1.QueryParamsRequest, $root.osmosis.tokenfactory.v1beta1.QueryParamsResponse, request, callback); - }, "name", { value: "Params" }); - - /** - * Calls Params. - * @function params - * @memberof osmosis.tokenfactory.v1beta1.Query - * @instance - * @param {osmosis.tokenfactory.v1beta1.IQueryParamsRequest} request QueryParamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Query#denomAuthorityMetadata}. - * @memberof osmosis.tokenfactory.v1beta1.Query - * @typedef DenomAuthorityMetadataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse} [response] QueryDenomAuthorityMetadataResponse - */ - - /** - * Calls DenomAuthorityMetadata. - * @function denomAuthorityMetadata - * @memberof osmosis.tokenfactory.v1beta1.Query - * @instance - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest} request QueryDenomAuthorityMetadataRequest message or plain object - * @param {osmosis.tokenfactory.v1beta1.Query.DenomAuthorityMetadataCallback} callback Node-style callback called with the error, if any, and QueryDenomAuthorityMetadataResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomAuthorityMetadata = function denomAuthorityMetadata(request, callback) { - return this.rpcCall(denomAuthorityMetadata, $root.osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest, $root.osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse, request, callback); - }, "name", { value: "DenomAuthorityMetadata" }); - - /** - * Calls DenomAuthorityMetadata. - * @function denomAuthorityMetadata - * @memberof osmosis.tokenfactory.v1beta1.Query - * @instance - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest} request QueryDenomAuthorityMetadataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Query#denomsFromCreator}. - * @memberof osmosis.tokenfactory.v1beta1.Query - * @typedef DenomsFromCreatorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse} [response] QueryDenomsFromCreatorResponse - */ - - /** - * Calls DenomsFromCreator. - * @function denomsFromCreator - * @memberof osmosis.tokenfactory.v1beta1.Query - * @instance - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest} request QueryDenomsFromCreatorRequest message or plain object - * @param {osmosis.tokenfactory.v1beta1.Query.DenomsFromCreatorCallback} callback Node-style callback called with the error, if any, and QueryDenomsFromCreatorResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Query.prototype.denomsFromCreator = function denomsFromCreator(request, callback) { - return this.rpcCall(denomsFromCreator, $root.osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest, $root.osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse, request, callback); - }, "name", { value: "DenomsFromCreator" }); - - /** - * Calls DenomsFromCreator. - * @function denomsFromCreator - * @memberof osmosis.tokenfactory.v1beta1.Query - * @instance - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest} request QueryDenomsFromCreatorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Query; - })(); - - v1beta1.QueryParamsRequest = (function() { - - /** - * Properties of a QueryParamsRequest. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IQueryParamsRequest - */ - - /** - * Constructs a new QueryParamsRequest. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a QueryParamsRequest. - * @implements IQueryParamsRequest - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IQueryParamsRequest=} [properties] Properties to set - */ - function QueryParamsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryParamsRequest.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsRequest - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryParamsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsRequest - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryParamsRequest} message QueryParamsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.QueryParamsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.QueryParamsRequest} QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsRequest message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsRequest - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.QueryParamsRequest} QueryParamsRequest - */ - QueryParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.QueryParamsRequest) - return object; - return new $root.osmosis.tokenfactory.v1beta1.QueryParamsRequest(); - }; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsRequest - * @static - * @param {osmosis.tokenfactory.v1beta1.QueryParamsRequest} message QueryParamsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this QueryParamsRequest to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsRequest - * @instance - * @returns {Object.} JSON object - */ - QueryParamsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsRequest; - })(); - - v1beta1.QueryParamsResponse = (function() { - - /** - * Properties of a QueryParamsResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IQueryParamsResponse - * @property {osmosis.tokenfactory.v1beta1.IParams|null} [params] QueryParamsResponse params - */ - - /** - * Constructs a new QueryParamsResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a QueryParamsResponse. - * @implements IQueryParamsResponse - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IQueryParamsResponse=} [properties] Properties to set - */ - function QueryParamsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryParamsResponse params. - * @member {osmosis.tokenfactory.v1beta1.IParams|null|undefined} params - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsResponse - * @instance - */ - QueryParamsResponse.prototype.params = null; - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryParamsResponse.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.osmosis.tokenfactory.v1beta1.Params.encode(message.params, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryParamsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryParamsResponse} message QueryParamsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.QueryParamsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = $root.osmosis.tokenfactory.v1beta1.Params.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.QueryParamsResponse} QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParamsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryParamsResponse message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParamsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.params != null && message.hasOwnProperty("params")) { - var error = $root.osmosis.tokenfactory.v1beta1.Params.verify(message.params); - if (error) - return "params." + error; - } - return null; - }; - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsResponse - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.QueryParamsResponse} QueryParamsResponse - */ - QueryParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.QueryParamsResponse) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.QueryParamsResponse(); - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".osmosis.tokenfactory.v1beta1.QueryParamsResponse.params: object expected"); - message.params = $root.osmosis.tokenfactory.v1beta1.Params.fromObject(object.params); - } - return message; - }; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.QueryParamsResponse} message QueryParamsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParamsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.params = null; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.osmosis.tokenfactory.v1beta1.Params.toObject(message.params, options); - return object; - }; - - /** - * Converts this QueryParamsResponse to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.QueryParamsResponse - * @instance - * @returns {Object.} JSON object - */ - QueryParamsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryParamsResponse; - })(); - - v1beta1.QueryDenomAuthorityMetadataRequest = (function() { - - /** - * Properties of a QueryDenomAuthorityMetadataRequest. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IQueryDenomAuthorityMetadataRequest - * @property {string|null} [creator] QueryDenomAuthorityMetadataRequest creator - * @property {string|null} [subdenom] QueryDenomAuthorityMetadataRequest subdenom - */ - - /** - * Constructs a new QueryDenomAuthorityMetadataRequest. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a QueryDenomAuthorityMetadataRequest. - * @implements IQueryDenomAuthorityMetadataRequest - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest=} [properties] Properties to set - */ - function QueryDenomAuthorityMetadataRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomAuthorityMetadataRequest creator. - * @member {string} creator - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @instance - */ - QueryDenomAuthorityMetadataRequest.prototype.creator = ""; - - /** - * QueryDenomAuthorityMetadataRequest subdenom. - * @member {string} subdenom - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @instance - */ - QueryDenomAuthorityMetadataRequest.prototype.subdenom = ""; - - /** - * Encodes the specified QueryDenomAuthorityMetadataRequest message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest} message QueryDenomAuthorityMetadataRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomAuthorityMetadataRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - if (message.subdenom != null && Object.hasOwnProperty.call(message, "subdenom")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subdenom); - return writer; - }; - - /** - * Encodes the specified QueryDenomAuthorityMetadataRequest message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest} message QueryDenomAuthorityMetadataRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomAuthorityMetadataRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomAuthorityMetadataRequest message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest} QueryDenomAuthorityMetadataRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomAuthorityMetadataRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - case 2: - message.subdenom = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomAuthorityMetadataRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest} QueryDenomAuthorityMetadataRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomAuthorityMetadataRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomAuthorityMetadataRequest message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomAuthorityMetadataRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.subdenom != null && message.hasOwnProperty("subdenom")) - if (!$util.isString(message.subdenom)) - return "subdenom: string expected"; - return null; - }; - - /** - * Creates a QueryDenomAuthorityMetadataRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest} QueryDenomAuthorityMetadataRequest - */ - QueryDenomAuthorityMetadataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest(); - if (object.creator != null) - message.creator = String(object.creator); - if (object.subdenom != null) - message.subdenom = String(object.subdenom); - return message; - }; - - /** - * Creates a plain object from a QueryDenomAuthorityMetadataRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @static - * @param {osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest} message QueryDenomAuthorityMetadataRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomAuthorityMetadataRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.creator = ""; - object.subdenom = ""; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.subdenom != null && message.hasOwnProperty("subdenom")) - object.subdenom = message.subdenom; - return object; - }; - - /** - * Converts this QueryDenomAuthorityMetadataRequest to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomAuthorityMetadataRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomAuthorityMetadataRequest; - })(); - - v1beta1.QueryDenomAuthorityMetadataResponse = (function() { - - /** - * Properties of a QueryDenomAuthorityMetadataResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IQueryDenomAuthorityMetadataResponse - * @property {osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata|null} [authority_metadata] QueryDenomAuthorityMetadataResponse authority_metadata - */ - - /** - * Constructs a new QueryDenomAuthorityMetadataResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a QueryDenomAuthorityMetadataResponse. - * @implements IQueryDenomAuthorityMetadataResponse - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataResponse=} [properties] Properties to set - */ - function QueryDenomAuthorityMetadataResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomAuthorityMetadataResponse authority_metadata. - * @member {osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata|null|undefined} authority_metadata - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse - * @instance - */ - QueryDenomAuthorityMetadataResponse.prototype.authority_metadata = null; - - /** - * Encodes the specified QueryDenomAuthorityMetadataResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataResponse} message QueryDenomAuthorityMetadataResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomAuthorityMetadataResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.authority_metadata != null && Object.hasOwnProperty.call(message, "authority_metadata")) - $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.encode(message.authority_metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QueryDenomAuthorityMetadataResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataResponse} message QueryDenomAuthorityMetadataResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomAuthorityMetadataResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomAuthorityMetadataResponse message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse} QueryDenomAuthorityMetadataResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomAuthorityMetadataResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.authority_metadata = $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomAuthorityMetadataResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse} QueryDenomAuthorityMetadataResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomAuthorityMetadataResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomAuthorityMetadataResponse message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomAuthorityMetadataResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.authority_metadata != null && message.hasOwnProperty("authority_metadata")) { - var error = $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.verify(message.authority_metadata); - if (error) - return "authority_metadata." + error; - } - return null; - }; - - /** - * Creates a QueryDenomAuthorityMetadataResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse} QueryDenomAuthorityMetadataResponse - */ - QueryDenomAuthorityMetadataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse(); - if (object.authority_metadata != null) { - if (typeof object.authority_metadata !== "object") - throw TypeError(".osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse.authority_metadata: object expected"); - message.authority_metadata = $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.fromObject(object.authority_metadata); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomAuthorityMetadataResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse} message QueryDenomAuthorityMetadataResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomAuthorityMetadataResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.authority_metadata = null; - if (message.authority_metadata != null && message.hasOwnProperty("authority_metadata")) - object.authority_metadata = $root.osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.toObject(message.authority_metadata, options); - return object; - }; - - /** - * Converts this QueryDenomAuthorityMetadataResponse to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomAuthorityMetadataResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomAuthorityMetadataResponse; - })(); - - v1beta1.QueryDenomsFromCreatorRequest = (function() { - - /** - * Properties of a QueryDenomsFromCreatorRequest. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IQueryDenomsFromCreatorRequest - * @property {string|null} [creator] QueryDenomsFromCreatorRequest creator - */ - - /** - * Constructs a new QueryDenomsFromCreatorRequest. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a QueryDenomsFromCreatorRequest. - * @implements IQueryDenomsFromCreatorRequest - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest=} [properties] Properties to set - */ - function QueryDenomsFromCreatorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomsFromCreatorRequest creator. - * @member {string} creator - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest - * @instance - */ - QueryDenomsFromCreatorRequest.prototype.creator = ""; - - /** - * Encodes the specified QueryDenomsFromCreatorRequest message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest} message QueryDenomsFromCreatorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomsFromCreatorRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.creator); - return writer; - }; - - /** - * Encodes the specified QueryDenomsFromCreatorRequest message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest} message QueryDenomsFromCreatorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomsFromCreatorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomsFromCreatorRequest message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest} QueryDenomsFromCreatorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomsFromCreatorRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomsFromCreatorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest} QueryDenomsFromCreatorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomsFromCreatorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomsFromCreatorRequest message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomsFromCreatorRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - return null; - }; - - /** - * Creates a QueryDenomsFromCreatorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest} QueryDenomsFromCreatorRequest - */ - QueryDenomsFromCreatorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest(); - if (object.creator != null) - message.creator = String(object.creator); - return message; - }; - - /** - * Creates a plain object from a QueryDenomsFromCreatorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest - * @static - * @param {osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest} message QueryDenomsFromCreatorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomsFromCreatorRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.creator = ""; - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - return object; - }; - - /** - * Converts this QueryDenomsFromCreatorRequest to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest - * @instance - * @returns {Object.} JSON object - */ - QueryDenomsFromCreatorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomsFromCreatorRequest; - })(); - - v1beta1.QueryDenomsFromCreatorResponse = (function() { - - /** - * Properties of a QueryDenomsFromCreatorResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @interface IQueryDenomsFromCreatorResponse - * @property {Array.|null} [denoms] QueryDenomsFromCreatorResponse denoms - */ - - /** - * Constructs a new QueryDenomsFromCreatorResponse. - * @memberof osmosis.tokenfactory.v1beta1 - * @classdesc Represents a QueryDenomsFromCreatorResponse. - * @implements IQueryDenomsFromCreatorResponse - * @constructor - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorResponse=} [properties] Properties to set - */ - function QueryDenomsFromCreatorResponse(properties) { - this.denoms = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryDenomsFromCreatorResponse denoms. - * @member {Array.} denoms - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse - * @instance - */ - QueryDenomsFromCreatorResponse.prototype.denoms = $util.emptyArray; - - /** - * Encodes the specified QueryDenomsFromCreatorResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse.verify|verify} messages. - * @function encode - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorResponse} message QueryDenomsFromCreatorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomsFromCreatorResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denoms != null && message.denoms.length) - for (var i = 0; i < message.denoms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denoms[i]); - return writer; - }; - - /** - * Encodes the specified QueryDenomsFromCreatorResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorResponse} message QueryDenomsFromCreatorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryDenomsFromCreatorResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryDenomsFromCreatorResponse message from the specified reader or buffer. - * @function decode - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse} QueryDenomsFromCreatorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomsFromCreatorResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.denoms && message.denoms.length)) - message.denoms = []; - message.denoms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryDenomsFromCreatorResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse} QueryDenomsFromCreatorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryDenomsFromCreatorResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryDenomsFromCreatorResponse message. - * @function verify - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryDenomsFromCreatorResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denoms != null && message.hasOwnProperty("denoms")) { - if (!Array.isArray(message.denoms)) - return "denoms: array expected"; - for (var i = 0; i < message.denoms.length; ++i) - if (!$util.isString(message.denoms[i])) - return "denoms: string[] expected"; - } - return null; - }; - - /** - * Creates a QueryDenomsFromCreatorResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse - * @static - * @param {Object.} object Plain object - * @returns {osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse} QueryDenomsFromCreatorResponse - */ - QueryDenomsFromCreatorResponse.fromObject = function fromObject(object) { - if (object instanceof $root.osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse) - return object; - var message = new $root.osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse(); - if (object.denoms) { - if (!Array.isArray(object.denoms)) - throw TypeError(".osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse.denoms: array expected"); - message.denoms = []; - for (var i = 0; i < object.denoms.length; ++i) - message.denoms[i] = String(object.denoms[i]); - } - return message; - }; - - /** - * Creates a plain object from a QueryDenomsFromCreatorResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse - * @static - * @param {osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse} message QueryDenomsFromCreatorResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryDenomsFromCreatorResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.denoms = []; - if (message.denoms && message.denoms.length) { - object.denoms = []; - for (var j = 0; j < message.denoms.length; ++j) - object.denoms[j] = message.denoms[j]; - } - return object; - }; - - /** - * Converts this QueryDenomsFromCreatorResponse to JSON. - * @function toJSON - * @memberof osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse - * @instance - * @returns {Object.} JSON object - */ - QueryDenomsFromCreatorResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QueryDenomsFromCreatorResponse; - })(); - - return v1beta1; - })(); - - return tokenfactory; - })(); - - return osmosis; - })(); - - return $root; -}); diff --git a/src/generated/proto.d.ts b/src/generated/proto.d.ts deleted file mode 100644 index 93bebbc5..00000000 --- a/src/generated/proto.d.ts +++ /dev/null @@ -1,23068 +0,0 @@ -import * as $protobuf from "protobufjs"; -/** Namespace neutron. */ -export namespace neutron { - - /** Namespace contractmanager. */ - namespace contractmanager { - - /** Properties of a Failure. */ - interface IFailure { - - /** Failure channel_id */ - channel_id?: (string|null); - - /** Failure address */ - address?: (string|null); - - /** Failure id */ - id?: (Long|null); - - /** Failure ack_id */ - ack_id?: (Long|null); - - /** Failure ack_type */ - ack_type?: (string|null); - } - - /** Represents a Failure. */ - class Failure implements IFailure { - - /** - * Constructs a new Failure. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.contractmanager.IFailure); - - /** Failure channel_id. */ - public channel_id: string; - - /** Failure address. */ - public address: string; - - /** Failure id. */ - public id: Long; - - /** Failure ack_id. */ - public ack_id: Long; - - /** Failure ack_type. */ - public ack_type: string; - - /** - * Encodes the specified Failure message. Does not implicitly {@link neutron.contractmanager.Failure.verify|verify} messages. - * @param message Failure message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.contractmanager.IFailure, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Failure message, length delimited. Does not implicitly {@link neutron.contractmanager.Failure.verify|verify} messages. - * @param message Failure message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.contractmanager.IFailure, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Failure message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Failure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.contractmanager.Failure; - - /** - * Decodes a Failure message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Failure - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.contractmanager.Failure; - - /** - * Verifies a Failure message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Failure message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Failure - */ - public static fromObject(object: { [k: string]: any }): neutron.contractmanager.Failure; - - /** - * Creates a plain object from a Failure message. Also converts values to other types if specified. - * @param message Failure - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.contractmanager.Failure, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Failure to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState params */ - params?: (neutron.contractmanager.IParams|null); - - /** GenesisState failures_list */ - failures_list?: (neutron.contractmanager.IFailure[]|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.contractmanager.IGenesisState); - - /** GenesisState params. */ - public params?: (neutron.contractmanager.IParams|null); - - /** GenesisState failures_list. */ - public failures_list: neutron.contractmanager.IFailure[]; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.contractmanager.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.contractmanager.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.contractmanager.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.contractmanager.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.contractmanager.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.contractmanager.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): neutron.contractmanager.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.contractmanager.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.contractmanager.IParams); - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.contractmanager.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.contractmanager.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.contractmanager.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.contractmanager.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.contractmanager.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.contractmanager.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): neutron.contractmanager.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.contractmanager.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: neutron.contractmanager.IQueryParamsRequest, callback: neutron.contractmanager.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: neutron.contractmanager.IQueryParamsRequest): Promise; - - /** - * Calls AddressFailures. - * @param request QueryFailuresRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryFailuresResponse - */ - public addressFailures(request: neutron.contractmanager.IQueryFailuresRequest, callback: neutron.contractmanager.Query.AddressFailuresCallback): void; - - /** - * Calls AddressFailures. - * @param request QueryFailuresRequest message or plain object - * @returns Promise - */ - public addressFailures(request: neutron.contractmanager.IQueryFailuresRequest): Promise; - - /** - * Calls Failures. - * @param request QueryFailuresRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryFailuresResponse - */ - public failures(request: neutron.contractmanager.IQueryFailuresRequest, callback: neutron.contractmanager.Query.FailuresCallback): void; - - /** - * Calls Failures. - * @param request QueryFailuresRequest message or plain object - * @returns Promise - */ - public failures(request: neutron.contractmanager.IQueryFailuresRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link neutron.contractmanager.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: neutron.contractmanager.QueryParamsResponse) => void; - - /** - * Callback as used by {@link neutron.contractmanager.Query#addressFailures}. - * @param error Error, if any - * @param [response] QueryFailuresResponse - */ - type AddressFailuresCallback = (error: (Error|null), response?: neutron.contractmanager.QueryFailuresResponse) => void; - - /** - * Callback as used by {@link neutron.contractmanager.Query#failures}. - * @param error Error, if any - * @param [response] QueryFailuresResponse - */ - type FailuresCallback = (error: (Error|null), response?: neutron.contractmanager.QueryFailuresResponse) => void; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.contractmanager.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.contractmanager.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.contractmanager.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.contractmanager.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.contractmanager.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.contractmanager.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.contractmanager.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.contractmanager.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.contractmanager.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (neutron.contractmanager.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.contractmanager.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (neutron.contractmanager.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.contractmanager.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.contractmanager.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.contractmanager.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.contractmanager.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.contractmanager.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.contractmanager.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.contractmanager.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.contractmanager.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryFailuresRequest. */ - interface IQueryFailuresRequest { - - /** QueryFailuresRequest address */ - address?: (string|null); - - /** QueryFailuresRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryFailuresRequest. */ - class QueryFailuresRequest implements IQueryFailuresRequest { - - /** - * Constructs a new QueryFailuresRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.contractmanager.IQueryFailuresRequest); - - /** QueryFailuresRequest address. */ - public address: string; - - /** QueryFailuresRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryFailuresRequest message. Does not implicitly {@link neutron.contractmanager.QueryFailuresRequest.verify|verify} messages. - * @param message QueryFailuresRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.contractmanager.IQueryFailuresRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryFailuresRequest message, length delimited. Does not implicitly {@link neutron.contractmanager.QueryFailuresRequest.verify|verify} messages. - * @param message QueryFailuresRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.contractmanager.IQueryFailuresRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryFailuresRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryFailuresRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.contractmanager.QueryFailuresRequest; - - /** - * Decodes a QueryFailuresRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryFailuresRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.contractmanager.QueryFailuresRequest; - - /** - * Verifies a QueryFailuresRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryFailuresRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryFailuresRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.contractmanager.QueryFailuresRequest; - - /** - * Creates a plain object from a QueryFailuresRequest message. Also converts values to other types if specified. - * @param message QueryFailuresRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.contractmanager.QueryFailuresRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryFailuresRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryFailuresResponse. */ - interface IQueryFailuresResponse { - - /** QueryFailuresResponse failures */ - failures?: (neutron.contractmanager.IFailure[]|null); - - /** QueryFailuresResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - } - - /** Represents a QueryFailuresResponse. */ - class QueryFailuresResponse implements IQueryFailuresResponse { - - /** - * Constructs a new QueryFailuresResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.contractmanager.IQueryFailuresResponse); - - /** QueryFailuresResponse failures. */ - public failures: neutron.contractmanager.IFailure[]; - - /** QueryFailuresResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** - * Encodes the specified QueryFailuresResponse message. Does not implicitly {@link neutron.contractmanager.QueryFailuresResponse.verify|verify} messages. - * @param message QueryFailuresResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.contractmanager.IQueryFailuresResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryFailuresResponse message, length delimited. Does not implicitly {@link neutron.contractmanager.QueryFailuresResponse.verify|verify} messages. - * @param message QueryFailuresResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.contractmanager.IQueryFailuresResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryFailuresResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryFailuresResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.contractmanager.QueryFailuresResponse; - - /** - * Decodes a QueryFailuresResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryFailuresResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.contractmanager.QueryFailuresResponse; - - /** - * Verifies a QueryFailuresResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryFailuresResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryFailuresResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.contractmanager.QueryFailuresResponse; - - /** - * Creates a plain object from a QueryFailuresResponse message. Also converts values to other types if specified. - * @param message QueryFailuresResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.contractmanager.QueryFailuresResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryFailuresResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace cron. */ - namespace cron { - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState scheduleList */ - scheduleList?: (neutron.cron.ISchedule[]|null); - - /** GenesisState params */ - params?: (neutron.cron.IParams|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IGenesisState); - - /** GenesisState scheduleList. */ - public scheduleList: neutron.cron.ISchedule[]; - - /** GenesisState params. */ - public params?: (neutron.cron.IParams|null); - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.cron.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.cron.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params security_address */ - security_address?: (string|null); - - /** Params limit */ - limit?: (Long|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IParams); - - /** Params security_address. */ - public security_address: string; - - /** Params limit. */ - public limit: Long; - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.cron.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.cron.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Schedule. */ - interface ISchedule { - - /** Schedule name */ - name?: (string|null); - - /** Schedule period */ - period?: (Long|null); - - /** Schedule msgs */ - msgs?: (neutron.cron.IMsgExecuteContract[]|null); - - /** Schedule last_execute_height */ - last_execute_height?: (Long|null); - } - - /** Represents a Schedule. */ - class Schedule implements ISchedule { - - /** - * Constructs a new Schedule. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.ISchedule); - - /** Schedule name. */ - public name: string; - - /** Schedule period. */ - public period: Long; - - /** Schedule msgs. */ - public msgs: neutron.cron.IMsgExecuteContract[]; - - /** Schedule last_execute_height. */ - public last_execute_height: Long; - - /** - * Encodes the specified Schedule message. Does not implicitly {@link neutron.cron.Schedule.verify|verify} messages. - * @param message Schedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Schedule message, length delimited. Does not implicitly {@link neutron.cron.Schedule.verify|verify} messages. - * @param message Schedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Schedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Schedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.Schedule; - - /** - * Decodes a Schedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Schedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.Schedule; - - /** - * Verifies a Schedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Schedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Schedule - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.Schedule; - - /** - * Creates a plain object from a Schedule message. Also converts values to other types if specified. - * @param message Schedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Schedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgExecuteContract. */ - interface IMsgExecuteContract { - - /** MsgExecuteContract contract */ - contract?: (string|null); - - /** MsgExecuteContract msg */ - msg?: (string|null); - } - - /** Represents a MsgExecuteContract. */ - class MsgExecuteContract implements IMsgExecuteContract { - - /** - * Constructs a new MsgExecuteContract. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IMsgExecuteContract); - - /** MsgExecuteContract contract. */ - public contract: string; - - /** MsgExecuteContract msg. */ - public msg: string; - - /** - * Encodes the specified MsgExecuteContract message. Does not implicitly {@link neutron.cron.MsgExecuteContract.verify|verify} messages. - * @param message MsgExecuteContract message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IMsgExecuteContract, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgExecuteContract message, length delimited. Does not implicitly {@link neutron.cron.MsgExecuteContract.verify|verify} messages. - * @param message MsgExecuteContract message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IMsgExecuteContract, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgExecuteContract message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgExecuteContract - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.MsgExecuteContract; - - /** - * Decodes a MsgExecuteContract message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgExecuteContract - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.MsgExecuteContract; - - /** - * Verifies a MsgExecuteContract message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgExecuteContract message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgExecuteContract - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.MsgExecuteContract; - - /** - * Creates a plain object from a MsgExecuteContract message. Also converts values to other types if specified. - * @param message MsgExecuteContract - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.MsgExecuteContract, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgExecuteContract to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ScheduleCount. */ - interface IScheduleCount { - - /** ScheduleCount count */ - count?: (number|null); - } - - /** Represents a ScheduleCount. */ - class ScheduleCount implements IScheduleCount { - - /** - * Constructs a new ScheduleCount. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IScheduleCount); - - /** ScheduleCount count. */ - public count: number; - - /** - * Encodes the specified ScheduleCount message. Does not implicitly {@link neutron.cron.ScheduleCount.verify|verify} messages. - * @param message ScheduleCount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IScheduleCount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ScheduleCount message, length delimited. Does not implicitly {@link neutron.cron.ScheduleCount.verify|verify} messages. - * @param message ScheduleCount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IScheduleCount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ScheduleCount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ScheduleCount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.ScheduleCount; - - /** - * Decodes a ScheduleCount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ScheduleCount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.ScheduleCount; - - /** - * Verifies a ScheduleCount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ScheduleCount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ScheduleCount - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.ScheduleCount; - - /** - * Creates a plain object from a ScheduleCount message. Also converts values to other types if specified. - * @param message ScheduleCount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.ScheduleCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ScheduleCount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: neutron.cron.IQueryParamsRequest, callback: neutron.cron.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: neutron.cron.IQueryParamsRequest): Promise; - - /** - * Calls Schedule. - * @param request QueryGetScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryGetScheduleResponse - */ - public schedule(request: neutron.cron.IQueryGetScheduleRequest, callback: neutron.cron.Query.ScheduleCallback): void; - - /** - * Calls Schedule. - * @param request QueryGetScheduleRequest message or plain object - * @returns Promise - */ - public schedule(request: neutron.cron.IQueryGetScheduleRequest): Promise; - - /** - * Calls Schedules. - * @param request QuerySchedulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QuerySchedulesResponse - */ - public schedules(request: neutron.cron.IQuerySchedulesRequest, callback: neutron.cron.Query.SchedulesCallback): void; - - /** - * Calls Schedules. - * @param request QuerySchedulesRequest message or plain object - * @returns Promise - */ - public schedules(request: neutron.cron.IQuerySchedulesRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link neutron.cron.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: neutron.cron.QueryParamsResponse) => void; - - /** - * Callback as used by {@link neutron.cron.Query#schedule}. - * @param error Error, if any - * @param [response] QueryGetScheduleResponse - */ - type ScheduleCallback = (error: (Error|null), response?: neutron.cron.QueryGetScheduleResponse) => void; - - /** - * Callback as used by {@link neutron.cron.Query#schedules}. - * @param error Error, if any - * @param [response] QuerySchedulesResponse - */ - type SchedulesCallback = (error: (Error|null), response?: neutron.cron.QuerySchedulesResponse) => void; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.cron.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.cron.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (neutron.cron.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (neutron.cron.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.cron.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.cron.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryGetScheduleRequest. */ - interface IQueryGetScheduleRequest { - - /** QueryGetScheduleRequest name */ - name?: (string|null); - } - - /** Represents a QueryGetScheduleRequest. */ - class QueryGetScheduleRequest implements IQueryGetScheduleRequest { - - /** - * Constructs a new QueryGetScheduleRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IQueryGetScheduleRequest); - - /** QueryGetScheduleRequest name. */ - public name: string; - - /** - * Encodes the specified QueryGetScheduleRequest message. Does not implicitly {@link neutron.cron.QueryGetScheduleRequest.verify|verify} messages. - * @param message QueryGetScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IQueryGetScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryGetScheduleRequest message, length delimited. Does not implicitly {@link neutron.cron.QueryGetScheduleRequest.verify|verify} messages. - * @param message QueryGetScheduleRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IQueryGetScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryGetScheduleRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryGetScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.QueryGetScheduleRequest; - - /** - * Decodes a QueryGetScheduleRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryGetScheduleRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.QueryGetScheduleRequest; - - /** - * Verifies a QueryGetScheduleRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryGetScheduleRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryGetScheduleRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.QueryGetScheduleRequest; - - /** - * Creates a plain object from a QueryGetScheduleRequest message. Also converts values to other types if specified. - * @param message QueryGetScheduleRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.QueryGetScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryGetScheduleRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryGetScheduleResponse. */ - interface IQueryGetScheduleResponse { - - /** QueryGetScheduleResponse schedule */ - schedule?: (neutron.cron.ISchedule|null); - } - - /** Represents a QueryGetScheduleResponse. */ - class QueryGetScheduleResponse implements IQueryGetScheduleResponse { - - /** - * Constructs a new QueryGetScheduleResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IQueryGetScheduleResponse); - - /** QueryGetScheduleResponse schedule. */ - public schedule?: (neutron.cron.ISchedule|null); - - /** - * Encodes the specified QueryGetScheduleResponse message. Does not implicitly {@link neutron.cron.QueryGetScheduleResponse.verify|verify} messages. - * @param message QueryGetScheduleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IQueryGetScheduleResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryGetScheduleResponse message, length delimited. Does not implicitly {@link neutron.cron.QueryGetScheduleResponse.verify|verify} messages. - * @param message QueryGetScheduleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IQueryGetScheduleResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryGetScheduleResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryGetScheduleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.QueryGetScheduleResponse; - - /** - * Decodes a QueryGetScheduleResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryGetScheduleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.QueryGetScheduleResponse; - - /** - * Verifies a QueryGetScheduleResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryGetScheduleResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryGetScheduleResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.QueryGetScheduleResponse; - - /** - * Creates a plain object from a QueryGetScheduleResponse message. Also converts values to other types if specified. - * @param message QueryGetScheduleResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.QueryGetScheduleResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryGetScheduleResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QuerySchedulesRequest. */ - interface IQuerySchedulesRequest { - - /** QuerySchedulesRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QuerySchedulesRequest. */ - class QuerySchedulesRequest implements IQuerySchedulesRequest { - - /** - * Constructs a new QuerySchedulesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IQuerySchedulesRequest); - - /** QuerySchedulesRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QuerySchedulesRequest message. Does not implicitly {@link neutron.cron.QuerySchedulesRequest.verify|verify} messages. - * @param message QuerySchedulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IQuerySchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuerySchedulesRequest message, length delimited. Does not implicitly {@link neutron.cron.QuerySchedulesRequest.verify|verify} messages. - * @param message QuerySchedulesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IQuerySchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuerySchedulesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuerySchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.QuerySchedulesRequest; - - /** - * Decodes a QuerySchedulesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuerySchedulesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.QuerySchedulesRequest; - - /** - * Verifies a QuerySchedulesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuerySchedulesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuerySchedulesRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.QuerySchedulesRequest; - - /** - * Creates a plain object from a QuerySchedulesRequest message. Also converts values to other types if specified. - * @param message QuerySchedulesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.QuerySchedulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuerySchedulesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QuerySchedulesResponse. */ - interface IQuerySchedulesResponse { - - /** QuerySchedulesResponse schedules */ - schedules?: (neutron.cron.ISchedule[]|null); - - /** QuerySchedulesResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - } - - /** Represents a QuerySchedulesResponse. */ - class QuerySchedulesResponse implements IQuerySchedulesResponse { - - /** - * Constructs a new QuerySchedulesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.cron.IQuerySchedulesResponse); - - /** QuerySchedulesResponse schedules. */ - public schedules: neutron.cron.ISchedule[]; - - /** QuerySchedulesResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** - * Encodes the specified QuerySchedulesResponse message. Does not implicitly {@link neutron.cron.QuerySchedulesResponse.verify|verify} messages. - * @param message QuerySchedulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.cron.IQuerySchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuerySchedulesResponse message, length delimited. Does not implicitly {@link neutron.cron.QuerySchedulesResponse.verify|verify} messages. - * @param message QuerySchedulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.cron.IQuerySchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuerySchedulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuerySchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.cron.QuerySchedulesResponse; - - /** - * Decodes a QuerySchedulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuerySchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.cron.QuerySchedulesResponse; - - /** - * Verifies a QuerySchedulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuerySchedulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuerySchedulesResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.cron.QuerySchedulesResponse; - - /** - * Creates a plain object from a QuerySchedulesResponse message. Also converts values to other types if specified. - * @param message QuerySchedulesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.cron.QuerySchedulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuerySchedulesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace feeburner. */ - namespace feeburner { - - /** Properties of a TotalBurnedNeutronsAmount. */ - interface ITotalBurnedNeutronsAmount { - - /** TotalBurnedNeutronsAmount coin */ - coin?: (cosmos.base.v1beta1.ICoin|null); - } - - /** Represents a TotalBurnedNeutronsAmount. */ - class TotalBurnedNeutronsAmount implements ITotalBurnedNeutronsAmount { - - /** - * Constructs a new TotalBurnedNeutronsAmount. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feeburner.ITotalBurnedNeutronsAmount); - - /** TotalBurnedNeutronsAmount coin. */ - public coin?: (cosmos.base.v1beta1.ICoin|null); - - /** - * Encodes the specified TotalBurnedNeutronsAmount message. Does not implicitly {@link neutron.feeburner.TotalBurnedNeutronsAmount.verify|verify} messages. - * @param message TotalBurnedNeutronsAmount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feeburner.ITotalBurnedNeutronsAmount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TotalBurnedNeutronsAmount message, length delimited. Does not implicitly {@link neutron.feeburner.TotalBurnedNeutronsAmount.verify|verify} messages. - * @param message TotalBurnedNeutronsAmount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feeburner.ITotalBurnedNeutronsAmount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TotalBurnedNeutronsAmount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TotalBurnedNeutronsAmount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feeburner.TotalBurnedNeutronsAmount; - - /** - * Decodes a TotalBurnedNeutronsAmount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TotalBurnedNeutronsAmount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feeburner.TotalBurnedNeutronsAmount; - - /** - * Verifies a TotalBurnedNeutronsAmount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TotalBurnedNeutronsAmount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TotalBurnedNeutronsAmount - */ - public static fromObject(object: { [k: string]: any }): neutron.feeburner.TotalBurnedNeutronsAmount; - - /** - * Creates a plain object from a TotalBurnedNeutronsAmount message. Also converts values to other types if specified. - * @param message TotalBurnedNeutronsAmount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feeburner.TotalBurnedNeutronsAmount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TotalBurnedNeutronsAmount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState params */ - params?: (neutron.feeburner.IParams|null); - - /** GenesisState total_burned_neutrons_amount */ - total_burned_neutrons_amount?: (neutron.feeburner.ITotalBurnedNeutronsAmount|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feeburner.IGenesisState); - - /** GenesisState params. */ - public params?: (neutron.feeburner.IParams|null); - - /** GenesisState total_burned_neutrons_amount. */ - public total_burned_neutrons_amount?: (neutron.feeburner.ITotalBurnedNeutronsAmount|null); - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.feeburner.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feeburner.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.feeburner.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feeburner.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feeburner.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feeburner.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): neutron.feeburner.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feeburner.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params neutron_denom */ - neutron_denom?: (string|null); - - /** Params reserve_address */ - reserve_address?: (string|null); - - /** Params treasury_address */ - treasury_address?: (string|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feeburner.IParams); - - /** Params neutron_denom. */ - public neutron_denom: string; - - /** Params reserve_address. */ - public reserve_address: string; - - /** Params treasury_address. */ - public treasury_address: string; - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.feeburner.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feeburner.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.feeburner.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feeburner.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feeburner.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feeburner.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): neutron.feeburner.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feeburner.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: neutron.feeburner.IQueryParamsRequest, callback: neutron.feeburner.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: neutron.feeburner.IQueryParamsRequest): Promise; - - /** - * Calls TotalBurnedNeutronsAmount. - * @param request QueryTotalBurnedNeutronsAmountRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryTotalBurnedNeutronsAmountResponse - */ - public totalBurnedNeutronsAmount(request: neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest, callback: neutron.feeburner.Query.TotalBurnedNeutronsAmountCallback): void; - - /** - * Calls TotalBurnedNeutronsAmount. - * @param request QueryTotalBurnedNeutronsAmountRequest message or plain object - * @returns Promise - */ - public totalBurnedNeutronsAmount(request: neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link neutron.feeburner.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: neutron.feeburner.QueryParamsResponse) => void; - - /** - * Callback as used by {@link neutron.feeburner.Query#totalBurnedNeutronsAmount}. - * @param error Error, if any - * @param [response] QueryTotalBurnedNeutronsAmountResponse - */ - type TotalBurnedNeutronsAmountCallback = (error: (Error|null), response?: neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse) => void; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feeburner.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.feeburner.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feeburner.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.feeburner.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feeburner.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feeburner.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feeburner.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.feeburner.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feeburner.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (neutron.feeburner.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feeburner.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (neutron.feeburner.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.feeburner.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feeburner.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.feeburner.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feeburner.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feeburner.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feeburner.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.feeburner.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feeburner.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTotalBurnedNeutronsAmountRequest. */ - interface IQueryTotalBurnedNeutronsAmountRequest { - } - - /** Represents a QueryTotalBurnedNeutronsAmountRequest. */ - class QueryTotalBurnedNeutronsAmountRequest implements IQueryTotalBurnedNeutronsAmountRequest { - - /** - * Constructs a new QueryTotalBurnedNeutronsAmountRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest); - - /** - * Encodes the specified QueryTotalBurnedNeutronsAmountRequest message. Does not implicitly {@link neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest.verify|verify} messages. - * @param message QueryTotalBurnedNeutronsAmountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryTotalBurnedNeutronsAmountRequest message, length delimited. Does not implicitly {@link neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest.verify|verify} messages. - * @param message QueryTotalBurnedNeutronsAmountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feeburner.IQueryTotalBurnedNeutronsAmountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryTotalBurnedNeutronsAmountRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTotalBurnedNeutronsAmountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest; - - /** - * Decodes a QueryTotalBurnedNeutronsAmountRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTotalBurnedNeutronsAmountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest; - - /** - * Verifies a QueryTotalBurnedNeutronsAmountRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryTotalBurnedNeutronsAmountRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTotalBurnedNeutronsAmountRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest; - - /** - * Creates a plain object from a QueryTotalBurnedNeutronsAmountRequest message. Also converts values to other types if specified. - * @param message QueryTotalBurnedNeutronsAmountRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feeburner.QueryTotalBurnedNeutronsAmountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTotalBurnedNeutronsAmountRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryTotalBurnedNeutronsAmountResponse. */ - interface IQueryTotalBurnedNeutronsAmountResponse { - - /** QueryTotalBurnedNeutronsAmountResponse total_burned_neutrons_amount */ - total_burned_neutrons_amount?: (neutron.feeburner.ITotalBurnedNeutronsAmount|null); - } - - /** Represents a QueryTotalBurnedNeutronsAmountResponse. */ - class QueryTotalBurnedNeutronsAmountResponse implements IQueryTotalBurnedNeutronsAmountResponse { - - /** - * Constructs a new QueryTotalBurnedNeutronsAmountResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feeburner.IQueryTotalBurnedNeutronsAmountResponse); - - /** QueryTotalBurnedNeutronsAmountResponse total_burned_neutrons_amount. */ - public total_burned_neutrons_amount?: (neutron.feeburner.ITotalBurnedNeutronsAmount|null); - - /** - * Encodes the specified QueryTotalBurnedNeutronsAmountResponse message. Does not implicitly {@link neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse.verify|verify} messages. - * @param message QueryTotalBurnedNeutronsAmountResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feeburner.IQueryTotalBurnedNeutronsAmountResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryTotalBurnedNeutronsAmountResponse message, length delimited. Does not implicitly {@link neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse.verify|verify} messages. - * @param message QueryTotalBurnedNeutronsAmountResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feeburner.IQueryTotalBurnedNeutronsAmountResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryTotalBurnedNeutronsAmountResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTotalBurnedNeutronsAmountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse; - - /** - * Decodes a QueryTotalBurnedNeutronsAmountResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTotalBurnedNeutronsAmountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse; - - /** - * Verifies a QueryTotalBurnedNeutronsAmountResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryTotalBurnedNeutronsAmountResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTotalBurnedNeutronsAmountResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse; - - /** - * Creates a plain object from a QueryTotalBurnedNeutronsAmountResponse message. Also converts values to other types if specified. - * @param message QueryTotalBurnedNeutronsAmountResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feeburner.QueryTotalBurnedNeutronsAmountResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTotalBurnedNeutronsAmountResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace feerefunder. */ - namespace feerefunder { - - /** Properties of a Fee. */ - interface IFee { - - /** Fee recv_fee */ - recv_fee?: (cosmos.base.v1beta1.ICoin[]|null); - - /** Fee ack_fee */ - ack_fee?: (cosmos.base.v1beta1.ICoin[]|null); - - /** Fee timeout_fee */ - timeout_fee?: (cosmos.base.v1beta1.ICoin[]|null); - } - - /** Represents a Fee. */ - class Fee implements IFee { - - /** - * Constructs a new Fee. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feerefunder.IFee); - - /** Fee recv_fee. */ - public recv_fee: cosmos.base.v1beta1.ICoin[]; - - /** Fee ack_fee. */ - public ack_fee: cosmos.base.v1beta1.ICoin[]; - - /** Fee timeout_fee. */ - public timeout_fee: cosmos.base.v1beta1.ICoin[]; - - /** - * Encodes the specified Fee message. Does not implicitly {@link neutron.feerefunder.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feerefunder.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link neutron.feerefunder.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feerefunder.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feerefunder.Fee; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feerefunder.Fee; - - /** - * Verifies a Fee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Fee - */ - public static fromObject(object: { [k: string]: any }): neutron.feerefunder.Fee; - - /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. - * @param message Fee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feerefunder.Fee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Fee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PacketID. */ - interface IPacketID { - - /** PacketID channel_id */ - channel_id?: (string|null); - - /** PacketID port_id */ - port_id?: (string|null); - - /** PacketID sequence */ - sequence?: (Long|null); - } - - /** Represents a PacketID. */ - class PacketID implements IPacketID { - - /** - * Constructs a new PacketID. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feerefunder.IPacketID); - - /** PacketID channel_id. */ - public channel_id: string; - - /** PacketID port_id. */ - public port_id: string; - - /** PacketID sequence. */ - public sequence: Long; - - /** - * Encodes the specified PacketID message. Does not implicitly {@link neutron.feerefunder.PacketID.verify|verify} messages. - * @param message PacketID message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feerefunder.IPacketID, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PacketID message, length delimited. Does not implicitly {@link neutron.feerefunder.PacketID.verify|verify} messages. - * @param message PacketID message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feerefunder.IPacketID, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PacketID message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PacketID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feerefunder.PacketID; - - /** - * Decodes a PacketID message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PacketID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feerefunder.PacketID; - - /** - * Verifies a PacketID message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PacketID message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PacketID - */ - public static fromObject(object: { [k: string]: any }): neutron.feerefunder.PacketID; - - /** - * Creates a plain object from a PacketID message. Also converts values to other types if specified. - * @param message PacketID - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feerefunder.PacketID, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PacketID to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState params */ - params?: (neutron.feerefunder.IParams|null); - - /** GenesisState fee_infos */ - fee_infos?: (neutron.feerefunder.IFeeInfo[]|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feerefunder.IGenesisState); - - /** GenesisState params. */ - public params?: (neutron.feerefunder.IParams|null); - - /** GenesisState fee_infos. */ - public fee_infos: neutron.feerefunder.IFeeInfo[]; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.feerefunder.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feerefunder.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.feerefunder.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feerefunder.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feerefunder.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feerefunder.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): neutron.feerefunder.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feerefunder.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FeeInfo. */ - interface IFeeInfo { - - /** FeeInfo payer */ - payer?: (string|null); - - /** FeeInfo packet_id */ - packet_id?: (neutron.feerefunder.IPacketID|null); - - /** FeeInfo fee */ - fee?: (neutron.feerefunder.IFee|null); - } - - /** Represents a FeeInfo. */ - class FeeInfo implements IFeeInfo { - - /** - * Constructs a new FeeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feerefunder.IFeeInfo); - - /** FeeInfo payer. */ - public payer: string; - - /** FeeInfo packet_id. */ - public packet_id?: (neutron.feerefunder.IPacketID|null); - - /** FeeInfo fee. */ - public fee?: (neutron.feerefunder.IFee|null); - - /** - * Encodes the specified FeeInfo message. Does not implicitly {@link neutron.feerefunder.FeeInfo.verify|verify} messages. - * @param message FeeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feerefunder.IFeeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeeInfo message, length delimited. Does not implicitly {@link neutron.feerefunder.FeeInfo.verify|verify} messages. - * @param message FeeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feerefunder.IFeeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feerefunder.FeeInfo; - - /** - * Decodes a FeeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feerefunder.FeeInfo; - - /** - * Verifies a FeeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeeInfo - */ - public static fromObject(object: { [k: string]: any }): neutron.feerefunder.FeeInfo; - - /** - * Creates a plain object from a FeeInfo message. Also converts values to other types if specified. - * @param message FeeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feerefunder.FeeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params min_fee */ - min_fee?: (neutron.feerefunder.IFee|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feerefunder.IParams); - - /** Params min_fee. */ - public min_fee?: (neutron.feerefunder.IFee|null); - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.feerefunder.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feerefunder.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.feerefunder.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feerefunder.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feerefunder.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feerefunder.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): neutron.feerefunder.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feerefunder.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: neutron.feerefunder.IQueryParamsRequest, callback: neutron.feerefunder.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: neutron.feerefunder.IQueryParamsRequest): Promise; - - /** - * Calls FeeInfo. - * @param request FeeInfoRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FeeInfoResponse - */ - public feeInfo(request: neutron.feerefunder.IFeeInfoRequest, callback: neutron.feerefunder.Query.FeeInfoCallback): void; - - /** - * Calls FeeInfo. - * @param request FeeInfoRequest message or plain object - * @returns Promise - */ - public feeInfo(request: neutron.feerefunder.IFeeInfoRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link neutron.feerefunder.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: neutron.feerefunder.QueryParamsResponse) => void; - - /** - * Callback as used by {@link neutron.feerefunder.Query#feeInfo}. - * @param error Error, if any - * @param [response] FeeInfoResponse - */ - type FeeInfoCallback = (error: (Error|null), response?: neutron.feerefunder.FeeInfoResponse) => void; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feerefunder.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.feerefunder.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feerefunder.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.feerefunder.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feerefunder.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feerefunder.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feerefunder.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.feerefunder.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feerefunder.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (neutron.feerefunder.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feerefunder.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (neutron.feerefunder.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.feerefunder.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feerefunder.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.feerefunder.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feerefunder.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feerefunder.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feerefunder.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.feerefunder.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feerefunder.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FeeInfoRequest. */ - interface IFeeInfoRequest { - - /** FeeInfoRequest channel_id */ - channel_id?: (string|null); - - /** FeeInfoRequest port_id */ - port_id?: (string|null); - - /** FeeInfoRequest sequence */ - sequence?: (Long|null); - } - - /** Represents a FeeInfoRequest. */ - class FeeInfoRequest implements IFeeInfoRequest { - - /** - * Constructs a new FeeInfoRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feerefunder.IFeeInfoRequest); - - /** FeeInfoRequest channel_id. */ - public channel_id: string; - - /** FeeInfoRequest port_id. */ - public port_id: string; - - /** FeeInfoRequest sequence. */ - public sequence: Long; - - /** - * Encodes the specified FeeInfoRequest message. Does not implicitly {@link neutron.feerefunder.FeeInfoRequest.verify|verify} messages. - * @param message FeeInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feerefunder.IFeeInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeeInfoRequest message, length delimited. Does not implicitly {@link neutron.feerefunder.FeeInfoRequest.verify|verify} messages. - * @param message FeeInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feerefunder.IFeeInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeeInfoRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeeInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feerefunder.FeeInfoRequest; - - /** - * Decodes a FeeInfoRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeeInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feerefunder.FeeInfoRequest; - - /** - * Verifies a FeeInfoRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeeInfoRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeeInfoRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.feerefunder.FeeInfoRequest; - - /** - * Creates a plain object from a FeeInfoRequest message. Also converts values to other types if specified. - * @param message FeeInfoRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feerefunder.FeeInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeeInfoRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FeeInfoResponse. */ - interface IFeeInfoResponse { - - /** FeeInfoResponse fee_info */ - fee_info?: (neutron.feerefunder.IFeeInfo|null); - } - - /** Represents a FeeInfoResponse. */ - class FeeInfoResponse implements IFeeInfoResponse { - - /** - * Constructs a new FeeInfoResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.feerefunder.IFeeInfoResponse); - - /** FeeInfoResponse fee_info. */ - public fee_info?: (neutron.feerefunder.IFeeInfo|null); - - /** - * Encodes the specified FeeInfoResponse message. Does not implicitly {@link neutron.feerefunder.FeeInfoResponse.verify|verify} messages. - * @param message FeeInfoResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.feerefunder.IFeeInfoResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeeInfoResponse message, length delimited. Does not implicitly {@link neutron.feerefunder.FeeInfoResponse.verify|verify} messages. - * @param message FeeInfoResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.feerefunder.IFeeInfoResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeeInfoResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeeInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.feerefunder.FeeInfoResponse; - - /** - * Decodes a FeeInfoResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeeInfoResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.feerefunder.FeeInfoResponse; - - /** - * Verifies a FeeInfoResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeeInfoResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeeInfoResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.feerefunder.FeeInfoResponse; - - /** - * Creates a plain object from a FeeInfoResponse message. Also converts values to other types if specified. - * @param message FeeInfoResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.feerefunder.FeeInfoResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeeInfoResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace interchainqueries. */ - namespace interchainqueries { - - /** Properties of a RegisteredQuery. */ - interface IRegisteredQuery { - - /** RegisteredQuery id */ - id?: (Long|null); - - /** RegisteredQuery owner */ - owner?: (string|null); - - /** RegisteredQuery query_type */ - query_type?: (string|null); - - /** RegisteredQuery keys */ - keys?: (neutron.interchainqueries.IKVKey[]|null); - - /** RegisteredQuery transactions_filter */ - transactions_filter?: (string|null); - - /** RegisteredQuery connection_id */ - connection_id?: (string|null); - - /** RegisteredQuery update_period */ - update_period?: (Long|null); - - /** RegisteredQuery last_submitted_result_local_height */ - last_submitted_result_local_height?: (Long|null); - - /** RegisteredQuery last_submitted_result_remote_height */ - last_submitted_result_remote_height?: (ibc.core.client.v1.IHeight|null); - - /** RegisteredQuery deposit */ - deposit?: (cosmos.base.v1beta1.ICoin[]|null); - - /** RegisteredQuery submit_timeout */ - submit_timeout?: (Long|null); - - /** RegisteredQuery registered_at_height */ - registered_at_height?: (Long|null); - } - - /** Represents a RegisteredQuery. */ - class RegisteredQuery implements IRegisteredQuery { - - /** - * Constructs a new RegisteredQuery. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IRegisteredQuery); - - /** RegisteredQuery id. */ - public id: Long; - - /** RegisteredQuery owner. */ - public owner: string; - - /** RegisteredQuery query_type. */ - public query_type: string; - - /** RegisteredQuery keys. */ - public keys: neutron.interchainqueries.IKVKey[]; - - /** RegisteredQuery transactions_filter. */ - public transactions_filter: string; - - /** RegisteredQuery connection_id. */ - public connection_id: string; - - /** RegisteredQuery update_period. */ - public update_period: Long; - - /** RegisteredQuery last_submitted_result_local_height. */ - public last_submitted_result_local_height: Long; - - /** RegisteredQuery last_submitted_result_remote_height. */ - public last_submitted_result_remote_height?: (ibc.core.client.v1.IHeight|null); - - /** RegisteredQuery deposit. */ - public deposit: cosmos.base.v1beta1.ICoin[]; - - /** RegisteredQuery submit_timeout. */ - public submit_timeout: Long; - - /** RegisteredQuery registered_at_height. */ - public registered_at_height: Long; - - /** - * Encodes the specified RegisteredQuery message. Does not implicitly {@link neutron.interchainqueries.RegisteredQuery.verify|verify} messages. - * @param message RegisteredQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IRegisteredQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RegisteredQuery message, length delimited. Does not implicitly {@link neutron.interchainqueries.RegisteredQuery.verify|verify} messages. - * @param message RegisteredQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IRegisteredQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RegisteredQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RegisteredQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.RegisteredQuery; - - /** - * Decodes a RegisteredQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RegisteredQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.RegisteredQuery; - - /** - * Verifies a RegisteredQuery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RegisteredQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RegisteredQuery - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.RegisteredQuery; - - /** - * Creates a plain object from a RegisteredQuery message. Also converts values to other types if specified. - * @param message RegisteredQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.RegisteredQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RegisteredQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a KVKey. */ - interface IKVKey { - - /** KVKey path */ - path?: (string|null); - - /** KVKey key */ - key?: (Uint8Array|null); - } - - /** Represents a KVKey. */ - class KVKey implements IKVKey { - - /** - * Constructs a new KVKey. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IKVKey); - - /** KVKey path. */ - public path: string; - - /** KVKey key. */ - public key: Uint8Array; - - /** - * Encodes the specified KVKey message. Does not implicitly {@link neutron.interchainqueries.KVKey.verify|verify} messages. - * @param message KVKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IKVKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KVKey message, length delimited. Does not implicitly {@link neutron.interchainqueries.KVKey.verify|verify} messages. - * @param message KVKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IKVKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KVKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KVKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.KVKey; - - /** - * Decodes a KVKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KVKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.KVKey; - - /** - * Verifies a KVKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KVKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KVKey - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.KVKey; - - /** - * Creates a plain object from a KVKey message. Also converts values to other types if specified. - * @param message KVKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.KVKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KVKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState params */ - params?: (neutron.interchainqueries.IParams|null); - - /** GenesisState registered_queries */ - registered_queries?: (neutron.interchainqueries.IRegisteredQuery[]|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IGenesisState); - - /** GenesisState params. */ - public params?: (neutron.interchainqueries.IParams|null); - - /** GenesisState registered_queries. */ - public registered_queries: neutron.interchainqueries.IRegisteredQuery[]; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.interchainqueries.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.interchainqueries.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params query_submit_timeout */ - query_submit_timeout?: (Long|null); - - /** Params query_deposit */ - query_deposit?: (cosmos.base.v1beta1.ICoin[]|null); - - /** Params tx_query_removal_limit */ - tx_query_removal_limit?: (Long|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IParams); - - /** Params query_submit_timeout. */ - public query_submit_timeout: Long; - - /** Params query_deposit. */ - public query_deposit: cosmos.base.v1beta1.ICoin[]; - - /** Params tx_query_removal_limit. */ - public tx_query_removal_limit: Long; - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.interchainqueries.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.interchainqueries.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls RegisterInterchainQuery. - * @param request MsgRegisterInterchainQuery message or plain object - * @param callback Node-style callback called with the error, if any, and MsgRegisterInterchainQueryResponse - */ - public registerInterchainQuery(request: neutron.interchainqueries.IMsgRegisterInterchainQuery, callback: neutron.interchainqueries.Msg.RegisterInterchainQueryCallback): void; - - /** - * Calls RegisterInterchainQuery. - * @param request MsgRegisterInterchainQuery message or plain object - * @returns Promise - */ - public registerInterchainQuery(request: neutron.interchainqueries.IMsgRegisterInterchainQuery): Promise; - - /** - * Calls SubmitQueryResult. - * @param request MsgSubmitQueryResult message or plain object - * @param callback Node-style callback called with the error, if any, and MsgSubmitQueryResultResponse - */ - public submitQueryResult(request: neutron.interchainqueries.IMsgSubmitQueryResult, callback: neutron.interchainqueries.Msg.SubmitQueryResultCallback): void; - - /** - * Calls SubmitQueryResult. - * @param request MsgSubmitQueryResult message or plain object - * @returns Promise - */ - public submitQueryResult(request: neutron.interchainqueries.IMsgSubmitQueryResult): Promise; - - /** - * Calls RemoveInterchainQuery. - * @param request MsgRemoveInterchainQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and MsgRemoveInterchainQueryResponse - */ - public removeInterchainQuery(request: neutron.interchainqueries.IMsgRemoveInterchainQueryRequest, callback: neutron.interchainqueries.Msg.RemoveInterchainQueryCallback): void; - - /** - * Calls RemoveInterchainQuery. - * @param request MsgRemoveInterchainQueryRequest message or plain object - * @returns Promise - */ - public removeInterchainQuery(request: neutron.interchainqueries.IMsgRemoveInterchainQueryRequest): Promise; - - /** - * Calls UpdateInterchainQuery. - * @param request MsgUpdateInterchainQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and MsgUpdateInterchainQueryResponse - */ - public updateInterchainQuery(request: neutron.interchainqueries.IMsgUpdateInterchainQueryRequest, callback: neutron.interchainqueries.Msg.UpdateInterchainQueryCallback): void; - - /** - * Calls UpdateInterchainQuery. - * @param request MsgUpdateInterchainQueryRequest message or plain object - * @returns Promise - */ - public updateInterchainQuery(request: neutron.interchainqueries.IMsgUpdateInterchainQueryRequest): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link neutron.interchainqueries.Msg#registerInterchainQuery}. - * @param error Error, if any - * @param [response] MsgRegisterInterchainQueryResponse - */ - type RegisterInterchainQueryCallback = (error: (Error|null), response?: neutron.interchainqueries.MsgRegisterInterchainQueryResponse) => void; - - /** - * Callback as used by {@link neutron.interchainqueries.Msg#submitQueryResult}. - * @param error Error, if any - * @param [response] MsgSubmitQueryResultResponse - */ - type SubmitQueryResultCallback = (error: (Error|null), response?: neutron.interchainqueries.MsgSubmitQueryResultResponse) => void; - - /** - * Callback as used by {@link neutron.interchainqueries.Msg#removeInterchainQuery}. - * @param error Error, if any - * @param [response] MsgRemoveInterchainQueryResponse - */ - type RemoveInterchainQueryCallback = (error: (Error|null), response?: neutron.interchainqueries.MsgRemoveInterchainQueryResponse) => void; - - /** - * Callback as used by {@link neutron.interchainqueries.Msg#updateInterchainQuery}. - * @param error Error, if any - * @param [response] MsgUpdateInterchainQueryResponse - */ - type UpdateInterchainQueryCallback = (error: (Error|null), response?: neutron.interchainqueries.MsgUpdateInterchainQueryResponse) => void; - } - - /** Properties of a MsgRegisterInterchainQuery. */ - interface IMsgRegisterInterchainQuery { - - /** MsgRegisterInterchainQuery query_type */ - query_type?: (string|null); - - /** MsgRegisterInterchainQuery keys */ - keys?: (neutron.interchainqueries.IKVKey[]|null); - - /** MsgRegisterInterchainQuery transactions_filter */ - transactions_filter?: (string|null); - - /** MsgRegisterInterchainQuery connection_id */ - connection_id?: (string|null); - - /** MsgRegisterInterchainQuery update_period */ - update_period?: (Long|null); - - /** MsgRegisterInterchainQuery sender */ - sender?: (string|null); - } - - /** Represents a MsgRegisterInterchainQuery. */ - class MsgRegisterInterchainQuery implements IMsgRegisterInterchainQuery { - - /** - * Constructs a new MsgRegisterInterchainQuery. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IMsgRegisterInterchainQuery); - - /** MsgRegisterInterchainQuery query_type. */ - public query_type: string; - - /** MsgRegisterInterchainQuery keys. */ - public keys: neutron.interchainqueries.IKVKey[]; - - /** MsgRegisterInterchainQuery transactions_filter. */ - public transactions_filter: string; - - /** MsgRegisterInterchainQuery connection_id. */ - public connection_id: string; - - /** MsgRegisterInterchainQuery update_period. */ - public update_period: Long; - - /** MsgRegisterInterchainQuery sender. */ - public sender: string; - - /** - * Encodes the specified MsgRegisterInterchainQuery message. Does not implicitly {@link neutron.interchainqueries.MsgRegisterInterchainQuery.verify|verify} messages. - * @param message MsgRegisterInterchainQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IMsgRegisterInterchainQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRegisterInterchainQuery message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgRegisterInterchainQuery.verify|verify} messages. - * @param message MsgRegisterInterchainQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IMsgRegisterInterchainQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRegisterInterchainQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRegisterInterchainQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.MsgRegisterInterchainQuery; - - /** - * Decodes a MsgRegisterInterchainQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRegisterInterchainQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.MsgRegisterInterchainQuery; - - /** - * Verifies a MsgRegisterInterchainQuery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRegisterInterchainQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRegisterInterchainQuery - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.MsgRegisterInterchainQuery; - - /** - * Creates a plain object from a MsgRegisterInterchainQuery message. Also converts values to other types if specified. - * @param message MsgRegisterInterchainQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.MsgRegisterInterchainQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRegisterInterchainQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgRegisterInterchainQueryResponse. */ - interface IMsgRegisterInterchainQueryResponse { - - /** MsgRegisterInterchainQueryResponse id */ - id?: (Long|null); - } - - /** Represents a MsgRegisterInterchainQueryResponse. */ - class MsgRegisterInterchainQueryResponse implements IMsgRegisterInterchainQueryResponse { - - /** - * Constructs a new MsgRegisterInterchainQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IMsgRegisterInterchainQueryResponse); - - /** MsgRegisterInterchainQueryResponse id. */ - public id: Long; - - /** - * Encodes the specified MsgRegisterInterchainQueryResponse message. Does not implicitly {@link neutron.interchainqueries.MsgRegisterInterchainQueryResponse.verify|verify} messages. - * @param message MsgRegisterInterchainQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IMsgRegisterInterchainQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRegisterInterchainQueryResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgRegisterInterchainQueryResponse.verify|verify} messages. - * @param message MsgRegisterInterchainQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IMsgRegisterInterchainQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRegisterInterchainQueryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRegisterInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.MsgRegisterInterchainQueryResponse; - - /** - * Decodes a MsgRegisterInterchainQueryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRegisterInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.MsgRegisterInterchainQueryResponse; - - /** - * Verifies a MsgRegisterInterchainQueryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRegisterInterchainQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRegisterInterchainQueryResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.MsgRegisterInterchainQueryResponse; - - /** - * Creates a plain object from a MsgRegisterInterchainQueryResponse message. Also converts values to other types if specified. - * @param message MsgRegisterInterchainQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.MsgRegisterInterchainQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRegisterInterchainQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitQueryResult. */ - interface IMsgSubmitQueryResult { - - /** MsgSubmitQueryResult query_id */ - query_id?: (Long|null); - - /** MsgSubmitQueryResult sender */ - sender?: (string|null); - - /** MsgSubmitQueryResult client_id */ - client_id?: (string|null); - - /** MsgSubmitQueryResult result */ - result?: (neutron.interchainqueries.IQueryResult|null); - } - - /** Represents a MsgSubmitQueryResult. */ - class MsgSubmitQueryResult implements IMsgSubmitQueryResult { - - /** - * Constructs a new MsgSubmitQueryResult. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IMsgSubmitQueryResult); - - /** MsgSubmitQueryResult query_id. */ - public query_id: Long; - - /** MsgSubmitQueryResult sender. */ - public sender: string; - - /** MsgSubmitQueryResult client_id. */ - public client_id: string; - - /** MsgSubmitQueryResult result. */ - public result?: (neutron.interchainqueries.IQueryResult|null); - - /** - * Encodes the specified MsgSubmitQueryResult message. Does not implicitly {@link neutron.interchainqueries.MsgSubmitQueryResult.verify|verify} messages. - * @param message MsgSubmitQueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IMsgSubmitQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitQueryResult message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgSubmitQueryResult.verify|verify} messages. - * @param message MsgSubmitQueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IMsgSubmitQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitQueryResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitQueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.MsgSubmitQueryResult; - - /** - * Decodes a MsgSubmitQueryResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitQueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.MsgSubmitQueryResult; - - /** - * Verifies a MsgSubmitQueryResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitQueryResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitQueryResult - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.MsgSubmitQueryResult; - - /** - * Creates a plain object from a MsgSubmitQueryResult message. Also converts values to other types if specified. - * @param message MsgSubmitQueryResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.MsgSubmitQueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitQueryResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryResult. */ - interface IQueryResult { - - /** QueryResult kv_results */ - kv_results?: (neutron.interchainqueries.IStorageValue[]|null); - - /** QueryResult block */ - block?: (neutron.interchainqueries.IBlock|null); - - /** QueryResult height */ - height?: (Long|null); - - /** QueryResult revision */ - revision?: (Long|null); - - /** QueryResult allow_kv_callbacks */ - allow_kv_callbacks?: (boolean|null); - } - - /** Represents a QueryResult. */ - class QueryResult implements IQueryResult { - - /** - * Constructs a new QueryResult. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryResult); - - /** QueryResult kv_results. */ - public kv_results: neutron.interchainqueries.IStorageValue[]; - - /** QueryResult block. */ - public block?: (neutron.interchainqueries.IBlock|null); - - /** QueryResult height. */ - public height: Long; - - /** QueryResult revision. */ - public revision: Long; - - /** QueryResult allow_kv_callbacks. */ - public allow_kv_callbacks: boolean; - - /** - * Encodes the specified QueryResult message. Does not implicitly {@link neutron.interchainqueries.QueryResult.verify|verify} messages. - * @param message QueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryResult.verify|verify} messages. - * @param message QueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryResult; - - /** - * Decodes a QueryResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryResult; - - /** - * Verifies a QueryResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryResult - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryResult; - - /** - * Creates a plain object from a QueryResult message. Also converts values to other types if specified. - * @param message QueryResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StorageValue. */ - interface IStorageValue { - - /** StorageValue storage_prefix */ - storage_prefix?: (string|null); - - /** StorageValue key */ - key?: (Uint8Array|null); - - /** StorageValue value */ - value?: (Uint8Array|null); - - /** StorageValue Proof */ - Proof?: (tendermint.crypto.IProofOps|null); - } - - /** Represents a StorageValue. */ - class StorageValue implements IStorageValue { - - /** - * Constructs a new StorageValue. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IStorageValue); - - /** StorageValue storage_prefix. */ - public storage_prefix: string; - - /** StorageValue key. */ - public key: Uint8Array; - - /** StorageValue value. */ - public value: Uint8Array; - - /** StorageValue Proof. */ - public Proof?: (tendermint.crypto.IProofOps|null); - - /** - * Encodes the specified StorageValue message. Does not implicitly {@link neutron.interchainqueries.StorageValue.verify|verify} messages. - * @param message StorageValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IStorageValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StorageValue message, length delimited. Does not implicitly {@link neutron.interchainqueries.StorageValue.verify|verify} messages. - * @param message StorageValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IStorageValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StorageValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StorageValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.StorageValue; - - /** - * Decodes a StorageValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StorageValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.StorageValue; - - /** - * Verifies a StorageValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StorageValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StorageValue - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.StorageValue; - - /** - * Creates a plain object from a StorageValue message. Also converts values to other types if specified. - * @param message StorageValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.StorageValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StorageValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Block. */ - interface IBlock { - - /** Block next_block_header */ - next_block_header?: (google.protobuf.IAny|null); - - /** Block header */ - header?: (google.protobuf.IAny|null); - - /** Block tx */ - tx?: (neutron.interchainqueries.ITxValue|null); - } - - /** Represents a Block. */ - class Block implements IBlock { - - /** - * Constructs a new Block. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IBlock); - - /** Block next_block_header. */ - public next_block_header?: (google.protobuf.IAny|null); - - /** Block header. */ - public header?: (google.protobuf.IAny|null); - - /** Block tx. */ - public tx?: (neutron.interchainqueries.ITxValue|null); - - /** - * Encodes the specified Block message. Does not implicitly {@link neutron.interchainqueries.Block.verify|verify} messages. - * @param message Block message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Block message, length delimited. Does not implicitly {@link neutron.interchainqueries.Block.verify|verify} messages. - * @param message Block message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Block message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Block - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.Block; - - /** - * Decodes a Block message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Block - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.Block; - - /** - * Verifies a Block message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Block message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Block - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.Block; - - /** - * Creates a plain object from a Block message. Also converts values to other types if specified. - * @param message Block - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.Block, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Block to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TxValue. */ - interface ITxValue { - - /** TxValue response */ - response?: (tendermint.abci.IResponseDeliverTx|null); - - /** TxValue delivery_proof */ - delivery_proof?: (tendermint.crypto.IProof|null); - - /** TxValue inclusion_proof */ - inclusion_proof?: (tendermint.crypto.IProof|null); - - /** TxValue data */ - data?: (Uint8Array|null); - } - - /** Represents a TxValue. */ - class TxValue implements ITxValue { - - /** - * Constructs a new TxValue. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.ITxValue); - - /** TxValue response. */ - public response?: (tendermint.abci.IResponseDeliverTx|null); - - /** TxValue delivery_proof. */ - public delivery_proof?: (tendermint.crypto.IProof|null); - - /** TxValue inclusion_proof. */ - public inclusion_proof?: (tendermint.crypto.IProof|null); - - /** TxValue data. */ - public data: Uint8Array; - - /** - * Encodes the specified TxValue message. Does not implicitly {@link neutron.interchainqueries.TxValue.verify|verify} messages. - * @param message TxValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.ITxValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TxValue message, length delimited. Does not implicitly {@link neutron.interchainqueries.TxValue.verify|verify} messages. - * @param message TxValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.ITxValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TxValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.TxValue; - - /** - * Decodes a TxValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TxValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.TxValue; - - /** - * Verifies a TxValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TxValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TxValue - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.TxValue; - - /** - * Creates a plain object from a TxValue message. Also converts values to other types if specified. - * @param message TxValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.TxValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TxValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitQueryResultResponse. */ - interface IMsgSubmitQueryResultResponse { - } - - /** Represents a MsgSubmitQueryResultResponse. */ - class MsgSubmitQueryResultResponse implements IMsgSubmitQueryResultResponse { - - /** - * Constructs a new MsgSubmitQueryResultResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IMsgSubmitQueryResultResponse); - - /** - * Encodes the specified MsgSubmitQueryResultResponse message. Does not implicitly {@link neutron.interchainqueries.MsgSubmitQueryResultResponse.verify|verify} messages. - * @param message MsgSubmitQueryResultResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IMsgSubmitQueryResultResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitQueryResultResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgSubmitQueryResultResponse.verify|verify} messages. - * @param message MsgSubmitQueryResultResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IMsgSubmitQueryResultResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitQueryResultResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitQueryResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.MsgSubmitQueryResultResponse; - - /** - * Decodes a MsgSubmitQueryResultResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitQueryResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.MsgSubmitQueryResultResponse; - - /** - * Verifies a MsgSubmitQueryResultResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitQueryResultResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitQueryResultResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.MsgSubmitQueryResultResponse; - - /** - * Creates a plain object from a MsgSubmitQueryResultResponse message. Also converts values to other types if specified. - * @param message MsgSubmitQueryResultResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.MsgSubmitQueryResultResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitQueryResultResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgRemoveInterchainQueryRequest. */ - interface IMsgRemoveInterchainQueryRequest { - - /** MsgRemoveInterchainQueryRequest query_id */ - query_id?: (Long|null); - - /** MsgRemoveInterchainQueryRequest sender */ - sender?: (string|null); - } - - /** Represents a MsgRemoveInterchainQueryRequest. */ - class MsgRemoveInterchainQueryRequest implements IMsgRemoveInterchainQueryRequest { - - /** - * Constructs a new MsgRemoveInterchainQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IMsgRemoveInterchainQueryRequest); - - /** MsgRemoveInterchainQueryRequest query_id. */ - public query_id: Long; - - /** MsgRemoveInterchainQueryRequest sender. */ - public sender: string; - - /** - * Encodes the specified MsgRemoveInterchainQueryRequest message. Does not implicitly {@link neutron.interchainqueries.MsgRemoveInterchainQueryRequest.verify|verify} messages. - * @param message MsgRemoveInterchainQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IMsgRemoveInterchainQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRemoveInterchainQueryRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgRemoveInterchainQueryRequest.verify|verify} messages. - * @param message MsgRemoveInterchainQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IMsgRemoveInterchainQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRemoveInterchainQueryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRemoveInterchainQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.MsgRemoveInterchainQueryRequest; - - /** - * Decodes a MsgRemoveInterchainQueryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRemoveInterchainQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.MsgRemoveInterchainQueryRequest; - - /** - * Verifies a MsgRemoveInterchainQueryRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRemoveInterchainQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRemoveInterchainQueryRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.MsgRemoveInterchainQueryRequest; - - /** - * Creates a plain object from a MsgRemoveInterchainQueryRequest message. Also converts values to other types if specified. - * @param message MsgRemoveInterchainQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.MsgRemoveInterchainQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRemoveInterchainQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgRemoveInterchainQueryResponse. */ - interface IMsgRemoveInterchainQueryResponse { - } - - /** Represents a MsgRemoveInterchainQueryResponse. */ - class MsgRemoveInterchainQueryResponse implements IMsgRemoveInterchainQueryResponse { - - /** - * Constructs a new MsgRemoveInterchainQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IMsgRemoveInterchainQueryResponse); - - /** - * Encodes the specified MsgRemoveInterchainQueryResponse message. Does not implicitly {@link neutron.interchainqueries.MsgRemoveInterchainQueryResponse.verify|verify} messages. - * @param message MsgRemoveInterchainQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IMsgRemoveInterchainQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRemoveInterchainQueryResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgRemoveInterchainQueryResponse.verify|verify} messages. - * @param message MsgRemoveInterchainQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IMsgRemoveInterchainQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRemoveInterchainQueryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRemoveInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.MsgRemoveInterchainQueryResponse; - - /** - * Decodes a MsgRemoveInterchainQueryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRemoveInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.MsgRemoveInterchainQueryResponse; - - /** - * Verifies a MsgRemoveInterchainQueryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRemoveInterchainQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRemoveInterchainQueryResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.MsgRemoveInterchainQueryResponse; - - /** - * Creates a plain object from a MsgRemoveInterchainQueryResponse message. Also converts values to other types if specified. - * @param message MsgRemoveInterchainQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.MsgRemoveInterchainQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRemoveInterchainQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgUpdateInterchainQueryRequest. */ - interface IMsgUpdateInterchainQueryRequest { - - /** MsgUpdateInterchainQueryRequest query_id */ - query_id?: (Long|null); - - /** MsgUpdateInterchainQueryRequest new_keys */ - new_keys?: (neutron.interchainqueries.IKVKey[]|null); - - /** MsgUpdateInterchainQueryRequest new_update_period */ - new_update_period?: (Long|null); - - /** MsgUpdateInterchainQueryRequest new_transactions_filter */ - new_transactions_filter?: (string|null); - - /** MsgUpdateInterchainQueryRequest sender */ - sender?: (string|null); - } - - /** Represents a MsgUpdateInterchainQueryRequest. */ - class MsgUpdateInterchainQueryRequest implements IMsgUpdateInterchainQueryRequest { - - /** - * Constructs a new MsgUpdateInterchainQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IMsgUpdateInterchainQueryRequest); - - /** MsgUpdateInterchainQueryRequest query_id. */ - public query_id: Long; - - /** MsgUpdateInterchainQueryRequest new_keys. */ - public new_keys: neutron.interchainqueries.IKVKey[]; - - /** MsgUpdateInterchainQueryRequest new_update_period. */ - public new_update_period: Long; - - /** MsgUpdateInterchainQueryRequest new_transactions_filter. */ - public new_transactions_filter: string; - - /** MsgUpdateInterchainQueryRequest sender. */ - public sender: string; - - /** - * Encodes the specified MsgUpdateInterchainQueryRequest message. Does not implicitly {@link neutron.interchainqueries.MsgUpdateInterchainQueryRequest.verify|verify} messages. - * @param message MsgUpdateInterchainQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IMsgUpdateInterchainQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgUpdateInterchainQueryRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgUpdateInterchainQueryRequest.verify|verify} messages. - * @param message MsgUpdateInterchainQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IMsgUpdateInterchainQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgUpdateInterchainQueryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgUpdateInterchainQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.MsgUpdateInterchainQueryRequest; - - /** - * Decodes a MsgUpdateInterchainQueryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgUpdateInterchainQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.MsgUpdateInterchainQueryRequest; - - /** - * Verifies a MsgUpdateInterchainQueryRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgUpdateInterchainQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgUpdateInterchainQueryRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.MsgUpdateInterchainQueryRequest; - - /** - * Creates a plain object from a MsgUpdateInterchainQueryRequest message. Also converts values to other types if specified. - * @param message MsgUpdateInterchainQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.MsgUpdateInterchainQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgUpdateInterchainQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgUpdateInterchainQueryResponse. */ - interface IMsgUpdateInterchainQueryResponse { - } - - /** Represents a MsgUpdateInterchainQueryResponse. */ - class MsgUpdateInterchainQueryResponse implements IMsgUpdateInterchainQueryResponse { - - /** - * Constructs a new MsgUpdateInterchainQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IMsgUpdateInterchainQueryResponse); - - /** - * Encodes the specified MsgUpdateInterchainQueryResponse message. Does not implicitly {@link neutron.interchainqueries.MsgUpdateInterchainQueryResponse.verify|verify} messages. - * @param message MsgUpdateInterchainQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IMsgUpdateInterchainQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgUpdateInterchainQueryResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.MsgUpdateInterchainQueryResponse.verify|verify} messages. - * @param message MsgUpdateInterchainQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IMsgUpdateInterchainQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgUpdateInterchainQueryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgUpdateInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.MsgUpdateInterchainQueryResponse; - - /** - * Decodes a MsgUpdateInterchainQueryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgUpdateInterchainQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.MsgUpdateInterchainQueryResponse; - - /** - * Verifies a MsgUpdateInterchainQueryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgUpdateInterchainQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgUpdateInterchainQueryResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.MsgUpdateInterchainQueryResponse; - - /** - * Creates a plain object from a MsgUpdateInterchainQueryResponse message. Also converts values to other types if specified. - * @param message MsgUpdateInterchainQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.MsgUpdateInterchainQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgUpdateInterchainQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: neutron.interchainqueries.IQueryParamsRequest, callback: neutron.interchainqueries.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: neutron.interchainqueries.IQueryParamsRequest): Promise; - - /** - * Calls RegisteredQueries. - * @param request QueryRegisteredQueriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryRegisteredQueriesResponse - */ - public registeredQueries(request: neutron.interchainqueries.IQueryRegisteredQueriesRequest, callback: neutron.interchainqueries.Query.RegisteredQueriesCallback): void; - - /** - * Calls RegisteredQueries. - * @param request QueryRegisteredQueriesRequest message or plain object - * @returns Promise - */ - public registeredQueries(request: neutron.interchainqueries.IQueryRegisteredQueriesRequest): Promise; - - /** - * Calls RegisteredQuery. - * @param request QueryRegisteredQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryRegisteredQueryResponse - */ - public registeredQuery(request: neutron.interchainqueries.IQueryRegisteredQueryRequest, callback: neutron.interchainqueries.Query.RegisteredQueryCallback): void; - - /** - * Calls RegisteredQuery. - * @param request QueryRegisteredQueryRequest message or plain object - * @returns Promise - */ - public registeredQuery(request: neutron.interchainqueries.IQueryRegisteredQueryRequest): Promise; - - /** - * Calls QueryResult. - * @param request QueryRegisteredQueryResultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryRegisteredQueryResultResponse - */ - public queryResult(request: neutron.interchainqueries.IQueryRegisteredQueryResultRequest, callback: neutron.interchainqueries.Query.QueryResultCallback): void; - - /** - * Calls QueryResult. - * @param request QueryRegisteredQueryResultRequest message or plain object - * @returns Promise - */ - public queryResult(request: neutron.interchainqueries.IQueryRegisteredQueryResultRequest): Promise; - - /** - * Calls LastRemoteHeight. - * @param request QueryLastRemoteHeight message or plain object - * @param callback Node-style callback called with the error, if any, and QueryLastRemoteHeightResponse - */ - public lastRemoteHeight(request: neutron.interchainqueries.IQueryLastRemoteHeight, callback: neutron.interchainqueries.Query.LastRemoteHeightCallback): void; - - /** - * Calls LastRemoteHeight. - * @param request QueryLastRemoteHeight message or plain object - * @returns Promise - */ - public lastRemoteHeight(request: neutron.interchainqueries.IQueryLastRemoteHeight): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link neutron.interchainqueries.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: neutron.interchainqueries.QueryParamsResponse) => void; - - /** - * Callback as used by {@link neutron.interchainqueries.Query#registeredQueries}. - * @param error Error, if any - * @param [response] QueryRegisteredQueriesResponse - */ - type RegisteredQueriesCallback = (error: (Error|null), response?: neutron.interchainqueries.QueryRegisteredQueriesResponse) => void; - - /** - * Callback as used by {@link neutron.interchainqueries.Query#registeredQuery}. - * @param error Error, if any - * @param [response] QueryRegisteredQueryResponse - */ - type RegisteredQueryCallback = (error: (Error|null), response?: neutron.interchainqueries.QueryRegisteredQueryResponse) => void; - - /** - * Callback as used by {@link neutron.interchainqueries.Query#queryResult}. - * @param error Error, if any - * @param [response] QueryRegisteredQueryResultResponse - */ - type QueryResultCallback = (error: (Error|null), response?: neutron.interchainqueries.QueryRegisteredQueryResultResponse) => void; - - /** - * Callback as used by {@link neutron.interchainqueries.Query#lastRemoteHeight}. - * @param error Error, if any - * @param [response] QueryLastRemoteHeightResponse - */ - type LastRemoteHeightCallback = (error: (Error|null), response?: neutron.interchainqueries.QueryLastRemoteHeightResponse) => void; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.interchainqueries.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (neutron.interchainqueries.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (neutron.interchainqueries.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.interchainqueries.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryRegisteredQueriesRequest. */ - interface IQueryRegisteredQueriesRequest { - - /** QueryRegisteredQueriesRequest owners */ - owners?: (string[]|null); - - /** QueryRegisteredQueriesRequest connection_id */ - connection_id?: (string|null); - - /** QueryRegisteredQueriesRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryRegisteredQueriesRequest. */ - class QueryRegisteredQueriesRequest implements IQueryRegisteredQueriesRequest { - - /** - * Constructs a new QueryRegisteredQueriesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryRegisteredQueriesRequest); - - /** QueryRegisteredQueriesRequest owners. */ - public owners: string[]; - - /** QueryRegisteredQueriesRequest connection_id. */ - public connection_id: string; - - /** QueryRegisteredQueriesRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryRegisteredQueriesRequest message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueriesRequest.verify|verify} messages. - * @param message QueryRegisteredQueriesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryRegisteredQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryRegisteredQueriesRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueriesRequest.verify|verify} messages. - * @param message QueryRegisteredQueriesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryRegisteredQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryRegisteredQueriesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryRegisteredQueriesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryRegisteredQueriesRequest; - - /** - * Decodes a QueryRegisteredQueriesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryRegisteredQueriesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryRegisteredQueriesRequest; - - /** - * Verifies a QueryRegisteredQueriesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryRegisteredQueriesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryRegisteredQueriesRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryRegisteredQueriesRequest; - - /** - * Creates a plain object from a QueryRegisteredQueriesRequest message. Also converts values to other types if specified. - * @param message QueryRegisteredQueriesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryRegisteredQueriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryRegisteredQueriesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryRegisteredQueriesResponse. */ - interface IQueryRegisteredQueriesResponse { - - /** QueryRegisteredQueriesResponse registered_queries */ - registered_queries?: (neutron.interchainqueries.IRegisteredQuery[]|null); - - /** QueryRegisteredQueriesResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - } - - /** Represents a QueryRegisteredQueriesResponse. */ - class QueryRegisteredQueriesResponse implements IQueryRegisteredQueriesResponse { - - /** - * Constructs a new QueryRegisteredQueriesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryRegisteredQueriesResponse); - - /** QueryRegisteredQueriesResponse registered_queries. */ - public registered_queries: neutron.interchainqueries.IRegisteredQuery[]; - - /** QueryRegisteredQueriesResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** - * Encodes the specified QueryRegisteredQueriesResponse message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueriesResponse.verify|verify} messages. - * @param message QueryRegisteredQueriesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryRegisteredQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryRegisteredQueriesResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueriesResponse.verify|verify} messages. - * @param message QueryRegisteredQueriesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryRegisteredQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryRegisteredQueriesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryRegisteredQueriesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryRegisteredQueriesResponse; - - /** - * Decodes a QueryRegisteredQueriesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryRegisteredQueriesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryRegisteredQueriesResponse; - - /** - * Verifies a QueryRegisteredQueriesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryRegisteredQueriesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryRegisteredQueriesResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryRegisteredQueriesResponse; - - /** - * Creates a plain object from a QueryRegisteredQueriesResponse message. Also converts values to other types if specified. - * @param message QueryRegisteredQueriesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryRegisteredQueriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryRegisteredQueriesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryRegisteredQueryRequest. */ - interface IQueryRegisteredQueryRequest { - - /** QueryRegisteredQueryRequest query_id */ - query_id?: (Long|null); - } - - /** Represents a QueryRegisteredQueryRequest. */ - class QueryRegisteredQueryRequest implements IQueryRegisteredQueryRequest { - - /** - * Constructs a new QueryRegisteredQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryRegisteredQueryRequest); - - /** QueryRegisteredQueryRequest query_id. */ - public query_id: Long; - - /** - * Encodes the specified QueryRegisteredQueryRequest message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryRequest.verify|verify} messages. - * @param message QueryRegisteredQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryRegisteredQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryRegisteredQueryRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryRequest.verify|verify} messages. - * @param message QueryRegisteredQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryRegisteredQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryRegisteredQueryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryRegisteredQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryRegisteredQueryRequest; - - /** - * Decodes a QueryRegisteredQueryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryRegisteredQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryRegisteredQueryRequest; - - /** - * Verifies a QueryRegisteredQueryRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryRegisteredQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryRegisteredQueryRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryRegisteredQueryRequest; - - /** - * Creates a plain object from a QueryRegisteredQueryRequest message. Also converts values to other types if specified. - * @param message QueryRegisteredQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryRegisteredQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryRegisteredQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryRegisteredQueryResponse. */ - interface IQueryRegisteredQueryResponse { - - /** QueryRegisteredQueryResponse registered_query */ - registered_query?: (neutron.interchainqueries.IRegisteredQuery|null); - } - - /** Represents a QueryRegisteredQueryResponse. */ - class QueryRegisteredQueryResponse implements IQueryRegisteredQueryResponse { - - /** - * Constructs a new QueryRegisteredQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryRegisteredQueryResponse); - - /** QueryRegisteredQueryResponse registered_query. */ - public registered_query?: (neutron.interchainqueries.IRegisteredQuery|null); - - /** - * Encodes the specified QueryRegisteredQueryResponse message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResponse.verify|verify} messages. - * @param message QueryRegisteredQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryRegisteredQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryRegisteredQueryResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResponse.verify|verify} messages. - * @param message QueryRegisteredQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryRegisteredQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryRegisteredQueryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryRegisteredQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryRegisteredQueryResponse; - - /** - * Decodes a QueryRegisteredQueryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryRegisteredQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryRegisteredQueryResponse; - - /** - * Verifies a QueryRegisteredQueryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryRegisteredQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryRegisteredQueryResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryRegisteredQueryResponse; - - /** - * Creates a plain object from a QueryRegisteredQueryResponse message. Also converts values to other types if specified. - * @param message QueryRegisteredQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryRegisteredQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryRegisteredQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryRegisteredQueryResultRequest. */ - interface IQueryRegisteredQueryResultRequest { - - /** QueryRegisteredQueryResultRequest query_id */ - query_id?: (Long|null); - } - - /** Represents a QueryRegisteredQueryResultRequest. */ - class QueryRegisteredQueryResultRequest implements IQueryRegisteredQueryResultRequest { - - /** - * Constructs a new QueryRegisteredQueryResultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryRegisteredQueryResultRequest); - - /** QueryRegisteredQueryResultRequest query_id. */ - public query_id: Long; - - /** - * Encodes the specified QueryRegisteredQueryResultRequest message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResultRequest.verify|verify} messages. - * @param message QueryRegisteredQueryResultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryRegisteredQueryResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryRegisteredQueryResultRequest message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResultRequest.verify|verify} messages. - * @param message QueryRegisteredQueryResultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryRegisteredQueryResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryRegisteredQueryResultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryRegisteredQueryResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryRegisteredQueryResultRequest; - - /** - * Decodes a QueryRegisteredQueryResultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryRegisteredQueryResultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryRegisteredQueryResultRequest; - - /** - * Verifies a QueryRegisteredQueryResultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryRegisteredQueryResultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryRegisteredQueryResultRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryRegisteredQueryResultRequest; - - /** - * Creates a plain object from a QueryRegisteredQueryResultRequest message. Also converts values to other types if specified. - * @param message QueryRegisteredQueryResultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryRegisteredQueryResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryRegisteredQueryResultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryRegisteredQueryResultResponse. */ - interface IQueryRegisteredQueryResultResponse { - - /** QueryRegisteredQueryResultResponse result */ - result?: (neutron.interchainqueries.IQueryResult|null); - } - - /** Represents a QueryRegisteredQueryResultResponse. */ - class QueryRegisteredQueryResultResponse implements IQueryRegisteredQueryResultResponse { - - /** - * Constructs a new QueryRegisteredQueryResultResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryRegisteredQueryResultResponse); - - /** QueryRegisteredQueryResultResponse result. */ - public result?: (neutron.interchainqueries.IQueryResult|null); - - /** - * Encodes the specified QueryRegisteredQueryResultResponse message. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResultResponse.verify|verify} messages. - * @param message QueryRegisteredQueryResultResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryRegisteredQueryResultResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryRegisteredQueryResultResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryRegisteredQueryResultResponse.verify|verify} messages. - * @param message QueryRegisteredQueryResultResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryRegisteredQueryResultResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryRegisteredQueryResultResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryRegisteredQueryResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryRegisteredQueryResultResponse; - - /** - * Decodes a QueryRegisteredQueryResultResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryRegisteredQueryResultResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryRegisteredQueryResultResponse; - - /** - * Verifies a QueryRegisteredQueryResultResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryRegisteredQueryResultResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryRegisteredQueryResultResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryRegisteredQueryResultResponse; - - /** - * Creates a plain object from a QueryRegisteredQueryResultResponse message. Also converts values to other types if specified. - * @param message QueryRegisteredQueryResultResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryRegisteredQueryResultResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryRegisteredQueryResultResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Transaction. */ - interface ITransaction { - - /** Transaction id */ - id?: (Long|null); - - /** Transaction height */ - height?: (Long|null); - - /** Transaction data */ - data?: (Uint8Array|null); - } - - /** Represents a Transaction. */ - class Transaction implements ITransaction { - - /** - * Constructs a new Transaction. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.ITransaction); - - /** Transaction id. */ - public id: Long; - - /** Transaction height. */ - public height: Long; - - /** Transaction data. */ - public data: Uint8Array; - - /** - * Encodes the specified Transaction message. Does not implicitly {@link neutron.interchainqueries.Transaction.verify|verify} messages. - * @param message Transaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Transaction message, length delimited. Does not implicitly {@link neutron.interchainqueries.Transaction.verify|verify} messages. - * @param message Transaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.ITransaction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Transaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.Transaction; - - /** - * Decodes a Transaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Transaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.Transaction; - - /** - * Verifies a Transaction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Transaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Transaction - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.Transaction; - - /** - * Creates a plain object from a Transaction message. Also converts values to other types if specified. - * @param message Transaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.Transaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Transaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryLastRemoteHeight. */ - interface IQueryLastRemoteHeight { - - /** QueryLastRemoteHeight connection_id */ - connection_id?: (string|null); - } - - /** Represents a QueryLastRemoteHeight. */ - class QueryLastRemoteHeight implements IQueryLastRemoteHeight { - - /** - * Constructs a new QueryLastRemoteHeight. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryLastRemoteHeight); - - /** QueryLastRemoteHeight connection_id. */ - public connection_id: string; - - /** - * Encodes the specified QueryLastRemoteHeight message. Does not implicitly {@link neutron.interchainqueries.QueryLastRemoteHeight.verify|verify} messages. - * @param message QueryLastRemoteHeight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryLastRemoteHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryLastRemoteHeight message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryLastRemoteHeight.verify|verify} messages. - * @param message QueryLastRemoteHeight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryLastRemoteHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryLastRemoteHeight message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryLastRemoteHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryLastRemoteHeight; - - /** - * Decodes a QueryLastRemoteHeight message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryLastRemoteHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryLastRemoteHeight; - - /** - * Verifies a QueryLastRemoteHeight message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryLastRemoteHeight message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryLastRemoteHeight - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryLastRemoteHeight; - - /** - * Creates a plain object from a QueryLastRemoteHeight message. Also converts values to other types if specified. - * @param message QueryLastRemoteHeight - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryLastRemoteHeight, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryLastRemoteHeight to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryLastRemoteHeightResponse. */ - interface IQueryLastRemoteHeightResponse { - - /** QueryLastRemoteHeightResponse height */ - height?: (Long|null); - } - - /** Represents a QueryLastRemoteHeightResponse. */ - class QueryLastRemoteHeightResponse implements IQueryLastRemoteHeightResponse { - - /** - * Constructs a new QueryLastRemoteHeightResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchainqueries.IQueryLastRemoteHeightResponse); - - /** QueryLastRemoteHeightResponse height. */ - public height: Long; - - /** - * Encodes the specified QueryLastRemoteHeightResponse message. Does not implicitly {@link neutron.interchainqueries.QueryLastRemoteHeightResponse.verify|verify} messages. - * @param message QueryLastRemoteHeightResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchainqueries.IQueryLastRemoteHeightResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryLastRemoteHeightResponse message, length delimited. Does not implicitly {@link neutron.interchainqueries.QueryLastRemoteHeightResponse.verify|verify} messages. - * @param message QueryLastRemoteHeightResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchainqueries.IQueryLastRemoteHeightResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryLastRemoteHeightResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryLastRemoteHeightResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchainqueries.QueryLastRemoteHeightResponse; - - /** - * Decodes a QueryLastRemoteHeightResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryLastRemoteHeightResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchainqueries.QueryLastRemoteHeightResponse; - - /** - * Verifies a QueryLastRemoteHeightResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryLastRemoteHeightResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryLastRemoteHeightResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchainqueries.QueryLastRemoteHeightResponse; - - /** - * Creates a plain object from a QueryLastRemoteHeightResponse message. Also converts values to other types if specified. - * @param message QueryLastRemoteHeightResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchainqueries.QueryLastRemoteHeightResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryLastRemoteHeightResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace interchaintxs. */ - namespace interchaintxs { - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState params */ - params?: (neutron.interchaintxs.IParams|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.IGenesisState); - - /** GenesisState params. */ - public params?: (neutron.interchaintxs.IParams|null); - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link neutron.interchaintxs.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link neutron.interchaintxs.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params msg_submit_tx_max_messages */ - msg_submit_tx_max_messages?: (Long|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.IParams); - - /** Params msg_submit_tx_max_messages. */ - public msg_submit_tx_max_messages: Long; - - /** - * Encodes the specified Params message. Does not implicitly {@link neutron.interchaintxs.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link neutron.interchaintxs.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Namespace v1. */ - namespace v1 { - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls RegisterInterchainAccount. - * @param request MsgRegisterInterchainAccount message or plain object - * @param callback Node-style callback called with the error, if any, and MsgRegisterInterchainAccountResponse - */ - public registerInterchainAccount(request: neutron.interchaintxs.v1.IMsgRegisterInterchainAccount, callback: neutron.interchaintxs.v1.Msg.RegisterInterchainAccountCallback): void; - - /** - * Calls RegisterInterchainAccount. - * @param request MsgRegisterInterchainAccount message or plain object - * @returns Promise - */ - public registerInterchainAccount(request: neutron.interchaintxs.v1.IMsgRegisterInterchainAccount): Promise; - - /** - * Calls SubmitTx. - * @param request MsgSubmitTx message or plain object - * @param callback Node-style callback called with the error, if any, and MsgSubmitTxResponse - */ - public submitTx(request: neutron.interchaintxs.v1.IMsgSubmitTx, callback: neutron.interchaintxs.v1.Msg.SubmitTxCallback): void; - - /** - * Calls SubmitTx. - * @param request MsgSubmitTx message or plain object - * @returns Promise - */ - public submitTx(request: neutron.interchaintxs.v1.IMsgSubmitTx): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link neutron.interchaintxs.v1.Msg#registerInterchainAccount}. - * @param error Error, if any - * @param [response] MsgRegisterInterchainAccountResponse - */ - type RegisterInterchainAccountCallback = (error: (Error|null), response?: neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse) => void; - - /** - * Callback as used by {@link neutron.interchaintxs.v1.Msg#submitTx}. - * @param error Error, if any - * @param [response] MsgSubmitTxResponse - */ - type SubmitTxCallback = (error: (Error|null), response?: neutron.interchaintxs.v1.MsgSubmitTxResponse) => void; - } - - /** Properties of a MsgRegisterInterchainAccount. */ - interface IMsgRegisterInterchainAccount { - - /** MsgRegisterInterchainAccount from_address */ - from_address?: (string|null); - - /** MsgRegisterInterchainAccount connection_id */ - connection_id?: (string|null); - - /** MsgRegisterInterchainAccount interchain_account_id */ - interchain_account_id?: (string|null); - } - - /** Represents a MsgRegisterInterchainAccount. */ - class MsgRegisterInterchainAccount implements IMsgRegisterInterchainAccount { - - /** - * Constructs a new MsgRegisterInterchainAccount. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.v1.IMsgRegisterInterchainAccount); - - /** MsgRegisterInterchainAccount from_address. */ - public from_address: string; - - /** MsgRegisterInterchainAccount connection_id. */ - public connection_id: string; - - /** MsgRegisterInterchainAccount interchain_account_id. */ - public interchain_account_id: string; - - /** - * Encodes the specified MsgRegisterInterchainAccount message. Does not implicitly {@link neutron.interchaintxs.v1.MsgRegisterInterchainAccount.verify|verify} messages. - * @param message MsgRegisterInterchainAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.v1.IMsgRegisterInterchainAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRegisterInterchainAccount message, length delimited. Does not implicitly {@link neutron.interchaintxs.v1.MsgRegisterInterchainAccount.verify|verify} messages. - * @param message MsgRegisterInterchainAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.v1.IMsgRegisterInterchainAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRegisterInterchainAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRegisterInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.v1.MsgRegisterInterchainAccount; - - /** - * Decodes a MsgRegisterInterchainAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRegisterInterchainAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.v1.MsgRegisterInterchainAccount; - - /** - * Verifies a MsgRegisterInterchainAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRegisterInterchainAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRegisterInterchainAccount - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.v1.MsgRegisterInterchainAccount; - - /** - * Creates a plain object from a MsgRegisterInterchainAccount message. Also converts values to other types if specified. - * @param message MsgRegisterInterchainAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.v1.MsgRegisterInterchainAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRegisterInterchainAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgRegisterInterchainAccountResponse. */ - interface IMsgRegisterInterchainAccountResponse { - } - - /** Represents a MsgRegisterInterchainAccountResponse. */ - class MsgRegisterInterchainAccountResponse implements IMsgRegisterInterchainAccountResponse { - - /** - * Constructs a new MsgRegisterInterchainAccountResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.v1.IMsgRegisterInterchainAccountResponse); - - /** - * Encodes the specified MsgRegisterInterchainAccountResponse message. Does not implicitly {@link neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse.verify|verify} messages. - * @param message MsgRegisterInterchainAccountResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.v1.IMsgRegisterInterchainAccountResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgRegisterInterchainAccountResponse message, length delimited. Does not implicitly {@link neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse.verify|verify} messages. - * @param message MsgRegisterInterchainAccountResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.v1.IMsgRegisterInterchainAccountResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgRegisterInterchainAccountResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgRegisterInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse; - - /** - * Decodes a MsgRegisterInterchainAccountResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgRegisterInterchainAccountResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse; - - /** - * Verifies a MsgRegisterInterchainAccountResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgRegisterInterchainAccountResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgRegisterInterchainAccountResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse; - - /** - * Creates a plain object from a MsgRegisterInterchainAccountResponse message. Also converts values to other types if specified. - * @param message MsgRegisterInterchainAccountResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.v1.MsgRegisterInterchainAccountResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgRegisterInterchainAccountResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitTx. */ - interface IMsgSubmitTx { - - /** MsgSubmitTx from_address */ - from_address?: (string|null); - - /** MsgSubmitTx interchain_account_id */ - interchain_account_id?: (string|null); - - /** MsgSubmitTx connection_id */ - connection_id?: (string|null); - - /** MsgSubmitTx msgs */ - msgs?: (google.protobuf.IAny[]|null); - - /** MsgSubmitTx memo */ - memo?: (string|null); - - /** MsgSubmitTx timeout */ - timeout?: (Long|null); - - /** MsgSubmitTx fee */ - fee?: (neutron.feerefunder.IFee|null); - } - - /** Represents a MsgSubmitTx. */ - class MsgSubmitTx implements IMsgSubmitTx { - - /** - * Constructs a new MsgSubmitTx. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.v1.IMsgSubmitTx); - - /** MsgSubmitTx from_address. */ - public from_address: string; - - /** MsgSubmitTx interchain_account_id. */ - public interchain_account_id: string; - - /** MsgSubmitTx connection_id. */ - public connection_id: string; - - /** MsgSubmitTx msgs. */ - public msgs: google.protobuf.IAny[]; - - /** MsgSubmitTx memo. */ - public memo: string; - - /** MsgSubmitTx timeout. */ - public timeout: Long; - - /** MsgSubmitTx fee. */ - public fee?: (neutron.feerefunder.IFee|null); - - /** - * Encodes the specified MsgSubmitTx message. Does not implicitly {@link neutron.interchaintxs.v1.MsgSubmitTx.verify|verify} messages. - * @param message MsgSubmitTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.v1.IMsgSubmitTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitTx message, length delimited. Does not implicitly {@link neutron.interchaintxs.v1.MsgSubmitTx.verify|verify} messages. - * @param message MsgSubmitTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.v1.IMsgSubmitTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.v1.MsgSubmitTx; - - /** - * Decodes a MsgSubmitTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.v1.MsgSubmitTx; - - /** - * Verifies a MsgSubmitTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitTx - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.v1.MsgSubmitTx; - - /** - * Creates a plain object from a MsgSubmitTx message. Also converts values to other types if specified. - * @param message MsgSubmitTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.v1.MsgSubmitTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgSubmitTxResponse. */ - interface IMsgSubmitTxResponse { - - /** MsgSubmitTxResponse sequence_id */ - sequence_id?: (Long|null); - - /** MsgSubmitTxResponse channel */ - channel?: (string|null); - } - - /** Represents a MsgSubmitTxResponse. */ - class MsgSubmitTxResponse implements IMsgSubmitTxResponse { - - /** - * Constructs a new MsgSubmitTxResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.v1.IMsgSubmitTxResponse); - - /** MsgSubmitTxResponse sequence_id. */ - public sequence_id: Long; - - /** MsgSubmitTxResponse channel. */ - public channel: string; - - /** - * Encodes the specified MsgSubmitTxResponse message. Does not implicitly {@link neutron.interchaintxs.v1.MsgSubmitTxResponse.verify|verify} messages. - * @param message MsgSubmitTxResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.v1.IMsgSubmitTxResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSubmitTxResponse message, length delimited. Does not implicitly {@link neutron.interchaintxs.v1.MsgSubmitTxResponse.verify|verify} messages. - * @param message MsgSubmitTxResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.v1.IMsgSubmitTxResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSubmitTxResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSubmitTxResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.v1.MsgSubmitTxResponse; - - /** - * Decodes a MsgSubmitTxResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSubmitTxResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.v1.MsgSubmitTxResponse; - - /** - * Verifies a MsgSubmitTxResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSubmitTxResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSubmitTxResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.v1.MsgSubmitTxResponse; - - /** - * Creates a plain object from a MsgSubmitTxResponse message. Also converts values to other types if specified. - * @param message MsgSubmitTxResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.v1.MsgSubmitTxResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSubmitTxResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: neutron.interchaintxs.IQueryParamsRequest, callback: neutron.interchaintxs.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: neutron.interchaintxs.IQueryParamsRequest): Promise; - - /** - * Calls InterchainAccountAddress. - * @param request QueryInterchainAccountAddressRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryInterchainAccountAddressResponse - */ - public interchainAccountAddress(request: neutron.interchaintxs.IQueryInterchainAccountAddressRequest, callback: neutron.interchaintxs.Query.InterchainAccountAddressCallback): void; - - /** - * Calls InterchainAccountAddress. - * @param request QueryInterchainAccountAddressRequest message or plain object - * @returns Promise - */ - public interchainAccountAddress(request: neutron.interchaintxs.IQueryInterchainAccountAddressRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link neutron.interchaintxs.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: neutron.interchaintxs.QueryParamsResponse) => void; - - /** - * Callback as used by {@link neutron.interchaintxs.Query#interchainAccountAddress}. - * @param error Error, if any - * @param [response] QueryInterchainAccountAddressResponse - */ - type InterchainAccountAddressCallback = (error: (Error|null), response?: neutron.interchaintxs.QueryInterchainAccountAddressResponse) => void; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link neutron.interchaintxs.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link neutron.interchaintxs.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (neutron.interchaintxs.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (neutron.interchaintxs.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link neutron.interchaintxs.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link neutron.interchaintxs.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryInterchainAccountAddressRequest. */ - interface IQueryInterchainAccountAddressRequest { - - /** QueryInterchainAccountAddressRequest owner_address */ - owner_address?: (string|null); - - /** QueryInterchainAccountAddressRequest interchain_account_id */ - interchain_account_id?: (string|null); - - /** QueryInterchainAccountAddressRequest connection_id */ - connection_id?: (string|null); - } - - /** Represents a QueryInterchainAccountAddressRequest. */ - class QueryInterchainAccountAddressRequest implements IQueryInterchainAccountAddressRequest { - - /** - * Constructs a new QueryInterchainAccountAddressRequest. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.IQueryInterchainAccountAddressRequest); - - /** QueryInterchainAccountAddressRequest owner_address. */ - public owner_address: string; - - /** QueryInterchainAccountAddressRequest interchain_account_id. */ - public interchain_account_id: string; - - /** QueryInterchainAccountAddressRequest connection_id. */ - public connection_id: string; - - /** - * Encodes the specified QueryInterchainAccountAddressRequest message. Does not implicitly {@link neutron.interchaintxs.QueryInterchainAccountAddressRequest.verify|verify} messages. - * @param message QueryInterchainAccountAddressRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.IQueryInterchainAccountAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryInterchainAccountAddressRequest message, length delimited. Does not implicitly {@link neutron.interchaintxs.QueryInterchainAccountAddressRequest.verify|verify} messages. - * @param message QueryInterchainAccountAddressRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.IQueryInterchainAccountAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryInterchainAccountAddressRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryInterchainAccountAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.QueryInterchainAccountAddressRequest; - - /** - * Decodes a QueryInterchainAccountAddressRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryInterchainAccountAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.QueryInterchainAccountAddressRequest; - - /** - * Verifies a QueryInterchainAccountAddressRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryInterchainAccountAddressRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryInterchainAccountAddressRequest - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.QueryInterchainAccountAddressRequest; - - /** - * Creates a plain object from a QueryInterchainAccountAddressRequest message. Also converts values to other types if specified. - * @param message QueryInterchainAccountAddressRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.QueryInterchainAccountAddressRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryInterchainAccountAddressRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryInterchainAccountAddressResponse. */ - interface IQueryInterchainAccountAddressResponse { - - /** QueryInterchainAccountAddressResponse interchain_account_address */ - interchain_account_address?: (string|null); - } - - /** Represents a QueryInterchainAccountAddressResponse. */ - class QueryInterchainAccountAddressResponse implements IQueryInterchainAccountAddressResponse { - - /** - * Constructs a new QueryInterchainAccountAddressResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.interchaintxs.IQueryInterchainAccountAddressResponse); - - /** QueryInterchainAccountAddressResponse interchain_account_address. */ - public interchain_account_address: string; - - /** - * Encodes the specified QueryInterchainAccountAddressResponse message. Does not implicitly {@link neutron.interchaintxs.QueryInterchainAccountAddressResponse.verify|verify} messages. - * @param message QueryInterchainAccountAddressResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.interchaintxs.IQueryInterchainAccountAddressResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryInterchainAccountAddressResponse message, length delimited. Does not implicitly {@link neutron.interchaintxs.QueryInterchainAccountAddressResponse.verify|verify} messages. - * @param message QueryInterchainAccountAddressResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.interchaintxs.IQueryInterchainAccountAddressResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryInterchainAccountAddressResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryInterchainAccountAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.interchaintxs.QueryInterchainAccountAddressResponse; - - /** - * Decodes a QueryInterchainAccountAddressResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryInterchainAccountAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.interchaintxs.QueryInterchainAccountAddressResponse; - - /** - * Verifies a QueryInterchainAccountAddressResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryInterchainAccountAddressResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryInterchainAccountAddressResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.interchaintxs.QueryInterchainAccountAddressResponse; - - /** - * Creates a plain object from a QueryInterchainAccountAddressResponse message. Also converts values to other types if specified. - * @param message QueryInterchainAccountAddressResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.interchaintxs.QueryInterchainAccountAddressResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryInterchainAccountAddressResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace transfer. */ - namespace transfer { - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Transfer. - * @param request MsgTransfer message or plain object - * @param callback Node-style callback called with the error, if any, and MsgTransferResponse - */ - public transfer(request: neutron.transfer.IMsgTransfer, callback: neutron.transfer.Msg.TransferCallback): void; - - /** - * Calls Transfer. - * @param request MsgTransfer message or plain object - * @returns Promise - */ - public transfer(request: neutron.transfer.IMsgTransfer): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link neutron.transfer.Msg#transfer}. - * @param error Error, if any - * @param [response] MsgTransferResponse - */ - type TransferCallback = (error: (Error|null), response?: neutron.transfer.MsgTransferResponse) => void; - } - - /** Properties of a MsgTransfer. */ - interface IMsgTransfer { - - /** MsgTransfer source_port */ - source_port?: (string|null); - - /** MsgTransfer source_channel */ - source_channel?: (string|null); - - /** MsgTransfer token */ - token?: (cosmos.base.v1beta1.ICoin|null); - - /** MsgTransfer sender */ - sender?: (string|null); - - /** MsgTransfer receiver */ - receiver?: (string|null); - - /** MsgTransfer timeout_height */ - timeout_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgTransfer timeout_timestamp */ - timeout_timestamp?: (Long|null); - - /** MsgTransfer memo */ - memo?: (string|null); - - /** MsgTransfer fee */ - fee?: (neutron.feerefunder.IFee|null); - } - - /** Represents a MsgTransfer. */ - class MsgTransfer implements IMsgTransfer { - - /** - * Constructs a new MsgTransfer. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.transfer.IMsgTransfer); - - /** MsgTransfer source_port. */ - public source_port: string; - - /** MsgTransfer source_channel. */ - public source_channel: string; - - /** MsgTransfer token. */ - public token?: (cosmos.base.v1beta1.ICoin|null); - - /** MsgTransfer sender. */ - public sender: string; - - /** MsgTransfer receiver. */ - public receiver: string; - - /** MsgTransfer timeout_height. */ - public timeout_height?: (ibc.core.client.v1.IHeight|null); - - /** MsgTransfer timeout_timestamp. */ - public timeout_timestamp: Long; - - /** MsgTransfer memo. */ - public memo: string; - - /** MsgTransfer fee. */ - public fee?: (neutron.feerefunder.IFee|null); - - /** - * Encodes the specified MsgTransfer message. Does not implicitly {@link neutron.transfer.MsgTransfer.verify|verify} messages. - * @param message MsgTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.transfer.IMsgTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgTransfer message, length delimited. Does not implicitly {@link neutron.transfer.MsgTransfer.verify|verify} messages. - * @param message MsgTransfer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.transfer.IMsgTransfer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.transfer.MsgTransfer; - - /** - * Decodes a MsgTransfer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgTransfer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.transfer.MsgTransfer; - - /** - * Verifies a MsgTransfer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgTransfer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgTransfer - */ - public static fromObject(object: { [k: string]: any }): neutron.transfer.MsgTransfer; - - /** - * Creates a plain object from a MsgTransfer message. Also converts values to other types if specified. - * @param message MsgTransfer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.transfer.MsgTransfer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgTransfer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgTransferResponse. */ - interface IMsgTransferResponse { - - /** MsgTransferResponse sequence_id */ - sequence_id?: (Long|null); - - /** MsgTransferResponse channel */ - channel?: (string|null); - } - - /** Represents a MsgTransferResponse. */ - class MsgTransferResponse implements IMsgTransferResponse { - - /** - * Constructs a new MsgTransferResponse. - * @param [properties] Properties to set - */ - constructor(properties?: neutron.transfer.IMsgTransferResponse); - - /** MsgTransferResponse sequence_id. */ - public sequence_id: Long; - - /** MsgTransferResponse channel. */ - public channel: string; - - /** - * Encodes the specified MsgTransferResponse message. Does not implicitly {@link neutron.transfer.MsgTransferResponse.verify|verify} messages. - * @param message MsgTransferResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: neutron.transfer.IMsgTransferResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgTransferResponse message, length delimited. Does not implicitly {@link neutron.transfer.MsgTransferResponse.verify|verify} messages. - * @param message MsgTransferResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: neutron.transfer.IMsgTransferResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): neutron.transfer.MsgTransferResponse; - - /** - * Decodes a MsgTransferResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgTransferResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): neutron.transfer.MsgTransferResponse; - - /** - * Verifies a MsgTransferResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgTransferResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgTransferResponse - */ - public static fromObject(object: { [k: string]: any }): neutron.transfer.MsgTransferResponse; - - /** - * Creates a plain object from a MsgTransferResponse message. Also converts values to other types if specified. - * @param message MsgTransferResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: neutron.transfer.MsgTransferResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgTransferResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls DenomTrace. - * @param request QueryDenomTraceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomTraceResponse - */ - public denomTrace(request: ibc.applications.transfer.v1.IQueryDenomTraceRequest, callback: neutron.transfer.Query.DenomTraceCallback): void; - - /** - * Calls DenomTrace. - * @param request QueryDenomTraceRequest message or plain object - * @returns Promise - */ - public denomTrace(request: ibc.applications.transfer.v1.IQueryDenomTraceRequest): Promise; - - /** - * Calls DenomTraces. - * @param request QueryDenomTracesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomTracesResponse - */ - public denomTraces(request: ibc.applications.transfer.v1.IQueryDenomTracesRequest, callback: neutron.transfer.Query.DenomTracesCallback): void; - - /** - * Calls DenomTraces. - * @param request QueryDenomTracesRequest message or plain object - * @returns Promise - */ - public denomTraces(request: ibc.applications.transfer.v1.IQueryDenomTracesRequest): Promise; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: ibc.applications.transfer.v1.IQueryParamsRequest, callback: neutron.transfer.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: ibc.applications.transfer.v1.IQueryParamsRequest): Promise; - - /** - * Calls DenomHash. - * @param request QueryDenomHashRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomHashResponse - */ - public denomHash(request: ibc.applications.transfer.v1.IQueryDenomHashRequest, callback: neutron.transfer.Query.DenomHashCallback): void; - - /** - * Calls DenomHash. - * @param request QueryDenomHashRequest message or plain object - * @returns Promise - */ - public denomHash(request: ibc.applications.transfer.v1.IQueryDenomHashRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link neutron.transfer.Query#denomTrace}. - * @param error Error, if any - * @param [response] QueryDenomTraceResponse - */ - type DenomTraceCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryDenomTraceResponse) => void; - - /** - * Callback as used by {@link neutron.transfer.Query#denomTraces}. - * @param error Error, if any - * @param [response] QueryDenomTracesResponse - */ - type DenomTracesCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryDenomTracesResponse) => void; - - /** - * Callback as used by {@link neutron.transfer.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryParamsResponse) => void; - - /** - * Callback as used by {@link neutron.transfer.Query#denomHash}. - * @param error Error, if any - * @param [response] QueryDenomHashResponse - */ - type DenomHashCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryDenomHashResponse) => void; - } - } -} - -/** Namespace cosmos. */ -export namespace cosmos { - - /** Namespace base. */ - namespace base { - - /** Namespace query. */ - namespace query { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a PageRequest. */ - interface IPageRequest { - - /** PageRequest key */ - key?: (Uint8Array|null); - - /** PageRequest offset */ - offset?: (Long|null); - - /** PageRequest limit */ - limit?: (Long|null); - - /** PageRequest count_total */ - count_total?: (boolean|null); - - /** PageRequest reverse */ - reverse?: (boolean|null); - } - - /** Represents a PageRequest. */ - class PageRequest implements IPageRequest { - - /** - * Constructs a new PageRequest. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.query.v1beta1.IPageRequest); - - /** PageRequest key. */ - public key: Uint8Array; - - /** PageRequest offset. */ - public offset: Long; - - /** PageRequest limit. */ - public limit: Long; - - /** PageRequest count_total. */ - public count_total: boolean; - - /** PageRequest reverse. */ - public reverse: boolean; - - /** - * Encodes the specified PageRequest message. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @param message PageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.query.v1beta1.IPageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PageRequest message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageRequest.verify|verify} messages. - * @param message PageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.query.v1beta1.IPageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PageRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.query.v1beta1.PageRequest; - - /** - * Decodes a PageRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.query.v1beta1.PageRequest; - - /** - * Verifies a PageRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PageRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PageRequest - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.query.v1beta1.PageRequest; - - /** - * Creates a plain object from a PageRequest message. Also converts values to other types if specified. - * @param message PageRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.query.v1beta1.PageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PageRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PageResponse. */ - interface IPageResponse { - - /** PageResponse next_key */ - next_key?: (Uint8Array|null); - - /** PageResponse total */ - total?: (Long|null); - } - - /** Represents a PageResponse. */ - class PageResponse implements IPageResponse { - - /** - * Constructs a new PageResponse. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.query.v1beta1.IPageResponse); - - /** PageResponse next_key. */ - public next_key: Uint8Array; - - /** PageResponse total. */ - public total: Long; - - /** - * Encodes the specified PageResponse message. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @param message PageResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.query.v1beta1.IPageResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PageResponse message, length delimited. Does not implicitly {@link cosmos.base.query.v1beta1.PageResponse.verify|verify} messages. - * @param message PageResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.query.v1beta1.IPageResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PageResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.query.v1beta1.PageResponse; - - /** - * Decodes a PageResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PageResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.query.v1beta1.PageResponse; - - /** - * Verifies a PageResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PageResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PageResponse - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.query.v1beta1.PageResponse; - - /** - * Creates a plain object from a PageResponse message. Also converts values to other types if specified. - * @param message PageResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.query.v1beta1.PageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PageResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a Coin. */ - interface ICoin { - - /** Coin denom */ - denom?: (string|null); - - /** Coin amount */ - amount?: (string|null); - } - - /** Represents a Coin. */ - class Coin implements ICoin { - - /** - * Constructs a new Coin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.ICoin); - - /** Coin denom. */ - public denom: string; - - /** Coin amount. */ - public amount: string; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.Coin; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.Coin; - - /** - * Verifies a Coin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Coin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.Coin; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @param message Coin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Coin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecCoin. */ - interface IDecCoin { - - /** DecCoin denom */ - denom?: (string|null); - - /** DecCoin amount */ - amount?: (string|null); - } - - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - - /** - * Constructs a new DecCoin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecCoin; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecCoin; - - /** - * Verifies a DecCoin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecCoin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecCoin; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @param message DecCoin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecCoin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecCoin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IntProto. */ - interface IIntProto { - - /** IntProto int */ - int?: (string|null); - } - - /** Represents an IntProto. */ - class IntProto implements IIntProto { - - /** - * Constructs a new IntProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.IntProto; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.IntProto; - - /** - * Verifies an IntProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.IntProto; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @param message IntProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.IntProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecProto. */ - interface IDecProto { - - /** DecProto dec */ - dec?: (string|null); - } - - /** Represents a DecProto. */ - class DecProto implements IDecProto { - - /** - * Constructs a new DecProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecProto; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecProto; - - /** - * Verifies a DecProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecProto; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @param message DecProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Namespace upgrade. */ - namespace upgrade { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a Plan. */ - interface IPlan { - - /** Plan name */ - name?: (string|null); - - /** Plan time */ - time?: (google.protobuf.ITimestamp|null); - - /** Plan height */ - height?: (Long|null); - - /** Plan info */ - info?: (string|null); - - /** Plan upgraded_client_state */ - upgraded_client_state?: (google.protobuf.IAny|null); - } - - /** Represents a Plan. */ - class Plan implements IPlan { - - /** - * Constructs a new Plan. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.upgrade.v1beta1.IPlan); - - /** Plan name. */ - public name: string; - - /** Plan time. */ - public time?: (google.protobuf.ITimestamp|null); - - /** Plan height. */ - public height: Long; - - /** Plan info. */ - public info: string; - - /** Plan upgraded_client_state. */ - public upgraded_client_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified Plan message. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @param message Plan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.upgrade.v1beta1.IPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Plan message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.Plan.verify|verify} messages. - * @param message Plan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.upgrade.v1beta1.IPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Plan message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.upgrade.v1beta1.Plan; - - /** - * Decodes a Plan message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Plan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.upgrade.v1beta1.Plan; - - /** - * Verifies a Plan message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Plan message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Plan - */ - public static fromObject(object: { [k: string]: any }): cosmos.upgrade.v1beta1.Plan; - - /** - * Creates a plain object from a Plan message. Also converts values to other types if specified. - * @param message Plan - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.upgrade.v1beta1.Plan, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Plan to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SoftwareUpgradeProposal. */ - interface ISoftwareUpgradeProposal { - - /** SoftwareUpgradeProposal title */ - title?: (string|null); - - /** SoftwareUpgradeProposal description */ - description?: (string|null); - - /** SoftwareUpgradeProposal plan */ - plan?: (cosmos.upgrade.v1beta1.IPlan|null); - } - - /** Represents a SoftwareUpgradeProposal. */ - class SoftwareUpgradeProposal implements ISoftwareUpgradeProposal { - - /** - * Constructs a new SoftwareUpgradeProposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal); - - /** SoftwareUpgradeProposal title. */ - public title: string; - - /** SoftwareUpgradeProposal description. */ - public description: string; - - /** SoftwareUpgradeProposal plan. */ - public plan?: (cosmos.upgrade.v1beta1.IPlan|null); - - /** - * Encodes the specified SoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @param message SoftwareUpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.SoftwareUpgradeProposal.verify|verify} messages. - * @param message SoftwareUpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.upgrade.v1beta1.ISoftwareUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.upgrade.v1beta1.SoftwareUpgradeProposal; - - /** - * Decodes a SoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.upgrade.v1beta1.SoftwareUpgradeProposal; - - /** - * Verifies a SoftwareUpgradeProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SoftwareUpgradeProposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.upgrade.v1beta1.SoftwareUpgradeProposal; - - /** - * Creates a plain object from a SoftwareUpgradeProposal message. Also converts values to other types if specified. - * @param message SoftwareUpgradeProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.upgrade.v1beta1.SoftwareUpgradeProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SoftwareUpgradeProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CancelSoftwareUpgradeProposal. */ - interface ICancelSoftwareUpgradeProposal { - - /** CancelSoftwareUpgradeProposal title */ - title?: (string|null); - - /** CancelSoftwareUpgradeProposal description */ - description?: (string|null); - } - - /** Represents a CancelSoftwareUpgradeProposal. */ - class CancelSoftwareUpgradeProposal implements ICancelSoftwareUpgradeProposal { - - /** - * Constructs a new CancelSoftwareUpgradeProposal. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal); - - /** CancelSoftwareUpgradeProposal title. */ - public title: string; - - /** CancelSoftwareUpgradeProposal description. */ - public description: string; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @param message CancelSoftwareUpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelSoftwareUpgradeProposal message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal.verify|verify} messages. - * @param message CancelSoftwareUpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.upgrade.v1beta1.ICancelSoftwareUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal; - - /** - * Decodes a CancelSoftwareUpgradeProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelSoftwareUpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal; - - /** - * Verifies a CancelSoftwareUpgradeProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelSoftwareUpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelSoftwareUpgradeProposal - */ - public static fromObject(object: { [k: string]: any }): cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal; - - /** - * Creates a plain object from a CancelSoftwareUpgradeProposal message. Also converts values to other types if specified. - * @param message CancelSoftwareUpgradeProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelSoftwareUpgradeProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ModuleVersion. */ - interface IModuleVersion { - - /** ModuleVersion name */ - name?: (string|null); - - /** ModuleVersion version */ - version?: (Long|null); - } - - /** Represents a ModuleVersion. */ - class ModuleVersion implements IModuleVersion { - - /** - * Constructs a new ModuleVersion. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.upgrade.v1beta1.IModuleVersion); - - /** ModuleVersion name. */ - public name: string; - - /** ModuleVersion version. */ - public version: Long; - - /** - * Encodes the specified ModuleVersion message. Does not implicitly {@link cosmos.upgrade.v1beta1.ModuleVersion.verify|verify} messages. - * @param message ModuleVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.upgrade.v1beta1.IModuleVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ModuleVersion message, length delimited. Does not implicitly {@link cosmos.upgrade.v1beta1.ModuleVersion.verify|verify} messages. - * @param message ModuleVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.upgrade.v1beta1.IModuleVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ModuleVersion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ModuleVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.upgrade.v1beta1.ModuleVersion; - - /** - * Decodes a ModuleVersion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ModuleVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.upgrade.v1beta1.ModuleVersion; - - /** - * Verifies a ModuleVersion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ModuleVersion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ModuleVersion - */ - public static fromObject(object: { [k: string]: any }): cosmos.upgrade.v1beta1.ModuleVersion; - - /** - * Creates a plain object from a ModuleVersion message. Also converts values to other types if specified. - * @param message ModuleVersion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.upgrade.v1beta1.ModuleVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ModuleVersion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } -} - -/** Namespace ibc. */ -export namespace ibc { - - /** Namespace core. */ - namespace core { - - /** Namespace client. */ - namespace client { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of an IdentifiedClientState. */ - interface IIdentifiedClientState { - - /** IdentifiedClientState client_id */ - client_id?: (string|null); - - /** IdentifiedClientState client_state */ - client_state?: (google.protobuf.IAny|null); - } - - /** Represents an IdentifiedClientState. */ - class IdentifiedClientState implements IIdentifiedClientState { - - /** - * Constructs a new IdentifiedClientState. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IIdentifiedClientState); - - /** IdentifiedClientState client_id. */ - public client_id: string; - - /** IdentifiedClientState client_state. */ - public client_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified IdentifiedClientState message. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @param message IdentifiedClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IIdentifiedClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IdentifiedClientState message, length delimited. Does not implicitly {@link ibc.core.client.v1.IdentifiedClientState.verify|verify} messages. - * @param message IdentifiedClientState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IIdentifiedClientState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.IdentifiedClientState; - - /** - * Decodes an IdentifiedClientState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentifiedClientState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.IdentifiedClientState; - - /** - * Verifies an IdentifiedClientState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IdentifiedClientState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentifiedClientState - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.IdentifiedClientState; - - /** - * Creates a plain object from an IdentifiedClientState message. Also converts values to other types if specified. - * @param message IdentifiedClientState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.IdentifiedClientState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IdentifiedClientState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConsensusStateWithHeight. */ - interface IConsensusStateWithHeight { - - /** ConsensusStateWithHeight height */ - height?: (ibc.core.client.v1.IHeight|null); - - /** ConsensusStateWithHeight consensus_state */ - consensus_state?: (google.protobuf.IAny|null); - } - - /** Represents a ConsensusStateWithHeight. */ - class ConsensusStateWithHeight implements IConsensusStateWithHeight { - - /** - * Constructs a new ConsensusStateWithHeight. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IConsensusStateWithHeight); - - /** ConsensusStateWithHeight height. */ - public height?: (ibc.core.client.v1.IHeight|null); - - /** ConsensusStateWithHeight consensus_state. */ - public consensus_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified ConsensusStateWithHeight message. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @param message ConsensusStateWithHeight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IConsensusStateWithHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsensusStateWithHeight message, length delimited. Does not implicitly {@link ibc.core.client.v1.ConsensusStateWithHeight.verify|verify} messages. - * @param message ConsensusStateWithHeight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IConsensusStateWithHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.ConsensusStateWithHeight; - - /** - * Decodes a ConsensusStateWithHeight message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsensusStateWithHeight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.ConsensusStateWithHeight; - - /** - * Verifies a ConsensusStateWithHeight message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsensusStateWithHeight message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsensusStateWithHeight - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.ConsensusStateWithHeight; - - /** - * Creates a plain object from a ConsensusStateWithHeight message. Also converts values to other types if specified. - * @param message ConsensusStateWithHeight - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.ConsensusStateWithHeight, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsensusStateWithHeight to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ClientConsensusStates. */ - interface IClientConsensusStates { - - /** ClientConsensusStates client_id */ - client_id?: (string|null); - - /** ClientConsensusStates consensus_states */ - consensus_states?: (ibc.core.client.v1.IConsensusStateWithHeight[]|null); - } - - /** Represents a ClientConsensusStates. */ - class ClientConsensusStates implements IClientConsensusStates { - - /** - * Constructs a new ClientConsensusStates. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IClientConsensusStates); - - /** ClientConsensusStates client_id. */ - public client_id: string; - - /** ClientConsensusStates consensus_states. */ - public consensus_states: ibc.core.client.v1.IConsensusStateWithHeight[]; - - /** - * Encodes the specified ClientConsensusStates message. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @param message ClientConsensusStates message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IClientConsensusStates, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientConsensusStates message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientConsensusStates.verify|verify} messages. - * @param message ClientConsensusStates message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IClientConsensusStates, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.ClientConsensusStates; - - /** - * Decodes a ClientConsensusStates message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientConsensusStates - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.ClientConsensusStates; - - /** - * Verifies a ClientConsensusStates message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientConsensusStates message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientConsensusStates - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.ClientConsensusStates; - - /** - * Creates a plain object from a ClientConsensusStates message. Also converts values to other types if specified. - * @param message ClientConsensusStates - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.ClientConsensusStates, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientConsensusStates to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ClientUpdateProposal. */ - interface IClientUpdateProposal { - - /** ClientUpdateProposal title */ - title?: (string|null); - - /** ClientUpdateProposal description */ - description?: (string|null); - - /** ClientUpdateProposal subject_client_id */ - subject_client_id?: (string|null); - - /** ClientUpdateProposal substitute_client_id */ - substitute_client_id?: (string|null); - } - - /** Represents a ClientUpdateProposal. */ - class ClientUpdateProposal implements IClientUpdateProposal { - - /** - * Constructs a new ClientUpdateProposal. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IClientUpdateProposal); - - /** ClientUpdateProposal title. */ - public title: string; - - /** ClientUpdateProposal description. */ - public description: string; - - /** ClientUpdateProposal subject_client_id. */ - public subject_client_id: string; - - /** ClientUpdateProposal substitute_client_id. */ - public substitute_client_id: string; - - /** - * Encodes the specified ClientUpdateProposal message. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @param message ClientUpdateProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IClientUpdateProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientUpdateProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.ClientUpdateProposal.verify|verify} messages. - * @param message ClientUpdateProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IClientUpdateProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.ClientUpdateProposal; - - /** - * Decodes a ClientUpdateProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientUpdateProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.ClientUpdateProposal; - - /** - * Verifies a ClientUpdateProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientUpdateProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientUpdateProposal - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.ClientUpdateProposal; - - /** - * Creates a plain object from a ClientUpdateProposal message. Also converts values to other types if specified. - * @param message ClientUpdateProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.ClientUpdateProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientUpdateProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpgradeProposal. */ - interface IUpgradeProposal { - - /** UpgradeProposal title */ - title?: (string|null); - - /** UpgradeProposal description */ - description?: (string|null); - - /** UpgradeProposal plan */ - plan?: (cosmos.upgrade.v1beta1.IPlan|null); - - /** UpgradeProposal upgraded_client_state */ - upgraded_client_state?: (google.protobuf.IAny|null); - } - - /** Represents an UpgradeProposal. */ - class UpgradeProposal implements IUpgradeProposal { - - /** - * Constructs a new UpgradeProposal. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IUpgradeProposal); - - /** UpgradeProposal title. */ - public title: string; - - /** UpgradeProposal description. */ - public description: string; - - /** UpgradeProposal plan. */ - public plan?: (cosmos.upgrade.v1beta1.IPlan|null); - - /** UpgradeProposal upgraded_client_state. */ - public upgraded_client_state?: (google.protobuf.IAny|null); - - /** - * Encodes the specified UpgradeProposal message. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @param message UpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpgradeProposal message, length delimited. Does not implicitly {@link ibc.core.client.v1.UpgradeProposal.verify|verify} messages. - * @param message UpgradeProposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IUpgradeProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.UpgradeProposal; - - /** - * Decodes an UpgradeProposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpgradeProposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.UpgradeProposal; - - /** - * Verifies an UpgradeProposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpgradeProposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpgradeProposal - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.UpgradeProposal; - - /** - * Creates a plain object from an UpgradeProposal message. Also converts values to other types if specified. - * @param message UpgradeProposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.UpgradeProposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpgradeProposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Height. */ - interface IHeight { - - /** Height revision_number */ - revision_number?: (Long|null); - - /** Height revision_height */ - revision_height?: (Long|null); - } - - /** Represents an Height. */ - class Height implements IHeight { - - /** - * Constructs a new Height. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IHeight); - - /** Height revision_number. */ - public revision_number: Long; - - /** Height revision_height. */ - public revision_height: Long; - - /** - * Encodes the specified Height message. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @param message Height message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Height message, length delimited. Does not implicitly {@link ibc.core.client.v1.Height.verify|verify} messages. - * @param message Height message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IHeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Height message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.Height; - - /** - * Decodes an Height message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Height - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.Height; - - /** - * Verifies an Height message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Height message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Height - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.Height; - - /** - * Creates a plain object from an Height message. Also converts values to other types if specified. - * @param message Height - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.Height, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Height to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params allowed_clients */ - allowed_clients?: (string[]|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.core.client.v1.IParams); - - /** Params allowed_clients. */ - public allowed_clients: string[]; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.core.client.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.core.client.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.core.client.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.core.client.v1.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.core.client.v1.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): ibc.core.client.v1.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.core.client.v1.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } - - /** Namespace applications. */ - namespace applications { - - /** Namespace transfer. */ - namespace transfer { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls DenomTrace. - * @param request QueryDenomTraceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomTraceResponse - */ - public denomTrace(request: ibc.applications.transfer.v1.IQueryDenomTraceRequest, callback: ibc.applications.transfer.v1.Query.DenomTraceCallback): void; - - /** - * Calls DenomTrace. - * @param request QueryDenomTraceRequest message or plain object - * @returns Promise - */ - public denomTrace(request: ibc.applications.transfer.v1.IQueryDenomTraceRequest): Promise; - - /** - * Calls DenomTraces. - * @param request QueryDenomTracesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomTracesResponse - */ - public denomTraces(request: ibc.applications.transfer.v1.IQueryDenomTracesRequest, callback: ibc.applications.transfer.v1.Query.DenomTracesCallback): void; - - /** - * Calls DenomTraces. - * @param request QueryDenomTracesRequest message or plain object - * @returns Promise - */ - public denomTraces(request: ibc.applications.transfer.v1.IQueryDenomTracesRequest): Promise; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: ibc.applications.transfer.v1.IQueryParamsRequest, callback: ibc.applications.transfer.v1.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: ibc.applications.transfer.v1.IQueryParamsRequest): Promise; - - /** - * Calls DenomHash. - * @param request QueryDenomHashRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomHashResponse - */ - public denomHash(request: ibc.applications.transfer.v1.IQueryDenomHashRequest, callback: ibc.applications.transfer.v1.Query.DenomHashCallback): void; - - /** - * Calls DenomHash. - * @param request QueryDenomHashRequest message or plain object - * @returns Promise - */ - public denomHash(request: ibc.applications.transfer.v1.IQueryDenomHashRequest): Promise; - - /** - * Calls EscrowAddress. - * @param request QueryEscrowAddressRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryEscrowAddressResponse - */ - public escrowAddress(request: ibc.applications.transfer.v1.IQueryEscrowAddressRequest, callback: ibc.applications.transfer.v1.Query.EscrowAddressCallback): void; - - /** - * Calls EscrowAddress. - * @param request QueryEscrowAddressRequest message or plain object - * @returns Promise - */ - public escrowAddress(request: ibc.applications.transfer.v1.IQueryEscrowAddressRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTrace}. - * @param error Error, if any - * @param [response] QueryDenomTraceResponse - */ - type DenomTraceCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryDenomTraceResponse) => void; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomTraces}. - * @param error Error, if any - * @param [response] QueryDenomTracesResponse - */ - type DenomTracesCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryDenomTracesResponse) => void; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryParamsResponse) => void; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#denomHash}. - * @param error Error, if any - * @param [response] QueryDenomHashResponse - */ - type DenomHashCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryDenomHashResponse) => void; - - /** - * Callback as used by {@link ibc.applications.transfer.v1.Query#escrowAddress}. - * @param error Error, if any - * @param [response] QueryEscrowAddressResponse - */ - type EscrowAddressCallback = (error: (Error|null), response?: ibc.applications.transfer.v1.QueryEscrowAddressResponse) => void; - } - - /** Properties of a QueryDenomTraceRequest. */ - interface IQueryDenomTraceRequest { - - /** QueryDenomTraceRequest hash */ - hash?: (string|null); - } - - /** Represents a QueryDenomTraceRequest. */ - class QueryDenomTraceRequest implements IQueryDenomTraceRequest { - - /** - * Constructs a new QueryDenomTraceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomTraceRequest); - - /** QueryDenomTraceRequest hash. */ - public hash: string; - - /** - * Encodes the specified QueryDenomTraceRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @param message QueryDenomTraceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomTraceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomTraceRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceRequest.verify|verify} messages. - * @param message QueryDenomTraceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomTraceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomTraceRequest; - - /** - * Decodes a QueryDenomTraceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomTraceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomTraceRequest; - - /** - * Verifies a QueryDenomTraceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomTraceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomTraceRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomTraceRequest; - - /** - * Creates a plain object from a QueryDenomTraceRequest message. Also converts values to other types if specified. - * @param message QueryDenomTraceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomTraceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomTraceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomTraceResponse. */ - interface IQueryDenomTraceResponse { - - /** QueryDenomTraceResponse denom_trace */ - denom_trace?: (ibc.applications.transfer.v1.IDenomTrace|null); - } - - /** Represents a QueryDenomTraceResponse. */ - class QueryDenomTraceResponse implements IQueryDenomTraceResponse { - - /** - * Constructs a new QueryDenomTraceResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomTraceResponse); - - /** QueryDenomTraceResponse denom_trace. */ - public denom_trace?: (ibc.applications.transfer.v1.IDenomTrace|null); - - /** - * Encodes the specified QueryDenomTraceResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @param message QueryDenomTraceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomTraceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomTraceResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTraceResponse.verify|verify} messages. - * @param message QueryDenomTraceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomTraceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomTraceResponse; - - /** - * Decodes a QueryDenomTraceResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomTraceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomTraceResponse; - - /** - * Verifies a QueryDenomTraceResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomTraceResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomTraceResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomTraceResponse; - - /** - * Creates a plain object from a QueryDenomTraceResponse message. Also converts values to other types if specified. - * @param message QueryDenomTraceResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomTraceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomTraceResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomTracesRequest. */ - interface IQueryDenomTracesRequest { - - /** QueryDenomTracesRequest pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - } - - /** Represents a QueryDenomTracesRequest. */ - class QueryDenomTracesRequest implements IQueryDenomTracesRequest { - - /** - * Constructs a new QueryDenomTracesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomTracesRequest); - - /** QueryDenomTracesRequest pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageRequest|null); - - /** - * Encodes the specified QueryDenomTracesRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @param message QueryDenomTracesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomTracesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomTracesRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesRequest.verify|verify} messages. - * @param message QueryDenomTracesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomTracesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomTracesRequest; - - /** - * Decodes a QueryDenomTracesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomTracesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomTracesRequest; - - /** - * Verifies a QueryDenomTracesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomTracesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomTracesRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomTracesRequest; - - /** - * Creates a plain object from a QueryDenomTracesRequest message. Also converts values to other types if specified. - * @param message QueryDenomTracesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomTracesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomTracesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomTracesResponse. */ - interface IQueryDenomTracesResponse { - - /** QueryDenomTracesResponse denom_traces */ - denom_traces?: (ibc.applications.transfer.v1.IDenomTrace[]|null); - - /** QueryDenomTracesResponse pagination */ - pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - } - - /** Represents a QueryDenomTracesResponse. */ - class QueryDenomTracesResponse implements IQueryDenomTracesResponse { - - /** - * Constructs a new QueryDenomTracesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomTracesResponse); - - /** QueryDenomTracesResponse denom_traces. */ - public denom_traces: ibc.applications.transfer.v1.IDenomTrace[]; - - /** QueryDenomTracesResponse pagination. */ - public pagination?: (cosmos.base.query.v1beta1.IPageResponse|null); - - /** - * Encodes the specified QueryDenomTracesResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @param message QueryDenomTracesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomTracesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomTracesResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomTracesResponse.verify|verify} messages. - * @param message QueryDenomTracesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomTracesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomTracesResponse; - - /** - * Decodes a QueryDenomTracesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomTracesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomTracesResponse; - - /** - * Verifies a QueryDenomTracesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomTracesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomTracesResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomTracesResponse; - - /** - * Creates a plain object from a QueryDenomTracesResponse message. Also converts values to other types if specified. - * @param message QueryDenomTracesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomTracesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomTracesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (ibc.applications.transfer.v1.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (ibc.applications.transfer.v1.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomHashRequest. */ - interface IQueryDenomHashRequest { - - /** QueryDenomHashRequest trace */ - trace?: (string|null); - } - - /** Represents a QueryDenomHashRequest. */ - class QueryDenomHashRequest implements IQueryDenomHashRequest { - - /** - * Constructs a new QueryDenomHashRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomHashRequest); - - /** QueryDenomHashRequest trace. */ - public trace: string; - - /** - * Encodes the specified QueryDenomHashRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @param message QueryDenomHashRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomHashRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomHashRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashRequest.verify|verify} messages. - * @param message QueryDenomHashRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomHashRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomHashRequest; - - /** - * Decodes a QueryDenomHashRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomHashRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomHashRequest; - - /** - * Verifies a QueryDenomHashRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomHashRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomHashRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomHashRequest; - - /** - * Creates a plain object from a QueryDenomHashRequest message. Also converts values to other types if specified. - * @param message QueryDenomHashRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomHashRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomHashRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomHashResponse. */ - interface IQueryDenomHashResponse { - - /** QueryDenomHashResponse hash */ - hash?: (string|null); - } - - /** Represents a QueryDenomHashResponse. */ - class QueryDenomHashResponse implements IQueryDenomHashResponse { - - /** - * Constructs a new QueryDenomHashResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryDenomHashResponse); - - /** QueryDenomHashResponse hash. */ - public hash: string; - - /** - * Encodes the specified QueryDenomHashResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @param message QueryDenomHashResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryDenomHashResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomHashResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryDenomHashResponse.verify|verify} messages. - * @param message QueryDenomHashResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryDenomHashResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryDenomHashResponse; - - /** - * Decodes a QueryDenomHashResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomHashResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryDenomHashResponse; - - /** - * Verifies a QueryDenomHashResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomHashResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomHashResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryDenomHashResponse; - - /** - * Creates a plain object from a QueryDenomHashResponse message. Also converts values to other types if specified. - * @param message QueryDenomHashResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryDenomHashResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomHashResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryEscrowAddressRequest. */ - interface IQueryEscrowAddressRequest { - - /** QueryEscrowAddressRequest port_id */ - port_id?: (string|null); - - /** QueryEscrowAddressRequest channel_id */ - channel_id?: (string|null); - } - - /** Represents a QueryEscrowAddressRequest. */ - class QueryEscrowAddressRequest implements IQueryEscrowAddressRequest { - - /** - * Constructs a new QueryEscrowAddressRequest. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryEscrowAddressRequest); - - /** QueryEscrowAddressRequest port_id. */ - public port_id: string; - - /** QueryEscrowAddressRequest channel_id. */ - public channel_id: string; - - /** - * Encodes the specified QueryEscrowAddressRequest message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @param message QueryEscrowAddressRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryEscrowAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryEscrowAddressRequest message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressRequest.verify|verify} messages. - * @param message QueryEscrowAddressRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryEscrowAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryEscrowAddressRequest; - - /** - * Decodes a QueryEscrowAddressRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryEscrowAddressRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryEscrowAddressRequest; - - /** - * Verifies a QueryEscrowAddressRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryEscrowAddressRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryEscrowAddressRequest - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryEscrowAddressRequest; - - /** - * Creates a plain object from a QueryEscrowAddressRequest message. Also converts values to other types if specified. - * @param message QueryEscrowAddressRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryEscrowAddressRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryEscrowAddressRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryEscrowAddressResponse. */ - interface IQueryEscrowAddressResponse { - - /** QueryEscrowAddressResponse escrow_address */ - escrow_address?: (string|null); - } - - /** Represents a QueryEscrowAddressResponse. */ - class QueryEscrowAddressResponse implements IQueryEscrowAddressResponse { - - /** - * Constructs a new QueryEscrowAddressResponse. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IQueryEscrowAddressResponse); - - /** QueryEscrowAddressResponse escrow_address. */ - public escrow_address: string; - - /** - * Encodes the specified QueryEscrowAddressResponse message. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @param message QueryEscrowAddressResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IQueryEscrowAddressResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryEscrowAddressResponse message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.QueryEscrowAddressResponse.verify|verify} messages. - * @param message QueryEscrowAddressResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IQueryEscrowAddressResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.QueryEscrowAddressResponse; - - /** - * Decodes a QueryEscrowAddressResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryEscrowAddressResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.QueryEscrowAddressResponse; - - /** - * Verifies a QueryEscrowAddressResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryEscrowAddressResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryEscrowAddressResponse - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.QueryEscrowAddressResponse; - - /** - * Creates a plain object from a QueryEscrowAddressResponse message. Also converts values to other types if specified. - * @param message QueryEscrowAddressResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.QueryEscrowAddressResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryEscrowAddressResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DenomTrace. */ - interface IDenomTrace { - - /** DenomTrace path */ - path?: (string|null); - - /** DenomTrace base_denom */ - base_denom?: (string|null); - } - - /** Represents a DenomTrace. */ - class DenomTrace implements IDenomTrace { - - /** - * Constructs a new DenomTrace. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IDenomTrace); - - /** DenomTrace path. */ - public path: string; - - /** DenomTrace base_denom. */ - public base_denom: string; - - /** - * Encodes the specified DenomTrace message. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @param message DenomTrace message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IDenomTrace, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DenomTrace message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.DenomTrace.verify|verify} messages. - * @param message DenomTrace message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IDenomTrace, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DenomTrace message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.DenomTrace; - - /** - * Decodes a DenomTrace message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DenomTrace - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.DenomTrace; - - /** - * Verifies a DenomTrace message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DenomTrace message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DenomTrace - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.DenomTrace; - - /** - * Creates a plain object from a DenomTrace message. Also converts values to other types if specified. - * @param message DenomTrace - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.DenomTrace, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DenomTrace to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params send_enabled */ - send_enabled?: (boolean|null); - - /** Params receive_enabled */ - receive_enabled?: (boolean|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: ibc.applications.transfer.v1.IParams); - - /** Params send_enabled. */ - public send_enabled: boolean; - - /** Params receive_enabled. */ - public receive_enabled: boolean; - - /** - * Encodes the specified Params message. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: ibc.applications.transfer.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link ibc.applications.transfer.v1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: ibc.applications.transfer.v1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ibc.applications.transfer.v1.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ibc.applications.transfer.v1.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): ibc.applications.transfer.v1.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: ibc.applications.transfer.v1.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - } -} - -/** Namespace cosmos_proto. */ -export namespace cosmos_proto { - - /** Properties of an InterfaceDescriptor. */ - interface IInterfaceDescriptor { - - /** InterfaceDescriptor name */ - name?: (string|null); - - /** InterfaceDescriptor description */ - description?: (string|null); - } - - /** Represents an InterfaceDescriptor. */ - class InterfaceDescriptor implements IInterfaceDescriptor { - - /** - * Constructs a new InterfaceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos_proto.IInterfaceDescriptor); - - /** InterfaceDescriptor name. */ - public name: string; - - /** InterfaceDescriptor description. */ - public description: string; - - /** - * Encodes the specified InterfaceDescriptor message. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @param message InterfaceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos_proto.IInterfaceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InterfaceDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.InterfaceDescriptor.verify|verify} messages. - * @param message InterfaceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos_proto.IInterfaceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos_proto.InterfaceDescriptor; - - /** - * Decodes an InterfaceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InterfaceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos_proto.InterfaceDescriptor; - - /** - * Verifies an InterfaceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InterfaceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InterfaceDescriptor - */ - public static fromObject(object: { [k: string]: any }): cosmos_proto.InterfaceDescriptor; - - /** - * Creates a plain object from an InterfaceDescriptor message. Also converts values to other types if specified. - * @param message InterfaceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos_proto.InterfaceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InterfaceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ScalarDescriptor. */ - interface IScalarDescriptor { - - /** ScalarDescriptor name */ - name?: (string|null); - - /** ScalarDescriptor description */ - description?: (string|null); - - /** ScalarDescriptor field_type */ - field_type?: (cosmos_proto.ScalarType[]|null); - - /** ScalarDescriptor legacy_amino_encoding */ - legacy_amino_encoding?: (string|null); - } - - /** Represents a ScalarDescriptor. */ - class ScalarDescriptor implements IScalarDescriptor { - - /** - * Constructs a new ScalarDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos_proto.IScalarDescriptor); - - /** ScalarDescriptor name. */ - public name: string; - - /** ScalarDescriptor description. */ - public description: string; - - /** ScalarDescriptor field_type. */ - public field_type: cosmos_proto.ScalarType[]; - - /** ScalarDescriptor legacy_amino_encoding. */ - public legacy_amino_encoding: string; - - /** - * Encodes the specified ScalarDescriptor message. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @param message ScalarDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos_proto.IScalarDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ScalarDescriptor message, length delimited. Does not implicitly {@link cosmos_proto.ScalarDescriptor.verify|verify} messages. - * @param message ScalarDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos_proto.IScalarDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos_proto.ScalarDescriptor; - - /** - * Decodes a ScalarDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ScalarDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos_proto.ScalarDescriptor; - - /** - * Verifies a ScalarDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ScalarDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ScalarDescriptor - */ - public static fromObject(object: { [k: string]: any }): cosmos_proto.ScalarDescriptor; - - /** - * Creates a plain object from a ScalarDescriptor message. Also converts values to other types if specified. - * @param message ScalarDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos_proto.ScalarDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ScalarDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** ScalarType enum. */ - enum ScalarType { - SCALAR_TYPE_UNSPECIFIED = 0, - SCALAR_TYPE_STRING = 1, - SCALAR_TYPE_BYTES = 2 - } -} - -/** Namespace tendermint. */ -export namespace tendermint { - - /** Namespace crypto. */ - namespace crypto { - - /** Properties of a Proof. */ - interface IProof { - - /** Proof total */ - total?: (Long|null); - - /** Proof index */ - index?: (Long|null); - - /** Proof leaf_hash */ - leaf_hash?: (Uint8Array|null); - - /** Proof aunts */ - aunts?: (Uint8Array[]|null); - } - - /** Represents a Proof. */ - class Proof implements IProof { - - /** - * Constructs a new Proof. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IProof); - - /** Proof total. */ - public total: Long; - - /** Proof index. */ - public index: Long; - - /** Proof leaf_hash. */ - public leaf_hash: Uint8Array; - - /** Proof aunts. */ - public aunts: Uint8Array[]; - - /** - * Encodes the specified Proof message. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @param message Proof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Proof message, length delimited. Does not implicitly {@link tendermint.crypto.Proof.verify|verify} messages. - * @param message Proof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Proof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.Proof; - - /** - * Decodes a Proof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Proof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.Proof; - - /** - * Verifies a Proof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Proof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Proof - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.Proof; - - /** - * Creates a plain object from a Proof message. Also converts values to other types if specified. - * @param message Proof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.Proof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Proof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ValueOp. */ - interface IValueOp { - - /** ValueOp key */ - key?: (Uint8Array|null); - - /** ValueOp proof */ - proof?: (tendermint.crypto.IProof|null); - } - - /** Represents a ValueOp. */ - class ValueOp implements IValueOp { - - /** - * Constructs a new ValueOp. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IValueOp); - - /** ValueOp key. */ - public key: Uint8Array; - - /** ValueOp proof. */ - public proof?: (tendermint.crypto.IProof|null); - - /** - * Encodes the specified ValueOp message. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @param message ValueOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IValueOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValueOp message, length delimited. Does not implicitly {@link tendermint.crypto.ValueOp.verify|verify} messages. - * @param message ValueOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IValueOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValueOp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.ValueOp; - - /** - * Decodes a ValueOp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValueOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.ValueOp; - - /** - * Verifies a ValueOp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValueOp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValueOp - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.ValueOp; - - /** - * Creates a plain object from a ValueOp message. Also converts values to other types if specified. - * @param message ValueOp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.ValueOp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValueOp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DominoOp. */ - interface IDominoOp { - - /** DominoOp key */ - key?: (string|null); - - /** DominoOp input */ - input?: (string|null); - - /** DominoOp output */ - output?: (string|null); - } - - /** Represents a DominoOp. */ - class DominoOp implements IDominoOp { - - /** - * Constructs a new DominoOp. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IDominoOp); - - /** DominoOp key. */ - public key: string; - - /** DominoOp input. */ - public input: string; - - /** DominoOp output. */ - public output: string; - - /** - * Encodes the specified DominoOp message. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @param message DominoOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IDominoOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DominoOp message, length delimited. Does not implicitly {@link tendermint.crypto.DominoOp.verify|verify} messages. - * @param message DominoOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IDominoOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DominoOp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.DominoOp; - - /** - * Decodes a DominoOp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DominoOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.DominoOp; - - /** - * Verifies a DominoOp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DominoOp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DominoOp - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.DominoOp; - - /** - * Creates a plain object from a DominoOp message. Also converts values to other types if specified. - * @param message DominoOp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.DominoOp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DominoOp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ProofOp. */ - interface IProofOp { - - /** ProofOp type */ - type?: (string|null); - - /** ProofOp key */ - key?: (Uint8Array|null); - - /** ProofOp data */ - data?: (Uint8Array|null); - } - - /** Represents a ProofOp. */ - class ProofOp implements IProofOp { - - /** - * Constructs a new ProofOp. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IProofOp); - - /** ProofOp type. */ - public type: string; - - /** ProofOp key. */ - public key: Uint8Array; - - /** ProofOp data. */ - public data: Uint8Array; - - /** - * Encodes the specified ProofOp message. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @param message ProofOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IProofOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProofOp message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOp.verify|verify} messages. - * @param message ProofOp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IProofOp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProofOp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.ProofOp; - - /** - * Decodes a ProofOp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProofOp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.ProofOp; - - /** - * Verifies a ProofOp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProofOp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProofOp - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.ProofOp; - - /** - * Creates a plain object from a ProofOp message. Also converts values to other types if specified. - * @param message ProofOp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.ProofOp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProofOp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ProofOps. */ - interface IProofOps { - - /** ProofOps ops */ - ops?: (tendermint.crypto.IProofOp[]|null); - } - - /** Represents a ProofOps. */ - class ProofOps implements IProofOps { - - /** - * Constructs a new ProofOps. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IProofOps); - - /** ProofOps ops. */ - public ops: tendermint.crypto.IProofOp[]; - - /** - * Encodes the specified ProofOps message. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @param message ProofOps message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IProofOps, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProofOps message, length delimited. Does not implicitly {@link tendermint.crypto.ProofOps.verify|verify} messages. - * @param message ProofOps message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IProofOps, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProofOps message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.ProofOps; - - /** - * Decodes a ProofOps message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProofOps - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.ProofOps; - - /** - * Verifies a ProofOps message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProofOps message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProofOps - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.ProofOps; - - /** - * Creates a plain object from a ProofOps message. Also converts values to other types if specified. - * @param message ProofOps - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.ProofOps, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProofOps to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PublicKey. */ - interface IPublicKey { - - /** PublicKey ed25519 */ - ed25519?: (Uint8Array|null); - - /** PublicKey secp256k1 */ - secp256k1?: (Uint8Array|null); - } - - /** Represents a PublicKey. */ - class PublicKey implements IPublicKey { - - /** - * Constructs a new PublicKey. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.crypto.IPublicKey); - - /** PublicKey ed25519. */ - public ed25519?: (Uint8Array|null); - - /** PublicKey secp256k1. */ - public secp256k1?: (Uint8Array|null); - - /** PublicKey sum. */ - public sum?: ("ed25519"|"secp256k1"); - - /** - * Encodes the specified PublicKey message. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @param message PublicKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.crypto.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link tendermint.crypto.PublicKey.verify|verify} messages. - * @param message PublicKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.crypto.IPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PublicKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.crypto.PublicKey; - - /** - * Decodes a PublicKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PublicKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.crypto.PublicKey; - - /** - * Verifies a PublicKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PublicKey - */ - public static fromObject(object: { [k: string]: any }): tendermint.crypto.PublicKey; - - /** - * Creates a plain object from a PublicKey message. Also converts values to other types if specified. - * @param message PublicKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.crypto.PublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PublicKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace abci. */ - namespace abci { - - /** Properties of a Request. */ - interface IRequest { - - /** Request echo */ - echo?: (tendermint.abci.IRequestEcho|null); - - /** Request flush */ - flush?: (tendermint.abci.IRequestFlush|null); - - /** Request info */ - info?: (tendermint.abci.IRequestInfo|null); - - /** Request set_option */ - set_option?: (tendermint.abci.IRequestSetOption|null); - - /** Request init_chain */ - init_chain?: (tendermint.abci.IRequestInitChain|null); - - /** Request query */ - query?: (tendermint.abci.IRequestQuery|null); - - /** Request begin_block */ - begin_block?: (tendermint.abci.IRequestBeginBlock|null); - - /** Request check_tx */ - check_tx?: (tendermint.abci.IRequestCheckTx|null); - - /** Request deliver_tx */ - deliver_tx?: (tendermint.abci.IRequestDeliverTx|null); - - /** Request end_block */ - end_block?: (tendermint.abci.IRequestEndBlock|null); - - /** Request commit */ - commit?: (tendermint.abci.IRequestCommit|null); - - /** Request list_snapshots */ - list_snapshots?: (tendermint.abci.IRequestListSnapshots|null); - - /** Request offer_snapshot */ - offer_snapshot?: (tendermint.abci.IRequestOfferSnapshot|null); - - /** Request load_snapshot_chunk */ - load_snapshot_chunk?: (tendermint.abci.IRequestLoadSnapshotChunk|null); - - /** Request apply_snapshot_chunk */ - apply_snapshot_chunk?: (tendermint.abci.IRequestApplySnapshotChunk|null); - } - - /** Represents a Request. */ - class Request implements IRequest { - - /** - * Constructs a new Request. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequest); - - /** Request echo. */ - public echo?: (tendermint.abci.IRequestEcho|null); - - /** Request flush. */ - public flush?: (tendermint.abci.IRequestFlush|null); - - /** Request info. */ - public info?: (tendermint.abci.IRequestInfo|null); - - /** Request set_option. */ - public set_option?: (tendermint.abci.IRequestSetOption|null); - - /** Request init_chain. */ - public init_chain?: (tendermint.abci.IRequestInitChain|null); - - /** Request query. */ - public query?: (tendermint.abci.IRequestQuery|null); - - /** Request begin_block. */ - public begin_block?: (tendermint.abci.IRequestBeginBlock|null); - - /** Request check_tx. */ - public check_tx?: (tendermint.abci.IRequestCheckTx|null); - - /** Request deliver_tx. */ - public deliver_tx?: (tendermint.abci.IRequestDeliverTx|null); - - /** Request end_block. */ - public end_block?: (tendermint.abci.IRequestEndBlock|null); - - /** Request commit. */ - public commit?: (tendermint.abci.IRequestCommit|null); - - /** Request list_snapshots. */ - public list_snapshots?: (tendermint.abci.IRequestListSnapshots|null); - - /** Request offer_snapshot. */ - public offer_snapshot?: (tendermint.abci.IRequestOfferSnapshot|null); - - /** Request load_snapshot_chunk. */ - public load_snapshot_chunk?: (tendermint.abci.IRequestLoadSnapshotChunk|null); - - /** Request apply_snapshot_chunk. */ - public apply_snapshot_chunk?: (tendermint.abci.IRequestApplySnapshotChunk|null); - - /** Request value. */ - public value?: ("echo"|"flush"|"info"|"set_option"|"init_chain"|"query"|"begin_block"|"check_tx"|"deliver_tx"|"end_block"|"commit"|"list_snapshots"|"offer_snapshot"|"load_snapshot_chunk"|"apply_snapshot_chunk"); - - /** - * Encodes the specified Request message. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. - * @param message Request message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Request message, length delimited. Does not implicitly {@link tendermint.abci.Request.verify|verify} messages. - * @param message Request message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Request message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Request - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.Request; - - /** - * Decodes a Request message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Request - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.Request; - - /** - * Verifies a Request message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Request message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Request - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.Request; - - /** - * Creates a plain object from a Request message. Also converts values to other types if specified. - * @param message Request - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.Request, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Request to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestEcho. */ - interface IRequestEcho { - - /** RequestEcho message */ - message?: (string|null); - } - - /** Represents a RequestEcho. */ - class RequestEcho implements IRequestEcho { - - /** - * Constructs a new RequestEcho. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestEcho); - - /** RequestEcho message. */ - public message: string; - - /** - * Encodes the specified RequestEcho message. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. - * @param message RequestEcho message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestEcho, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestEcho message, length delimited. Does not implicitly {@link tendermint.abci.RequestEcho.verify|verify} messages. - * @param message RequestEcho message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestEcho, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestEcho message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestEcho; - - /** - * Decodes a RequestEcho message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestEcho; - - /** - * Verifies a RequestEcho message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestEcho message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestEcho - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestEcho; - - /** - * Creates a plain object from a RequestEcho message. Also converts values to other types if specified. - * @param message RequestEcho - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestEcho, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestEcho to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestFlush. */ - interface IRequestFlush { - } - - /** Represents a RequestFlush. */ - class RequestFlush implements IRequestFlush { - - /** - * Constructs a new RequestFlush. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestFlush); - - /** - * Encodes the specified RequestFlush message. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. - * @param message RequestFlush message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestFlush, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestFlush message, length delimited. Does not implicitly {@link tendermint.abci.RequestFlush.verify|verify} messages. - * @param message RequestFlush message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestFlush, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestFlush message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestFlush; - - /** - * Decodes a RequestFlush message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestFlush; - - /** - * Verifies a RequestFlush message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestFlush message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestFlush - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestFlush; - - /** - * Creates a plain object from a RequestFlush message. Also converts values to other types if specified. - * @param message RequestFlush - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestFlush, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestFlush to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestInfo. */ - interface IRequestInfo { - - /** RequestInfo version */ - version?: (string|null); - - /** RequestInfo block_version */ - block_version?: (Long|null); - - /** RequestInfo p2p_version */ - p2p_version?: (Long|null); - } - - /** Represents a RequestInfo. */ - class RequestInfo implements IRequestInfo { - - /** - * Constructs a new RequestInfo. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestInfo); - - /** RequestInfo version. */ - public version: string; - - /** RequestInfo block_version. */ - public block_version: Long; - - /** RequestInfo p2p_version. */ - public p2p_version: Long; - - /** - * Encodes the specified RequestInfo message. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. - * @param message RequestInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestInfo message, length delimited. Does not implicitly {@link tendermint.abci.RequestInfo.verify|verify} messages. - * @param message RequestInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestInfo; - - /** - * Decodes a RequestInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestInfo; - - /** - * Verifies a RequestInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestInfo - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestInfo; - - /** - * Creates a plain object from a RequestInfo message. Also converts values to other types if specified. - * @param message RequestInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestSetOption. */ - interface IRequestSetOption { - - /** RequestSetOption key */ - key?: (string|null); - - /** RequestSetOption value */ - value?: (string|null); - } - - /** Represents a RequestSetOption. */ - class RequestSetOption implements IRequestSetOption { - - /** - * Constructs a new RequestSetOption. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestSetOption); - - /** RequestSetOption key. */ - public key: string; - - /** RequestSetOption value. */ - public value: string; - - /** - * Encodes the specified RequestSetOption message. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. - * @param message RequestSetOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestSetOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestSetOption message, length delimited. Does not implicitly {@link tendermint.abci.RequestSetOption.verify|verify} messages. - * @param message RequestSetOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestSetOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestSetOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestSetOption; - - /** - * Decodes a RequestSetOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestSetOption; - - /** - * Verifies a RequestSetOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestSetOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestSetOption - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestSetOption; - - /** - * Creates a plain object from a RequestSetOption message. Also converts values to other types if specified. - * @param message RequestSetOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestSetOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestSetOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestInitChain. */ - interface IRequestInitChain { - - /** RequestInitChain time */ - time?: (google.protobuf.ITimestamp|null); - - /** RequestInitChain chain_id */ - chain_id?: (string|null); - - /** RequestInitChain consensus_params */ - consensus_params?: (tendermint.abci.IConsensusParams|null); - - /** RequestInitChain validators */ - validators?: (tendermint.abci.IValidatorUpdate[]|null); - - /** RequestInitChain app_state_bytes */ - app_state_bytes?: (Uint8Array|null); - - /** RequestInitChain initial_height */ - initial_height?: (Long|null); - } - - /** Represents a RequestInitChain. */ - class RequestInitChain implements IRequestInitChain { - - /** - * Constructs a new RequestInitChain. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestInitChain); - - /** RequestInitChain time. */ - public time?: (google.protobuf.ITimestamp|null); - - /** RequestInitChain chain_id. */ - public chain_id: string; - - /** RequestInitChain consensus_params. */ - public consensus_params?: (tendermint.abci.IConsensusParams|null); - - /** RequestInitChain validators. */ - public validators: tendermint.abci.IValidatorUpdate[]; - - /** RequestInitChain app_state_bytes. */ - public app_state_bytes: Uint8Array; - - /** RequestInitChain initial_height. */ - public initial_height: Long; - - /** - * Encodes the specified RequestInitChain message. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. - * @param message RequestInitChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestInitChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestInitChain message, length delimited. Does not implicitly {@link tendermint.abci.RequestInitChain.verify|verify} messages. - * @param message RequestInitChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestInitChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestInitChain message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestInitChain; - - /** - * Decodes a RequestInitChain message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestInitChain; - - /** - * Verifies a RequestInitChain message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestInitChain message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestInitChain - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestInitChain; - - /** - * Creates a plain object from a RequestInitChain message. Also converts values to other types if specified. - * @param message RequestInitChain - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestInitChain, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestInitChain to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestQuery. */ - interface IRequestQuery { - - /** RequestQuery data */ - data?: (Uint8Array|null); - - /** RequestQuery path */ - path?: (string|null); - - /** RequestQuery height */ - height?: (Long|null); - - /** RequestQuery prove */ - prove?: (boolean|null); - } - - /** Represents a RequestQuery. */ - class RequestQuery implements IRequestQuery { - - /** - * Constructs a new RequestQuery. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestQuery); - - /** RequestQuery data. */ - public data: Uint8Array; - - /** RequestQuery path. */ - public path: string; - - /** RequestQuery height. */ - public height: Long; - - /** RequestQuery prove. */ - public prove: boolean; - - /** - * Encodes the specified RequestQuery message. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. - * @param message RequestQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestQuery message, length delimited. Does not implicitly {@link tendermint.abci.RequestQuery.verify|verify} messages. - * @param message RequestQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestQuery; - - /** - * Decodes a RequestQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestQuery; - - /** - * Verifies a RequestQuery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestQuery - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestQuery; - - /** - * Creates a plain object from a RequestQuery message. Also converts values to other types if specified. - * @param message RequestQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestBeginBlock. */ - interface IRequestBeginBlock { - - /** RequestBeginBlock hash */ - hash?: (Uint8Array|null); - - /** RequestBeginBlock header */ - header?: (tendermint.types.IHeader|null); - - /** RequestBeginBlock last_commit_info */ - last_commit_info?: (tendermint.abci.ILastCommitInfo|null); - - /** RequestBeginBlock byzantine_validators */ - byzantine_validators?: (tendermint.abci.IEvidence[]|null); - } - - /** Represents a RequestBeginBlock. */ - class RequestBeginBlock implements IRequestBeginBlock { - - /** - * Constructs a new RequestBeginBlock. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestBeginBlock); - - /** RequestBeginBlock hash. */ - public hash: Uint8Array; - - /** RequestBeginBlock header. */ - public header?: (tendermint.types.IHeader|null); - - /** RequestBeginBlock last_commit_info. */ - public last_commit_info?: (tendermint.abci.ILastCommitInfo|null); - - /** RequestBeginBlock byzantine_validators. */ - public byzantine_validators: tendermint.abci.IEvidence[]; - - /** - * Encodes the specified RequestBeginBlock message. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. - * @param message RequestBeginBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestBeginBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestBeginBlock.verify|verify} messages. - * @param message RequestBeginBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestBeginBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestBeginBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestBeginBlock; - - /** - * Decodes a RequestBeginBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestBeginBlock; - - /** - * Verifies a RequestBeginBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestBeginBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestBeginBlock - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestBeginBlock; - - /** - * Creates a plain object from a RequestBeginBlock message. Also converts values to other types if specified. - * @param message RequestBeginBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestBeginBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestBeginBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** CheckTxType enum. */ - enum CheckTxType { - NEW = 0, - RECHECK = 1 - } - - /** Properties of a RequestCheckTx. */ - interface IRequestCheckTx { - - /** RequestCheckTx tx */ - tx?: (Uint8Array|null); - - /** RequestCheckTx type */ - type?: (tendermint.abci.CheckTxType|null); - } - - /** Represents a RequestCheckTx. */ - class RequestCheckTx implements IRequestCheckTx { - - /** - * Constructs a new RequestCheckTx. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestCheckTx); - - /** RequestCheckTx tx. */ - public tx: Uint8Array; - - /** RequestCheckTx type. */ - public type: tendermint.abci.CheckTxType; - - /** - * Encodes the specified RequestCheckTx message. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. - * @param message RequestCheckTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestCheckTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestCheckTx.verify|verify} messages. - * @param message RequestCheckTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestCheckTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestCheckTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestCheckTx; - - /** - * Decodes a RequestCheckTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestCheckTx; - - /** - * Verifies a RequestCheckTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestCheckTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestCheckTx - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestCheckTx; - - /** - * Creates a plain object from a RequestCheckTx message. Also converts values to other types if specified. - * @param message RequestCheckTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestCheckTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestCheckTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestDeliverTx. */ - interface IRequestDeliverTx { - - /** RequestDeliverTx tx */ - tx?: (Uint8Array|null); - } - - /** Represents a RequestDeliverTx. */ - class RequestDeliverTx implements IRequestDeliverTx { - - /** - * Constructs a new RequestDeliverTx. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestDeliverTx); - - /** RequestDeliverTx tx. */ - public tx: Uint8Array; - - /** - * Encodes the specified RequestDeliverTx message. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. - * @param message RequestDeliverTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestDeliverTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.RequestDeliverTx.verify|verify} messages. - * @param message RequestDeliverTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestDeliverTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestDeliverTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestDeliverTx; - - /** - * Decodes a RequestDeliverTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestDeliverTx; - - /** - * Verifies a RequestDeliverTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestDeliverTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestDeliverTx - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestDeliverTx; - - /** - * Creates a plain object from a RequestDeliverTx message. Also converts values to other types if specified. - * @param message RequestDeliverTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestDeliverTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestDeliverTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestEndBlock. */ - interface IRequestEndBlock { - - /** RequestEndBlock height */ - height?: (Long|null); - } - - /** Represents a RequestEndBlock. */ - class RequestEndBlock implements IRequestEndBlock { - - /** - * Constructs a new RequestEndBlock. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestEndBlock); - - /** RequestEndBlock height. */ - public height: Long; - - /** - * Encodes the specified RequestEndBlock message. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. - * @param message RequestEndBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestEndBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.RequestEndBlock.verify|verify} messages. - * @param message RequestEndBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestEndBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestEndBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestEndBlock; - - /** - * Decodes a RequestEndBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestEndBlock; - - /** - * Verifies a RequestEndBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestEndBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestEndBlock - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestEndBlock; - - /** - * Creates a plain object from a RequestEndBlock message. Also converts values to other types if specified. - * @param message RequestEndBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestEndBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestEndBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestCommit. */ - interface IRequestCommit { - } - - /** Represents a RequestCommit. */ - class RequestCommit implements IRequestCommit { - - /** - * Constructs a new RequestCommit. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestCommit); - - /** - * Encodes the specified RequestCommit message. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. - * @param message RequestCommit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestCommit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestCommit message, length delimited. Does not implicitly {@link tendermint.abci.RequestCommit.verify|verify} messages. - * @param message RequestCommit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestCommit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestCommit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestCommit; - - /** - * Decodes a RequestCommit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestCommit; - - /** - * Verifies a RequestCommit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestCommit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestCommit - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestCommit; - - /** - * Creates a plain object from a RequestCommit message. Also converts values to other types if specified. - * @param message RequestCommit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestCommit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestCommit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestListSnapshots. */ - interface IRequestListSnapshots { - } - - /** Represents a RequestListSnapshots. */ - class RequestListSnapshots implements IRequestListSnapshots { - - /** - * Constructs a new RequestListSnapshots. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestListSnapshots); - - /** - * Encodes the specified RequestListSnapshots message. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. - * @param message RequestListSnapshots message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestListSnapshots, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.RequestListSnapshots.verify|verify} messages. - * @param message RequestListSnapshots message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestListSnapshots, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestListSnapshots message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestListSnapshots; - - /** - * Decodes a RequestListSnapshots message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestListSnapshots; - - /** - * Verifies a RequestListSnapshots message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestListSnapshots message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestListSnapshots - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestListSnapshots; - - /** - * Creates a plain object from a RequestListSnapshots message. Also converts values to other types if specified. - * @param message RequestListSnapshots - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestListSnapshots, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestListSnapshots to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestOfferSnapshot. */ - interface IRequestOfferSnapshot { - - /** RequestOfferSnapshot snapshot */ - snapshot?: (tendermint.abci.ISnapshot|null); - - /** RequestOfferSnapshot app_hash */ - app_hash?: (Uint8Array|null); - } - - /** Represents a RequestOfferSnapshot. */ - class RequestOfferSnapshot implements IRequestOfferSnapshot { - - /** - * Constructs a new RequestOfferSnapshot. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestOfferSnapshot); - - /** RequestOfferSnapshot snapshot. */ - public snapshot?: (tendermint.abci.ISnapshot|null); - - /** RequestOfferSnapshot app_hash. */ - public app_hash: Uint8Array; - - /** - * Encodes the specified RequestOfferSnapshot message. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. - * @param message RequestOfferSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestOfferSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.RequestOfferSnapshot.verify|verify} messages. - * @param message RequestOfferSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestOfferSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestOfferSnapshot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestOfferSnapshot; - - /** - * Decodes a RequestOfferSnapshot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestOfferSnapshot; - - /** - * Verifies a RequestOfferSnapshot message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestOfferSnapshot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestOfferSnapshot - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestOfferSnapshot; - - /** - * Creates a plain object from a RequestOfferSnapshot message. Also converts values to other types if specified. - * @param message RequestOfferSnapshot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestOfferSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestOfferSnapshot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestLoadSnapshotChunk. */ - interface IRequestLoadSnapshotChunk { - - /** RequestLoadSnapshotChunk height */ - height?: (Long|null); - - /** RequestLoadSnapshotChunk format */ - format?: (number|null); - - /** RequestLoadSnapshotChunk chunk */ - chunk?: (number|null); - } - - /** Represents a RequestLoadSnapshotChunk. */ - class RequestLoadSnapshotChunk implements IRequestLoadSnapshotChunk { - - /** - * Constructs a new RequestLoadSnapshotChunk. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestLoadSnapshotChunk); - - /** RequestLoadSnapshotChunk height. */ - public height: Long; - - /** RequestLoadSnapshotChunk format. */ - public format: number; - - /** RequestLoadSnapshotChunk chunk. */ - public chunk: number; - - /** - * Encodes the specified RequestLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. - * @param message RequestLoadSnapshotChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestLoadSnapshotChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestLoadSnapshotChunk.verify|verify} messages. - * @param message RequestLoadSnapshotChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestLoadSnapshotChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestLoadSnapshotChunk; - - /** - * Decodes a RequestLoadSnapshotChunk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestLoadSnapshotChunk; - - /** - * Verifies a RequestLoadSnapshotChunk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestLoadSnapshotChunk - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestLoadSnapshotChunk; - - /** - * Creates a plain object from a RequestLoadSnapshotChunk message. Also converts values to other types if specified. - * @param message RequestLoadSnapshotChunk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestLoadSnapshotChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestLoadSnapshotChunk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestApplySnapshotChunk. */ - interface IRequestApplySnapshotChunk { - - /** RequestApplySnapshotChunk index */ - index?: (number|null); - - /** RequestApplySnapshotChunk chunk */ - chunk?: (Uint8Array|null); - - /** RequestApplySnapshotChunk sender */ - sender?: (string|null); - } - - /** Represents a RequestApplySnapshotChunk. */ - class RequestApplySnapshotChunk implements IRequestApplySnapshotChunk { - - /** - * Constructs a new RequestApplySnapshotChunk. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IRequestApplySnapshotChunk); - - /** RequestApplySnapshotChunk index. */ - public index: number; - - /** RequestApplySnapshotChunk chunk. */ - public chunk: Uint8Array; - - /** RequestApplySnapshotChunk sender. */ - public sender: string; - - /** - * Encodes the specified RequestApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. - * @param message RequestApplySnapshotChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IRequestApplySnapshotChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RequestApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.RequestApplySnapshotChunk.verify|verify} messages. - * @param message RequestApplySnapshotChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IRequestApplySnapshotChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RequestApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.RequestApplySnapshotChunk; - - /** - * Decodes a RequestApplySnapshotChunk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RequestApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.RequestApplySnapshotChunk; - - /** - * Verifies a RequestApplySnapshotChunk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RequestApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RequestApplySnapshotChunk - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.RequestApplySnapshotChunk; - - /** - * Creates a plain object from a RequestApplySnapshotChunk message. Also converts values to other types if specified. - * @param message RequestApplySnapshotChunk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.RequestApplySnapshotChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RequestApplySnapshotChunk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Response. */ - interface IResponse { - - /** Response exception */ - exception?: (tendermint.abci.IResponseException|null); - - /** Response echo */ - echo?: (tendermint.abci.IResponseEcho|null); - - /** Response flush */ - flush?: (tendermint.abci.IResponseFlush|null); - - /** Response info */ - info?: (tendermint.abci.IResponseInfo|null); - - /** Response set_option */ - set_option?: (tendermint.abci.IResponseSetOption|null); - - /** Response init_chain */ - init_chain?: (tendermint.abci.IResponseInitChain|null); - - /** Response query */ - query?: (tendermint.abci.IResponseQuery|null); - - /** Response begin_block */ - begin_block?: (tendermint.abci.IResponseBeginBlock|null); - - /** Response check_tx */ - check_tx?: (tendermint.abci.IResponseCheckTx|null); - - /** Response deliver_tx */ - deliver_tx?: (tendermint.abci.IResponseDeliverTx|null); - - /** Response end_block */ - end_block?: (tendermint.abci.IResponseEndBlock|null); - - /** Response commit */ - commit?: (tendermint.abci.IResponseCommit|null); - - /** Response list_snapshots */ - list_snapshots?: (tendermint.abci.IResponseListSnapshots|null); - - /** Response offer_snapshot */ - offer_snapshot?: (tendermint.abci.IResponseOfferSnapshot|null); - - /** Response load_snapshot_chunk */ - load_snapshot_chunk?: (tendermint.abci.IResponseLoadSnapshotChunk|null); - - /** Response apply_snapshot_chunk */ - apply_snapshot_chunk?: (tendermint.abci.IResponseApplySnapshotChunk|null); - } - - /** Represents a Response. */ - class Response implements IResponse { - - /** - * Constructs a new Response. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponse); - - /** Response exception. */ - public exception?: (tendermint.abci.IResponseException|null); - - /** Response echo. */ - public echo?: (tendermint.abci.IResponseEcho|null); - - /** Response flush. */ - public flush?: (tendermint.abci.IResponseFlush|null); - - /** Response info. */ - public info?: (tendermint.abci.IResponseInfo|null); - - /** Response set_option. */ - public set_option?: (tendermint.abci.IResponseSetOption|null); - - /** Response init_chain. */ - public init_chain?: (tendermint.abci.IResponseInitChain|null); - - /** Response query. */ - public query?: (tendermint.abci.IResponseQuery|null); - - /** Response begin_block. */ - public begin_block?: (tendermint.abci.IResponseBeginBlock|null); - - /** Response check_tx. */ - public check_tx?: (tendermint.abci.IResponseCheckTx|null); - - /** Response deliver_tx. */ - public deliver_tx?: (tendermint.abci.IResponseDeliverTx|null); - - /** Response end_block. */ - public end_block?: (tendermint.abci.IResponseEndBlock|null); - - /** Response commit. */ - public commit?: (tendermint.abci.IResponseCommit|null); - - /** Response list_snapshots. */ - public list_snapshots?: (tendermint.abci.IResponseListSnapshots|null); - - /** Response offer_snapshot. */ - public offer_snapshot?: (tendermint.abci.IResponseOfferSnapshot|null); - - /** Response load_snapshot_chunk. */ - public load_snapshot_chunk?: (tendermint.abci.IResponseLoadSnapshotChunk|null); - - /** Response apply_snapshot_chunk. */ - public apply_snapshot_chunk?: (tendermint.abci.IResponseApplySnapshotChunk|null); - - /** Response value. */ - public value?: ("exception"|"echo"|"flush"|"info"|"set_option"|"init_chain"|"query"|"begin_block"|"check_tx"|"deliver_tx"|"end_block"|"commit"|"list_snapshots"|"offer_snapshot"|"load_snapshot_chunk"|"apply_snapshot_chunk"); - - /** - * Encodes the specified Response message. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. - * @param message Response message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Response message, length delimited. Does not implicitly {@link tendermint.abci.Response.verify|verify} messages. - * @param message Response message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Response message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.Response; - - /** - * Decodes a Response message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Response - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.Response; - - /** - * Verifies a Response message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Response message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Response - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.Response; - - /** - * Creates a plain object from a Response message. Also converts values to other types if specified. - * @param message Response - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.Response, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Response to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseException. */ - interface IResponseException { - - /** ResponseException error */ - error?: (string|null); - } - - /** Represents a ResponseException. */ - class ResponseException implements IResponseException { - - /** - * Constructs a new ResponseException. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseException); - - /** ResponseException error. */ - public error: string; - - /** - * Encodes the specified ResponseException message. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. - * @param message ResponseException message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseException, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseException message, length delimited. Does not implicitly {@link tendermint.abci.ResponseException.verify|verify} messages. - * @param message ResponseException message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseException, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseException message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseException - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseException; - - /** - * Decodes a ResponseException message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseException - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseException; - - /** - * Verifies a ResponseException message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseException message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseException - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseException; - - /** - * Creates a plain object from a ResponseException message. Also converts values to other types if specified. - * @param message ResponseException - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseException, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseException to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseEcho. */ - interface IResponseEcho { - - /** ResponseEcho message */ - message?: (string|null); - } - - /** Represents a ResponseEcho. */ - class ResponseEcho implements IResponseEcho { - - /** - * Constructs a new ResponseEcho. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseEcho); - - /** ResponseEcho message. */ - public message: string; - - /** - * Encodes the specified ResponseEcho message. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. - * @param message ResponseEcho message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseEcho, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseEcho message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEcho.verify|verify} messages. - * @param message ResponseEcho message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseEcho, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseEcho message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseEcho; - - /** - * Decodes a ResponseEcho message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseEcho - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseEcho; - - /** - * Verifies a ResponseEcho message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseEcho message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseEcho - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseEcho; - - /** - * Creates a plain object from a ResponseEcho message. Also converts values to other types if specified. - * @param message ResponseEcho - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseEcho, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseEcho to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseFlush. */ - interface IResponseFlush { - } - - /** Represents a ResponseFlush. */ - class ResponseFlush implements IResponseFlush { - - /** - * Constructs a new ResponseFlush. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseFlush); - - /** - * Encodes the specified ResponseFlush message. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. - * @param message ResponseFlush message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseFlush, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseFlush message, length delimited. Does not implicitly {@link tendermint.abci.ResponseFlush.verify|verify} messages. - * @param message ResponseFlush message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseFlush, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseFlush message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseFlush; - - /** - * Decodes a ResponseFlush message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseFlush - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseFlush; - - /** - * Verifies a ResponseFlush message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseFlush message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseFlush - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseFlush; - - /** - * Creates a plain object from a ResponseFlush message. Also converts values to other types if specified. - * @param message ResponseFlush - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseFlush, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseFlush to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseInfo. */ - interface IResponseInfo { - - /** ResponseInfo data */ - data?: (string|null); - - /** ResponseInfo version */ - version?: (string|null); - - /** ResponseInfo app_version */ - app_version?: (Long|null); - - /** ResponseInfo last_block_height */ - last_block_height?: (Long|null); - - /** ResponseInfo last_block_app_hash */ - last_block_app_hash?: (Uint8Array|null); - } - - /** Represents a ResponseInfo. */ - class ResponseInfo implements IResponseInfo { - - /** - * Constructs a new ResponseInfo. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseInfo); - - /** ResponseInfo data. */ - public data: string; - - /** ResponseInfo version. */ - public version: string; - - /** ResponseInfo app_version. */ - public app_version: Long; - - /** ResponseInfo last_block_height. */ - public last_block_height: Long; - - /** ResponseInfo last_block_app_hash. */ - public last_block_app_hash: Uint8Array; - - /** - * Encodes the specified ResponseInfo message. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. - * @param message ResponseInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseInfo message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInfo.verify|verify} messages. - * @param message ResponseInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseInfo; - - /** - * Decodes a ResponseInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseInfo; - - /** - * Verifies a ResponseInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseInfo - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseInfo; - - /** - * Creates a plain object from a ResponseInfo message. Also converts values to other types if specified. - * @param message ResponseInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseSetOption. */ - interface IResponseSetOption { - - /** ResponseSetOption code */ - code?: (number|null); - - /** ResponseSetOption log */ - log?: (string|null); - - /** ResponseSetOption info */ - info?: (string|null); - } - - /** Represents a ResponseSetOption. */ - class ResponseSetOption implements IResponseSetOption { - - /** - * Constructs a new ResponseSetOption. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseSetOption); - - /** ResponseSetOption code. */ - public code: number; - - /** ResponseSetOption log. */ - public log: string; - - /** ResponseSetOption info. */ - public info: string; - - /** - * Encodes the specified ResponseSetOption message. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. - * @param message ResponseSetOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseSetOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseSetOption message, length delimited. Does not implicitly {@link tendermint.abci.ResponseSetOption.verify|verify} messages. - * @param message ResponseSetOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseSetOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseSetOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseSetOption; - - /** - * Decodes a ResponseSetOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseSetOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseSetOption; - - /** - * Verifies a ResponseSetOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseSetOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseSetOption - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseSetOption; - - /** - * Creates a plain object from a ResponseSetOption message. Also converts values to other types if specified. - * @param message ResponseSetOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseSetOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseSetOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseInitChain. */ - interface IResponseInitChain { - - /** ResponseInitChain consensus_params */ - consensus_params?: (tendermint.abci.IConsensusParams|null); - - /** ResponseInitChain validators */ - validators?: (tendermint.abci.IValidatorUpdate[]|null); - - /** ResponseInitChain app_hash */ - app_hash?: (Uint8Array|null); - } - - /** Represents a ResponseInitChain. */ - class ResponseInitChain implements IResponseInitChain { - - /** - * Constructs a new ResponseInitChain. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseInitChain); - - /** ResponseInitChain consensus_params. */ - public consensus_params?: (tendermint.abci.IConsensusParams|null); - - /** ResponseInitChain validators. */ - public validators: tendermint.abci.IValidatorUpdate[]; - - /** ResponseInitChain app_hash. */ - public app_hash: Uint8Array; - - /** - * Encodes the specified ResponseInitChain message. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. - * @param message ResponseInitChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseInitChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseInitChain message, length delimited. Does not implicitly {@link tendermint.abci.ResponseInitChain.verify|verify} messages. - * @param message ResponseInitChain message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseInitChain, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseInitChain message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseInitChain; - - /** - * Decodes a ResponseInitChain message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseInitChain - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseInitChain; - - /** - * Verifies a ResponseInitChain message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseInitChain message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseInitChain - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseInitChain; - - /** - * Creates a plain object from a ResponseInitChain message. Also converts values to other types if specified. - * @param message ResponseInitChain - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseInitChain, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseInitChain to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseQuery. */ - interface IResponseQuery { - - /** ResponseQuery code */ - code?: (number|null); - - /** ResponseQuery log */ - log?: (string|null); - - /** ResponseQuery info */ - info?: (string|null); - - /** ResponseQuery index */ - index?: (Long|null); - - /** ResponseQuery key */ - key?: (Uint8Array|null); - - /** ResponseQuery value */ - value?: (Uint8Array|null); - - /** ResponseQuery proof_ops */ - proof_ops?: (tendermint.crypto.IProofOps|null); - - /** ResponseQuery height */ - height?: (Long|null); - - /** ResponseQuery codespace */ - codespace?: (string|null); - } - - /** Represents a ResponseQuery. */ - class ResponseQuery implements IResponseQuery { - - /** - * Constructs a new ResponseQuery. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseQuery); - - /** ResponseQuery code. */ - public code: number; - - /** ResponseQuery log. */ - public log: string; - - /** ResponseQuery info. */ - public info: string; - - /** ResponseQuery index. */ - public index: Long; - - /** ResponseQuery key. */ - public key: Uint8Array; - - /** ResponseQuery value. */ - public value: Uint8Array; - - /** ResponseQuery proof_ops. */ - public proof_ops?: (tendermint.crypto.IProofOps|null); - - /** ResponseQuery height. */ - public height: Long; - - /** ResponseQuery codespace. */ - public codespace: string; - - /** - * Encodes the specified ResponseQuery message. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. - * @param message ResponseQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseQuery message, length delimited. Does not implicitly {@link tendermint.abci.ResponseQuery.verify|verify} messages. - * @param message ResponseQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseQuery; - - /** - * Decodes a ResponseQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseQuery; - - /** - * Verifies a ResponseQuery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseQuery - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseQuery; - - /** - * Creates a plain object from a ResponseQuery message. Also converts values to other types if specified. - * @param message ResponseQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseBeginBlock. */ - interface IResponseBeginBlock { - - /** ResponseBeginBlock events */ - events?: (tendermint.abci.IEvent[]|null); - } - - /** Represents a ResponseBeginBlock. */ - class ResponseBeginBlock implements IResponseBeginBlock { - - /** - * Constructs a new ResponseBeginBlock. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseBeginBlock); - - /** ResponseBeginBlock events. */ - public events: tendermint.abci.IEvent[]; - - /** - * Encodes the specified ResponseBeginBlock message. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. - * @param message ResponseBeginBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseBeginBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseBeginBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseBeginBlock.verify|verify} messages. - * @param message ResponseBeginBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseBeginBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseBeginBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseBeginBlock; - - /** - * Decodes a ResponseBeginBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseBeginBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseBeginBlock; - - /** - * Verifies a ResponseBeginBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseBeginBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseBeginBlock - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseBeginBlock; - - /** - * Creates a plain object from a ResponseBeginBlock message. Also converts values to other types if specified. - * @param message ResponseBeginBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseBeginBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseBeginBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseCheckTx. */ - interface IResponseCheckTx { - - /** ResponseCheckTx code */ - code?: (number|null); - - /** ResponseCheckTx data */ - data?: (Uint8Array|null); - - /** ResponseCheckTx log */ - log?: (string|null); - - /** ResponseCheckTx info */ - info?: (string|null); - - /** ResponseCheckTx gas_wanted */ - gas_wanted?: (Long|null); - - /** ResponseCheckTx gas_used */ - gas_used?: (Long|null); - - /** ResponseCheckTx events */ - events?: (tendermint.abci.IEvent[]|null); - - /** ResponseCheckTx codespace */ - codespace?: (string|null); - } - - /** Represents a ResponseCheckTx. */ - class ResponseCheckTx implements IResponseCheckTx { - - /** - * Constructs a new ResponseCheckTx. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseCheckTx); - - /** ResponseCheckTx code. */ - public code: number; - - /** ResponseCheckTx data. */ - public data: Uint8Array; - - /** ResponseCheckTx log. */ - public log: string; - - /** ResponseCheckTx info. */ - public info: string; - - /** ResponseCheckTx gas_wanted. */ - public gas_wanted: Long; - - /** ResponseCheckTx gas_used. */ - public gas_used: Long; - - /** ResponseCheckTx events. */ - public events: tendermint.abci.IEvent[]; - - /** ResponseCheckTx codespace. */ - public codespace: string; - - /** - * Encodes the specified ResponseCheckTx message. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. - * @param message ResponseCheckTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseCheckTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseCheckTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCheckTx.verify|verify} messages. - * @param message ResponseCheckTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseCheckTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseCheckTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseCheckTx; - - /** - * Decodes a ResponseCheckTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseCheckTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseCheckTx; - - /** - * Verifies a ResponseCheckTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseCheckTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseCheckTx - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseCheckTx; - - /** - * Creates a plain object from a ResponseCheckTx message. Also converts values to other types if specified. - * @param message ResponseCheckTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseCheckTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseCheckTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseDeliverTx. */ - interface IResponseDeliverTx { - - /** ResponseDeliverTx code */ - code?: (number|null); - - /** ResponseDeliverTx data */ - data?: (Uint8Array|null); - - /** ResponseDeliverTx log */ - log?: (string|null); - - /** ResponseDeliverTx info */ - info?: (string|null); - - /** ResponseDeliverTx gas_wanted */ - gas_wanted?: (Long|null); - - /** ResponseDeliverTx gas_used */ - gas_used?: (Long|null); - - /** ResponseDeliverTx events */ - events?: (tendermint.abci.IEvent[]|null); - - /** ResponseDeliverTx codespace */ - codespace?: (string|null); - } - - /** Represents a ResponseDeliverTx. */ - class ResponseDeliverTx implements IResponseDeliverTx { - - /** - * Constructs a new ResponseDeliverTx. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseDeliverTx); - - /** ResponseDeliverTx code. */ - public code: number; - - /** ResponseDeliverTx data. */ - public data: Uint8Array; - - /** ResponseDeliverTx log. */ - public log: string; - - /** ResponseDeliverTx info. */ - public info: string; - - /** ResponseDeliverTx gas_wanted. */ - public gas_wanted: Long; - - /** ResponseDeliverTx gas_used. */ - public gas_used: Long; - - /** ResponseDeliverTx events. */ - public events: tendermint.abci.IEvent[]; - - /** ResponseDeliverTx codespace. */ - public codespace: string; - - /** - * Encodes the specified ResponseDeliverTx message. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. - * @param message ResponseDeliverTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseDeliverTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseDeliverTx message, length delimited. Does not implicitly {@link tendermint.abci.ResponseDeliverTx.verify|verify} messages. - * @param message ResponseDeliverTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseDeliverTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseDeliverTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseDeliverTx; - - /** - * Decodes a ResponseDeliverTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseDeliverTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseDeliverTx; - - /** - * Verifies a ResponseDeliverTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseDeliverTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseDeliverTx - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseDeliverTx; - - /** - * Creates a plain object from a ResponseDeliverTx message. Also converts values to other types if specified. - * @param message ResponseDeliverTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseDeliverTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseDeliverTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseEndBlock. */ - interface IResponseEndBlock { - - /** ResponseEndBlock validator_updates */ - validator_updates?: (tendermint.abci.IValidatorUpdate[]|null); - - /** ResponseEndBlock consensus_param_updates */ - consensus_param_updates?: (tendermint.abci.IConsensusParams|null); - - /** ResponseEndBlock events */ - events?: (tendermint.abci.IEvent[]|null); - } - - /** Represents a ResponseEndBlock. */ - class ResponseEndBlock implements IResponseEndBlock { - - /** - * Constructs a new ResponseEndBlock. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseEndBlock); - - /** ResponseEndBlock validator_updates. */ - public validator_updates: tendermint.abci.IValidatorUpdate[]; - - /** ResponseEndBlock consensus_param_updates. */ - public consensus_param_updates?: (tendermint.abci.IConsensusParams|null); - - /** ResponseEndBlock events. */ - public events: tendermint.abci.IEvent[]; - - /** - * Encodes the specified ResponseEndBlock message. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. - * @param message ResponseEndBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseEndBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseEndBlock message, length delimited. Does not implicitly {@link tendermint.abci.ResponseEndBlock.verify|verify} messages. - * @param message ResponseEndBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseEndBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseEndBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseEndBlock; - - /** - * Decodes a ResponseEndBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseEndBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseEndBlock; - - /** - * Verifies a ResponseEndBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseEndBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseEndBlock - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseEndBlock; - - /** - * Creates a plain object from a ResponseEndBlock message. Also converts values to other types if specified. - * @param message ResponseEndBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseEndBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseEndBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseCommit. */ - interface IResponseCommit { - - /** ResponseCommit data */ - data?: (Uint8Array|null); - - /** ResponseCommit retain_height */ - retain_height?: (Long|null); - } - - /** Represents a ResponseCommit. */ - class ResponseCommit implements IResponseCommit { - - /** - * Constructs a new ResponseCommit. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseCommit); - - /** ResponseCommit data. */ - public data: Uint8Array; - - /** ResponseCommit retain_height. */ - public retain_height: Long; - - /** - * Encodes the specified ResponseCommit message. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. - * @param message ResponseCommit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseCommit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseCommit message, length delimited. Does not implicitly {@link tendermint.abci.ResponseCommit.verify|verify} messages. - * @param message ResponseCommit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseCommit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseCommit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseCommit; - - /** - * Decodes a ResponseCommit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseCommit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseCommit; - - /** - * Verifies a ResponseCommit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseCommit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseCommit - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseCommit; - - /** - * Creates a plain object from a ResponseCommit message. Also converts values to other types if specified. - * @param message ResponseCommit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseCommit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseCommit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseListSnapshots. */ - interface IResponseListSnapshots { - - /** ResponseListSnapshots snapshots */ - snapshots?: (tendermint.abci.ISnapshot[]|null); - } - - /** Represents a ResponseListSnapshots. */ - class ResponseListSnapshots implements IResponseListSnapshots { - - /** - * Constructs a new ResponseListSnapshots. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseListSnapshots); - - /** ResponseListSnapshots snapshots. */ - public snapshots: tendermint.abci.ISnapshot[]; - - /** - * Encodes the specified ResponseListSnapshots message. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. - * @param message ResponseListSnapshots message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseListSnapshots, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseListSnapshots message, length delimited. Does not implicitly {@link tendermint.abci.ResponseListSnapshots.verify|verify} messages. - * @param message ResponseListSnapshots message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseListSnapshots, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseListSnapshots message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseListSnapshots; - - /** - * Decodes a ResponseListSnapshots message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseListSnapshots - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseListSnapshots; - - /** - * Verifies a ResponseListSnapshots message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseListSnapshots message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseListSnapshots - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseListSnapshots; - - /** - * Creates a plain object from a ResponseListSnapshots message. Also converts values to other types if specified. - * @param message ResponseListSnapshots - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseListSnapshots, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseListSnapshots to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseOfferSnapshot. */ - interface IResponseOfferSnapshot { - - /** ResponseOfferSnapshot result */ - result?: (tendermint.abci.ResponseOfferSnapshot.Result|null); - } - - /** Represents a ResponseOfferSnapshot. */ - class ResponseOfferSnapshot implements IResponseOfferSnapshot { - - /** - * Constructs a new ResponseOfferSnapshot. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseOfferSnapshot); - - /** ResponseOfferSnapshot result. */ - public result: tendermint.abci.ResponseOfferSnapshot.Result; - - /** - * Encodes the specified ResponseOfferSnapshot message. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. - * @param message ResponseOfferSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseOfferSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseOfferSnapshot message, length delimited. Does not implicitly {@link tendermint.abci.ResponseOfferSnapshot.verify|verify} messages. - * @param message ResponseOfferSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseOfferSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseOfferSnapshot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseOfferSnapshot; - - /** - * Decodes a ResponseOfferSnapshot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseOfferSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseOfferSnapshot; - - /** - * Verifies a ResponseOfferSnapshot message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseOfferSnapshot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseOfferSnapshot - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseOfferSnapshot; - - /** - * Creates a plain object from a ResponseOfferSnapshot message. Also converts values to other types if specified. - * @param message ResponseOfferSnapshot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseOfferSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseOfferSnapshot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace ResponseOfferSnapshot { - - /** Result enum. */ - enum Result { - UNKNOWN = 0, - ACCEPT = 1, - ABORT = 2, - REJECT = 3, - REJECT_FORMAT = 4, - REJECT_SENDER = 5 - } - } - - /** Properties of a ResponseLoadSnapshotChunk. */ - interface IResponseLoadSnapshotChunk { - - /** ResponseLoadSnapshotChunk chunk */ - chunk?: (Uint8Array|null); - } - - /** Represents a ResponseLoadSnapshotChunk. */ - class ResponseLoadSnapshotChunk implements IResponseLoadSnapshotChunk { - - /** - * Constructs a new ResponseLoadSnapshotChunk. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseLoadSnapshotChunk); - - /** ResponseLoadSnapshotChunk chunk. */ - public chunk: Uint8Array; - - /** - * Encodes the specified ResponseLoadSnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. - * @param message ResponseLoadSnapshotChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseLoadSnapshotChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseLoadSnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseLoadSnapshotChunk.verify|verify} messages. - * @param message ResponseLoadSnapshotChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseLoadSnapshotChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseLoadSnapshotChunk; - - /** - * Decodes a ResponseLoadSnapshotChunk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseLoadSnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseLoadSnapshotChunk; - - /** - * Verifies a ResponseLoadSnapshotChunk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseLoadSnapshotChunk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseLoadSnapshotChunk - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseLoadSnapshotChunk; - - /** - * Creates a plain object from a ResponseLoadSnapshotChunk message. Also converts values to other types if specified. - * @param message ResponseLoadSnapshotChunk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseLoadSnapshotChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseLoadSnapshotChunk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ResponseApplySnapshotChunk. */ - interface IResponseApplySnapshotChunk { - - /** ResponseApplySnapshotChunk result */ - result?: (tendermint.abci.ResponseApplySnapshotChunk.Result|null); - - /** ResponseApplySnapshotChunk refetch_chunks */ - refetch_chunks?: (number[]|null); - - /** ResponseApplySnapshotChunk reject_senders */ - reject_senders?: (string[]|null); - } - - /** Represents a ResponseApplySnapshotChunk. */ - class ResponseApplySnapshotChunk implements IResponseApplySnapshotChunk { - - /** - * Constructs a new ResponseApplySnapshotChunk. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IResponseApplySnapshotChunk); - - /** ResponseApplySnapshotChunk result. */ - public result: tendermint.abci.ResponseApplySnapshotChunk.Result; - - /** ResponseApplySnapshotChunk refetch_chunks. */ - public refetch_chunks: number[]; - - /** ResponseApplySnapshotChunk reject_senders. */ - public reject_senders: string[]; - - /** - * Encodes the specified ResponseApplySnapshotChunk message. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. - * @param message ResponseApplySnapshotChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IResponseApplySnapshotChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResponseApplySnapshotChunk message, length delimited. Does not implicitly {@link tendermint.abci.ResponseApplySnapshotChunk.verify|verify} messages. - * @param message ResponseApplySnapshotChunk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IResponseApplySnapshotChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ResponseApplySnapshotChunk; - - /** - * Decodes a ResponseApplySnapshotChunk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseApplySnapshotChunk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ResponseApplySnapshotChunk; - - /** - * Verifies a ResponseApplySnapshotChunk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResponseApplySnapshotChunk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseApplySnapshotChunk - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ResponseApplySnapshotChunk; - - /** - * Creates a plain object from a ResponseApplySnapshotChunk message. Also converts values to other types if specified. - * @param message ResponseApplySnapshotChunk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ResponseApplySnapshotChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResponseApplySnapshotChunk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace ResponseApplySnapshotChunk { - - /** Result enum. */ - enum Result { - UNKNOWN = 0, - ACCEPT = 1, - ABORT = 2, - RETRY = 3, - RETRY_SNAPSHOT = 4, - REJECT_SNAPSHOT = 5 - } - } - - /** Properties of a ConsensusParams. */ - interface IConsensusParams { - - /** ConsensusParams block */ - block?: (tendermint.abci.IBlockParams|null); - - /** ConsensusParams evidence */ - evidence?: (tendermint.types.IEvidenceParams|null); - - /** ConsensusParams validator */ - validator?: (tendermint.types.IValidatorParams|null); - - /** ConsensusParams version */ - version?: (tendermint.types.IVersionParams|null); - } - - /** Represents a ConsensusParams. */ - class ConsensusParams implements IConsensusParams { - - /** - * Constructs a new ConsensusParams. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IConsensusParams); - - /** ConsensusParams block. */ - public block?: (tendermint.abci.IBlockParams|null); - - /** ConsensusParams evidence. */ - public evidence?: (tendermint.types.IEvidenceParams|null); - - /** ConsensusParams validator. */ - public validator?: (tendermint.types.IValidatorParams|null); - - /** ConsensusParams version. */ - public version?: (tendermint.types.IVersionParams|null); - - /** - * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. - * @param message ConsensusParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IConsensusParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.abci.ConsensusParams.verify|verify} messages. - * @param message ConsensusParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IConsensusParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ConsensusParams; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ConsensusParams; - - /** - * Verifies a ConsensusParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsensusParams - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ConsensusParams; - - /** - * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. - * @param message ConsensusParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ConsensusParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsensusParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BlockParams. */ - interface IBlockParams { - - /** BlockParams max_bytes */ - max_bytes?: (Long|null); - - /** BlockParams max_gas */ - max_gas?: (Long|null); - } - - /** Represents a BlockParams. */ - class BlockParams implements IBlockParams { - - /** - * Constructs a new BlockParams. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IBlockParams); - - /** BlockParams max_bytes. */ - public max_bytes: Long; - - /** BlockParams max_gas. */ - public max_gas: Long; - - /** - * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. - * @param message BlockParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IBlockParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.abci.BlockParams.verify|verify} messages. - * @param message BlockParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IBlockParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.BlockParams; - - /** - * Decodes a BlockParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.BlockParams; - - /** - * Verifies a BlockParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BlockParams - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.BlockParams; - - /** - * Creates a plain object from a BlockParams message. Also converts values to other types if specified. - * @param message BlockParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.BlockParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BlockParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a LastCommitInfo. */ - interface ILastCommitInfo { - - /** LastCommitInfo round */ - round?: (number|null); - - /** LastCommitInfo votes */ - votes?: (tendermint.abci.IVoteInfo[]|null); - } - - /** Represents a LastCommitInfo. */ - class LastCommitInfo implements ILastCommitInfo { - - /** - * Constructs a new LastCommitInfo. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.ILastCommitInfo); - - /** LastCommitInfo round. */ - public round: number; - - /** LastCommitInfo votes. */ - public votes: tendermint.abci.IVoteInfo[]; - - /** - * Encodes the specified LastCommitInfo message. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. - * @param message LastCommitInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.ILastCommitInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LastCommitInfo message, length delimited. Does not implicitly {@link tendermint.abci.LastCommitInfo.verify|verify} messages. - * @param message LastCommitInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.ILastCommitInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LastCommitInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LastCommitInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.LastCommitInfo; - - /** - * Decodes a LastCommitInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LastCommitInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.LastCommitInfo; - - /** - * Verifies a LastCommitInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LastCommitInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LastCommitInfo - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.LastCommitInfo; - - /** - * Creates a plain object from a LastCommitInfo message. Also converts values to other types if specified. - * @param message LastCommitInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.LastCommitInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LastCommitInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Event. */ - interface IEvent { - - /** Event type */ - type?: (string|null); - - /** Event attributes */ - attributes?: (tendermint.abci.IEventAttribute[]|null); - } - - /** Represents an Event. */ - class Event implements IEvent { - - /** - * Constructs a new Event. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IEvent); - - /** Event type. */ - public type: string; - - /** Event attributes. */ - public attributes: tendermint.abci.IEventAttribute[]; - - /** - * Encodes the specified Event message. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. - * @param message Event message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link tendermint.abci.Event.verify|verify} messages. - * @param message Event message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Event message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.Event; - - /** - * Decodes an Event message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.Event; - - /** - * Verifies an Event message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Event - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.Event; - - /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @param message Event - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.Event, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Event to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EventAttribute. */ - interface IEventAttribute { - - /** EventAttribute key */ - key?: (Uint8Array|null); - - /** EventAttribute value */ - value?: (Uint8Array|null); - - /** EventAttribute index */ - index?: (boolean|null); - } - - /** Represents an EventAttribute. */ - class EventAttribute implements IEventAttribute { - - /** - * Constructs a new EventAttribute. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IEventAttribute); - - /** EventAttribute key. */ - public key: Uint8Array; - - /** EventAttribute value. */ - public value: Uint8Array; - - /** EventAttribute index. */ - public index: boolean; - - /** - * Encodes the specified EventAttribute message. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. - * @param message EventAttribute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IEventAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EventAttribute message, length delimited. Does not implicitly {@link tendermint.abci.EventAttribute.verify|verify} messages. - * @param message EventAttribute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IEventAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EventAttribute message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EventAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.EventAttribute; - - /** - * Decodes an EventAttribute message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EventAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.EventAttribute; - - /** - * Verifies an EventAttribute message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EventAttribute message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EventAttribute - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.EventAttribute; - - /** - * Creates a plain object from an EventAttribute message. Also converts values to other types if specified. - * @param message EventAttribute - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.EventAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EventAttribute to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TxResult. */ - interface ITxResult { - - /** TxResult height */ - height?: (Long|null); - - /** TxResult index */ - index?: (number|null); - - /** TxResult tx */ - tx?: (Uint8Array|null); - - /** TxResult result */ - result?: (tendermint.abci.IResponseDeliverTx|null); - } - - /** Represents a TxResult. */ - class TxResult implements ITxResult { - - /** - * Constructs a new TxResult. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.ITxResult); - - /** TxResult height. */ - public height: Long; - - /** TxResult index. */ - public index: number; - - /** TxResult tx. */ - public tx: Uint8Array; - - /** TxResult result. */ - public result?: (tendermint.abci.IResponseDeliverTx|null); - - /** - * Encodes the specified TxResult message. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. - * @param message TxResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.ITxResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TxResult message, length delimited. Does not implicitly {@link tendermint.abci.TxResult.verify|verify} messages. - * @param message TxResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.ITxResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TxResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.TxResult; - - /** - * Decodes a TxResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TxResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.TxResult; - - /** - * Verifies a TxResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TxResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TxResult - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.TxResult; - - /** - * Creates a plain object from a TxResult message. Also converts values to other types if specified. - * @param message TxResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.TxResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TxResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Validator. */ - interface IValidator { - - /** Validator address */ - address?: (Uint8Array|null); - - /** Validator power */ - power?: (Long|null); - } - - /** Represents a Validator. */ - class Validator implements IValidator { - - /** - * Constructs a new Validator. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IValidator); - - /** Validator address. */ - public address: Uint8Array; - - /** Validator power. */ - public power: Long; - - /** - * Encodes the specified Validator message. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. - * @param message Validator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.abci.Validator.verify|verify} messages. - * @param message Validator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.Validator; - - /** - * Decodes a Validator message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.Validator; - - /** - * Verifies a Validator message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Validator message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Validator - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.Validator; - - /** - * Creates a plain object from a Validator message. Also converts values to other types if specified. - * @param message Validator - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.Validator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Validator to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ValidatorUpdate. */ - interface IValidatorUpdate { - - /** ValidatorUpdate pub_key */ - pub_key?: (tendermint.crypto.IPublicKey|null); - - /** ValidatorUpdate power */ - power?: (Long|null); - } - - /** Represents a ValidatorUpdate. */ - class ValidatorUpdate implements IValidatorUpdate { - - /** - * Constructs a new ValidatorUpdate. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IValidatorUpdate); - - /** ValidatorUpdate pub_key. */ - public pub_key?: (tendermint.crypto.IPublicKey|null); - - /** ValidatorUpdate power. */ - public power: Long; - - /** - * Encodes the specified ValidatorUpdate message. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. - * @param message ValidatorUpdate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IValidatorUpdate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidatorUpdate message, length delimited. Does not implicitly {@link tendermint.abci.ValidatorUpdate.verify|verify} messages. - * @param message ValidatorUpdate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IValidatorUpdate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidatorUpdate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidatorUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.ValidatorUpdate; - - /** - * Decodes a ValidatorUpdate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidatorUpdate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.ValidatorUpdate; - - /** - * Verifies a ValidatorUpdate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValidatorUpdate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidatorUpdate - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.ValidatorUpdate; - - /** - * Creates a plain object from a ValidatorUpdate message. Also converts values to other types if specified. - * @param message ValidatorUpdate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.ValidatorUpdate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidatorUpdate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a VoteInfo. */ - interface IVoteInfo { - - /** VoteInfo validator */ - validator?: (tendermint.abci.IValidator|null); - - /** VoteInfo signed_last_block */ - signed_last_block?: (boolean|null); - } - - /** Represents a VoteInfo. */ - class VoteInfo implements IVoteInfo { - - /** - * Constructs a new VoteInfo. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IVoteInfo); - - /** VoteInfo validator. */ - public validator?: (tendermint.abci.IValidator|null); - - /** VoteInfo signed_last_block. */ - public signed_last_block: boolean; - - /** - * Encodes the specified VoteInfo message. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. - * @param message VoteInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IVoteInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VoteInfo message, length delimited. Does not implicitly {@link tendermint.abci.VoteInfo.verify|verify} messages. - * @param message VoteInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IVoteInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VoteInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VoteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.VoteInfo; - - /** - * Decodes a VoteInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VoteInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.VoteInfo; - - /** - * Verifies a VoteInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VoteInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VoteInfo - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.VoteInfo; - - /** - * Creates a plain object from a VoteInfo message. Also converts values to other types if specified. - * @param message VoteInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.VoteInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VoteInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** EvidenceType enum. */ - enum EvidenceType { - UNKNOWN = 0, - DUPLICATE_VOTE = 1, - LIGHT_CLIENT_ATTACK = 2 - } - - /** Properties of an Evidence. */ - interface IEvidence { - - /** Evidence type */ - type?: (tendermint.abci.EvidenceType|null); - - /** Evidence validator */ - validator?: (tendermint.abci.IValidator|null); - - /** Evidence height */ - height?: (Long|null); - - /** Evidence time */ - time?: (google.protobuf.ITimestamp|null); - - /** Evidence total_voting_power */ - total_voting_power?: (Long|null); - } - - /** Represents an Evidence. */ - class Evidence implements IEvidence { - - /** - * Constructs a new Evidence. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.IEvidence); - - /** Evidence type. */ - public type: tendermint.abci.EvidenceType; - - /** Evidence validator. */ - public validator?: (tendermint.abci.IValidator|null); - - /** Evidence height. */ - public height: Long; - - /** Evidence time. */ - public time?: (google.protobuf.ITimestamp|null); - - /** Evidence total_voting_power. */ - public total_voting_power: Long; - - /** - * Encodes the specified Evidence message. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. - * @param message Evidence message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.IEvidence, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Evidence message, length delimited. Does not implicitly {@link tendermint.abci.Evidence.verify|verify} messages. - * @param message Evidence message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.IEvidence, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Evidence message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Evidence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.Evidence; - - /** - * Decodes an Evidence message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Evidence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.Evidence; - - /** - * Verifies an Evidence message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Evidence message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Evidence - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.Evidence; - - /** - * Creates a plain object from an Evidence message. Also converts values to other types if specified. - * @param message Evidence - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.Evidence, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Evidence to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Snapshot. */ - interface ISnapshot { - - /** Snapshot height */ - height?: (Long|null); - - /** Snapshot format */ - format?: (number|null); - - /** Snapshot chunks */ - chunks?: (number|null); - - /** Snapshot hash */ - hash?: (Uint8Array|null); - - /** Snapshot metadata */ - metadata?: (Uint8Array|null); - } - - /** Represents a Snapshot. */ - class Snapshot implements ISnapshot { - - /** - * Constructs a new Snapshot. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.abci.ISnapshot); - - /** Snapshot height. */ - public height: Long; - - /** Snapshot format. */ - public format: number; - - /** Snapshot chunks. */ - public chunks: number; - - /** Snapshot hash. */ - public hash: Uint8Array; - - /** Snapshot metadata. */ - public metadata: Uint8Array; - - /** - * Encodes the specified Snapshot message. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. - * @param message Snapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.abci.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link tendermint.abci.Snapshot.verify|verify} messages. - * @param message Snapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.abci.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Snapshot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.abci.Snapshot; - - /** - * Decodes a Snapshot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Snapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.abci.Snapshot; - - /** - * Verifies a Snapshot message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Snapshot - */ - public static fromObject(object: { [k: string]: any }): tendermint.abci.Snapshot; - - /** - * Creates a plain object from a Snapshot message. Also converts values to other types if specified. - * @param message Snapshot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.abci.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Snapshot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a ABCIApplication */ - class ABCIApplication extends $protobuf.rpc.Service { - - /** - * Constructs a new ABCIApplication service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Echo. - * @param request RequestEcho message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseEcho - */ - public echo(request: tendermint.abci.IRequestEcho, callback: tendermint.abci.ABCIApplication.EchoCallback): void; - - /** - * Calls Echo. - * @param request RequestEcho message or plain object - * @returns Promise - */ - public echo(request: tendermint.abci.IRequestEcho): Promise; - - /** - * Calls Flush. - * @param request RequestFlush message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseFlush - */ - public flush(request: tendermint.abci.IRequestFlush, callback: tendermint.abci.ABCIApplication.FlushCallback): void; - - /** - * Calls Flush. - * @param request RequestFlush message or plain object - * @returns Promise - */ - public flush(request: tendermint.abci.IRequestFlush): Promise; - - /** - * Calls Info. - * @param request RequestInfo message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseInfo - */ - public info(request: tendermint.abci.IRequestInfo, callback: tendermint.abci.ABCIApplication.InfoCallback): void; - - /** - * Calls Info. - * @param request RequestInfo message or plain object - * @returns Promise - */ - public info(request: tendermint.abci.IRequestInfo): Promise; - - /** - * Calls SetOption. - * @param request RequestSetOption message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseSetOption - */ - public setOption(request: tendermint.abci.IRequestSetOption, callback: tendermint.abci.ABCIApplication.SetOptionCallback): void; - - /** - * Calls SetOption. - * @param request RequestSetOption message or plain object - * @returns Promise - */ - public setOption(request: tendermint.abci.IRequestSetOption): Promise; - - /** - * Calls DeliverTx. - * @param request RequestDeliverTx message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseDeliverTx - */ - public deliverTx(request: tendermint.abci.IRequestDeliverTx, callback: tendermint.abci.ABCIApplication.DeliverTxCallback): void; - - /** - * Calls DeliverTx. - * @param request RequestDeliverTx message or plain object - * @returns Promise - */ - public deliverTx(request: tendermint.abci.IRequestDeliverTx): Promise; - - /** - * Calls CheckTx. - * @param request RequestCheckTx message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseCheckTx - */ - public checkTx(request: tendermint.abci.IRequestCheckTx, callback: tendermint.abci.ABCIApplication.CheckTxCallback): void; - - /** - * Calls CheckTx. - * @param request RequestCheckTx message or plain object - * @returns Promise - */ - public checkTx(request: tendermint.abci.IRequestCheckTx): Promise; - - /** - * Calls Query. - * @param request RequestQuery message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseQuery - */ - public query(request: tendermint.abci.IRequestQuery, callback: tendermint.abci.ABCIApplication.QueryCallback): void; - - /** - * Calls Query. - * @param request RequestQuery message or plain object - * @returns Promise - */ - public query(request: tendermint.abci.IRequestQuery): Promise; - - /** - * Calls Commit. - * @param request RequestCommit message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseCommit - */ - public commit(request: tendermint.abci.IRequestCommit, callback: tendermint.abci.ABCIApplication.CommitCallback): void; - - /** - * Calls Commit. - * @param request RequestCommit message or plain object - * @returns Promise - */ - public commit(request: tendermint.abci.IRequestCommit): Promise; - - /** - * Calls InitChain. - * @param request RequestInitChain message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseInitChain - */ - public initChain(request: tendermint.abci.IRequestInitChain, callback: tendermint.abci.ABCIApplication.InitChainCallback): void; - - /** - * Calls InitChain. - * @param request RequestInitChain message or plain object - * @returns Promise - */ - public initChain(request: tendermint.abci.IRequestInitChain): Promise; - - /** - * Calls BeginBlock. - * @param request RequestBeginBlock message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseBeginBlock - */ - public beginBlock(request: tendermint.abci.IRequestBeginBlock, callback: tendermint.abci.ABCIApplication.BeginBlockCallback): void; - - /** - * Calls BeginBlock. - * @param request RequestBeginBlock message or plain object - * @returns Promise - */ - public beginBlock(request: tendermint.abci.IRequestBeginBlock): Promise; - - /** - * Calls EndBlock. - * @param request RequestEndBlock message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseEndBlock - */ - public endBlock(request: tendermint.abci.IRequestEndBlock, callback: tendermint.abci.ABCIApplication.EndBlockCallback): void; - - /** - * Calls EndBlock. - * @param request RequestEndBlock message or plain object - * @returns Promise - */ - public endBlock(request: tendermint.abci.IRequestEndBlock): Promise; - - /** - * Calls ListSnapshots. - * @param request RequestListSnapshots message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseListSnapshots - */ - public listSnapshots(request: tendermint.abci.IRequestListSnapshots, callback: tendermint.abci.ABCIApplication.ListSnapshotsCallback): void; - - /** - * Calls ListSnapshots. - * @param request RequestListSnapshots message or plain object - * @returns Promise - */ - public listSnapshots(request: tendermint.abci.IRequestListSnapshots): Promise; - - /** - * Calls OfferSnapshot. - * @param request RequestOfferSnapshot message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseOfferSnapshot - */ - public offerSnapshot(request: tendermint.abci.IRequestOfferSnapshot, callback: tendermint.abci.ABCIApplication.OfferSnapshotCallback): void; - - /** - * Calls OfferSnapshot. - * @param request RequestOfferSnapshot message or plain object - * @returns Promise - */ - public offerSnapshot(request: tendermint.abci.IRequestOfferSnapshot): Promise; - - /** - * Calls LoadSnapshotChunk. - * @param request RequestLoadSnapshotChunk message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseLoadSnapshotChunk - */ - public loadSnapshotChunk(request: tendermint.abci.IRequestLoadSnapshotChunk, callback: tendermint.abci.ABCIApplication.LoadSnapshotChunkCallback): void; - - /** - * Calls LoadSnapshotChunk. - * @param request RequestLoadSnapshotChunk message or plain object - * @returns Promise - */ - public loadSnapshotChunk(request: tendermint.abci.IRequestLoadSnapshotChunk): Promise; - - /** - * Calls ApplySnapshotChunk. - * @param request RequestApplySnapshotChunk message or plain object - * @param callback Node-style callback called with the error, if any, and ResponseApplySnapshotChunk - */ - public applySnapshotChunk(request: tendermint.abci.IRequestApplySnapshotChunk, callback: tendermint.abci.ABCIApplication.ApplySnapshotChunkCallback): void; - - /** - * Calls ApplySnapshotChunk. - * @param request RequestApplySnapshotChunk message or plain object - * @returns Promise - */ - public applySnapshotChunk(request: tendermint.abci.IRequestApplySnapshotChunk): Promise; - } - - namespace ABCIApplication { - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#echo}. - * @param error Error, if any - * @param [response] ResponseEcho - */ - type EchoCallback = (error: (Error|null), response?: tendermint.abci.ResponseEcho) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#flush}. - * @param error Error, if any - * @param [response] ResponseFlush - */ - type FlushCallback = (error: (Error|null), response?: tendermint.abci.ResponseFlush) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#info}. - * @param error Error, if any - * @param [response] ResponseInfo - */ - type InfoCallback = (error: (Error|null), response?: tendermint.abci.ResponseInfo) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#setOption}. - * @param error Error, if any - * @param [response] ResponseSetOption - */ - type SetOptionCallback = (error: (Error|null), response?: tendermint.abci.ResponseSetOption) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#deliverTx}. - * @param error Error, if any - * @param [response] ResponseDeliverTx - */ - type DeliverTxCallback = (error: (Error|null), response?: tendermint.abci.ResponseDeliverTx) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#checkTx}. - * @param error Error, if any - * @param [response] ResponseCheckTx - */ - type CheckTxCallback = (error: (Error|null), response?: tendermint.abci.ResponseCheckTx) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#query}. - * @param error Error, if any - * @param [response] ResponseQuery - */ - type QueryCallback = (error: (Error|null), response?: tendermint.abci.ResponseQuery) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#commit}. - * @param error Error, if any - * @param [response] ResponseCommit - */ - type CommitCallback = (error: (Error|null), response?: tendermint.abci.ResponseCommit) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#initChain}. - * @param error Error, if any - * @param [response] ResponseInitChain - */ - type InitChainCallback = (error: (Error|null), response?: tendermint.abci.ResponseInitChain) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#beginBlock}. - * @param error Error, if any - * @param [response] ResponseBeginBlock - */ - type BeginBlockCallback = (error: (Error|null), response?: tendermint.abci.ResponseBeginBlock) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#endBlock}. - * @param error Error, if any - * @param [response] ResponseEndBlock - */ - type EndBlockCallback = (error: (Error|null), response?: tendermint.abci.ResponseEndBlock) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#listSnapshots}. - * @param error Error, if any - * @param [response] ResponseListSnapshots - */ - type ListSnapshotsCallback = (error: (Error|null), response?: tendermint.abci.ResponseListSnapshots) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#offerSnapshot}. - * @param error Error, if any - * @param [response] ResponseOfferSnapshot - */ - type OfferSnapshotCallback = (error: (Error|null), response?: tendermint.abci.ResponseOfferSnapshot) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#loadSnapshotChunk}. - * @param error Error, if any - * @param [response] ResponseLoadSnapshotChunk - */ - type LoadSnapshotChunkCallback = (error: (Error|null), response?: tendermint.abci.ResponseLoadSnapshotChunk) => void; - - /** - * Callback as used by {@link tendermint.abci.ABCIApplication#applySnapshotChunk}. - * @param error Error, if any - * @param [response] ResponseApplySnapshotChunk - */ - type ApplySnapshotChunkCallback = (error: (Error|null), response?: tendermint.abci.ResponseApplySnapshotChunk) => void; - } - } - - /** Namespace types. */ - namespace types { - - /** BlockIDFlag enum. */ - enum BlockIDFlag { - BLOCK_ID_FLAG_UNKNOWN = 0, - BLOCK_ID_FLAG_ABSENT = 1, - BLOCK_ID_FLAG_COMMIT = 2, - BLOCK_ID_FLAG_NIL = 3 - } - - /** SignedMsgType enum. */ - enum SignedMsgType { - SIGNED_MSG_TYPE_UNKNOWN = 0, - SIGNED_MSG_TYPE_PREVOTE = 1, - SIGNED_MSG_TYPE_PRECOMMIT = 2, - SIGNED_MSG_TYPE_PROPOSAL = 32 - } - - /** Properties of a PartSetHeader. */ - interface IPartSetHeader { - - /** PartSetHeader total */ - total?: (number|null); - - /** PartSetHeader hash */ - hash?: (Uint8Array|null); - } - - /** Represents a PartSetHeader. */ - class PartSetHeader implements IPartSetHeader { - - /** - * Constructs a new PartSetHeader. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IPartSetHeader); - - /** PartSetHeader total. */ - public total: number; - - /** PartSetHeader hash. */ - public hash: Uint8Array; - - /** - * Encodes the specified PartSetHeader message. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @param message PartSetHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IPartSetHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PartSetHeader message, length delimited. Does not implicitly {@link tendermint.types.PartSetHeader.verify|verify} messages. - * @param message PartSetHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IPartSetHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.PartSetHeader; - - /** - * Decodes a PartSetHeader message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PartSetHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.PartSetHeader; - - /** - * Verifies a PartSetHeader message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PartSetHeader message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartSetHeader - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.PartSetHeader; - - /** - * Creates a plain object from a PartSetHeader message. Also converts values to other types if specified. - * @param message PartSetHeader - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.PartSetHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartSetHeader to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Part. */ - interface IPart { - - /** Part index */ - index?: (number|null); - - /** Part bytes */ - bytes?: (Uint8Array|null); - - /** Part proof */ - proof?: (tendermint.crypto.IProof|null); - } - - /** Represents a Part. */ - class Part implements IPart { - - /** - * Constructs a new Part. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IPart); - - /** Part index. */ - public index: number; - - /** Part bytes. */ - public bytes: Uint8Array; - - /** Part proof. */ - public proof?: (tendermint.crypto.IProof|null); - - /** - * Encodes the specified Part message. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link tendermint.types.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Part message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Part; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Part; - - /** - * Verifies a Part message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Part - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Part; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @param message Part - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Part to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BlockID. */ - interface IBlockID { - - /** BlockID hash */ - hash?: (Uint8Array|null); - - /** BlockID part_set_header */ - part_set_header?: (tendermint.types.IPartSetHeader|null); - } - - /** Represents a BlockID. */ - class BlockID implements IBlockID { - - /** - * Constructs a new BlockID. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IBlockID); - - /** BlockID hash. */ - public hash: Uint8Array; - - /** BlockID part_set_header. */ - public part_set_header?: (tendermint.types.IPartSetHeader|null); - - /** - * Encodes the specified BlockID message. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @param message BlockID message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IBlockID, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BlockID message, length delimited. Does not implicitly {@link tendermint.types.BlockID.verify|verify} messages. - * @param message BlockID message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IBlockID, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockID message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.BlockID; - - /** - * Decodes a BlockID message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BlockID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.BlockID; - - /** - * Verifies a BlockID message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BlockID message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BlockID - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.BlockID; - - /** - * Creates a plain object from a BlockID message. Also converts values to other types if specified. - * @param message BlockID - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.BlockID, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BlockID to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Header. */ - interface IHeader { - - /** Header version */ - version?: (tendermint.version.IConsensus|null); - - /** Header chain_id */ - chain_id?: (string|null); - - /** Header height */ - height?: (Long|null); - - /** Header time */ - time?: (google.protobuf.ITimestamp|null); - - /** Header last_block_id */ - last_block_id?: (tendermint.types.IBlockID|null); - - /** Header last_commit_hash */ - last_commit_hash?: (Uint8Array|null); - - /** Header data_hash */ - data_hash?: (Uint8Array|null); - - /** Header validators_hash */ - validators_hash?: (Uint8Array|null); - - /** Header next_validators_hash */ - next_validators_hash?: (Uint8Array|null); - - /** Header consensus_hash */ - consensus_hash?: (Uint8Array|null); - - /** Header app_hash */ - app_hash?: (Uint8Array|null); - - /** Header last_results_hash */ - last_results_hash?: (Uint8Array|null); - - /** Header evidence_hash */ - evidence_hash?: (Uint8Array|null); - - /** Header proposer_address */ - proposer_address?: (Uint8Array|null); - } - - /** Represents a Header. */ - class Header implements IHeader { - - /** - * Constructs a new Header. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IHeader); - - /** Header version. */ - public version?: (tendermint.version.IConsensus|null); - - /** Header chain_id. */ - public chain_id: string; - - /** Header height. */ - public height: Long; - - /** Header time. */ - public time?: (google.protobuf.ITimestamp|null); - - /** Header last_block_id. */ - public last_block_id?: (tendermint.types.IBlockID|null); - - /** Header last_commit_hash. */ - public last_commit_hash: Uint8Array; - - /** Header data_hash. */ - public data_hash: Uint8Array; - - /** Header validators_hash. */ - public validators_hash: Uint8Array; - - /** Header next_validators_hash. */ - public next_validators_hash: Uint8Array; - - /** Header consensus_hash. */ - public consensus_hash: Uint8Array; - - /** Header app_hash. */ - public app_hash: Uint8Array; - - /** Header last_results_hash. */ - public last_results_hash: Uint8Array; - - /** Header evidence_hash. */ - public evidence_hash: Uint8Array; - - /** Header proposer_address. */ - public proposer_address: Uint8Array; - - /** - * Encodes the specified Header message. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link tendermint.types.Header.verify|verify} messages. - * @param message Header message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Header message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Header; - - /** - * Decodes a Header message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Header - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Header; - - /** - * Verifies a Header message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Header - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Header; - - /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @param message Header - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Header to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Data. */ - interface IData { - - /** Data txs */ - txs?: (Uint8Array[]|null); - } - - /** Represents a Data. */ - class Data implements IData { - - /** - * Constructs a new Data. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IData); - - /** Data txs. */ - public txs: Uint8Array[]; - - /** - * Encodes the specified Data message. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @param message Data message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Data message, length delimited. Does not implicitly {@link tendermint.types.Data.verify|verify} messages. - * @param message Data message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Data message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Data; - - /** - * Decodes a Data message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Data - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Data; - - /** - * Verifies a Data message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Data message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Data - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Data; - - /** - * Creates a plain object from a Data message. Also converts values to other types if specified. - * @param message Data - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Data, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Data to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Vote. */ - interface IVote { - - /** Vote type */ - type?: (tendermint.types.SignedMsgType|null); - - /** Vote height */ - height?: (Long|null); - - /** Vote round */ - round?: (number|null); - - /** Vote block_id */ - block_id?: (tendermint.types.IBlockID|null); - - /** Vote timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - - /** Vote validator_address */ - validator_address?: (Uint8Array|null); - - /** Vote validator_index */ - validator_index?: (number|null); - - /** Vote signature */ - signature?: (Uint8Array|null); - } - - /** Represents a Vote. */ - class Vote implements IVote { - - /** - * Constructs a new Vote. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IVote); - - /** Vote type. */ - public type: tendermint.types.SignedMsgType; - - /** Vote height. */ - public height: Long; - - /** Vote round. */ - public round: number; - - /** Vote block_id. */ - public block_id?: (tendermint.types.IBlockID|null); - - /** Vote timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** Vote validator_address. */ - public validator_address: Uint8Array; - - /** Vote validator_index. */ - public validator_index: number; - - /** Vote signature. */ - public signature: Uint8Array; - - /** - * Encodes the specified Vote message. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @param message Vote message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IVote, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Vote message, length delimited. Does not implicitly {@link tendermint.types.Vote.verify|verify} messages. - * @param message Vote message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IVote, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Vote message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Vote; - - /** - * Decodes a Vote message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Vote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Vote; - - /** - * Verifies a Vote message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Vote message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Vote - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Vote; - - /** - * Creates a plain object from a Vote message. Also converts values to other types if specified. - * @param message Vote - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Vote, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Vote to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Commit. */ - interface ICommit { - - /** Commit height */ - height?: (Long|null); - - /** Commit round */ - round?: (number|null); - - /** Commit block_id */ - block_id?: (tendermint.types.IBlockID|null); - - /** Commit signatures */ - signatures?: (tendermint.types.ICommitSig[]|null); - } - - /** Represents a Commit. */ - class Commit implements ICommit { - - /** - * Constructs a new Commit. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ICommit); - - /** Commit height. */ - public height: Long; - - /** Commit round. */ - public round: number; - - /** Commit block_id. */ - public block_id?: (tendermint.types.IBlockID|null); - - /** Commit signatures. */ - public signatures: tendermint.types.ICommitSig[]; - - /** - * Encodes the specified Commit message. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @param message Commit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ICommit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Commit message, length delimited. Does not implicitly {@link tendermint.types.Commit.verify|verify} messages. - * @param message Commit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ICommit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Commit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Commit; - - /** - * Decodes a Commit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Commit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Commit; - - /** - * Verifies a Commit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Commit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Commit - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Commit; - - /** - * Creates a plain object from a Commit message. Also converts values to other types if specified. - * @param message Commit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Commit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Commit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CommitSig. */ - interface ICommitSig { - - /** CommitSig block_id_flag */ - block_id_flag?: (tendermint.types.BlockIDFlag|null); - - /** CommitSig validator_address */ - validator_address?: (Uint8Array|null); - - /** CommitSig timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - - /** CommitSig signature */ - signature?: (Uint8Array|null); - } - - /** Represents a CommitSig. */ - class CommitSig implements ICommitSig { - - /** - * Constructs a new CommitSig. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ICommitSig); - - /** CommitSig block_id_flag. */ - public block_id_flag: tendermint.types.BlockIDFlag; - - /** CommitSig validator_address. */ - public validator_address: Uint8Array; - - /** CommitSig timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** CommitSig signature. */ - public signature: Uint8Array; - - /** - * Encodes the specified CommitSig message. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @param message CommitSig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ICommitSig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommitSig message, length delimited. Does not implicitly {@link tendermint.types.CommitSig.verify|verify} messages. - * @param message CommitSig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ICommitSig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommitSig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.CommitSig; - - /** - * Decodes a CommitSig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommitSig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.CommitSig; - - /** - * Verifies a CommitSig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitSig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitSig - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.CommitSig; - - /** - * Creates a plain object from a CommitSig message. Also converts values to other types if specified. - * @param message CommitSig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.CommitSig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitSig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Proposal. */ - interface IProposal { - - /** Proposal type */ - type?: (tendermint.types.SignedMsgType|null); - - /** Proposal height */ - height?: (Long|null); - - /** Proposal round */ - round?: (number|null); - - /** Proposal pol_round */ - pol_round?: (number|null); - - /** Proposal block_id */ - block_id?: (tendermint.types.IBlockID|null); - - /** Proposal timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); - - /** Proposal signature */ - signature?: (Uint8Array|null); - } - - /** Represents a Proposal. */ - class Proposal implements IProposal { - - /** - * Constructs a new Proposal. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IProposal); - - /** Proposal type. */ - public type: tendermint.types.SignedMsgType; - - /** Proposal height. */ - public height: Long; - - /** Proposal round. */ - public round: number; - - /** Proposal pol_round. */ - public pol_round: number; - - /** Proposal block_id. */ - public block_id?: (tendermint.types.IBlockID|null); - - /** Proposal timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); - - /** Proposal signature. */ - public signature: Uint8Array; - - /** - * Encodes the specified Proposal message. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @param message Proposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Proposal message, length delimited. Does not implicitly {@link tendermint.types.Proposal.verify|verify} messages. - * @param message Proposal message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IProposal, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Proposal message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Proposal; - - /** - * Decodes a Proposal message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Proposal - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Proposal; - - /** - * Verifies a Proposal message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Proposal message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Proposal - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Proposal; - - /** - * Creates a plain object from a Proposal message. Also converts values to other types if specified. - * @param message Proposal - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Proposal, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Proposal to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SignedHeader. */ - interface ISignedHeader { - - /** SignedHeader header */ - header?: (tendermint.types.IHeader|null); - - /** SignedHeader commit */ - commit?: (tendermint.types.ICommit|null); - } - - /** Represents a SignedHeader. */ - class SignedHeader implements ISignedHeader { - - /** - * Constructs a new SignedHeader. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ISignedHeader); - - /** SignedHeader header. */ - public header?: (tendermint.types.IHeader|null); - - /** SignedHeader commit. */ - public commit?: (tendermint.types.ICommit|null); - - /** - * Encodes the specified SignedHeader message. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @param message SignedHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ISignedHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SignedHeader message, length delimited. Does not implicitly {@link tendermint.types.SignedHeader.verify|verify} messages. - * @param message SignedHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ISignedHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SignedHeader message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.SignedHeader; - - /** - * Decodes a SignedHeader message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SignedHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.SignedHeader; - - /** - * Verifies a SignedHeader message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SignedHeader message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SignedHeader - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.SignedHeader; - - /** - * Creates a plain object from a SignedHeader message. Also converts values to other types if specified. - * @param message SignedHeader - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.SignedHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SignedHeader to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a LightBlock. */ - interface ILightBlock { - - /** LightBlock signed_header */ - signed_header?: (tendermint.types.ISignedHeader|null); - - /** LightBlock validator_set */ - validator_set?: (tendermint.types.IValidatorSet|null); - } - - /** Represents a LightBlock. */ - class LightBlock implements ILightBlock { - - /** - * Constructs a new LightBlock. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ILightBlock); - - /** LightBlock signed_header. */ - public signed_header?: (tendermint.types.ISignedHeader|null); - - /** LightBlock validator_set. */ - public validator_set?: (tendermint.types.IValidatorSet|null); - - /** - * Encodes the specified LightBlock message. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @param message LightBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ILightBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LightBlock message, length delimited. Does not implicitly {@link tendermint.types.LightBlock.verify|verify} messages. - * @param message LightBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ILightBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LightBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.LightBlock; - - /** - * Decodes a LightBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LightBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.LightBlock; - - /** - * Verifies a LightBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LightBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LightBlock - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.LightBlock; - - /** - * Creates a plain object from a LightBlock message. Also converts values to other types if specified. - * @param message LightBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.LightBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LightBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BlockMeta. */ - interface IBlockMeta { - - /** BlockMeta block_id */ - block_id?: (tendermint.types.IBlockID|null); - - /** BlockMeta block_size */ - block_size?: (Long|null); - - /** BlockMeta header */ - header?: (tendermint.types.IHeader|null); - - /** BlockMeta num_txs */ - num_txs?: (Long|null); - } - - /** Represents a BlockMeta. */ - class BlockMeta implements IBlockMeta { - - /** - * Constructs a new BlockMeta. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IBlockMeta); - - /** BlockMeta block_id. */ - public block_id?: (tendermint.types.IBlockID|null); - - /** BlockMeta block_size. */ - public block_size: Long; - - /** BlockMeta header. */ - public header?: (tendermint.types.IHeader|null); - - /** BlockMeta num_txs. */ - public num_txs: Long; - - /** - * Encodes the specified BlockMeta message. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @param message BlockMeta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IBlockMeta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BlockMeta message, length delimited. Does not implicitly {@link tendermint.types.BlockMeta.verify|verify} messages. - * @param message BlockMeta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IBlockMeta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockMeta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.BlockMeta; - - /** - * Decodes a BlockMeta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BlockMeta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.BlockMeta; - - /** - * Verifies a BlockMeta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BlockMeta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BlockMeta - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.BlockMeta; - - /** - * Creates a plain object from a BlockMeta message. Also converts values to other types if specified. - * @param message BlockMeta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.BlockMeta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BlockMeta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a TxProof. */ - interface ITxProof { - - /** TxProof root_hash */ - root_hash?: (Uint8Array|null); - - /** TxProof data */ - data?: (Uint8Array|null); - - /** TxProof proof */ - proof?: (tendermint.crypto.IProof|null); - } - - /** Represents a TxProof. */ - class TxProof implements ITxProof { - - /** - * Constructs a new TxProof. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ITxProof); - - /** TxProof root_hash. */ - public root_hash: Uint8Array; - - /** TxProof data. */ - public data: Uint8Array; - - /** TxProof proof. */ - public proof?: (tendermint.crypto.IProof|null); - - /** - * Encodes the specified TxProof message. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @param message TxProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ITxProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TxProof message, length delimited. Does not implicitly {@link tendermint.types.TxProof.verify|verify} messages. - * @param message TxProof message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ITxProof, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TxProof message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.TxProof; - - /** - * Decodes a TxProof message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TxProof - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.TxProof; - - /** - * Verifies a TxProof message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TxProof message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TxProof - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.TxProof; - - /** - * Creates a plain object from a TxProof message. Also converts values to other types if specified. - * @param message TxProof - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.TxProof, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TxProof to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ValidatorSet. */ - interface IValidatorSet { - - /** ValidatorSet validators */ - validators?: (tendermint.types.IValidator[]|null); - - /** ValidatorSet proposer */ - proposer?: (tendermint.types.IValidator|null); - - /** ValidatorSet total_voting_power */ - total_voting_power?: (Long|null); - } - - /** Represents a ValidatorSet. */ - class ValidatorSet implements IValidatorSet { - - /** - * Constructs a new ValidatorSet. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IValidatorSet); - - /** ValidatorSet validators. */ - public validators: tendermint.types.IValidator[]; - - /** ValidatorSet proposer. */ - public proposer?: (tendermint.types.IValidator|null); - - /** ValidatorSet total_voting_power. */ - public total_voting_power: Long; - - /** - * Encodes the specified ValidatorSet message. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @param message ValidatorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IValidatorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidatorSet message, length delimited. Does not implicitly {@link tendermint.types.ValidatorSet.verify|verify} messages. - * @param message ValidatorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IValidatorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.ValidatorSet; - - /** - * Decodes a ValidatorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidatorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.ValidatorSet; - - /** - * Verifies a ValidatorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValidatorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidatorSet - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.ValidatorSet; - - /** - * Creates a plain object from a ValidatorSet message. Also converts values to other types if specified. - * @param message ValidatorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.ValidatorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidatorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Validator. */ - interface IValidator { - - /** Validator address */ - address?: (Uint8Array|null); - - /** Validator pub_key */ - pub_key?: (tendermint.crypto.IPublicKey|null); - - /** Validator voting_power */ - voting_power?: (Long|null); - - /** Validator proposer_priority */ - proposer_priority?: (Long|null); - } - - /** Represents a Validator. */ - class Validator implements IValidator { - - /** - * Constructs a new Validator. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IValidator); - - /** Validator address. */ - public address: Uint8Array; - - /** Validator pub_key. */ - public pub_key?: (tendermint.crypto.IPublicKey|null); - - /** Validator voting_power. */ - public voting_power: Long; - - /** Validator proposer_priority. */ - public proposer_priority: Long; - - /** - * Encodes the specified Validator message. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @param message Validator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Validator message, length delimited. Does not implicitly {@link tendermint.types.Validator.verify|verify} messages. - * @param message Validator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Validator message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.Validator; - - /** - * Decodes a Validator message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Validator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.Validator; - - /** - * Verifies a Validator message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Validator message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Validator - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.Validator; - - /** - * Creates a plain object from a Validator message. Also converts values to other types if specified. - * @param message Validator - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.Validator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Validator to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a SimpleValidator. */ - interface ISimpleValidator { - - /** SimpleValidator pub_key */ - pub_key?: (tendermint.crypto.IPublicKey|null); - - /** SimpleValidator voting_power */ - voting_power?: (Long|null); - } - - /** Represents a SimpleValidator. */ - class SimpleValidator implements ISimpleValidator { - - /** - * Constructs a new SimpleValidator. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.ISimpleValidator); - - /** SimpleValidator pub_key. */ - public pub_key?: (tendermint.crypto.IPublicKey|null); - - /** SimpleValidator voting_power. */ - public voting_power: Long; - - /** - * Encodes the specified SimpleValidator message. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @param message SimpleValidator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.ISimpleValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SimpleValidator message, length delimited. Does not implicitly {@link tendermint.types.SimpleValidator.verify|verify} messages. - * @param message SimpleValidator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.ISimpleValidator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.SimpleValidator; - - /** - * Decodes a SimpleValidator message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimpleValidator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.SimpleValidator; - - /** - * Verifies a SimpleValidator message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SimpleValidator message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimpleValidator - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.SimpleValidator; - - /** - * Creates a plain object from a SimpleValidator message. Also converts values to other types if specified. - * @param message SimpleValidator - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.SimpleValidator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SimpleValidator to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ConsensusParams. */ - interface IConsensusParams { - - /** ConsensusParams block */ - block?: (tendermint.types.IBlockParams|null); - - /** ConsensusParams evidence */ - evidence?: (tendermint.types.IEvidenceParams|null); - - /** ConsensusParams validator */ - validator?: (tendermint.types.IValidatorParams|null); - - /** ConsensusParams version */ - version?: (tendermint.types.IVersionParams|null); - } - - /** Represents a ConsensusParams. */ - class ConsensusParams implements IConsensusParams { - - /** - * Constructs a new ConsensusParams. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IConsensusParams); - - /** ConsensusParams block. */ - public block?: (tendermint.types.IBlockParams|null); - - /** ConsensusParams evidence. */ - public evidence?: (tendermint.types.IEvidenceParams|null); - - /** ConsensusParams validator. */ - public validator?: (tendermint.types.IValidatorParams|null); - - /** ConsensusParams version. */ - public version?: (tendermint.types.IVersionParams|null); - - /** - * Encodes the specified ConsensusParams message. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. - * @param message ConsensusParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IConsensusParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsensusParams message, length delimited. Does not implicitly {@link tendermint.types.ConsensusParams.verify|verify} messages. - * @param message ConsensusParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IConsensusParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.ConsensusParams; - - /** - * Decodes a ConsensusParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsensusParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.ConsensusParams; - - /** - * Verifies a ConsensusParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsensusParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsensusParams - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.ConsensusParams; - - /** - * Creates a plain object from a ConsensusParams message. Also converts values to other types if specified. - * @param message ConsensusParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.ConsensusParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsensusParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BlockParams. */ - interface IBlockParams { - - /** BlockParams max_bytes */ - max_bytes?: (Long|null); - - /** BlockParams max_gas */ - max_gas?: (Long|null); - - /** BlockParams time_iota_ms */ - time_iota_ms?: (Long|null); - } - - /** Represents a BlockParams. */ - class BlockParams implements IBlockParams { - - /** - * Constructs a new BlockParams. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IBlockParams); - - /** BlockParams max_bytes. */ - public max_bytes: Long; - - /** BlockParams max_gas. */ - public max_gas: Long; - - /** BlockParams time_iota_ms. */ - public time_iota_ms: Long; - - /** - * Encodes the specified BlockParams message. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. - * @param message BlockParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IBlockParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BlockParams message, length delimited. Does not implicitly {@link tendermint.types.BlockParams.verify|verify} messages. - * @param message BlockParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IBlockParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlockParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.BlockParams; - - /** - * Decodes a BlockParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BlockParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.BlockParams; - - /** - * Verifies a BlockParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BlockParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BlockParams - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.BlockParams; - - /** - * Creates a plain object from a BlockParams message. Also converts values to other types if specified. - * @param message BlockParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.BlockParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BlockParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EvidenceParams. */ - interface IEvidenceParams { - - /** EvidenceParams max_age_num_blocks */ - max_age_num_blocks?: (Long|null); - - /** EvidenceParams max_age_duration */ - max_age_duration?: (google.protobuf.IDuration|null); - - /** EvidenceParams max_bytes */ - max_bytes?: (Long|null); - } - - /** Represents an EvidenceParams. */ - class EvidenceParams implements IEvidenceParams { - - /** - * Constructs a new EvidenceParams. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IEvidenceParams); - - /** EvidenceParams max_age_num_blocks. */ - public max_age_num_blocks: Long; - - /** EvidenceParams max_age_duration. */ - public max_age_duration?: (google.protobuf.IDuration|null); - - /** EvidenceParams max_bytes. */ - public max_bytes: Long; - - /** - * Encodes the specified EvidenceParams message. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. - * @param message EvidenceParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IEvidenceParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvidenceParams message, length delimited. Does not implicitly {@link tendermint.types.EvidenceParams.verify|verify} messages. - * @param message EvidenceParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IEvidenceParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvidenceParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvidenceParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.EvidenceParams; - - /** - * Decodes an EvidenceParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvidenceParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.EvidenceParams; - - /** - * Verifies an EvidenceParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EvidenceParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvidenceParams - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.EvidenceParams; - - /** - * Creates a plain object from an EvidenceParams message. Also converts values to other types if specified. - * @param message EvidenceParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.EvidenceParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvidenceParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ValidatorParams. */ - interface IValidatorParams { - - /** ValidatorParams pub_key_types */ - pub_key_types?: (string[]|null); - } - - /** Represents a ValidatorParams. */ - class ValidatorParams implements IValidatorParams { - - /** - * Constructs a new ValidatorParams. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IValidatorParams); - - /** ValidatorParams pub_key_types. */ - public pub_key_types: string[]; - - /** - * Encodes the specified ValidatorParams message. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. - * @param message ValidatorParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IValidatorParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidatorParams message, length delimited. Does not implicitly {@link tendermint.types.ValidatorParams.verify|verify} messages. - * @param message ValidatorParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IValidatorParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValidatorParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidatorParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.ValidatorParams; - - /** - * Decodes a ValidatorParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidatorParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.ValidatorParams; - - /** - * Verifies a ValidatorParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValidatorParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidatorParams - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.ValidatorParams; - - /** - * Creates a plain object from a ValidatorParams message. Also converts values to other types if specified. - * @param message ValidatorParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.ValidatorParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValidatorParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a VersionParams. */ - interface IVersionParams { - - /** VersionParams app_version */ - app_version?: (Long|null); - } - - /** Represents a VersionParams. */ - class VersionParams implements IVersionParams { - - /** - * Constructs a new VersionParams. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IVersionParams); - - /** VersionParams app_version. */ - public app_version: Long; - - /** - * Encodes the specified VersionParams message. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. - * @param message VersionParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IVersionParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VersionParams message, length delimited. Does not implicitly {@link tendermint.types.VersionParams.verify|verify} messages. - * @param message VersionParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IVersionParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VersionParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VersionParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.VersionParams; - - /** - * Decodes a VersionParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VersionParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.VersionParams; - - /** - * Verifies a VersionParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VersionParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VersionParams - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.VersionParams; - - /** - * Creates a plain object from a VersionParams message. Also converts values to other types if specified. - * @param message VersionParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.VersionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VersionParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a HashedParams. */ - interface IHashedParams { - - /** HashedParams block_max_bytes */ - block_max_bytes?: (Long|null); - - /** HashedParams block_max_gas */ - block_max_gas?: (Long|null); - } - - /** Represents a HashedParams. */ - class HashedParams implements IHashedParams { - - /** - * Constructs a new HashedParams. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.types.IHashedParams); - - /** HashedParams block_max_bytes. */ - public block_max_bytes: Long; - - /** HashedParams block_max_gas. */ - public block_max_gas: Long; - - /** - * Encodes the specified HashedParams message. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. - * @param message HashedParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.types.IHashedParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HashedParams message, length delimited. Does not implicitly {@link tendermint.types.HashedParams.verify|verify} messages. - * @param message HashedParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.types.IHashedParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HashedParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HashedParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.types.HashedParams; - - /** - * Decodes a HashedParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HashedParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.types.HashedParams; - - /** - * Verifies a HashedParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HashedParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HashedParams - */ - public static fromObject(object: { [k: string]: any }): tendermint.types.HashedParams; - - /** - * Creates a plain object from a HashedParams message. Also converts values to other types if specified. - * @param message HashedParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.types.HashedParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HashedParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace version. */ - namespace version { - - /** Properties of an App. */ - interface IApp { - - /** App protocol */ - protocol?: (Long|null); - - /** App software */ - software?: (string|null); - } - - /** Represents an App. */ - class App implements IApp { - - /** - * Constructs a new App. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.version.IApp); - - /** App protocol. */ - public protocol: Long; - - /** App software. */ - public software: string; - - /** - * Encodes the specified App message. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @param message App message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.version.IApp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified App message, length delimited. Does not implicitly {@link tendermint.version.App.verify|verify} messages. - * @param message App message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.version.IApp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an App message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.version.App; - - /** - * Decodes an App message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns App - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.version.App; - - /** - * Verifies an App message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an App message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns App - */ - public static fromObject(object: { [k: string]: any }): tendermint.version.App; - - /** - * Creates a plain object from an App message. Also converts values to other types if specified. - * @param message App - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.version.App, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this App to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Consensus. */ - interface IConsensus { - - /** Consensus block */ - block?: (Long|null); - - /** Consensus app */ - app?: (Long|null); - } - - /** Represents a Consensus. */ - class Consensus implements IConsensus { - - /** - * Constructs a new Consensus. - * @param [properties] Properties to set - */ - constructor(properties?: tendermint.version.IConsensus); - - /** Consensus block. */ - public block: Long; - - /** Consensus app. */ - public app: Long; - - /** - * Encodes the specified Consensus message. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @param message Consensus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: tendermint.version.IConsensus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Consensus message, length delimited. Does not implicitly {@link tendermint.version.Consensus.verify|verify} messages. - * @param message Consensus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: tendermint.version.IConsensus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Consensus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tendermint.version.Consensus; - - /** - * Decodes a Consensus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Consensus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tendermint.version.Consensus; - - /** - * Verifies a Consensus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Consensus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Consensus - */ - public static fromObject(object: { [k: string]: any }): tendermint.version.Consensus; - - /** - * Creates a plain object from a Consensus message. Also converts values to other types if specified. - * @param message Consensus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: tendermint.version.Consensus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Consensus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } -} - -/** Namespace google. */ -export namespace google { - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto public_dependency */ - public_dependency?: (number[]|null); - - /** FileDescriptorProto weak_dependency */ - weak_dependency?: (number[]|null); - - /** FileDescriptorProto message_type */ - message_type?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enum_type */ - enum_type?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto source_code_info */ - source_code_info?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto public_dependency. */ - public public_dependency: number[]; - - /** FileDescriptorProto weak_dependency. */ - public weak_dependency: number[]; - - /** FileDescriptorProto message_type. */ - public message_type: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enum_type. */ - public enum_type: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto source_code_info. */ - public source_code_info?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nested_type */ - nested_type?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enum_type */ - enum_type?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extension_range */ - extension_range?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneof_decl */ - oneof_decl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reserved_range */ - reserved_range?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reserved_name */ - reserved_name?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nested_type. */ - public nested_type: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enum_type. */ - public enum_type: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extension_range. */ - public extension_range: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneof_decl. */ - public oneof_decl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reserved_range. */ - public reserved_range: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reserved_name. */ - public reserved_name: string[]; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto type_name */ - type_name?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto default_value */ - default_value?: (string|null); - - /** FieldDescriptorProto oneof_index */ - oneof_index?: (number|null); - - /** FieldDescriptorProto json_name */ - json_name?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; - - /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; - - /** FieldDescriptorProto type_name. */ - public type_name: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto default_value. */ - public default_value: string; - - /** FieldDescriptorProto oneof_index. */ - public oneof_index: number; - - /** FieldDescriptorProto json_name. */ - public json_name: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto input_type */ - input_type?: (string|null); - - /** MethodDescriptorProto output_type */ - output_type?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto client_streaming */ - client_streaming?: (boolean|null); - - /** MethodDescriptorProto server_streaming */ - server_streaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto input_type. */ - public input_type: string; - - /** MethodDescriptorProto output_type. */ - public output_type: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto client_streaming. */ - public client_streaming: boolean; - - /** MethodDescriptorProto server_streaming. */ - public server_streaming: boolean; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions java_package */ - java_package?: (string|null); - - /** FileOptions java_outer_classname */ - java_outer_classname?: (string|null); - - /** FileOptions java_multiple_files */ - java_multiple_files?: (boolean|null); - - /** FileOptions java_generate_equals_and_hash */ - java_generate_equals_and_hash?: (boolean|null); - - /** FileOptions java_string_check_utf8 */ - java_string_check_utf8?: (boolean|null); - - /** FileOptions optimize_for */ - optimize_for?: (google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions go_package */ - go_package?: (string|null); - - /** FileOptions cc_generic_services */ - cc_generic_services?: (boolean|null); - - /** FileOptions java_generic_services */ - java_generic_services?: (boolean|null); - - /** FileOptions py_generic_services */ - py_generic_services?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions cc_enable_arenas */ - cc_enable_arenas?: (boolean|null); - - /** FileOptions objc_class_prefix */ - objc_class_prefix?: (string|null); - - /** FileOptions csharp_namespace */ - csharp_namespace?: (string|null); - - /** FileOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .gogoproto.goproto_getters_all */ - ".gogoproto.goproto_getters_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_enum_prefix_all */ - ".gogoproto.goproto_enum_prefix_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_stringer_all */ - ".gogoproto.goproto_stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.verbose_equal_all */ - ".gogoproto.verbose_equal_all"?: (boolean|null); - - /** FileOptions .gogoproto.face_all */ - ".gogoproto.face_all"?: (boolean|null); - - /** FileOptions .gogoproto.gostring_all */ - ".gogoproto.gostring_all"?: (boolean|null); - - /** FileOptions .gogoproto.populate_all */ - ".gogoproto.populate_all"?: (boolean|null); - - /** FileOptions .gogoproto.stringer_all */ - ".gogoproto.stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.onlyone_all */ - ".gogoproto.onlyone_all"?: (boolean|null); - - /** FileOptions .gogoproto.equal_all */ - ".gogoproto.equal_all"?: (boolean|null); - - /** FileOptions .gogoproto.description_all */ - ".gogoproto.description_all"?: (boolean|null); - - /** FileOptions .gogoproto.testgen_all */ - ".gogoproto.testgen_all"?: (boolean|null); - - /** FileOptions .gogoproto.benchgen_all */ - ".gogoproto.benchgen_all"?: (boolean|null); - - /** FileOptions .gogoproto.marshaler_all */ - ".gogoproto.marshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.unmarshaler_all */ - ".gogoproto.unmarshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.stable_marshaler_all */ - ".gogoproto.stable_marshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.sizer_all */ - ".gogoproto.sizer_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_enum_stringer_all */ - ".gogoproto.goproto_enum_stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.enum_stringer_all */ - ".gogoproto.enum_stringer_all"?: (boolean|null); - - /** FileOptions .gogoproto.unsafe_marshaler_all */ - ".gogoproto.unsafe_marshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.unsafe_unmarshaler_all */ - ".gogoproto.unsafe_unmarshaler_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_extensions_map_all */ - ".gogoproto.goproto_extensions_map_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_unrecognized_all */ - ".gogoproto.goproto_unrecognized_all"?: (boolean|null); - - /** FileOptions .gogoproto.gogoproto_import */ - ".gogoproto.gogoproto_import"?: (boolean|null); - - /** FileOptions .gogoproto.protosizer_all */ - ".gogoproto.protosizer_all"?: (boolean|null); - - /** FileOptions .gogoproto.compare_all */ - ".gogoproto.compare_all"?: (boolean|null); - - /** FileOptions .gogoproto.typedecl_all */ - ".gogoproto.typedecl_all"?: (boolean|null); - - /** FileOptions .gogoproto.enumdecl_all */ - ".gogoproto.enumdecl_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_registration */ - ".gogoproto.goproto_registration"?: (boolean|null); - - /** FileOptions .gogoproto.messagename_all */ - ".gogoproto.messagename_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_sizecache_all */ - ".gogoproto.goproto_sizecache_all"?: (boolean|null); - - /** FileOptions .gogoproto.goproto_unkeyed_all */ - ".gogoproto.goproto_unkeyed_all"?: (boolean|null); - - /** FileOptions .cosmos_proto.declare_interface */ - ".cosmos_proto.declare_interface"?: (cosmos_proto.IInterfaceDescriptor[]|null); - - /** FileOptions .cosmos_proto.declare_scalar */ - ".cosmos_proto.declare_scalar"?: (cosmos_proto.IScalarDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions java_package. */ - public java_package: string; - - /** FileOptions java_outer_classname. */ - public java_outer_classname: string; - - /** FileOptions java_multiple_files. */ - public java_multiple_files: boolean; - - /** FileOptions java_generate_equals_and_hash. */ - public java_generate_equals_and_hash: boolean; - - /** FileOptions java_string_check_utf8. */ - public java_string_check_utf8: boolean; - - /** FileOptions optimize_for. */ - public optimize_for: google.protobuf.FileOptions.OptimizeMode; - - /** FileOptions go_package. */ - public go_package: string; - - /** FileOptions cc_generic_services. */ - public cc_generic_services: boolean; - - /** FileOptions java_generic_services. */ - public java_generic_services: boolean; - - /** FileOptions py_generic_services. */ - public py_generic_services: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions cc_enable_arenas. */ - public cc_enable_arenas: boolean; - - /** FileOptions objc_class_prefix. */ - public objc_class_prefix: string; - - /** FileOptions csharp_namespace. */ - public csharp_namespace: string; - - /** FileOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions message_set_wire_format */ - message_set_wire_format?: (boolean|null); - - /** MessageOptions no_standard_descriptor_accessor */ - no_standard_descriptor_accessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions map_entry */ - map_entry?: (boolean|null); - - /** MessageOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .gogoproto.goproto_getters */ - ".gogoproto.goproto_getters"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_stringer */ - ".gogoproto.goproto_stringer"?: (boolean|null); - - /** MessageOptions .gogoproto.verbose_equal */ - ".gogoproto.verbose_equal"?: (boolean|null); - - /** MessageOptions .gogoproto.face */ - ".gogoproto.face"?: (boolean|null); - - /** MessageOptions .gogoproto.gostring */ - ".gogoproto.gostring"?: (boolean|null); - - /** MessageOptions .gogoproto.populate */ - ".gogoproto.populate"?: (boolean|null); - - /** MessageOptions .gogoproto.stringer */ - ".gogoproto.stringer"?: (boolean|null); - - /** MessageOptions .gogoproto.onlyone */ - ".gogoproto.onlyone"?: (boolean|null); - - /** MessageOptions .gogoproto.equal */ - ".gogoproto.equal"?: (boolean|null); - - /** MessageOptions .gogoproto.description */ - ".gogoproto.description"?: (boolean|null); - - /** MessageOptions .gogoproto.testgen */ - ".gogoproto.testgen"?: (boolean|null); - - /** MessageOptions .gogoproto.benchgen */ - ".gogoproto.benchgen"?: (boolean|null); - - /** MessageOptions .gogoproto.marshaler */ - ".gogoproto.marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.unmarshaler */ - ".gogoproto.unmarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.stable_marshaler */ - ".gogoproto.stable_marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.sizer */ - ".gogoproto.sizer"?: (boolean|null); - - /** MessageOptions .gogoproto.unsafe_marshaler */ - ".gogoproto.unsafe_marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.unsafe_unmarshaler */ - ".gogoproto.unsafe_unmarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_extensions_map */ - ".gogoproto.goproto_extensions_map"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_unrecognized */ - ".gogoproto.goproto_unrecognized"?: (boolean|null); - - /** MessageOptions .gogoproto.protosizer */ - ".gogoproto.protosizer"?: (boolean|null); - - /** MessageOptions .gogoproto.compare */ - ".gogoproto.compare"?: (boolean|null); - - /** MessageOptions .gogoproto.typedecl */ - ".gogoproto.typedecl"?: (boolean|null); - - /** MessageOptions .gogoproto.messagename */ - ".gogoproto.messagename"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_sizecache */ - ".gogoproto.goproto_sizecache"?: (boolean|null); - - /** MessageOptions .gogoproto.goproto_unkeyed */ - ".gogoproto.goproto_unkeyed"?: (boolean|null); - - /** MessageOptions .cosmos_proto.implements_interface */ - ".cosmos_proto.implements_interface"?: (string[]|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions message_set_wire_format. */ - public message_set_wire_format: boolean; - - /** MessageOptions no_standard_descriptor_accessor. */ - public no_standard_descriptor_accessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions map_entry. */ - public map_entry: boolean; - - /** MessageOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .gogoproto.nullable */ - ".gogoproto.nullable"?: (boolean|null); - - /** FieldOptions .gogoproto.embed */ - ".gogoproto.embed"?: (boolean|null); - - /** FieldOptions .gogoproto.customtype */ - ".gogoproto.customtype"?: (string|null); - - /** FieldOptions .gogoproto.customname */ - ".gogoproto.customname"?: (string|null); - - /** FieldOptions .gogoproto.jsontag */ - ".gogoproto.jsontag"?: (string|null); - - /** FieldOptions .gogoproto.moretags */ - ".gogoproto.moretags"?: (string|null); - - /** FieldOptions .gogoproto.casttype */ - ".gogoproto.casttype"?: (string|null); - - /** FieldOptions .gogoproto.castkey */ - ".gogoproto.castkey"?: (string|null); - - /** FieldOptions .gogoproto.castvalue */ - ".gogoproto.castvalue"?: (string|null); - - /** FieldOptions .gogoproto.stdtime */ - ".gogoproto.stdtime"?: (boolean|null); - - /** FieldOptions .gogoproto.stdduration */ - ".gogoproto.stdduration"?: (boolean|null); - - /** FieldOptions .gogoproto.wktpointer */ - ".gogoproto.wktpointer"?: (boolean|null); - - /** FieldOptions .gogoproto.castrepeated */ - ".gogoproto.castrepeated"?: (string|null); - - /** FieldOptions .cosmos_proto.accepts_interface */ - ".cosmos_proto.accepts_interface"?: (string|null); - - /** FieldOptions .cosmos_proto.scalar */ - ".cosmos_proto.scalar"?: (string|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allow_alias */ - allow_alias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** EnumOptions .gogoproto.goproto_enum_prefix */ - ".gogoproto.goproto_enum_prefix"?: (boolean|null); - - /** EnumOptions .gogoproto.goproto_enum_stringer */ - ".gogoproto.goproto_enum_stringer"?: (boolean|null); - - /** EnumOptions .gogoproto.enum_stringer */ - ".gogoproto.enum_stringer"?: (boolean|null); - - /** EnumOptions .gogoproto.enum_customname */ - ".gogoproto.enum_customname"?: (string|null); - - /** EnumOptions .gogoproto.enumdecl */ - ".gogoproto.enumdecl"?: (boolean|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allow_alias. */ - public allow_alias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** EnumValueOptions .gogoproto.enumvalue_customname */ - ".gogoproto.enumvalue_customname"?: (string|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions uninterpreted_option */ - uninterpreted_option?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions uninterpreted_option. */ - public uninterpreted_option: google.protobuf.IUninterpretedOption[]; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifier_value */ - identifier_value?: (string|null); - - /** UninterpretedOption positive_int_value */ - positive_int_value?: (Long|null); - - /** UninterpretedOption negative_int_value */ - negative_int_value?: (Long|null); - - /** UninterpretedOption double_value */ - double_value?: (number|null); - - /** UninterpretedOption string_value */ - string_value?: (Uint8Array|null); - - /** UninterpretedOption aggregate_value */ - aggregate_value?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifier_value. */ - public identifier_value: string; - - /** UninterpretedOption positive_int_value. */ - public positive_int_value: Long; - - /** UninterpretedOption negative_int_value. */ - public negative_int_value: Long; - - /** UninterpretedOption double_value. */ - public double_value: number; - - /** UninterpretedOption string_value. */ - public string_value: Uint8Array; - - /** UninterpretedOption aggregate_value. */ - public aggregate_value: string; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart name_part */ - name_part: string; - - /** NamePart is_extension */ - is_extension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart name_part. */ - public name_part: string; - - /** NamePart is_extension. */ - public is_extension: boolean; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leading_comments */ - leading_comments?: (string|null); - - /** Location trailing_comments */ - trailing_comments?: (string|null); - - /** Location leading_detached_comments */ - leading_detached_comments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leading_comments. */ - public leading_comments: string; - - /** Location trailing_comments. */ - public trailing_comments: string; - - /** Location leading_detached_comments. */ - public leading_detached_comments: string[]; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation source_file */ - source_file?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation source_file. */ - public source_file: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: Uint8Array; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (Long|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: Long; - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (Long|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: Long; - - /** Duration nanos. */ - public nanos: number; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fully_decode_reserved_expansion */ - fully_decode_reserved_expansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fully_decode_reserved_expansion. */ - public fully_decode_reserved_expansion: boolean; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule response_body */ - response_body?: (string|null); - - /** HttpRule additional_bindings */ - additional_bindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule response_body. */ - public response_body: string; - - /** HttpRule additional_bindings. */ - public additional_bindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } -} - -/** Namespace osmosis. */ -export namespace osmosis { - - /** Namespace tokenfactory. */ - namespace tokenfactory { - - /** Namespace v1beta1. */ - namespace v1beta1 { - - /** Properties of a GenesisState. */ - interface IGenesisState { - - /** GenesisState params */ - params?: (osmosis.tokenfactory.v1beta1.IParams|null); - - /** GenesisState factory_denoms */ - factory_denoms?: (osmosis.tokenfactory.v1beta1.IGenesisDenom[]|null); - } - - /** Represents a GenesisState. */ - class GenesisState implements IGenesisState { - - /** - * Constructs a new GenesisState. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IGenesisState); - - /** GenesisState params. */ - public params?: (osmosis.tokenfactory.v1beta1.IParams|null); - - /** GenesisState factory_denoms. */ - public factory_denoms: osmosis.tokenfactory.v1beta1.IGenesisDenom[]; - - /** - * Encodes the specified GenesisState message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisState message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.GenesisState.verify|verify} messages. - * @param message GenesisState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IGenesisState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.GenesisState; - - /** - * Decodes a GenesisState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.GenesisState; - - /** - * Verifies a GenesisState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisState - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.GenesisState; - - /** - * Creates a plain object from a GenesisState message. Also converts values to other types if specified. - * @param message GenesisState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.GenesisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GenesisDenom. */ - interface IGenesisDenom { - - /** GenesisDenom denom */ - denom?: (string|null); - - /** GenesisDenom authority_metadata */ - authority_metadata?: (osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata|null); - } - - /** Represents a GenesisDenom. */ - class GenesisDenom implements IGenesisDenom { - - /** - * Constructs a new GenesisDenom. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IGenesisDenom); - - /** GenesisDenom denom. */ - public denom: string; - - /** GenesisDenom authority_metadata. */ - public authority_metadata?: (osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata|null); - - /** - * Encodes the specified GenesisDenom message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.GenesisDenom.verify|verify} messages. - * @param message GenesisDenom message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IGenesisDenom, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenesisDenom message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.GenesisDenom.verify|verify} messages. - * @param message GenesisDenom message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IGenesisDenom, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenesisDenom message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenesisDenom - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.GenesisDenom; - - /** - * Decodes a GenesisDenom message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenesisDenom - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.GenesisDenom; - - /** - * Verifies a GenesisDenom message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenesisDenom message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenesisDenom - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.GenesisDenom; - - /** - * Creates a plain object from a GenesisDenom message. Also converts values to other types if specified. - * @param message GenesisDenom - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.GenesisDenom, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenesisDenom to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DenomAuthorityMetadata. */ - interface IDenomAuthorityMetadata { - - /** DenomAuthorityMetadata Admin */ - Admin?: (string|null); - } - - /** Represents a DenomAuthorityMetadata. */ - class DenomAuthorityMetadata implements IDenomAuthorityMetadata { - - /** - * Constructs a new DenomAuthorityMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata); - - /** DenomAuthorityMetadata Admin. */ - public Admin: string; - - /** - * Encodes the specified DenomAuthorityMetadata message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.verify|verify} messages. - * @param message DenomAuthorityMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DenomAuthorityMetadata message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata.verify|verify} messages. - * @param message DenomAuthorityMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DenomAuthorityMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DenomAuthorityMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata; - - /** - * Decodes a DenomAuthorityMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DenomAuthorityMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata; - - /** - * Verifies a DenomAuthorityMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DenomAuthorityMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DenomAuthorityMetadata - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata; - - /** - * Creates a plain object from a DenomAuthorityMetadata message. Also converts values to other types if specified. - * @param message DenomAuthorityMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DenomAuthorityMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Params. */ - interface IParams { - - /** Params denom_creation_fee */ - denom_creation_fee?: (cosmos.base.v1beta1.ICoin[]|null); - - /** Params fee_collector_address */ - fee_collector_address?: (string|null); - } - - /** Represents a Params. */ - class Params implements IParams { - - /** - * Constructs a new Params. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IParams); - - /** Params denom_creation_fee. */ - public denom_creation_fee: cosmos.base.v1beta1.ICoin[]; - - /** Params fee_collector_address. */ - public fee_collector_address: string; - - /** - * Encodes the specified Params message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Params message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.Params.verify|verify} messages. - * @param message Params message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Params message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.Params; - - /** - * Decodes a Params message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Params - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.Params; - - /** - * Verifies a Params message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Params message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Params - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.Params; - - /** - * Creates a plain object from a Params message. Also converts values to other types if specified. - * @param message Params - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.Params, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Params to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Msg */ - class Msg extends $protobuf.rpc.Service { - - /** - * Constructs a new Msg service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls CreateDenom. - * @param request MsgCreateDenom message or plain object - * @param callback Node-style callback called with the error, if any, and MsgCreateDenomResponse - */ - public createDenom(request: osmosis.tokenfactory.v1beta1.IMsgCreateDenom, callback: osmosis.tokenfactory.v1beta1.Msg.CreateDenomCallback): void; - - /** - * Calls CreateDenom. - * @param request MsgCreateDenom message or plain object - * @returns Promise - */ - public createDenom(request: osmosis.tokenfactory.v1beta1.IMsgCreateDenom): Promise; - - /** - * Calls Mint. - * @param request MsgMint message or plain object - * @param callback Node-style callback called with the error, if any, and MsgMintResponse - */ - public mint(request: osmosis.tokenfactory.v1beta1.IMsgMint, callback: osmosis.tokenfactory.v1beta1.Msg.MintCallback): void; - - /** - * Calls Mint. - * @param request MsgMint message or plain object - * @returns Promise - */ - public mint(request: osmosis.tokenfactory.v1beta1.IMsgMint): Promise; - - /** - * Calls Burn. - * @param request MsgBurn message or plain object - * @param callback Node-style callback called with the error, if any, and MsgBurnResponse - */ - public burn(request: osmosis.tokenfactory.v1beta1.IMsgBurn, callback: osmosis.tokenfactory.v1beta1.Msg.BurnCallback): void; - - /** - * Calls Burn. - * @param request MsgBurn message or plain object - * @returns Promise - */ - public burn(request: osmosis.tokenfactory.v1beta1.IMsgBurn): Promise; - - /** - * Calls ChangeAdmin. - * @param request MsgChangeAdmin message or plain object - * @param callback Node-style callback called with the error, if any, and MsgChangeAdminResponse - */ - public changeAdmin(request: osmosis.tokenfactory.v1beta1.IMsgChangeAdmin, callback: osmosis.tokenfactory.v1beta1.Msg.ChangeAdminCallback): void; - - /** - * Calls ChangeAdmin. - * @param request MsgChangeAdmin message or plain object - * @returns Promise - */ - public changeAdmin(request: osmosis.tokenfactory.v1beta1.IMsgChangeAdmin): Promise; - } - - namespace Msg { - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Msg#createDenom}. - * @param error Error, if any - * @param [response] MsgCreateDenomResponse - */ - type CreateDenomCallback = (error: (Error|null), response?: osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse) => void; - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Msg#mint}. - * @param error Error, if any - * @param [response] MsgMintResponse - */ - type MintCallback = (error: (Error|null), response?: osmosis.tokenfactory.v1beta1.MsgMintResponse) => void; - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Msg#burn}. - * @param error Error, if any - * @param [response] MsgBurnResponse - */ - type BurnCallback = (error: (Error|null), response?: osmosis.tokenfactory.v1beta1.MsgBurnResponse) => void; - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Msg#changeAdmin}. - * @param error Error, if any - * @param [response] MsgChangeAdminResponse - */ - type ChangeAdminCallback = (error: (Error|null), response?: osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse) => void; - } - - /** Properties of a MsgCreateDenom. */ - interface IMsgCreateDenom { - - /** MsgCreateDenom sender */ - sender?: (string|null); - - /** MsgCreateDenom subdenom */ - subdenom?: (string|null); - } - - /** Represents a MsgCreateDenom. */ - class MsgCreateDenom implements IMsgCreateDenom { - - /** - * Constructs a new MsgCreateDenom. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IMsgCreateDenom); - - /** MsgCreateDenom sender. */ - public sender: string; - - /** MsgCreateDenom subdenom. */ - public subdenom: string; - - /** - * Encodes the specified MsgCreateDenom message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgCreateDenom.verify|verify} messages. - * @param message MsgCreateDenom message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IMsgCreateDenom, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgCreateDenom message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgCreateDenom.verify|verify} messages. - * @param message MsgCreateDenom message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IMsgCreateDenom, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgCreateDenom message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgCreateDenom - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.MsgCreateDenom; - - /** - * Decodes a MsgCreateDenom message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgCreateDenom - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.MsgCreateDenom; - - /** - * Verifies a MsgCreateDenom message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgCreateDenom message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgCreateDenom - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.MsgCreateDenom; - - /** - * Creates a plain object from a MsgCreateDenom message. Also converts values to other types if specified. - * @param message MsgCreateDenom - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.MsgCreateDenom, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgCreateDenom to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgCreateDenomResponse. */ - interface IMsgCreateDenomResponse { - - /** MsgCreateDenomResponse new_token_denom */ - new_token_denom?: (string|null); - } - - /** Represents a MsgCreateDenomResponse. */ - class MsgCreateDenomResponse implements IMsgCreateDenomResponse { - - /** - * Constructs a new MsgCreateDenomResponse. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IMsgCreateDenomResponse); - - /** MsgCreateDenomResponse new_token_denom. */ - public new_token_denom: string; - - /** - * Encodes the specified MsgCreateDenomResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse.verify|verify} messages. - * @param message MsgCreateDenomResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IMsgCreateDenomResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgCreateDenomResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse.verify|verify} messages. - * @param message MsgCreateDenomResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IMsgCreateDenomResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgCreateDenomResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgCreateDenomResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse; - - /** - * Decodes a MsgCreateDenomResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgCreateDenomResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse; - - /** - * Verifies a MsgCreateDenomResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgCreateDenomResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgCreateDenomResponse - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse; - - /** - * Creates a plain object from a MsgCreateDenomResponse message. Also converts values to other types if specified. - * @param message MsgCreateDenomResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgCreateDenomResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgMint. */ - interface IMsgMint { - - /** MsgMint sender */ - sender?: (string|null); - - /** MsgMint amount */ - amount?: (cosmos.base.v1beta1.ICoin|null); - } - - /** Represents a MsgMint. */ - class MsgMint implements IMsgMint { - - /** - * Constructs a new MsgMint. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IMsgMint); - - /** MsgMint sender. */ - public sender: string; - - /** MsgMint amount. */ - public amount?: (cosmos.base.v1beta1.ICoin|null); - - /** - * Encodes the specified MsgMint message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgMint.verify|verify} messages. - * @param message MsgMint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IMsgMint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgMint message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgMint.verify|verify} messages. - * @param message MsgMint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IMsgMint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgMint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgMint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.MsgMint; - - /** - * Decodes a MsgMint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgMint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.MsgMint; - - /** - * Verifies a MsgMint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgMint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgMint - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.MsgMint; - - /** - * Creates a plain object from a MsgMint message. Also converts values to other types if specified. - * @param message MsgMint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.MsgMint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgMint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgMintResponse. */ - interface IMsgMintResponse { - } - - /** Represents a MsgMintResponse. */ - class MsgMintResponse implements IMsgMintResponse { - - /** - * Constructs a new MsgMintResponse. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IMsgMintResponse); - - /** - * Encodes the specified MsgMintResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgMintResponse.verify|verify} messages. - * @param message MsgMintResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IMsgMintResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgMintResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgMintResponse.verify|verify} messages. - * @param message MsgMintResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IMsgMintResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgMintResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgMintResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.MsgMintResponse; - - /** - * Decodes a MsgMintResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgMintResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.MsgMintResponse; - - /** - * Verifies a MsgMintResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgMintResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgMintResponse - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.MsgMintResponse; - - /** - * Creates a plain object from a MsgMintResponse message. Also converts values to other types if specified. - * @param message MsgMintResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.MsgMintResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgMintResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgBurn. */ - interface IMsgBurn { - - /** MsgBurn sender */ - sender?: (string|null); - - /** MsgBurn amount */ - amount?: (cosmos.base.v1beta1.ICoin|null); - } - - /** Represents a MsgBurn. */ - class MsgBurn implements IMsgBurn { - - /** - * Constructs a new MsgBurn. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IMsgBurn); - - /** MsgBurn sender. */ - public sender: string; - - /** MsgBurn amount. */ - public amount?: (cosmos.base.v1beta1.ICoin|null); - - /** - * Encodes the specified MsgBurn message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgBurn.verify|verify} messages. - * @param message MsgBurn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IMsgBurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgBurn message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgBurn.verify|verify} messages. - * @param message MsgBurn message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IMsgBurn, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgBurn message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgBurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.MsgBurn; - - /** - * Decodes a MsgBurn message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgBurn - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.MsgBurn; - - /** - * Verifies a MsgBurn message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgBurn message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgBurn - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.MsgBurn; - - /** - * Creates a plain object from a MsgBurn message. Also converts values to other types if specified. - * @param message MsgBurn - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.MsgBurn, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgBurn to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgBurnResponse. */ - interface IMsgBurnResponse { - } - - /** Represents a MsgBurnResponse. */ - class MsgBurnResponse implements IMsgBurnResponse { - - /** - * Constructs a new MsgBurnResponse. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IMsgBurnResponse); - - /** - * Encodes the specified MsgBurnResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgBurnResponse.verify|verify} messages. - * @param message MsgBurnResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IMsgBurnResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgBurnResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgBurnResponse.verify|verify} messages. - * @param message MsgBurnResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IMsgBurnResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgBurnResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgBurnResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.MsgBurnResponse; - - /** - * Decodes a MsgBurnResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgBurnResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.MsgBurnResponse; - - /** - * Verifies a MsgBurnResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgBurnResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgBurnResponse - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.MsgBurnResponse; - - /** - * Creates a plain object from a MsgBurnResponse message. Also converts values to other types if specified. - * @param message MsgBurnResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.MsgBurnResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgBurnResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChangeAdmin. */ - interface IMsgChangeAdmin { - - /** MsgChangeAdmin sender */ - sender?: (string|null); - - /** MsgChangeAdmin denom */ - denom?: (string|null); - - /** MsgChangeAdmin newAdmin */ - newAdmin?: (string|null); - } - - /** Represents a MsgChangeAdmin. */ - class MsgChangeAdmin implements IMsgChangeAdmin { - - /** - * Constructs a new MsgChangeAdmin. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IMsgChangeAdmin); - - /** MsgChangeAdmin sender. */ - public sender: string; - - /** MsgChangeAdmin denom. */ - public denom: string; - - /** MsgChangeAdmin newAdmin. */ - public newAdmin: string; - - /** - * Encodes the specified MsgChangeAdmin message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgChangeAdmin.verify|verify} messages. - * @param message MsgChangeAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IMsgChangeAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChangeAdmin message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgChangeAdmin.verify|verify} messages. - * @param message MsgChangeAdmin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IMsgChangeAdmin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChangeAdmin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChangeAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.MsgChangeAdmin; - - /** - * Decodes a MsgChangeAdmin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChangeAdmin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.MsgChangeAdmin; - - /** - * Verifies a MsgChangeAdmin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChangeAdmin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChangeAdmin - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.MsgChangeAdmin; - - /** - * Creates a plain object from a MsgChangeAdmin message. Also converts values to other types if specified. - * @param message MsgChangeAdmin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.MsgChangeAdmin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChangeAdmin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MsgChangeAdminResponse. */ - interface IMsgChangeAdminResponse { - } - - /** Represents a MsgChangeAdminResponse. */ - class MsgChangeAdminResponse implements IMsgChangeAdminResponse { - - /** - * Constructs a new MsgChangeAdminResponse. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IMsgChangeAdminResponse); - - /** - * Encodes the specified MsgChangeAdminResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse.verify|verify} messages. - * @param message MsgChangeAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IMsgChangeAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgChangeAdminResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse.verify|verify} messages. - * @param message MsgChangeAdminResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IMsgChangeAdminResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgChangeAdminResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgChangeAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse; - - /** - * Decodes a MsgChangeAdminResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgChangeAdminResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse; - - /** - * Verifies a MsgChangeAdminResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgChangeAdminResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgChangeAdminResponse - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse; - - /** - * Creates a plain object from a MsgChangeAdminResponse message. Also converts values to other types if specified. - * @param message MsgChangeAdminResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgChangeAdminResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Query */ - class Query extends $protobuf.rpc.Service { - - /** - * Constructs a new Query service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryParamsResponse - */ - public params(request: osmosis.tokenfactory.v1beta1.IQueryParamsRequest, callback: osmosis.tokenfactory.v1beta1.Query.ParamsCallback): void; - - /** - * Calls Params. - * @param request QueryParamsRequest message or plain object - * @returns Promise - */ - public params(request: osmosis.tokenfactory.v1beta1.IQueryParamsRequest): Promise; - - /** - * Calls DenomAuthorityMetadata. - * @param request QueryDenomAuthorityMetadataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomAuthorityMetadataResponse - */ - public denomAuthorityMetadata(request: osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest, callback: osmosis.tokenfactory.v1beta1.Query.DenomAuthorityMetadataCallback): void; - - /** - * Calls DenomAuthorityMetadata. - * @param request QueryDenomAuthorityMetadataRequest message or plain object - * @returns Promise - */ - public denomAuthorityMetadata(request: osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest): Promise; - - /** - * Calls DenomsFromCreator. - * @param request QueryDenomsFromCreatorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and QueryDenomsFromCreatorResponse - */ - public denomsFromCreator(request: osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest, callback: osmosis.tokenfactory.v1beta1.Query.DenomsFromCreatorCallback): void; - - /** - * Calls DenomsFromCreator. - * @param request QueryDenomsFromCreatorRequest message or plain object - * @returns Promise - */ - public denomsFromCreator(request: osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest): Promise; - } - - namespace Query { - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Query#params}. - * @param error Error, if any - * @param [response] QueryParamsResponse - */ - type ParamsCallback = (error: (Error|null), response?: osmosis.tokenfactory.v1beta1.QueryParamsResponse) => void; - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Query#denomAuthorityMetadata}. - * @param error Error, if any - * @param [response] QueryDenomAuthorityMetadataResponse - */ - type DenomAuthorityMetadataCallback = (error: (Error|null), response?: osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse) => void; - - /** - * Callback as used by {@link osmosis.tokenfactory.v1beta1.Query#denomsFromCreator}. - * @param error Error, if any - * @param [response] QueryDenomsFromCreatorResponse - */ - type DenomsFromCreatorCallback = (error: (Error|null), response?: osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse) => void; - } - - /** Properties of a QueryParamsRequest. */ - interface IQueryParamsRequest { - } - - /** Represents a QueryParamsRequest. */ - class QueryParamsRequest implements IQueryParamsRequest { - - /** - * Constructs a new QueryParamsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IQueryParamsRequest); - - /** - * Encodes the specified QueryParamsRequest message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsRequest message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryParamsRequest.verify|verify} messages. - * @param message QueryParamsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IQueryParamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.QueryParamsRequest; - - /** - * Decodes a QueryParamsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.QueryParamsRequest; - - /** - * Verifies a QueryParamsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsRequest - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.QueryParamsRequest; - - /** - * Creates a plain object from a QueryParamsRequest message. Also converts values to other types if specified. - * @param message QueryParamsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.QueryParamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryParamsResponse. */ - interface IQueryParamsResponse { - - /** QueryParamsResponse params */ - params?: (osmosis.tokenfactory.v1beta1.IParams|null); - } - - /** Represents a QueryParamsResponse. */ - class QueryParamsResponse implements IQueryParamsResponse { - - /** - * Constructs a new QueryParamsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IQueryParamsResponse); - - /** QueryParamsResponse params. */ - public params?: (osmosis.tokenfactory.v1beta1.IParams|null); - - /** - * Encodes the specified QueryParamsResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryParamsResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryParamsResponse.verify|verify} messages. - * @param message QueryParamsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IQueryParamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.QueryParamsResponse; - - /** - * Decodes a QueryParamsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParamsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.QueryParamsResponse; - - /** - * Verifies a QueryParamsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryParamsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParamsResponse - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.QueryParamsResponse; - - /** - * Creates a plain object from a QueryParamsResponse message. Also converts values to other types if specified. - * @param message QueryParamsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.QueryParamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryParamsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomAuthorityMetadataRequest. */ - interface IQueryDenomAuthorityMetadataRequest { - - /** QueryDenomAuthorityMetadataRequest creator */ - creator?: (string|null); - - /** QueryDenomAuthorityMetadataRequest subdenom */ - subdenom?: (string|null); - } - - /** Represents a QueryDenomAuthorityMetadataRequest. */ - class QueryDenomAuthorityMetadataRequest implements IQueryDenomAuthorityMetadataRequest { - - /** - * Constructs a new QueryDenomAuthorityMetadataRequest. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest); - - /** QueryDenomAuthorityMetadataRequest creator. */ - public creator: string; - - /** QueryDenomAuthorityMetadataRequest subdenom. */ - public subdenom: string; - - /** - * Encodes the specified QueryDenomAuthorityMetadataRequest message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest.verify|verify} messages. - * @param message QueryDenomAuthorityMetadataRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomAuthorityMetadataRequest message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest.verify|verify} messages. - * @param message QueryDenomAuthorityMetadataRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomAuthorityMetadataRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomAuthorityMetadataRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest; - - /** - * Decodes a QueryDenomAuthorityMetadataRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomAuthorityMetadataRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest; - - /** - * Verifies a QueryDenomAuthorityMetadataRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomAuthorityMetadataRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomAuthorityMetadataRequest - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest; - - /** - * Creates a plain object from a QueryDenomAuthorityMetadataRequest message. Also converts values to other types if specified. - * @param message QueryDenomAuthorityMetadataRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomAuthorityMetadataRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomAuthorityMetadataResponse. */ - interface IQueryDenomAuthorityMetadataResponse { - - /** QueryDenomAuthorityMetadataResponse authority_metadata */ - authority_metadata?: (osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata|null); - } - - /** Represents a QueryDenomAuthorityMetadataResponse. */ - class QueryDenomAuthorityMetadataResponse implements IQueryDenomAuthorityMetadataResponse { - - /** - * Constructs a new QueryDenomAuthorityMetadataResponse. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataResponse); - - /** QueryDenomAuthorityMetadataResponse authority_metadata. */ - public authority_metadata?: (osmosis.tokenfactory.v1beta1.IDenomAuthorityMetadata|null); - - /** - * Encodes the specified QueryDenomAuthorityMetadataResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse.verify|verify} messages. - * @param message QueryDenomAuthorityMetadataResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomAuthorityMetadataResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse.verify|verify} messages. - * @param message QueryDenomAuthorityMetadataResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IQueryDenomAuthorityMetadataResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomAuthorityMetadataResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomAuthorityMetadataResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse; - - /** - * Decodes a QueryDenomAuthorityMetadataResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomAuthorityMetadataResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse; - - /** - * Verifies a QueryDenomAuthorityMetadataResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomAuthorityMetadataResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomAuthorityMetadataResponse - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse; - - /** - * Creates a plain object from a QueryDenomAuthorityMetadataResponse message. Also converts values to other types if specified. - * @param message QueryDenomAuthorityMetadataResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomAuthorityMetadataResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomsFromCreatorRequest. */ - interface IQueryDenomsFromCreatorRequest { - - /** QueryDenomsFromCreatorRequest creator */ - creator?: (string|null); - } - - /** Represents a QueryDenomsFromCreatorRequest. */ - class QueryDenomsFromCreatorRequest implements IQueryDenomsFromCreatorRequest { - - /** - * Constructs a new QueryDenomsFromCreatorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest); - - /** QueryDenomsFromCreatorRequest creator. */ - public creator: string; - - /** - * Encodes the specified QueryDenomsFromCreatorRequest message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest.verify|verify} messages. - * @param message QueryDenomsFromCreatorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomsFromCreatorRequest message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest.verify|verify} messages. - * @param message QueryDenomsFromCreatorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomsFromCreatorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomsFromCreatorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest; - - /** - * Decodes a QueryDenomsFromCreatorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomsFromCreatorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest; - - /** - * Verifies a QueryDenomsFromCreatorRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomsFromCreatorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomsFromCreatorRequest - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest; - - /** - * Creates a plain object from a QueryDenomsFromCreatorRequest message. Also converts values to other types if specified. - * @param message QueryDenomsFromCreatorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomsFromCreatorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QueryDenomsFromCreatorResponse. */ - interface IQueryDenomsFromCreatorResponse { - - /** QueryDenomsFromCreatorResponse denoms */ - denoms?: (string[]|null); - } - - /** Represents a QueryDenomsFromCreatorResponse. */ - class QueryDenomsFromCreatorResponse implements IQueryDenomsFromCreatorResponse { - - /** - * Constructs a new QueryDenomsFromCreatorResponse. - * @param [properties] Properties to set - */ - constructor(properties?: osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorResponse); - - /** QueryDenomsFromCreatorResponse denoms. */ - public denoms: string[]; - - /** - * Encodes the specified QueryDenomsFromCreatorResponse message. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse.verify|verify} messages. - * @param message QueryDenomsFromCreatorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryDenomsFromCreatorResponse message, length delimited. Does not implicitly {@link osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse.verify|verify} messages. - * @param message QueryDenomsFromCreatorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: osmosis.tokenfactory.v1beta1.IQueryDenomsFromCreatorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryDenomsFromCreatorResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryDenomsFromCreatorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse; - - /** - * Decodes a QueryDenomsFromCreatorResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryDenomsFromCreatorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse; - - /** - * Verifies a QueryDenomsFromCreatorResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryDenomsFromCreatorResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryDenomsFromCreatorResponse - */ - public static fromObject(object: { [k: string]: any }): osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse; - - /** - * Creates a plain object from a QueryDenomsFromCreatorResponse message. Also converts values to other types if specified. - * @param message QueryDenomsFromCreatorResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryDenomsFromCreatorResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } -}